#ifndef _DRAW_GRAPHS #define _DRAW_GRAPHS #define MAX_STRLEN 16 struct rrd_image { char *rrd_database; /* Database file path */ char *image_filename; /* Output image */ int width; /* Image dimensions */ int height; char timestart[MAX_STRLEN]; char timeend[MAX_STRLEN]; char imageformat[MAX_STRLEN]; char **options; /* Null terminated list of rrdgraph options */ int text_lead; /* Number of spaces at the beginning of line */ char **text; /* Null terminated list of text lines */ }; struct rrd_data_source { char *type; /* Data source type, such as GAUGE or COUNTER */ char *name; int heartbeat; /* Heartbeat value in seconds */ double min; /* Maximum and minimum values accepted by data source */ double max; }; struct rrd_archive { char *type; /* Archive type, such as MAX, MIN or AVERAGE */ double xff; /* xfiles factor, 0..1 exclusive */ int steps; /* How many points needed to construct data point */ int rows; /* How many points are kept */ }; struct rrd_database { char *filename; /* rrd database location */ int interval; /* Update interval */ int (*parse)(char *data); /* Parser to aquire data */ struct rrd_image **images; /* Images to draw */ struct rrd_data_source *sources; /* These are currently only used */ struct rrd_archive *archives; /* generating new rrd database */ int last_update; /* When was the data last updated */ char *name; /* Name of the database */ }; int rrdtool_draw_image(struct rrd_image *image); int rrdtool_draw_images(struct rrd_image **image); int rrdtool_update_data(struct rrd_database *rrd); int rrdtool_check_databases(struct rrd_database *dbs[]); #endif