Code

make rrdtool compile on windows with cv++. check out win32/rrdlib.vcproj.
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 2 Dec 2008 22:04:16 +0000 (22:04 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 2 Dec 2008 22:04:16 +0000 (22:04 +0000)
-- Christof.Wegmann with exitgames.com

git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3/program@1684 a5681a0c-68f1-0310-ab6d-d61299d08faa

31 files changed:
Makefile.am
src/rrd.h
src/rrd_create.c
src/rrd_diff.c
src/rrd_dump.c
src/rrd_error.c
src/rrd_fetch.c
src/rrd_first.c
src/rrd_format.c
src/rrd_getopt.c
src/rrd_getopt.h
src/rrd_getopt1.c
src/rrd_gfx.c
src/rrd_graph.c
src/rrd_graph.h
src/rrd_hw.c
src/rrd_hw_math.c
src/rrd_hw_update.c
src/rrd_info.c
src/rrd_lastupdate.c
src/rrd_open.c
src/rrd_parsetime.c
src/rrd_resize.c
src/rrd_restore.c
src/rrd_rpncalc.c
src/rrd_thread_safe_nt.c
src/rrd_tune.c
src/rrd_update.c
src/rrd_xport.c
win32/config.h
win32/rrdlib.vcproj [new file with mode: 0644]

index 9f20a78b96833fbad4f0c68ab8656be6f56e2793..7b6595e508f34723a9e54eb0e0e614819964210c 100644 (file)
@@ -14,7 +14,7 @@ SUBDIRS = $(PO) src examples doc bindings
 EXTRA_DIST = COPYRIGHT CHANGES WIN32-BUILD-TIPS.txt TODO CONTRIBUTORS THREADS \
              intltool-extract.in  intltool-merge.in    intltool-update.in \
             rrdtool.spec favicon.ico win32/config.h win32/rrd.dsp \
-            win32/rrd.vcproj win32/rrdtool.dsp win32/rrdtool.dsw \
+            win32/rrdlib.vcproj win32/rrd.vcproj win32/rrdtool.dsp win32/rrdtool.dsw \
             win32/rrdtool.vcproj win32/Makefile \
             win32/rrd_config.h.msvc netware/Makefile
 
index 0fde235d09953781d1a80f364dbab6d2a56566de..a78792368db8d2e0e9ca48918ac8499e73cd37af 100644 (file)
--- a/src/rrd.h
+++ b/src/rrd.h
@@ -53,7 +53,15 @@ extern    "C" {
 #define _RRDLIB_H
 
 #include <sys/types.h>  /* for off_t */
+
+#ifndef WIN32
 #include <unistd.h>     /* for off_t */
+#else
+#include <string.h>
+typedef size_t ssize_t;
+typedef long off_t;
+#endif 
+
 #include <time.h>
 #include <stdio.h>      /* for FILE */
 
@@ -264,6 +272,9 @@ extern    "C" {
     rrd_context_t *rrd_get_context(
     void);
 
+#ifdef WIN32
+rrd_context_t *rrd_force_new_context(void);
+#endif
 
     int       rrd_proc_start_end(
     rrd_time_value_t *,
index 446067da1f930f0637e54d342319a963374ffee3..aa27f75baea706d46154bdbeb7d5bff4ca7259d2 100644 (file)
 
 #include "rrd_is_thread_safe.h"
 
+#ifdef WIN32
+#include <fcntl.h>
+#include <process.h>
+#endif
+
 unsigned long FnvHash(
     const char *str);
 int       create_hw_contingent_rras(
@@ -126,14 +131,14 @@ int rrd_create_r(
     /* init rrd clean */
     rrd_init(&rrd);
     /* static header */
-    if ((rrd.stat_head = calloc(1, sizeof(stat_head_t))) == NULL) {
+    if ((rrd.stat_head = (stat_head_t*)calloc(1, sizeof(stat_head_t))) == NULL) {
         rrd_set_error("allocating rrd.stat_head");
         rrd_free2(&rrd);
         return (-1);
     }
 
     /* live header */
-    if ((rrd.live_head = calloc(1, sizeof(live_head_t))) == NULL) {
+    if ((rrd.live_head = (live_head_t*)calloc(1, sizeof(live_head_t))) == NULL) {
         rrd_set_error("allocating rrd.live_head");
         rrd_free2(&rrd);
         return (-1);
@@ -164,7 +169,7 @@ int rrd_create_r(
         if (strncmp(argv[i], "DS:", 3) == 0) {
             size_t    old_size = sizeof(ds_def_t) * (rrd.stat_head->ds_cnt);
 
-            if ((rrd.ds_def = rrd_realloc(rrd.ds_def,
+            if ((rrd.ds_def = (ds_def_t*)rrd_realloc(rrd.ds_def,
                                           old_size + sizeof(ds_def_t))) ==
                 NULL) {
                 rrd_set_error("allocating rrd.ds_def");
@@ -233,7 +238,7 @@ int rrd_create_r(
             size_t    old_size = sizeof(rra_def_t) * (rrd.stat_head->rra_cnt);
             int       row_cnt;
 
-            if ((rrd.rra_def = rrd_realloc(rrd.rra_def,
+            if ((rrd.rra_def = (rra_def_t*)rrd_realloc(rrd.rra_def,
                                            old_size + sizeof(rra_def_t))) ==
                 NULL) {
                 rrd_set_error("allocating rrd.rra_def");
@@ -608,7 +613,7 @@ int create_hw_contingent_rras(
     (rrd->stat_head->rra_cnt)++;
     /* allocate the memory for the 4 contingent RRAs */
     old_size = sizeof(rra_def_t) * (rrd->stat_head->rra_cnt);
-    if ((rrd->rra_def = rrd_realloc(rrd->rra_def,
+    if ((rrd->rra_def = (rra_def_t*)rrd_realloc(rrd->rra_def,
                                     old_size + 4 * sizeof(rra_def_t))) ==
         NULL) {
         rrd_free2(rrd);
@@ -697,7 +702,7 @@ int rrd_create_fn(
 
     write(rrd_file, rrd->live_head, sizeof(live_head_t));
 
-    if ((rrd->pdp_prep = calloc(1, sizeof(pdp_prep_t))) == NULL) {
+    if ((rrd->pdp_prep = (pdp_prep_t*)calloc(1, sizeof(pdp_prep_t))) == NULL) {
         rrd_set_error("allocating pdp_prep");
         rrd_free2(rrd);
         close(rrd_file);
@@ -713,7 +718,7 @@ int rrd_create_fn(
     for (i = 0; i < rrd->stat_head->ds_cnt; i++)
         write(rrd_file, rrd->pdp_prep, sizeof(pdp_prep_t));
 
-    if ((rrd->cdp_prep = calloc(1, sizeof(cdp_prep_t))) == NULL) {
+    if ((rrd->cdp_prep = (cdp_prep_t*)calloc(1, sizeof(cdp_prep_t))) == NULL) {
         rrd_set_error("allocating cdp_prep");
         rrd_free2(rrd);
         close(rrd_file);
@@ -760,7 +765,7 @@ int rrd_create_fn(
     /* now, we must make sure that the rest of the rrd
        struct is properly initialized */
 
-    if ((rrd->rra_ptr = calloc(1, sizeof(rra_ptr_t))) == NULL) {
+    if ((rrd->rra_ptr = (rra_ptr_t*)calloc(1, sizeof(rra_ptr_t))) == NULL) {
         rrd_set_error("allocating rra_ptr");
         rrd_free2(rrd);
         close(rrd_file);
@@ -796,7 +801,11 @@ int rrd_create_fn(
         unkn_cnt -= 512;
     }
     free(unknown);
+
+#ifndef WIN32
     fdatasync(rrd_file);
+#endif
+
     rrd_free2(rrd);
     if (close(rrd_file) == -1) {
         rrd_set_error("creating rrd: %s", rrd_strerror(errno));
@@ -830,9 +839,17 @@ long int rra_random_row(
     rra_def_t *rra)
 {
     if (!rand_init) {
+#ifdef WIN32
+        srand((unsigned int) time(NULL) + (unsigned int) getpid());
+#else
         srandom((unsigned int) time(NULL) + (unsigned int) getpid());
+#endif
         rand_init++;
     }
 
+#ifdef WIN32
+    return rand() % rra->row_cnt;
+#else
     return random() % rra->row_cnt;
+#endif
 }
index 4fe6835b33b08df1d6bdde194f0ecfb76ccf5a16..eec345a1005042711f4bbb429a988828fb072708 100644 (file)
 
 #include "rrd_tool.h"
 
+#ifdef WIN32
+#include <ctype.h>
+#endif
+
 double rrd_diff(
     char *a,
     char *b)
index ff385d436277580af8c4f3f5a7370c0b547d3adf..6f723b77219ef8862490301ac7af7364f54cebf5 100644 (file)
  * checkin
  *
  *****************************************************************************/
+
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 #include "rrd_tool.h"
 #include "rrd_rpncalc.h"
 
index d21e300dfaf295e65f57d1c95896dab09be85374..fe65f846eb57501131b805e44d96fe3de831db26 100644 (file)
 #include "rrd_tool.h"
 #include <stdarg.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 #define MAXLEN 4096
 #define ERRBUFLEN 256
 #define CTX (rrd_get_context())
index bb895daa5f8c20f1bede625bd078121abf8e6039..370dc1fb6a94e7b6226e23e32c42e10e0acd3e72 100644 (file)
  *
  *****************************************************************************/
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 #include "rrd_tool.h"
 
 #include "rrd_is_thread_safe.h"
@@ -227,7 +231,7 @@ int rrd_fetch_fn(
     }
 
     for (i = 0; (unsigned long) i < rrd.stat_head->ds_cnt; i++) {
-        if ((((*ds_namv)[i]) = malloc(sizeof(char) * DS_NAM_SIZE)) == NULL) {
+        if ((((*ds_namv)[i]) = (char*)malloc(sizeof(char) * DS_NAM_SIZE)) == NULL) {
             rrd_set_error("malloc fetch ds_namv entry");
             goto err_free_ds_namv;
         }
@@ -327,7 +331,7 @@ int rrd_fetch_fn(
 ** database is the one with time stamp (t+s) which means t to t+s.
 */
     *ds_cnt = rrd.stat_head->ds_cnt;
-    if (((*data) = malloc(*ds_cnt * rows * sizeof(rrd_value_t))) == NULL) {
+    if (((*data) = (rrd_value_t *)malloc(*ds_cnt * rows * sizeof(rrd_value_t))) == NULL) {
         rrd_set_error("malloc fetch data area");
         goto err_free_all_ds_namv;
     }
index 3d2f02b14247b5964d7fefd1f461403e5bd3b399..c0cce10405244529aa67ac681369b352ca9bb4f9 100644 (file)
@@ -8,6 +8,9 @@
 
 #include "rrd_tool.h"
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
 
 time_t rrd_first(
     int argc,
index 34f9ddf5c5b3cb695aa2b6632c0a2cf8822eab48..13a7185d0c336dc3cde9bccd653f1cb9fa0a847c 100644 (file)
@@ -62,7 +62,7 @@ enum dst_en dst_conv(
         converter(DERIVE, DST_DERIVE)
         converter(COMPUTE, DST_CDEF)
         rrd_set_error("unknown data acquisition function '%s'", string);
-    return (-1);
+    return (enum dst_en)(-1);
 }
 
 
@@ -81,7 +81,7 @@ enum cf_en cf_conv(
         converter(DEVSEASONAL, CF_DEVSEASONAL)
         converter(FAILURES, CF_FAILURES)
         rrd_set_error("unknown consolidation function '%s'", string);
-    return (-1);
+    return (enum cf_en)(-1);
 }
 
 #undef converter
index 50a61e882ea76d13104285a6b30d9af92adff995..57266302db8ac849b9826836e9b3bfdbc2dac511 100644 (file)
@@ -30,6 +30,8 @@
 #define _NO_PROTO
 #endif
 
+#ifndef WIN32
+
 #if !defined (__STDC__) || !__STDC__
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
@@ -38,6 +40,7 @@
 #endif
 #endif
 
+#endif // WIN32
 
 #ifdef HAVE_CONFIG_H
 #include "../rrd_config.h"
@@ -207,11 +210,15 @@ static char *posixly_correct;
 char     *getenv(
     );
 
+#ifdef WIN32
+static char* my_index(const char* str, int chr)
+#else // WIN32
 static char *my_index(
     str,
     chr)
     const char *str;
     int chr;
+#endif // wIN32
 {
     while (*str) {
         if (*str == chr)
@@ -288,9 +295,13 @@ static void exchange(
     char **);
 #endif
 
+#ifdef WIN32
+static void exchange(char** argv)
+#else // WIN32
 static void exchange(
     argv)
     char    **argv;
+#endif // WIN32
 {
     int       bottom = first_nonopt;
     int       middle = last_nonopt;
@@ -346,6 +357,12 @@ static const char *_getopt_initialize(
     char *const *,
     const char *);
 #endif
+
+#ifdef WIN32
+static const char* _getopt_initialize(int argc,
+                                      char** argv,
+                                      const char* optstring)
+#else // WIN32
 static const char *_getopt_initialize(
     argc,
     argv,
@@ -353,6 +370,7 @@ static const char *_getopt_initialize(
     int argc;
     char     *const *argv;
     const char *optstring;
+#endif // WIN32
 {
     /* Start processing options with ARGV-element 1 (since ARGV-element 0
        is the program name); the sequence of previously skipped
@@ -455,6 +473,14 @@ static const char *_getopt_initialize(
    If LONG_ONLY is nonzero, '-' as well as '--' can introduce
    long-named options.  */
 
+#ifdef WIN32
+int _getopt_internal(int argc,
+                     char** argv,
+                     const char *optstring,
+                     const struct option *longopts,
+                     int* longind,
+                     int long_only)
+#else // WIN32
 int _getopt_internal(
     argc,
     argv,
@@ -468,6 +494,7 @@ int _getopt_internal(
     const struct option *longopts;
     int      *longind;
     int long_only;
+#endif // WIN32
 {
     optarg = NULL;
 
@@ -867,6 +894,12 @@ int _getopt_internal(
     }
 }
 
+#ifdef WIN32
+int getopt(
+    int argc,
+    char** argv,
+    const char* optstring)
+#else // WIN32
 int getopt(
     argc,
     argv,
@@ -874,6 +907,7 @@ int getopt(
     int argc;
     char     *const *argv;
     const char *optstring;
+#endif // WIN32
 {
     return _getopt_internal(argc, argv, optstring,
                             (const struct option *) 0, (int *) 0, 0);
index 91906efe2dc7b7f9c635bb753c3c0d67b5947df1..89a5da6dbefb452bd318083c463a2ef0e4269869 100644 (file)
@@ -132,6 +132,20 @@ extern    "C" {
     int *longind,
     int long_only);
 #else                   /* not __STDC__ */
+
+#ifdef WIN32
+    int getopt_long(int argc,
+                    char **argv,
+                    const char *options,
+                    const struct option *long_options,
+                    int *opt_index);
+    int _getopt_internal(int argc,
+                         char **argv,
+                         const char *shortopts,
+                         const struct option *longopts,
+                         int *longind,
+                         int long_only);
+#else // WIN32
     extern int getopt(
         );
     extern int getopt_long(
@@ -141,6 +155,8 @@ extern    "C" {
 
     extern int _getopt_internal(
         );
+#endif // WIN32
+
 #endif                  /* __STDC__ */
 
 #ifdef __cplusplus
index 075bc8da48b79643af6794ddfc5c51270693982a..724e1a5d9319ab1ae9cbc49dbf848d4a48df4dba 100644 (file)
@@ -19,7 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 \f
-
+#ifndef WIN32
 #if !defined (__STDC__) || !__STDC__
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
@@ -27,6 +27,7 @@
 #define const
 #endif
 #endif
+#endif // WIN32
 
 #ifdef HAVE_CONFIG_H
 #include "../rrd_config.h"
 #define NULL 0
 #endif
 
+#ifdef WIN32
+int getopt_long(int argc,
+                char** argv,
+                const char* options,
+                const struct option* long_options,
+                int* opt_index)
+#else // WIN32
 int getopt_long(
     argc,
     argv,
@@ -76,6 +84,7 @@ int getopt_long(
     const char *options;
     const struct option *long_options;
     int      *opt_index;
+#endif // WIN32
 {
     return _getopt_internal(argc, argv, options, long_options, opt_index, 0);
 }
@@ -85,6 +94,13 @@ int getopt_long(
    but does match a short option, it is parsed as a short option
    instead.  */
 
+#ifdef WIN32
+int getopt_long_only(int argc,
+                     char** argv,
+                     const char* options,
+                     const struct option* long_options,
+                     int* opt_index)
+#else // WIN32
 int getopt_long_only(
     argc,
     argv,
@@ -96,6 +112,7 @@ int getopt_long_only(
     const char *options;
     const struct option *long_options;
     int      *opt_index;
+#endif // WIN32
 {
     return _getopt_internal(argc, argv, options, long_options, opt_index, 1);
 }
index 2b19e323b3514bf1580b18d353b4c820135da276..a45ad6e323c1610b576486500f7a7995194aeb95 100644 (file)
@@ -154,7 +154,7 @@ static PangoLayout *gfx_prep_text(
         pango_layout_set_tabs(layout, tab_array);
         pango_tab_array_free(tab_array);
     }
-   pfd = pango_layout_get_font_description(layout);
+   pfd = (PangoFontDescription*)(pango_layout_get_font_description(layout));
 
    if (!pfd || !pango_font_description_equal (pfd,font_desc)){
         pango_layout_set_font_description(layout, font_desc);
index 41f99f6c2a3622c3910a21d60264858f95ed8350..35893e2fa3901ec57164a8a452750829596e88ae 100644 (file)
@@ -234,7 +234,7 @@ enum gf_en gf_conv(
     conv_if(XPORT, GF_XPORT);
     conv_if(SHIFT, GF_SHIFT);
 
-    return (-1);
+    return (enum gf_en)(-1);
 }
 
 enum gfx_if_en if_conv(
@@ -246,7 +246,7 @@ enum gfx_if_en if_conv(
     conv_if(EPS, IF_EPS);
     conv_if(PDF, IF_PDF);
 
-    return (-1);
+    return (enum gfx_if_en)(-1);
 }
 
 enum tmt_en tmt_conv(
@@ -260,7 +260,7 @@ enum tmt_en tmt_conv(
     conv_if(WEEK, TMT_WEEK);
     conv_if(MONTH, TMT_MONTH);
     conv_if(YEAR, TMT_YEAR);
-    return (-1);
+    return (enum tmt_en)(-1);
 }
 
 enum grc_en grc_conv(
@@ -278,7 +278,7 @@ enum grc_en grc_conv(
     conv_if(AXIS, GRC_AXIS);
     conv_if(FRAME, GRC_FRAME);
 
-    return -1;
+    return (enum grc_en)(-1);
 }
 
 enum text_prop_en text_prop_conv(
@@ -291,7 +291,7 @@ enum text_prop_en text_prop_conv(
     conv_if(UNIT, TEXT_PROP_UNIT);
     conv_if(LEGEND, TEXT_PROP_LEGEND);
     conv_if(WATERMARK, TEXT_PROP_WATERMARK);
-    return -1;
+    return (enum text_prop_en)(-1);
 }
 
 
@@ -301,7 +301,7 @@ int im_free(
     image_desc_t *im)
 {
     unsigned long i, ii;
-    cairo_status_t status = 0;
+    cairo_status_t status = CAIRO_STATUS_SUCCESS;
 
     if (im == NULL)
         return 0;
@@ -421,7 +421,7 @@ void si_unit(
 
     if (im->unitsexponent != 9999) {
         /* unitsexponent = 9, 6, 3, 0, -3, -6, -9, etc */
-        viewdigits = floor(im->unitsexponent / 3);
+        viewdigits = floor((double)(im->unitsexponent / 3));
     } else {
         viewdigits = digits;
     }
@@ -1017,9 +1017,9 @@ int data_calc(
                         /* add one entry to the array that keeps track of the step sizes of the
                          * data sources going into the CDEF. */
                         if ((steparray =
-                             rrd_realloc(steparray,
+                                         (long*)(rrd_realloc(steparray,
                                          (++stepcnt +
-                                          1) * sizeof(*steparray))) == NULL) {
+                                          1) * sizeof(*steparray)))) == NULL) {
                             rrd_set_error("realloc steparray");
                             rpnstack_free(&rpnstack);
                             return -1;
@@ -1085,10 +1085,10 @@ int data_calc(
              */
             im->gdes[gdi].step = lcd(steparray);
             free(steparray);
-            if ((im->gdes[gdi].data = malloc(((im->gdes[gdi].end -
+            if ((im->gdes[gdi].data = (rrd_value_t*)(malloc(((im->gdes[gdi].end -
                                                im->gdes[gdi].start)
                                               / im->gdes[gdi].step)
-                                             * sizeof(double))) == NULL) {
+                                             * sizeof(double)))) == NULL) {
                 rrd_set_error("malloc im->gdes[gdi].data");
                 rpnstack_free(&rpnstack);
                 return -1;
@@ -1175,8 +1175,8 @@ int data_proc(
     for (i = 0; i < im->gdes_c; i++) {
         if ((im->gdes[i].gf == GF_LINE) ||
             (im->gdes[i].gf == GF_AREA) || (im->gdes[i].gf == GF_TICK)) {
-            if ((im->gdes[i].p_data = malloc((im->xsize + 1)
-                                             * sizeof(rrd_value_t))) == NULL) {
+            if ((im->gdes[i].p_data = (rrd_value_t*)(malloc((im->xsize + 1)
+                                             * sizeof(rrd_value_t)))) == NULL) {
                 rrd_set_error("malloc data_proc");
                 return -1;
             }
@@ -1532,7 +1532,7 @@ int print_calc(
                 rrd_infoval_t prline;
 
                 if (im->gdes[i].strftm) {
-                    prline.u_str = malloc((FMT_LEG_LEN + 2) * sizeof(char));
+                    prline.u_str = (char*)(malloc((FMT_LEG_LEN + 2) * sizeof(char)));
                     strftime(prline.u_str,
                              FMT_LEG_LEN, im->gdes[i].format, &tmvdef);
                 } else if (bad_format(im->gdes[i].format)) {
@@ -1633,7 +1633,7 @@ int leg_place(
     char     *tab;
 
     if (!(im->extra_flags & NOLEGEND) & !(im->extra_flags & ONLY_GRAPH)) {
-        if ((legspace = malloc(im->gdes_c * sizeof(int))) == NULL) {
+        if ((legspace = (int*)(malloc(im->gdes_c * sizeof(int)))) == NULL) {
             rrd_set_error("malloc for legspace");
             return -1;
         }
@@ -2034,7 +2034,7 @@ double frexp10(
     double    mnt;
     int       iexp;
 
-    iexp = floor(log(fabs(x)) / log(10));
+    iexp = floor(log((double)(fabs(x))) / log(10.0));
     mnt = x / pow(10.0, iexp);
     if (mnt >= 10.0) {
         iexp++;
@@ -2908,10 +2908,10 @@ static cairo_status_t cairo_output(
     *data,
     unsigned int length)
 {
-    image_desc_t *im = closure;
+    image_desc_t *im = (image_desc_t*)(closure);
 
     im->rendered_image =
-        realloc(im->rendered_image, im->rendered_image_size + length);
+        (unsigned char*)(realloc(im->rendered_image, im->rendered_image_size + length));
     if (im->rendered_image == NULL)
         return CAIRO_STATUS_WRITE_ERROR;
     memcpy(im->rendered_image + im->rendered_image_size, data, length);
@@ -3530,14 +3530,14 @@ int rrd_graph(
         if (strcmp(walker->key, "image_info") == 0) {
             prlines++;
             if (((*prdata) =
-                 rrd_realloc((*prdata),
-                             (prlines + 1) * sizeof(char *))) == NULL) {
+                 (char**)(rrd_realloc((*prdata),
+                             (prlines + 1) * sizeof(char *)))) == NULL) {
                 rrd_set_error("realloc prdata");
                 return 0;
             }
             /* imginfo goes to position 0 in the prdata array */
-            (*prdata)[prlines - 1] = malloc((strlen(walker->value.u_str)
-                                             + 2) * sizeof(char));
+            (*prdata)[prlines - 1] = (char*)(malloc((strlen(walker->value.u_str)
+                                             + 2) * sizeof(char)));
             strcpy((*prdata)[prlines - 1], walker->value.u_str);
             (*prdata)[prlines] = NULL;
         }
@@ -3561,13 +3561,13 @@ int rrd_graph(
         } else if (strncmp(walker->key, "print", 5) == 0) { /* keys are prdate[0..] */
             prlines++;
             if (((*prdata) =
-                 rrd_realloc((*prdata),
-                             (prlines + 1) * sizeof(char *))) == NULL) {
+                 (char**)(rrd_realloc((*prdata),
+                             (prlines + 1) * sizeof(char *)))) == NULL) {
                 rrd_set_error("realloc prdata");
                 return 0;
             }
-            (*prdata)[prlines - 1] = malloc((strlen(walker->value.u_str)
-                                             + 2) * sizeof(char));
+            (*prdata)[prlines - 1] = (char*)(malloc((strlen(walker->value.u_str)
+                                             + 2) * sizeof(char)));
             (*prdata)[prlines] = NULL;
             strcpy((*prdata)[prlines - 1], walker->value.u_str);
         } else if (strcmp(walker->key, "image") == 0) {
@@ -4476,7 +4476,7 @@ int vdef_calc(
     case VDEF_PERCENT:{
         rrd_value_t *array;
         int       field;
-        if ((array = malloc(steps * sizeof(double))) == NULL) {
+        if ((array = (rrd_value_t*)(malloc(steps * sizeof(double)))) == NULL) {
             rrd_set_error("malloc VDEV_PERCENT");
             return -1;
         }
index 62765086a69c5d7b4605d38a8037c275507071ce..704fe5eaecd6d6b2200860ed1c272aa8cbd09e92 100644 (file)
 #include "rrd_tool.h"
 #include "rrd_rpncalc.h"
 
+#ifdef WIN32
+#  include <windows.h>
+#  define MAXPATH MAX_PATH
+#endif
 
 #define ALTYGRID        0x01   /* use alternative y grid algorithm */
 #define ALTAUTOSCALE    0x02   /* use alternative algorithm to find lower and upper bounds */
index bd5a1afa24f7ecfd35f3036c64d7f17c797d2214..80e030ab7b19664109021870f1d14936f83796ba 100644 (file)
 #include "rrd_hw_math.h"
 #include "rrd_hw_update.h"
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 #define hw_dep_idx(rrd, rra_idx) rrd->rra_def[rra_idx].par[RRA_dependent_rra_idx].u_cnt
 
 /* #define DEBUG */
index 7ce9dc26d379cae02965ee327d9a9ffb0943c723..5aa2895e38b4c68b8fc307202a54f019054e9158 100644 (file)
@@ -4,7 +4,9 @@
 
 #include "rrd_tool.h"
 #include "rrd_hw_math.h"
+#ifndef WIN32
 #include "rrd_config.h"
+#endif
 
 /*****************************************************************************
  * RRDtool supports both the additive and multiplicative Holt-Winters methods. 
index 9514380510ca1dd65ac537691704e5a95ef95c55..8a5f700306835280cad2c9bf9801e990c0ab7f94 100644 (file)
@@ -4,7 +4,9 @@
 
 #include "rrd_tool.h"
 #include "rrd_format.h"
+#ifndef WIN32
 #include "rrd_config.h"
+#endif
 #include "rrd_hw_math.h"
 #include "rrd_hw_update.h"
 
index b83640faae51f0ccb98e0933701a1fff11b934e2..62499059a89be8f9cb53c14b1b0fafd56b145a4d 100644 (file)
@@ -8,6 +8,10 @@
 #include "rrd_rpncalc.h"
 #include <stdarg.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 /* proto */
 rrd_info_t *rrd_info(
     int,
@@ -23,7 +27,7 @@ char     *sprintf_alloc(
     int       maxlen = 1024 + strlen(fmt);
     char     *str = NULL;
     va_list   argp;
-    str = malloc(sizeof(char) * (maxlen + 1));
+    str = (char*)(malloc(sizeof(char) * (maxlen + 1)));
     if (str != NULL) {
         va_start(argp, fmt);
 #ifdef HAVE_VSNPRINTF
@@ -44,7 +48,7 @@ rrd_info_t
 {
     rrd_info_t *next;
 
-    next = malloc(sizeof(*next));
+    next = (rrd_info_t*)(malloc(sizeof(*next)));
     next->next = (rrd_info_t *) 0;
     if (info)
         info->next = next;
@@ -61,13 +65,13 @@ rrd_info_t
         next->value.u_int = value.u_int;
         break;
     case RD_I_STR:
-        next->value.u_str = malloc(sizeof(char) * (strlen(value.u_str) + 1));
+        next->value.u_str = (char*)(malloc(sizeof(char) * (strlen(value.u_str) + 1)));
         strcpy(next->value.u_str, value.u_str);
         break;
     case RD_I_BLO:
         next->value.u_blo.size = value.u_blo.size;
         next->value.u_blo.ptr =
-            malloc(sizeof(unsigned char) * value.u_blo.size);
+            (unsigned char*)malloc(sizeof(unsigned char) * value.u_blo.size);
         memcpy(next->value.u_blo.ptr, value.u_blo.ptr, value.u_blo.size);
         break;
     }
index 264fa29b3db661693fd1731baf856c7f618250ad..104cc03ddeae4e056e2c44dbc0403bfefa7c6cf7 100644 (file)
@@ -8,6 +8,10 @@
 #include "rrd_rpncalc.h"
 #include <stdarg.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 int rrd_lastupdate(
     int argc,
     char **argv,
index 06afabe12540400a1635e190f0b3b04e73f64665..e5f20c9af1675f60945dccf21ea838e0c8cf58d1 100644 (file)
@@ -8,6 +8,13 @@
 
 #include "rrd_tool.h"
 #include "unused.h"
+
+#ifdef WIN32
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#endif
+
 #define MEMBLK 8192
 
 /* DEBUG 2 prints information obtained via mincore(2) */
@@ -34,7 +41,7 @@
 #define __rrd_read(dst, dst_t, cnt) { \
        size_t wanted = sizeof(dst_t)*(cnt); \
         size_t got; \
-       if ((dst = malloc(wanted)) == NULL) { \
+       if ((dst = (dst_t*)malloc(wanted)) == NULL) { \
                rrd_set_error(#dst " malloc"); \
                goto out_nullify_head; \
        } \
@@ -66,7 +73,13 @@ rrd_file_t *rrd_open(
     unsigned rdwr)
 {
     int       flags = 0;
+
+/* Win32 can't use S_IRUSR flag */
+#ifndef WIN32
     mode_t    mode = S_IRUSR;
+#else
+    int mode = 0;
+#endif
     int       version;
 
 #ifdef HAVE_MMAP
@@ -86,7 +99,7 @@ rrd_file_t *rrd_open(
         free(rrd->stat_head);
     }
     rrd_init(rrd);
-    rrd_file = malloc(sizeof(rrd_file_t));
+    rrd_file = (rrd_file_t*)malloc(sizeof(rrd_file_t));
     if (rrd_file == NULL) {
         rrd_set_error("allocating rrd_file descriptor for '%s'", file_name);
         return NULL;
@@ -111,7 +124,9 @@ rrd_file_t *rrd_open(
 #endif
     } else {
         if (rdwr & RRD_READWRITE) {
+#ifndef WIN32 // Win32 can't use this mode
             mode |= S_IWUSR;
+#endif
             flags |= O_RDWR;
 #ifdef HAVE_MMAP
             mm_flags = MAP_SHARED;
@@ -557,10 +572,16 @@ ssize_t rrd_write(
 void rrd_flush(
     rrd_file_t *rrd_file)
 {
+/*
+ * Win32 can only flush files by FlushFileBuffers function, 
+ * but it works with HANDLE hFile, not FILE. So skipping
+ */
+#ifndef WIN32
     if (fdatasync(rrd_file->fd) != 0) {
         rrd_set_error("flushing fd %d: %s", rrd_file->fd,
                       rrd_strerror(errno));
     }
+#endif
 }
 
 
index 7fa355938fe6ed399bc955f7626f86d345087623..6bf7d68f846d3d822bcb30a397516479cf85d2c9 100644 (file)
 #include "rrd_tool.h"
 #include <stdarg.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#include <ctype.h>
+#endif
+
 /* Structures and unions */
 
 enum {                  /* symbols */
index 803c961bb77726d03898c78569b6452b162d3f37..a26dee420f1298d6e79ff43c1a93df941f25b57e 100644 (file)
@@ -8,6 +8,10 @@
 
 #include "rrd_tool.h"
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 int rrd_resize(
     int argc,
     char **argv)
@@ -85,7 +89,7 @@ int rrd_resize(
         }
     /* the size of the new file */
     /* yes we are abusing the float cookie for this, aargh */
-    if ((rrdnew.stat_head = calloc(1, sizeof(stat_head_t))) == NULL) {
+    if ((rrdnew.stat_head = (stat_head_t*)calloc(1, sizeof(stat_head_t))) == NULL) {
         rrd_set_error("allocating stat_head for new RRD");
         rrd_free(&rrdold);
         rrd_close(rrd_file);
@@ -108,7 +112,7 @@ int rrd_resize(
         return (-1);
     }
 /*XXX: do one write for those parts of header that are unchanged */
-    if ((rrdnew.stat_head = malloc(sizeof(stat_head_t))) == NULL) {
+    if ((rrdnew.stat_head = (stat_head_t*)malloc(sizeof(stat_head_t))) == NULL) {
         rrd_set_error("allocating stat_head for new RRD");
         rrd_free(&rrdnew);
         rrd_free(&rrdold);
@@ -117,7 +121,7 @@ int rrd_resize(
         return (-1);
     }
 
-    if ((rrdnew.rra_ptr = malloc(sizeof(rra_ptr_t) * rrdold.stat_head->rra_cnt)) == NULL) {
+    if ((rrdnew.rra_ptr = (rra_ptr_t*)malloc(sizeof(rra_ptr_t) * rrdold.stat_head->rra_cnt)) == NULL) {
         rrd_set_error("allocating rra_ptr for new RRD");
         rrd_free(&rrdnew);
         rrd_free(&rrdold);
@@ -126,7 +130,7 @@ int rrd_resize(
         return (-1);
     }
 
-    if ((rrdnew.rra_def = malloc(sizeof(rra_def_t) * rrdold.stat_head->rra_cnt)) == NULL) {
+    if ((rrdnew.rra_def = (rra_def_t*)malloc(sizeof(rra_def_t) * rrdold.stat_head->rra_cnt)) == NULL) {
         rrd_set_error("allocating rra_def for new RRD");
         rrd_free(&rrdnew);
         rrd_free(&rrdold);
@@ -135,6 +139,7 @@ int rrd_resize(
         return (-1);
     }
      
+#ifndef WIN32
     memcpy(rrdnew.stat_head,rrdold.stat_head,sizeof(stat_head_t));
     rrdnew.ds_def = rrdold.ds_def;
     memcpy(rrdnew.rra_def,rrdold.rra_def,sizeof(rra_def_t) * rrdold.stat_head->rra_cnt);    
@@ -142,7 +147,54 @@ int rrd_resize(
     rrdnew.pdp_prep = rrdold.pdp_prep;
     rrdnew.cdp_prep = rrdold.cdp_prep;
     memcpy(rrdnew.rra_ptr,rrdold.rra_ptr,sizeof(rra_ptr_t) * rrdold.stat_head->rra_cnt);
+#else // WIN32
+       /*
+        * For windows Other fields also should be allocated. Crashes otherwise
+        */
+
+    if ((rrdnew.ds_def = (ds_def_t*)malloc(sizeof(ds_def_t) * rrdold.stat_head->ds_cnt)) == NULL) {
+        rrd_set_error("allocating ds_def for new RRD");
+        rrd_free(&rrdnew);
+        rrd_free(&rrdold);
+        rrd_close(rrd_file);
+        rrd_close(rrd_out_file);
+        return (-1);
+    }
+
+    if ((rrdnew.live_head = (live_head_t*)malloc(sizeof(live_head_t))) == NULL) {
+        rrd_set_error("allocating live_head for new RRD");
+        rrd_free(&rrdnew);
+        rrd_free(&rrdold);
+        rrd_close(rrd_file);
+        rrd_close(rrd_out_file);
+        return (-1);
+    }
 
+    if ((rrdnew.pdp_prep = (pdp_prep_t*)malloc(sizeof(pdp_prep_t))) == NULL) {
+        rrd_set_error("allocating pdp_prep for new RRD");
+        rrd_free(&rrdnew);
+        rrd_free(&rrdold);
+        rrd_close(rrd_file);
+        rrd_close(rrd_out_file);
+        return (-1);
+    }
+
+    if ((rrdnew.cdp_prep = (cdp_prep_t*)malloc(sizeof(cdp_prep_t))) == NULL) {
+        rrd_set_error("allocating cdp_prep for new RRD");
+        rrd_free(&rrdnew);
+        rrd_free(&rrdold);
+        rrd_close(rrd_file);
+        rrd_close(rrd_out_file);
+        return (-1);
+    }
+    memcpy(rrdnew.stat_head,rrdold.stat_head,sizeof(stat_head_t));
+    memcpy(rrdnew.ds_def,rrdold.ds_def,sizeof(ds_def_t) * rrdold.stat_head->ds_cnt);
+    memcpy(rrdnew.rra_def,rrdold.rra_def,sizeof(rra_def_t) * rrdold.stat_head->rra_cnt);    
+    memcpy(rrdnew.live_head,rrdold.live_head,sizeof(live_head_t));
+    memcpy(rrdnew.pdp_prep,rrdold.pdp_prep,sizeof(pdp_prep_t));
+    memcpy(rrdnew.cdp_prep,rrdold.cdp_prep,sizeof(cdp_prep_t));
+    memcpy(rrdnew.rra_ptr,rrdold.rra_ptr,sizeof(rra_ptr_t) * rrdold.stat_head->rra_cnt);
+#endif // WIN32
 
     version = atoi(rrdold.stat_head->version);
     switch (version) {
index f8777b4e32894d80a2c58afe11d4a82f90045f12..2335f59298427a581f335d5b1bdec518c9a11247 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-#include <unistd.h>
 #include <fcntl.h>
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+
+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#include <math.h>
 # include <io.h>
 # define open _open
 # define close _close
+#else
+# include <unistd.h>
 #endif
+
 #include <libxml/parser.h>
 #include "rrd_tool.h"
 #include "rrd_rpncalc.h"
@@ -132,6 +136,15 @@ static int get_double_from_node(
         return (-1);
     }
 
+#ifdef WIN32
+    if (strcmp(str_ptr, " NaN ") == 0)
+    {
+        *value = DNAN;
+        xmlFree(str_ptr);
+        return 0;
+    }
+#endif
+
     end_ptr = NULL;
     temp = strtod(str_ptr, &end_ptr);
     xmlFree(str_ptr);
@@ -695,7 +708,11 @@ static int parse_tag_rra(
     }
 
     /* Set the RRA pointer to a random location */
+#ifdef WIN32
+    cur_rra_ptr->cur_row = rand() % cur_rra_def->row_cnt;
+#else
     cur_rra_ptr->cur_row = random() % cur_rra_def->row_cnt;
+#endif
 
     return (status);
 }                       /* int parse_tag_rra */
@@ -1043,7 +1060,11 @@ int rrd_restore(
 {
     rrd_t    *rrd;
 
+#ifdef WIN32
+    srand((unsigned int) time(NULL));
+#else
     srandom((unsigned int) time(NULL) + (unsigned int) getpid());
+#endif
     /* init rrd clean */
     optind = 0;
     opterr = 0;         /* initialize getopt */
index 48ac26f0de5ffc7e9e80e806e62eb96f2fa89b9c..2e7868b72185d9d30c714bd4405fdba2779e0111 100644 (file)
 #include <limits.h>
 #include <locale.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 short     addop2str(
     enum op_en op,
     enum op_en op_type,
@@ -73,7 +77,7 @@ rpnp_t   *rpn_expand(
     if (rpnp == NULL)
         return NULL;
     for (i = 0; rpnc[i].op != OP_END; ++i) {
-        rpnp[i].op = (long) rpnc[i].op;
+        rpnp[i].op = (enum op_en) rpnc[i].op;
         if (rpnp[i].op == OP_NUMBER) {
             rpnp[i].val = (double) rpnc[i].val;
         } else if (rpnp[i].op == OP_VARIABLE || rpnp[i].op == OP_PREV_OTHER) {
@@ -106,7 +110,7 @@ void rpn_compact2str(
             (*str)[offset++] = ',';
 
 #define add_op(VV,VVV) \
-         if (addop2str(rpnc[i].op, VV, VVV, str, &offset) == 1) continue;
+         if (addop2str((enum op_en)(rpnc[i].op), VV, VVV, str, &offset) == 1) continue;
 
         if (rpnc[i].op == OP_NUMBER) {
             /* convert a short into a string */
@@ -132,7 +136,7 @@ void rpn_compact2str(
 #undef add_op
 
 #define add_op(VV,VVV) \
-         if (addop2str(rpnc[i].op, VV, #VVV, str, &offset) == 1) continue;
+         if (addop2str((enum op_en)rpnc[i].op, VV, #VVV, str, &offset) == 1) continue;
 
         add_op(OP_ADD, +)
             add_op(OP_SUB, -)
@@ -461,9 +465,9 @@ short rpn_calc(
         if (stptr + 5 > rpnstack->dc_stacksize) {
             /* could move this to a separate function */
             rpnstack->dc_stacksize += rpnstack->dc_stackblock;
-            rpnstack->s = rrd_realloc(rpnstack->s,
+            rpnstack->s = (double*)(rrd_realloc(rpnstack->s,
                                       (rpnstack->dc_stacksize) *
-                                      sizeof(*(rpnstack->s)));
+                                                            sizeof(*(rpnstack->s))));
             if (rpnstack->s == NULL) {
                 rrd_set_error("RPN stack overflow");
                 return -1;
index 0655e832f5a8df864c19b00a2ae7c3ec7753f6f5..597fe88eb5c544641f4ba58403899dca65ca57a6 100644 (file)
@@ -22,7 +22,7 @@ static CRITICAL_SECTION CriticalSection;
 
 
 /* Once-only initialisation of the key */
-static DWORD context_key_once = 0;
+static volatile LONG context_key_once = 0;
 
 
 /* Free the thread-specific rrd_context - we might actually use
@@ -51,7 +51,7 @@ rrd_context_t *rrd_get_context(
 
     context_init_context();
 
-    ctx = TlsGetValue(context_key);
+    ctx = (rrd_context_t*)(TlsGetValue(context_key));
     if (!ctx) {
         ctx = rrd_new_context();
         TlsSetValue(context_key, ctx);
@@ -59,6 +59,20 @@ rrd_context_t *rrd_get_context(
     return ctx;
 }
 
+#ifdef WIN32
+       rrd_context_t *rrd_force_new_context(void)
+       {
+               rrd_context_t *ctx;
+
+               context_init_context();
+
+               ctx = rrd_new_context();
+               TlsSetValue(context_key, ctx);
+
+               return ctx;
+       }
+#endif
+
 #undef strerror
 const char *rrd_strerror(
     int err)
index 484b0b4be3117e000d633d2a850c812ec0f3cf45..5dfac78213679a9e23fd09c58c971d0aec779742 100644 (file)
 #include "rrd_hw.h"
 #include <locale.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 int       set_hwarg(
     rrd_t *rrd,
     enum cf_en cf,
index fdaca577deaf0bb549f9f4d74250cad060d56523..288454c42af5aa802ae11da7ae363a1e6614852f 100644 (file)
 
 #include <locale.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 #include "rrd_hw.h"
 #include "rrd_rpncalc.h"
 
@@ -1496,7 +1500,7 @@ static int update_cdp_prep(
             if (elapsed_pdp_st > 2) {
                 reset_cdp(rrd, elapsed_pdp_st, pdp_temp, last_seasonal_coef,
                           seasonal_coef, rra_idx, ds_idx, cdp_idx,
-                          current_cf);
+                          (enum cf_en)current_cf);
             }
         }
 
index cda248a0e937f07bd7dc600fe5c2cff1db0ed4aa..4071f47b8c01eb6151c52067e218c82ca6946f80 100644 (file)
@@ -206,20 +206,20 @@ int rrd_xport_fn(
     }
 
     /* a list of referenced gdes */
-    ref_list = malloc(sizeof(int) * (*col_cnt));
+    ref_list = (int*)malloc(sizeof(int) * (*col_cnt));
     if (ref_list == NULL)
         return -1;
 
     /* a list to save pointers to the column's legend entry */
     /* this is a return value! */
-    legend_list = malloc(sizeof(char *) * (*col_cnt));
+    legend_list = (char**)malloc(sizeof(char *) * (*col_cnt));
     if (legend_list == NULL) {
         free(ref_list);
         return -1;
     }
 
     /* lets find the step size we have to use for xport */
-    step_list = malloc(sizeof(long)*((*col_cnt)+1));
+    step_list = (long*)malloc(sizeof(long)*((*col_cnt)+1));
     step_list_ptr = step_list;
     j = 0;
     for (i = 0; i < im->gdes_c; i++) {
@@ -232,7 +232,7 @@ int rrd_xport_fn(
             /* reserve room for one legend entry */
             /* is FMT_LEG_LEN + 5 the correct size? */
             if ((legend_list[j] =
-                malloc(sizeof(char) * (FMT_LEG_LEN + 5))) == NULL) {
+                (char*)malloc(sizeof(char) * (FMT_LEG_LEN + 5))) == NULL) {
                 free(ref_list);
                 *data = NULL;
                 while (--j > -1)
@@ -266,7 +266,7 @@ int rrd_xport_fn(
     /* this is a return value! */
     row_cnt = ((*end) - (*start)) / (*step);
     if (((*data) =
-         malloc((*col_cnt) * row_cnt * sizeof(rrd_value_t))) == NULL) {
+        (rrd_value_t*)malloc((*col_cnt) * row_cnt * sizeof(rrd_value_t))) == NULL) {
         free(ref_list);
         free(legend_list);
         rrd_set_error("malloc xport data area");
index d3bf6e63fd28f77f5d7323e9229068d7a578f7ab..53db0d527a356ac76f8748fb439a72ecc88d1eaa 100644 (file)
@@ -20,6 +20,7 @@
 #define HAVE_MKTIME 1
 #define HAVE_STRFTIME 1
 #define HAVE_STRING_H 1
+#define HAVE_STDLIB_H 1
 #define HAVE_VSNPRINTF 1
 #define HAVE_SYS_TYPES_H 1
 #define HAVE_SYS_STAT_H 1
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
-#define NUMVERS 1.2015
+#define NUMVERS 1.3040
 #define PACKAGE_NAME "rrdtool"
-#define PACKAGE_VERSION "1.2.15"
+#define PACKAGE_VERSION "1.3.4"
 #define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION
 
 #define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF)
 #define isnan _isnan
 #define finite _finite
 #define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#define strftime strftime_
+//#define vsnprintf _vsnprintf
+//#define strftime strftime_
 
 #define NO_NULL_REALLOC 1
 #if NO_NULL_REALLOC
diff --git a/win32/rrdlib.vcproj b/win32/rrdlib.vcproj
new file mode 100644 (file)
index 0000000..00a8b01
--- /dev/null
@@ -0,0 +1,367 @@
+<?xml version="1.0" encoding="windows-1251"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9,00"\r
+       Name="rrdlib"\r
+       ProjectGUID="{CC158E1D-1364-43CA-9B2D-4AF54225C7CA}"\r
+       RootNamespace="rrdlib"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories=".;../../contrib/cairo/include/cairo;&quot;../../contrib/pango/include/pango-1.0&quot;;&quot;../../contrib/glib/include/glib-2.0&quot;;&quot;../../contrib/glib/lib/glib-2.0/include&quot;;../../contrib/libpng/include;../../contrib/zlib/include;../../contrib/libxml2/include/libxml2"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               PrecompiledHeaderThrough="precompiled.h"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="2"\r
+                               DisableSpecificWarnings="4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib libpng.lib zdll.lib glib-2.0.lib gobject-2.0.lib libxml2.lib"\r
+                               AdditionalLibraryDirectories="../../contrib/cairo/lib;../../contrib/pango/lib;../../contrib/glib/lib;../../contrib/libpng/lib;../../contrib/zlib/lib;../../contrib/libxml2/lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories=".;../../contrib/cairo/include/cairo;&quot;../../contrib/pango/include/pango-1.0&quot;;&quot;../../contrib/glib/include/glib-2.0&quot;;&quot;../../contrib/glib/lib/glib-2.0/include&quot;;../../contrib/libpng/include;../../contrib/zlib/include;../../contrib/libxml2/include/libxml2"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               PrecompiledHeaderThrough="precompiled.h"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="2"\r
+                               DisableSpecificWarnings="4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib libpng.lib zdll.lib glib-2.0.lib gobject-2.0.lib libxml2.lib"\r
+                               AdditionalLibraryDirectories="../../contrib/cairo/lib;../../contrib/pango/lib;../../contrib/glib/lib;../../contrib/libpng/lib;../../contrib/zlib/lib;../../contrib/libxml2/lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\src\hash_32.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\pngsize.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_create.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_diff.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_dump.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_error.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_fetch.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_first.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_format.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_getopt.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_getopt1.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_gfx.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_graph.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_graph_helper.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw_math.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw_update.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_info.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_last.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_lastupdate.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_nan_inf.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_open.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_parsetime.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_resize.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_restore.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_rpncalc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_thread_safe_nt.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_tune.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_update.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_version.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_xport.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\win32\config.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\fnv.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_format.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_getopt.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_graph.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw_math.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw_update.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_i18n.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_is_thread_safe.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_parsetime.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_rpncalc.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_tool.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_xport.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\unused.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r