]> git.itanic.dy.fi Git - rrdd/blob - rrdtool.h
onewire_parser.c: Fix compiler warnings about string lengths
[rrdd] / rrdtool.h
1 #ifndef _DRAW_GRAPHS
2 #define _DRAW_GRAPHS
3
4 #define MAX_STRLEN 16
5
6 struct rrd_image {
7         const char *rrd_database;       /* Database file path */
8         const char *image_filename; /* Output image */
9         int     width;          /* Image dimensions */
10         int     height;
11         char    timestart[MAX_STRLEN];
12         char    timeend[MAX_STRLEN];
13         char    imageformat[MAX_STRLEN];
14         const char **options; /* Null terminated list of rrdgraph options */
15         int     text_lead;      /* Number of spaces at the beginning of line */
16         const char      **text; /* Null terminated list of text lines */
17         const char *updatestr;  /* "Last update" string comment */
18 };
19
20 struct rrd_data_source {
21         const char *type; /* Data source type, such as GAUGE or COUNTER */
22         const char *name;
23         int heartbeat;  /* Heartbeat value in seconds */
24         double min;     /* Maximum and minimum values accepted by data source */
25         double max;
26 };
27
28 struct rrd_archive {
29         const char *type; /* Archive type, such as MAX, MIN or AVERAGE */
30         double xff;     /* xfiles factor, 0..1 exclusive */
31         int steps;      /* How many points needed to construct data point */
32         int rows;       /* How many points are kept */
33 };
34
35 struct rrd_database {
36         const char *filename;   /* rrd database location */
37         int     interval;       /* Update interval */
38
39         /* Parser to aquire data for rrd */
40         struct parser_info *parser;
41         const char **parser_data;       /* data to be fed to the parser */
42         void *parser_state;             /* pointer to parser private state */
43
44         char *const *pre_draw_cmd; /* Command to execute prior drawing images*/
45         char *const *post_draw_cmd; /* ..and after drawing images */
46
47         struct  rrd_image **images; /* Images to draw */
48
49         struct rrd_data_source *sources; /* These are currently only used */
50         struct rrd_archive *archives;    /* generating new rrd database */
51
52         const char *logfile;    /* Name of a file where data can be logged */
53         const char *logfile_timestamp_fmt;
54
55         time_t last_update;     /* When was the data last updated */
56         int update_active;
57         int update_backoff;
58         const char *name;               /* Name of the database */
59 };
60
61 int rrdtool_draw_image(struct rrd_image *image);
62 int rrdtool_draw_images(struct rrd_image **image);
63 int rrdtool_update_data(struct rrd_database *rrd);
64 struct rrd_database *get_outdated_db(struct rrd_database **dblist);
65 int get_next_update(struct rrd_database **dblist, const char **name);
66 int rrdtool_create_missing_databases(struct rrd_database *dbs[]);
67
68 #endif