Code

win32 portability patch and win32/rrdlib.vcproj file for the source
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 18 Nov 2008 17:19:17 +0000 (17:19 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 18 Nov 2008 17:19:17 +0000 (17:19 +0000)
-- christof wegmann Christof.Wegmann with exitgames.com
some fixes to make the result work on unix again ...

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1677 a5681a0c-68f1-0310-ab6d-d61299d08faa

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

index 02b72a76f24f8a1935a1ba841530b5f08459e754..ee5c263f3791fbdb74ca501b834eae07bcbe57b5 100644 (file)
@@ -83,3 +83,4 @@ Alexander Lucke (lucke with dns-net.de)
  of DNS:NET Internet Services (www.dns-net.de) http://rrdtool.org
 Hedley Simons <heds@metahusky.net>
 Nicola Worthington <nicolaw@cpan.org>
+Wegmann, Christof <Christof.Wegmann@exitgames.com> 1.3/trunk win32 port
index b40251f5cadd78a60ab2090d146b049706a401e6..90286d1d37db135a85a40c0378dc83dca1516d39 100644 (file)
@@ -53,10 +53,17 @@ extern    "C" {
 #define _RRDLIB_H
 
 #include <sys/types.h>  /* for off_t */
+
+#ifndef WIN32
 #include <unistd.h>     /* for off_t */
+#else
+       typedef size_t ssize_t;
+       typedef long off_t;
+#endif 
+
 #include <time.h>
 #include <stdio.h>      /* for FILE */
-
+#include <string.h>
 
 /* Formerly rrd_nan_inf.h */
 #ifndef DNAN
@@ -79,9 +86,9 @@ extern    "C" {
 
 /* information about an rrd file */
     typedef struct rrd_file_t {
-        off_t     header_len;   /* length of the header of this rrd file */
-        off_t     file_len; /* total size of the rrd file */
-        off_t     pos;  /* current pos in file */
+        size_t     header_len;   /* length of the header of this rrd file */
+        size_t     file_len; /* total size of the rrd file */
+        size_t     pos;  /* current pos in file */
         void      *pvt;
     } rrd_file_t;
 
@@ -271,15 +278,18 @@ extern    "C" {
     } rrd_context_t;
 
 /* returns the current per-thread rrd_context */
-    rrd_context_t *rrd_get_context(
-    void);
+    rrd_context_t *rrd_get_context(void);
 
+#ifdef WIN32
+/* this was added by the win32 porters Christof.Wegmann@exitgames.com */
+    rrd_context_t *rrd_force_new_context(void);
 
     int       rrd_proc_start_end(
     rrd_time_value_t *,
     rrd_time_value_t *,
     time_t *,
     time_t *);
+#endif
 
 /* HELPER FUNCTIONS */
     void      rrd_set_error(
index 1776c2b3fcde3049e9e83e7570fd0796284209a3..90b78f8df989eab0b76a509ef21dc116ccbeb25e 100644 (file)
 #ifndef __RRD_CLIENT_H
 #define __RRD_CLIENT_H 1
 
+#ifndef WIN32
 #include <stdint.h>
+#else
+#      include <stdlib.h>
+       typedef signed char     int8_t;
+       typedef unsigned char   uint8_t;
+       typedef signed int      int16_t;
+       typedef unsigned int    uint16_t;
+       typedef signed long int         int32_t;
+       typedef unsigned long int       uint32_t;
+       typedef signed long long int    int64_t;
+       typedef unsigned long long int  uint64_t;
+#endif
+
 
 #ifndef RRDCACHED_DEFAULT_ADDRESS
 # define RRDCACHED_DEFAULT_ADDRESS "unix:/tmp/rrdcached.sock"
 #define RRDCACHED_DEFAULT_PORT "42217"
 #define ENV_RRDCACHED_ADDRESS "RRDCACHED_ADDRESS"
 
+
+// Windows version has no daemon/client support
+
+#ifndef WIN32
 int rrdc_connect (const char *addr);
 int rrdc_is_connected(const char *daemon_addr);
 int rrdc_disconnect (void);
@@ -41,6 +58,13 @@ int rrdc_update (const char *filename, int values_num,
 int rrdc_flush (const char *filename);
 int rrdc_flush_if_daemon (const char *opt_daemon, const char *filename);
 
+#else
+#      define rrdc_flush_if_daemon(a,b) 0
+#      define rrdc_connect(a) 0
+#      define rrdc_is_connected(a) 0
+#      define rrdc_flush(a) 0
+#      define rrdc_update(a,b,c) 0
+#endif
 
 struct rrdc_stats_s
 {
index 48a4d8ff6650bbca3427f31f65ffac90d514d551..f5dbd58db7690f30f066da9198de9ec58482de30 100644 (file)
 
 #include "rrd_is_thread_safe.h"
 
+#ifdef WIN32
+# include <process.h>
+#endif
+
 unsigned long FnvHash(
     const char *str);
 int       create_hw_contingent_rras(
@@ -124,14 +128,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);
@@ -162,7 +166,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");
@@ -231,7 +235,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");
@@ -606,7 +610,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);
@@ -694,7 +698,7 @@ int rrd_create_fn(
 
     rrd_write(rrd_file_dn, 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);
         rrd_close(rrd_file_dn);
@@ -710,7 +714,7 @@ int rrd_create_fn(
     for (i = 0; i < rrd->stat_head->ds_cnt; i++)
         rrd_write(rrd_file_dn, 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);
         rrd_close(rrd_file_dn);
@@ -757,7 +761,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);
         rrd_close(rrd_file_dn);
index 68216cb5ee4525f92c01809b5f512c5285b31259..6445e55d6bad10ad207ea4d64ff73e4a413d4cee 100644 (file)
 #include "rrd_client.h"
 
 #include <stdlib.h>
+
+#ifndef WIN32
 #include <stdint.h>
-#include <stdio.h>
 #include <unistd.h>
-#include <string.h>
 #include <strings.h>
-#include <stdint.h>
 #include <inttypes.h>
+#      include <sys/socket.h>
+
+#else
+
+#endif
+#include <stdio.h>
+#include <string.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <sys/socket.h>
 #include <sys/un.h>
 #include <netdb.h>
 #include <poll.h>
index 093a293841d8923b56a289129c41e10a6a8ea131..2b5cb6678a60429be0628b8505bc531a8c43fb5b 100644 (file)
@@ -35,6 +35,7 @@
  *
  *****************************************************************************/
 
+#include <ctype.h>
 #include "rrd_tool.h"
 
 double rrd_diff(
index d8c6eedcb18b15792c1c90ad06777e76971e723a..d816c22fcc8b22c69be019c1e7682142f08474b5 100644 (file)
  *
  *************************************************************************** */
 
-#include "rrd_tool.h"
+#include <stdlib.h>
 #include <stdarg.h>
 
+#include "rrd_tool.h"
+
 #define MAXLEN 4096
 #define ERRBUFLEN 256
 #define CTX (rrd_get_context())
index 83b0cf6fcc584334e0bfa0eb20b2e74615113fa3..abfe66c89a8483a1b1fb9d482ed5857f889f7d1e 100644 (file)
@@ -258,7 +258,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;
         }
@@ -358,7 +358,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 82b99f385ef6f5fae0bcaee8bbbb1e2fd1466e91..4fb4a4ef10c08e670d521fb193c12d91de9ef597 100644 (file)
@@ -6,6 +6,7 @@
  * Initial version by Burton Strauss, ntopSupport.com - 3/2005
  *****************************************************************************/
 
+#include <stdlib.h>
 #include "rrd_tool.h"
 
 
index 55653a5447eb9023163149e3a1f23dd815d775eb..4e53e196481e9de2d0a9fcf50eadb4d5deed9d0d 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..dbb3f3f76dd76630b112c01e875adcf657d2a2af 100644 (file)
@@ -30,7 +30,8 @@
 #define _NO_PROTO
 #endif
 
-#if !defined (__STDC__) || !__STDC__
+
+#if !defined WIN32 && (!defined (__STDC__) || !__STDC__)
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
 #ifndef const
@@ -207,11 +208,7 @@ static char *posixly_correct;
 char     *getenv(
     );
 
-static char *my_index(
-    str,
-    chr)
-    const char *str;
-    int chr;
+static char* my_index(const char* str, int chr)
 {
     while (*str) {
         if (*str == chr)
@@ -288,9 +285,7 @@ static void exchange(
     char **);
 #endif
 
-static void exchange(
-    argv)
-    char    **argv;
+static void exchange(char** argv)
 {
     int       bottom = first_nonopt;
     int       middle = last_nonopt;
@@ -346,13 +341,9 @@ static const char *_getopt_initialize(
     char *const *,
     const char *);
 #endif
-static const char *_getopt_initialize(
-    argc,
-    argv,
-    optstring)
-    int argc;
-    char     *const *argv;
-    const char *optstring;
+static const char* _getopt_initialize(int argc,
+                                      char** argv,
+                                      const char* optstring)
 {
     /* Start processing options with ARGV-element 1 (since ARGV-element 0
        is the program name); the sequence of previously skipped
@@ -455,19 +446,12 @@ static const char *_getopt_initialize(
    If LONG_ONLY is nonzero, '-' as well as '--' can introduce
    long-named options.  */
 
-int _getopt_internal(
-    argc,
-    argv,
-    optstring,
-    longopts,
-    longind,
-    long_only)
-    int argc;
-    char     *const *argv;
-    const char *optstring;
-    const struct option *longopts;
-    int      *longind;
-    int long_only;
+int _getopt_internal(int argc,
+                     char** argv,
+                     const char *optstring,
+                     const struct option *longopts,
+                     int* longind,
+                     int long_only)
 {
     optarg = NULL;
 
@@ -868,12 +852,9 @@ int _getopt_internal(
 }
 
 int getopt(
-    argc,
-    argv,
-    optstring)
-    int argc;
-    char     *const *argv;
-    const char *optstring;
+    int argc,
+    char** argv,
+    const char* optstring)
 {
     return _getopt_internal(argc, argv, optstring,
                             (const struct option *) 0, (int *) 0, 0);
index 91906efe2dc7b7f9c635bb753c3c0d67b5947df1..1d443f194f0fa18cef6bf4613054c6327fe3a318 100644 (file)
@@ -132,15 +132,17 @@ extern    "C" {
     int *longind,
     int long_only);
 #else                   /* not __STDC__ */
-    extern int getopt(
-        );
-    extern int getopt_long(
-        );
-    extern int getopt_long_only(
-        );
-
-    extern int _getopt_internal(
-        );
+    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);
 #endif                  /* __STDC__ */
 
 #ifdef __cplusplus
index 075bc8da48b79643af6794ddfc5c51270693982a..1ace77e24c9157e5254a485d0866b417bc5411e8 100644 (file)
@@ -20,7 +20,7 @@
    Boston, MA 02111-1307, USA.  */
 \f
 
-#if !defined (__STDC__) || !__STDC__
+#if !defined WIN32 && (!defined (__STDC__) || !__STDC__)
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
 #ifndef const
 #define NULL 0
 #endif
 
-int getopt_long(
-    argc,
-    argv,
-    options,
-    long_options,
-    opt_index)
-    int argc;
-    char     *const *argv;
-    const char *options;
-    const struct option *long_options;
-    int      *opt_index;
+int getopt_long(int argc,
+                char** argv,
+                const char* options,
+                const struct option* long_options,
+                int* opt_index)
 {
     return _getopt_internal(argc, argv, options, long_options, opt_index, 0);
 }
@@ -85,17 +79,11 @@ int getopt_long(
    but does match a short option, it is parsed as a short option
    instead.  */
 
-int getopt_long_only(
-    argc,
-    argv,
-    options,
-    long_options,
-    opt_index)
-    int argc;
-    char     *const *argv;
-    const char *options;
-    const struct option *long_options;
-    int      *opt_index;
+int getopt_long_only(int argc,
+                     char** argv,
+                     const char* options,
+                     const struct option* long_options,
+                     int* opt_index)
 {
     return _getopt_internal(argc, argv, options, long_options, opt_index, 1);
 }
index a24889fb439458685b338b1cf50e4299d6f80316..1618e6279a8ef1f6eeb0bdb2e0abb17e15e99c01 100644 (file)
@@ -236,7 +236,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(
@@ -248,7 +248,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(
@@ -262,7 +262,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(
@@ -280,7 +280,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(
@@ -293,7 +293,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);
 }
 
 
@@ -303,7 +303,7 @@ int im_free(
     image_desc_t *im)
 {
     unsigned long i, ii;
-    cairo_status_t status = 0;
+    cairo_status_t status = (cairo_status_t) 0;
 
     if (im == NULL)
         return 0;
@@ -427,7 +427,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;
     }
@@ -1053,7 +1053,7 @@ 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) {
                             rrd_set_error("realloc steparray");
@@ -1121,7 +1121,7 @@ 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) {
@@ -1211,7 +1211,7 @@ 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)
+            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;
@@ -1568,7 +1568,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)) {
@@ -1669,7 +1669,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;
         }
@@ -2070,7 +2070,7 @@ double frexp10(
     double    mnt;
     int       iexp;
 
-    iexp = floor(log(fabs(x)) / log(10));
+    iexp = floor(log((double)fabs(x)) / log((double)10));
     mnt = x / pow(10.0, iexp);
     if (mnt >= 10.0) {
         iexp++;
@@ -2944,10 +2944,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);
@@ -3566,13 +3566,13 @@ int rrd_graph(
         if (strcmp(walker->key, "image_info") == 0) {
             prlines++;
             if (((*prdata) =
-                 rrd_realloc((*prdata),
+                 (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)
+            (*prdata)[prlines - 1] = (char*)malloc((strlen(walker->value.u_str)
                                              + 2) * sizeof(char));
             strcpy((*prdata)[prlines - 1], walker->value.u_str);
             (*prdata)[prlines] = NULL;
@@ -3597,12 +3597,12 @@ int rrd_graph(
         } else if (strncmp(walker->key, "print", 5) == 0) { /* keys are prdate[0..] */
             prlines++;
             if (((*prdata) =
-                 rrd_realloc((*prdata),
+                 (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)
+            (*prdata)[prlines - 1] = (char*)malloc((strlen(walker->value.u_str)
                                              + 2) * sizeof(char));
             (*prdata)[prlines] = NULL;
             strcpy((*prdata)[prlines - 1], walker->value.u_str);
@@ -4537,7 +4537,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 8b86e864667e67f3897625742ceb84cf45aed9e6..6681390c11c6fcbb7c153d846bbaa160c78e33fc 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 e563926b458d0ccd4cae2f82730f287b530bcec3..6f2c50732051c5c16dfbb8644904b968e8c40956 100644 (file)
@@ -6,6 +6,8 @@
  * Initial version by Jake Brutlag, WebTV Networks, 5/1/00
  *****************************************************************************/
 
+#include <stdlib.h>
+
 #include "rrd_tool.h"
 #include "rrd_hw.h"
 #include "rrd_hw_math.h"
index 7ce9dc26d379cae02965ee327d9a9ffb0943c723..05fbf0231c42a6fe31cf1cd7677029ead0bfb93c 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "rrd_tool.h"
 #include "rrd_hw_math.h"
-#include "rrd_config.h"
 
 /*****************************************************************************
  * RRDtool supports both the additive and multiplicative Holt-Winters methods. 
index 9514380510ca1dd65ac537691704e5a95ef95c55..90a8a5203dcf12b4a21368feb139c4ff70a73cd9 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "rrd_tool.h"
 #include "rrd_format.h"
-#include "rrd_config.h"
 #include "rrd_hw_math.h"
 #include "rrd_hw_update.h"
 
index 3b5364a392e4de587cc2ae6bdb4c838494cc8c47..174bf1ab3cde821acfdc3e380ce320cb2188e91c 100644 (file)
@@ -24,7 +24,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
@@ -45,7 +45,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;
@@ -62,13 +62,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 654005fac248cf786bf87d79a64bd7e82cce91fe..5598546d11ae471cad5c4fa332e565829cfc53ed 100644 (file)
@@ -6,10 +6,33 @@
  * $Id$
  *****************************************************************************/
 
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
 #include "rrd_tool.h"
 #include "unused.h"
 #define MEMBLK 8192
 
+#ifdef WIN32
+#      define random() rand()
+#      define srandom(x) srand(x)
+#      define getpid() 0
+
+#define        _LK_UNLCK       0       /* Unlock */
+#define        _LK_LOCK        1       /* Lock */
+#define        _LK_NBLCK       2       /* Non-blocking lock */
+#define        _LK_RLCK        3       /* Lock for read only */
+#define        _LK_NBRLCK      4       /* Non-blocking lock for read only */
+
+
+#define        LK_UNLCK        _LK_UNLCK
+#define        LK_LOCK         _LK_LOCK
+#define        LK_NBLCK        _LK_NBLCK
+#define        LK_RLCK         _LK_RLCK
+#define        LK_NBRLCK       _LK_NBRLCK
+#endif
+
 /* DEBUG 2 prints information obtained via mincore(2) */
 #define DEBUG 1
 /* do not calculate exact madvise hints but assume 1 page for headers and
@@ -34,7 +57,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; \
        } \
@@ -73,7 +96,7 @@ rrd_file_t *rrd_open(
     rrd_t *rrd,
     unsigned rdwr)
 {
-    int i;
+    unsigned long ui;
     int       flags = 0;
     int       version;
 
@@ -85,8 +108,8 @@ rrd_file_t *rrd_open(
     struct stat statb;
     rrd_file_t *rrd_file = NULL;
     rrd_simple_file_t *rrd_simple_file = NULL;
-    off_t     newfile_size = 0;
-    off_t header_len, value_cnt, data_len;
+    size_t     newfile_size = 0;
+    size_t header_len, value_cnt, data_len;
 
     /* Are we creating a new file? */
     if((rdwr & RRD_CREAT) && (rrd->stat_head != NULL))
@@ -102,15 +125,15 @@ rrd_file_t *rrd_open(
           sizeof(rra_ptr_t) * rrd->stat_head->rra_cnt;
 
         value_cnt = 0;
-        for (i = 0; i < rrd->stat_head->rra_cnt; i++)
-            value_cnt += rrd->stat_head->ds_cnt * rrd->rra_def[i].row_cnt;
+        for (ui = 0; ui < rrd->stat_head->rra_cnt; ui++)
+            value_cnt += rrd->stat_head->ds_cnt * rrd->rra_def[ui].row_cnt;
 
         data_len = sizeof(rrd_value_t) * value_cnt;
 
         newfile_size = header_len + data_len;
     }
     
-    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;
@@ -313,12 +336,11 @@ rrd_file_t *rrd_open(
 
     {
       unsigned long row_cnt = 0;
-      unsigned long i;
 
-      for (i=0; i<rrd->stat_head->rra_cnt; i++)
-        row_cnt += rrd->rra_def[i].row_cnt;
+      for (ui=0; ui<rrd->stat_head->rra_cnt; ui++)
+        row_cnt += rrd->rra_def[ui].row_cnt;
 
-      off_t correct_len = rrd_file->header_len +
+      size_t  correct_len = rrd_file->header_len +
         sizeof(rrd_value_t) * row_cnt * rrd->stat_head->ds_cnt;
 
       if (correct_len > rrd_file->file_len)
@@ -357,7 +379,7 @@ void mincore_print(
     rrd_simple_file = (rrd_simple_file_t *)rrd_file->pvt;
 #ifdef HAVE_MMAP
     /* pretty print blocks in core */
-    off_t     off;
+    size_t     off;
     unsigned char *vec;
     ssize_t   _page_size = sysconf(_SC_PAGESIZE);
 
@@ -438,9 +460,9 @@ void rrd_dontneed(
 {
     rrd_simple_file_t *rrd_simple_file = (rrd_simple_file_t *)rrd_file->pvt;
 #if defined USE_MADVISE || defined HAVE_POSIX_FADVISE
-    off_t dontneed_start;
-    off_t rra_start;
-    off_t active_block;
+    size_t dontneed_start;
+    size_t rra_start;
+    size_t active_block;
     unsigned long i;
     ssize_t   _page_size = sysconf(_SC_PAGESIZE);
 
@@ -622,7 +644,7 @@ ssize_t rrd_write(
 {
     rrd_simple_file_t *rrd_simple_file = (rrd_simple_file_t *)rrd_file->pvt;
 #ifdef HAVE_MMAP
-    int old_size = rrd_file->file_len;
+    size_t old_size = rrd_file->file_len;
     if (count == 0)
         return 0;
     if (buf == NULL)
@@ -651,12 +673,14 @@ ssize_t rrd_write(
 void rrd_flush(
     rrd_file_t *rrd_file)
 {
+#ifndef WIN32
     rrd_simple_file_t *rrd_simple_file;
     rrd_simple_file = (rrd_simple_file_t *)rrd_file->pvt;
     if (fdatasync(rrd_simple_file->fd) != 0) {
         rrd_set_error("flushing fd %d: %s", rrd_simple_file->fd,
                       rrd_strerror(errno));
     }
+#endif
 }
 
 
@@ -718,10 +742,10 @@ void rrd_freemem(
  * aligning RRAs within stripes, or other performance enhancements
  */
 void rrd_notify_row(
-    rrd_file_t *rrd_file,
-    int rra_idx,
-    unsigned long rra_row,
-    time_t rra_time)
+    rrd_file_t *rrd_file  __attribute__((unused)),
+    int rra_idx  __attribute__((unused)),
+    unsigned long rra_row  __attribute__((unused)),
+    time_t rra_time  __attribute__((unused)))
 {
 }
 
@@ -733,8 +757,8 @@ void rrd_notify_row(
  * don't change to a new disk block at the same time
  */
 unsigned long rrd_select_initial_row(
-    rrd_file_t *rrd_file,
-    int rra_idx,
+    rrd_file_t *rrd_file  __attribute__((unused)),
+    int rra_idx  __attribute__((unused)),
     rra_def_t *rra
     )
 {
index 7fa355938fe6ed399bc955f7626f86d345087623..f3a8e2ec094b8d049303b3a4655c2c4bc35b200a 100644 (file)
 
 /* Local headers */
 
-#include "rrd_tool.h"
 #include <stdarg.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "rrd_tool.h"
 
 /* Structures and unions */
 
index 32a501ad8cdb4ef088c7ba46cd96a09b3587c37a..d84096cdc278962a7ac2b0528453ecfc5fd705d7 100644 (file)
@@ -6,6 +6,8 @@
  * Initial version by Alex van den Bogaerdt
  *****************************************************************************/
 
+#include <stdlib.h>
+
 #include "rrd_tool.h"
 
 int rrd_resize(
@@ -88,14 +90,14 @@ int rrd_resize(
     rrd_init(&rrdnew);
     /* These need to be initialised before calling rrd_open() with 
        the RRD_CREATE flag */
-    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);
         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);
@@ -125,7 +127,7 @@ int rrd_resize(
         return (-1);
     }
 /*XXX: do one write for those parts of header that are unchanged */
-    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);
index ab8b138044d45158484302e6f8cf0b1637ff398c..f803ab68bfe99be49346a3fe6b9ee0cc1ae6624b 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-#include <unistd.h>
+
+
+#ifndef WIN32
+#      include <unistd.h>     /* for off_t */
+#else
+#      define random() rand()
+#      define srandom(x) srand(x)
+#      define getpid() 0
+       typedef size_t ssize_t;
+       typedef long off_t;
+#endif 
+
 #include <fcntl.h>
 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
 # include <io.h>
index d83c0f4a7d920aabd62f6daacff1d910c7b8061b..b5f6bccbce91f3b6d9375976e0be7bf6cadaeeee 100644 (file)
@@ -4,11 +4,13 @@
  * rrd_rpncalc.c  RPN calculator functions
  ****************************************************************************/
 
+#include <limits.h>
+#include <locale.h>
+#include <stdlib.h>
+
 #include "rrd_tool.h"
 #include "rrd_rpncalc.h"
 // #include "rrd_graph.h"
-#include <limits.h>
-#include <locale.h>
 
 short     addop2str(
     enum op_en op,
@@ -73,7 +75,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 = 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 +108,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 +134,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, -)
@@ -465,7 +467,7 @@ 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)));
             if (rpnstack->s == NULL) {
index eee5543a01c016953f2ccda94f0f52baa5c11e68..e0dad45a565f8acacf40c6c17afd8b6ca28be816 100644 (file)
@@ -38,7 +38,7 @@ static void context_destroy_context(
 static void context_init_context(
     void)
 {
-    if (!InterlockedExchange(&context_key_once, 1)) {
+    if (!InterlockedExchange((LONG*)(&context_key_once), 1)) {
         context_key = TlsAlloc();
         InitializeCriticalSection(&CriticalSection);
         atexit(context_destroy_context);
@@ -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,23 @@ rrd_context_t *rrd_get_context(
     return ctx;
 }
 
+
+/* this was added by the win32 porters Christof.Wegmann@exitgames.com */
+
+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;
+}
+
+
 #undef strerror
 const char *rrd_strerror(
     int err)
index 051631cfb0e4df83dfecc16b82063ae85f08793c..4da8019e36daddccd16714b64e32460530bd3d1c 100644 (file)
@@ -70,8 +70,7 @@ void PrintUsage(
 
     const char *help_dump =
         N_("* dump - dump an RRD to XML\n\n"
-           "\trrdtool dump filename.rrd >filename.xml\n"
-           "\t\t[--header|-h {xsd,dtd}]\n\n");
+           "\trrdtool dump filename.rrd >filename.xml\n\n");
 
     const char *help_info =
         N_("* info - returns the configuration and status of the RRD\n\n"
index 89559af7a51f71c17996ee39e377e12386ba59e0..0df0476b5c7756dcc3a21de632fd8b0a95058fe7 100644 (file)
  *
  *****************************************************************************/
 
+#include <stdlib.h>
+#include <locale.h>
+
 #include "rrd_tool.h"
 #include "rrd_rpncalc.h"
 #include "rrd_hw.h"
-#include <locale.h>
 
 int       set_hwarg(
     rrd_t *rrd,
index 1d9d5150d325f90a65af55ade48702c7ddce02b5..72a9905cc3d83095e473c886eff3581f3b937b26 100644 (file)
@@ -449,7 +449,7 @@ int rrd_update(
     {
         rc = rrdc_update (argv[optind], /* file */
                           argc - optind - 1, /* values_num */
-                          (void *) (argv + optind + 1)); /* values */
+                          (const char *const *) (argv + optind + 1)); /* values */
         if (rc > 0)
             rrd_set_error("Failed sending the values to rrdcached: %s",
                           rrd_strerror (rc));
index 225fba5587652f3de1ff17eb6210495c5462f578..82044694779b5916ff07d44d9eb9eea70865c897 100644 (file)
@@ -233,20 +233,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++) {
@@ -259,7 +259,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)
@@ -293,7 +293,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..61992343541501561583916e669d07502efa0d31 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.3020
 #define PACKAGE_NAME "rrdtool"
-#define PACKAGE_VERSION "1.2.15"
+#define PACKAGE_VERSION "1.3.2"
 #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/program/win32/rrdlib.vcproj b/program/win32/rrdlib.vcproj
new file mode 100644 (file)
index 0000000..bae4a95
--- /dev/null
@@ -0,0 +1,613 @@
+<?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
+                               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
+                               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
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\pngsize.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_create.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_diff.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_dump.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_error.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_fetch.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_first.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_format.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_getopt.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_getopt1.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_gfx.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_graph.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_graph_helper.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw_math.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_hw_update.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_info.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_last.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_lastupdate.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_nan_inf.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_open.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_parsetime.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_resize.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_restore.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_rpncalc.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_thread_safe_nt.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_tune.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_update.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_version.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\src\rrd_xport.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               CompileAs="2"\r
+                                       />\r
+                               </FileConfiguration>\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