1 /*****************************************************************************
2 * RRDtool 1.0.33 Copyright Tobias Oetiker, 1997 - 2000
3 *****************************************************************************
4 * rrd_tool.h Common Header File
5 *****************************************************************************/
15 #include "../confignt/config.h"
22 #ifdef MUST_DISABLE_SIGFPE
26 #ifdef MUST_DISABLE_FPMASK
27 #include <floatingpoint.h>
38 # include <sys/param.h>
48 /* Sorry: don't know autoconf as well how to check the exist of
49 dirent.h ans sys/stat.h
53 #include <sys/types.h>
61 # include <sys/time.h>
64 # include <sys/times.h>
66 #if HAVE_SYS_RESOURCE_H
67 # include <sys/resource.h>
68 #if (defined(__svr4__) && defined(__sun__))
69 /* Solaris headers (pre 2.6) don't have a getrusage prototype.
71 extern int getrusage(int, struct rusage *);
72 #endif /* __svr4__ && __sun__ */
79 /* unix-only includes */
81 int isnan(double value);
86 /* Win32 only includes */
88 #include <float.h> /* for _isnan */
90 #define finite _finite
91 #define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF)
94 /* local include files -- need to be after the system ones */
96 #include "rrd_format.h"
99 #define max(a,b) ((a) > (b) ? (a) : (b))
103 #define min(a,b) ((a) < (b) ? (a) : (b))
106 #define DIM(x) (sizeof(x)/sizeof(x[0]))
108 /* rrd info interface */
109 enum info_type { RD_I_VAL=0,
113 typedef union infoval {
119 typedef struct info_t {
127 info_t *rrd_info(int, char **);
129 /* HELPER FUNCTIONS */
131 int PngSize(FILE *, long *, long *);
133 int rrd_create_fn(char *file_name, rrd_t *rrd);
134 int rrd_fetch_fn(char *filename, enum cf_en cf_idx,
135 time_t *start,time_t *end,
137 unsigned long *ds_cnt,
141 void rrd_free(rrd_t *rrd);
142 void rrd_init(rrd_t *rrd);
144 int rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr);
145 int readfile(char *file, char **buffer, int skipfirst);
147 #define RRD_READONLY 0
148 #define RRD_READWRITE 1
150 enum cf_en cf_conv(char *string);
151 enum dst_en dst_conv(char *string);
152 long ds_match(rrd_t *rrd,char *ds_nam);
153 double rrd_diff(char *a, char *b);