]> git.itanic.dy.fi Git - rrdd/blob - rrdtool.h
config: Fix copy paste errors in error messages
[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 };
18
19 struct rrd_data_source {
20         const char *type; /* Data source type, such as GAUGE or COUNTER */
21         const char *name;
22         int heartbeat;  /* Heartbeat value in seconds */
23         double min;     /* Maximum and minimum values accepted by data source */
24         double max;
25 };
26
27 struct rrd_archive {
28         const char *type; /* Archive type, such as MAX, MIN or AVERAGE */
29         double xff;     /* xfiles factor, 0..1 exclusive */
30         int steps;      /* How many points needed to construct data point */
31         int rows;       /* How many points are kept */
32 };
33
34 struct rrd_database {
35         const char *filename;   /* rrd database location */
36         int     interval;       /* Update interval */
37
38         /* Parser to aquire data for rrd */
39         int (*parse)(char *rrd_data, const char **parser_data);
40         const char **parser_data;       /* data to be fed to the parser */
41
42         struct  rrd_image **images; /* Images to draw */
43
44         struct rrd_data_source *sources; /* These are currently only used */
45         struct rrd_archive *archives;    /* generating new rrd database */
46
47         int     last_update;    /* When was the data last updated */
48         const char *name;               /* Name of the database */
49 };
50
51 int rrdtool_draw_image(struct rrd_image *image);
52 int rrdtool_draw_images(struct rrd_image **image);
53 int rrdtool_update_data(struct rrd_database *rrd);
54 struct rrd_database *get_outdated_db(struct rrd_database **dblist);
55 int get_next_update(struct rrd_database **dblist, const char **name);
56 int rrdtool_create_missing_databases(struct rrd_database *dbs[]);
57
58 #endif