1 /*****************************************************************************
2 * RRDtool 1.0.33 Copyright Tobias Oetiker, 1997 - 2000
3 *****************************************************************************
4 * rrd_tool.h Common Header File
5 *****************************************************************************
8 * Revision 1.1 2001/02/25 22:25:06 oetiker
11 *****************************************************************************/
21 # include "ntconfig.h"
28 #ifdef MUST_DISABLE_SIGFPE
32 #ifdef MUST_DISABLE_FPMASK
33 #include <floatingpoint.h>
44 # include <sys/param.h>
58 # include <sys/time.h>
61 # include <sys/times.h>
63 #if HAVE_SYS_RESOURCE_H
64 # include <sys/resource.h>
65 #if (defined(__svr4__) && defined(__sun__))
66 /* Solaris headers (pre 2.6) don't have a getrusage prototype.
68 extern int getrusage(int, struct rusage *);
69 #endif /* __svr4__ && __sun__ */
76 /* unix-only includes */
78 int isnan(double value);
83 /* Win32 only includes */
85 #include <float.h> /* for _isnan */
87 #define finite _finite
88 #define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF)
91 /* local include files -- need to be after the system ones */
93 #include "rrd_format.h"
96 #define max(a,b) ((a) > (b) ? (a) : (b))
100 #define min(a,b) ((a) < (b) ? (a) : (b))
103 #define DIM(x) (sizeof(x)/sizeof(x[0]))
105 /* rrd info interface */
106 enum info_type { RD_I_VAL=0,
110 typedef union infoval {
116 typedef struct info_t {
124 info_t *rrd_info(int, char **);
126 /* HELPER FUNCTIONS */
127 int GifSize(FILE *, long *, long *);
128 int PngSize(FILE *, long *, long *);
129 int PngSize(FILE *, long *, long *);
132 void gdImagePng(gdImagePtr im, FILE *out);
134 int rrd_create_fn(char *file_name, rrd_t *rrd);
135 int rrd_fetch_fn(char *filename, enum cf_en cf_idx,
136 time_t *start,time_t *end,
138 unsigned long *ds_cnt,
142 void rrd_free(rrd_t *rrd);
143 void rrd_init(rrd_t *rrd);
145 int rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr);
146 int readfile(char *file, char **buffer, int skipfirst);
148 #define RRD_READONLY 0
149 #define RRD_READWRITE 1
151 enum cf_en cf_conv(char *string);
152 enum dst_en dst_conv(char *string);
153 long ds_match(rrd_t *rrd,char *ds_nam);
154 double rrd_diff(char *a, char *b);