X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph_helper.c;h=a15c0ed1dec7d1c6491cfadb534906b1bb44d637;hb=86a5012e6ecc922be53f8c621bbcd2c5e1e46755;hp=bea9d7b6c06ad711ba0aab6d849696f3d3ccd2dc;hpb=8c07cbbcf8f7f653216a7245dcc05f929df44299;p=rrdtool.git diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c index bea9d7b..a15c0ed 100644 --- a/src/rrd_graph_helper.c +++ b/src/rrd_graph_helper.c @@ -2,6 +2,27 @@ #define dprintf if (gdp->debug) printf +/* Define prototypes for the parsing methods. + Inputs: + char *line - pointer to base of input source + unsigned int eaten - index to next input character (INPUT/OUTPUT) + graph_desc_t *gdp - pointer to a graph description + image_desc_t *im - pointer to an image description +*/ + +int rrd_parse_find_gf (char *, unsigned int *, graph_desc_t *); +int rrd_parse_legend (char *, unsigned int *, graph_desc_t *); +int rrd_parse_color (char *, graph_desc_t *); +int rrd_parse_CF (char *, unsigned int *, graph_desc_t *); +int rrd_parse_print (char *, unsigned int *, graph_desc_t *, image_desc_t *); +int rrd_parse_PVHLAST (char *, unsigned int *, graph_desc_t *, image_desc_t *); +int rrd_parse_vname (char *, unsigned int *, graph_desc_t *, image_desc_t *); +int rrd_parse_def (char *, unsigned int *, graph_desc_t *, image_desc_t *); +int rrd_parse_vdef (char *, unsigned int *, graph_desc_t *, image_desc_t *); +int rrd_parse_cdef (char *, unsigned int *, graph_desc_t *, image_desc_t *); + + + int rrd_parse_find_gf(char *line, unsigned int *eaten, graph_desc_t *gdp) { char funcname[11],c1=0,c2=0; @@ -287,14 +308,14 @@ rrd_parse_def(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc_t * int i=0; char command[6]; /* step, start, end */ char tmpstr[256]; - struct time_value start_tv,end_tv; + struct rrd_time_value start_tv,end_tv; time_t start_tmp=0,end_tmp=0; char *parsetime_error=NULL; start_tv.type = end_tv.type=ABSOLUTE_TIME; start_tv.offset = end_tv.offset=0; - memcpy(&start_tv.tm, localtime(&gdp->start) , sizeof(struct tm) ); - memcpy(&end_tv.tm, localtime(&gdp->end) , sizeof(struct tm) ); + localtime_r(&gdp->start, &start_tv.tm); + localtime_r(&gdp->end, &end_tv.tm); dprintf("- parsing '%s'\n",&line[*eaten]); dprintf("- from line '%s'\n",line);