1 /*****************************************************************************
2 * RRDtool 1.3rc7 Copyright by Tobi Oetiker, 1997-2008
3 *****************************************************************************
4 * rrd_tool.h Common Header File
5 *****************************************************************************/
14 #include "../rrd_config.h"
15 #elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
16 #include "../win32/config.h"
21 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
23 /* Win32 only includes */
25 #include <float.h> /* for _isnan */
26 #include <io.h> /* for chdir */
28 struct tm *localtime_r(
44 /* unix-only includes */
45 #if !defined isnan && !defined HAVE_ISNAN
52 /* local include files -- need to be after the system ones */
53 #include "rrd_getopt.h"
54 #include "rrd_format.h"
57 #define max(a,b) ((a) > (b) ? (a) : (b))
61 #define min(a,b) ((a) < (b) ? (a) : (b))
64 #define DIM(x) (sizeof(x)/sizeof(x[0]))
73 unsigned long *ds_cnt,
92 /* HELPER FUNCTIONS */
100 const char *file_name,
103 const char *filename,
108 unsigned long *ds_cnt,
119 rrd_file_t *rrd_open(
120 const char *const file_name,
124 rrd_file_t *rrd_file,
127 rrd_file_t *rrd_file);
129 rrd_file_t *rrd_file,
133 rrd_file_t *rrd_file,
137 rrd_file_t *rrd_file);
139 rrd_file_t *rrd_file,
143 rrd_file_t *rrd_file);
149 #define RRD_READONLY (1<<0)
150 #define RRD_READWRITE (1<<1)
151 #define RRD_CREAT (1<<2)
152 #define RRD_READAHEAD (1<<3)
153 #define RRD_COPY (1<<4)
157 enum dst_en dst_conv(
166 /* rrd_strerror is thread safe, but still it uses a global buffer
167 (but one per thread), thus subsequent calls within a single
168 thread overwrite the same buffer */
169 const char *rrd_strerror(