]> git.itanic.dy.fi Git - rrdd/blobdiff - rrdtool.h
onewire_parser.c: Fix compiler warnings about string lengths
[rrdd] / rrdtool.h
index a045db4db5e426a10d696225ae385f6474f57155..94d0ad8887a3fc9ac34d526750644be58d2aed42 100644 (file)
--- a/rrdtool.h
+++ b/rrdtool.h
@@ -4,20 +4,65 @@
 #define MAX_STRLEN 16
 
 struct rrd_image {
-       char    *rrd_database;  /* Database file path */
-       char    *image_filename; /* Output image */
+       const char *rrd_database;       /* Database file path */
+       const 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 */
+       const 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 */
+       const char      **text; /* Null terminated list of text lines */
+       const char *updatestr;  /* "Last update" string comment */
+};
+
+struct rrd_data_source {
+       const char *type; /* Data source type, such as GAUGE or COUNTER */
+       const char *name;
+       int heartbeat;  /* Heartbeat value in seconds */
+       double min;     /* Maximum and minimum values accepted by data source */
+       double max;
+};
+
+struct rrd_archive {
+       const 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 {
+       const char *filename;   /* rrd database location */
+       int     interval;       /* Update interval */
+
+       /* Parser to aquire data for rrd */
+       struct parser_info *parser;
+       const char **parser_data;       /* data to be fed to the parser */
+       void *parser_state;             /* pointer to parser private state */
+
+       char *const *pre_draw_cmd; /* Command to execute prior drawing images*/
+       char *const *post_draw_cmd; /* ..and after drawing images */
+
+       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 */
+
+       const char *logfile;    /* Name of a file where data can be logged */
+       const char *logfile_timestamp_fmt;
+
+       time_t last_update;     /* When was the data last updated */
+       int update_active;
+       int update_backoff;
+       const 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);
+struct rrd_database *get_outdated_db(struct rrd_database **dblist);
+int get_next_update(struct rrd_database **dblist, const char **name);
+int rrdtool_create_missing_databases(struct rrd_database *dbs[]);
 
 #endif