1 /*****************************************************************************
2 * RRDtool 1.0.33 Copyright Tobias Oetiker, 1997 - 2000
3 *****************************************************************************
4 * rrd_tool.h Common Header File
5 *****************************************************************************/
15 # include "ntconfig.h"
22 #ifdef MUST_DISABLE_SIGFPE
26 #ifdef MUST_DISABLE_FPMASK
27 #include <floatingpoint.h>
38 # include <sys/param.h>
52 # include <sys/time.h>
55 # include <sys/times.h>
57 #if HAVE_SYS_RESOURCE_H
58 # include <sys/resource.h>
59 #if (defined(__svr4__) && defined(__sun__))
60 /* Solaris headers (pre 2.6) don't have a getrusage prototype.
62 extern int getrusage(int, struct rusage *);
63 #endif /* __svr4__ && __sun__ */
70 /* unix-only includes */
72 int isnan(double value);
77 /* Win32 only includes */
79 #include <float.h> /* for _isnan */
81 #define finite _finite
82 #define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF)
85 /* local include files -- need to be after the system ones */
87 #include "rrd_format.h"
90 #define max(a,b) ((a) > (b) ? (a) : (b))
94 #define min(a,b) ((a) < (b) ? (a) : (b))
97 #define DIM(x) (sizeof(x)/sizeof(x[0]))
99 /* rrd info interface */
100 enum info_type { RD_I_VAL=0,
104 typedef union infoval {
110 typedef struct info_t {
118 info_t *rrd_info(int, char **);
120 /* HELPER FUNCTIONS */
121 int GifSize(FILE *, long *, long *);
122 int PngSize(FILE *, long *, long *);
123 int PngSize(FILE *, long *, long *);
126 void gdImagePng(gdImagePtr im, FILE *out);
128 int rrd_create_fn(char *file_name, rrd_t *rrd);
129 int rrd_fetch_fn(char *filename, enum cf_en cf_idx,
130 time_t *start,time_t *end,
132 unsigned long *ds_cnt,
136 void rrd_free(rrd_t *rrd);
137 void rrd_init(rrd_t *rrd);
139 int rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr);
140 int readfile(char *file, char **buffer, int skipfirst);
142 #define RRD_READONLY 0
143 #define RRD_READWRITE 1
145 enum cf_en cf_conv(char *string);
146 enum dst_en dst_conv(char *string);
147 long ds_match(rrd_t *rrd,char *ds_nam);
148 double rrd_diff(char *a, char *b);