conv_if(CDEF,GF_CDEF)
conv_if(VDEF,GF_VDEF)
conv_if(PART,GF_PART)
+ conv_if(XPORT,GF_XPORT)
return (-1);
}
* so CDEFs can use VDEFs and vice versa
*/
switch (im->gdes[gdi].gf) {
+ case GF_XPORT:
+ break;
case GF_VDEF:
/* A VDEF has no DS. This also signals other parts
* of rrdtool that this is a VDEF value, not a CDEF.
case GF_CDEF:
case GF_VDEF:
case GF_PART:
+ case GF_XPORT:
break;
}
}
case GF_CDEF:
case GF_VDEF:
case GF_PART:
+ case GF_XPORT:
break;
}
}
case GF_COMMENT:
case GF_HRULE:
case GF_VRULE:
+ case GF_XPORT:
break;
case GF_TICK:
for (ii = 0; ii < im->xsize; ii++)
/* If the error string is set, we exit at the end of the switch */
switch (gdp->gf) {
+ case GF_XPORT:
+ break;
case GF_COMMENT:
if (rrd_graph_legend(gdp,&line[argstart])==0)
rrd_set_error("Cannot parse comment in line: %s",line);
int bad_format(char *fmt) {
- char *ptr;
- int n=0;
-
- ptr = fmt;
- while (*ptr != '\0') {
- if (*ptr == '%') {ptr++;
- if (*ptr == '\0') return 1;
- while ((*ptr >= '0' && *ptr <= '9') || *ptr == '.') {
- ptr++;
- }
- if (*ptr == '\0') return 1;
- if (*ptr == 'l') {
- ptr++;
- n++;
- if (*ptr == '\0') return 1;
- if (*ptr == 'e' || *ptr == 'f') {
- ptr++;
- } else { return 1; }
- }
- else if (*ptr == 's' || *ptr == 'S' || *ptr == '%') { ++ptr; }
- else { return 1; }
- } else {
- ++ptr;
- }
- }
- return (n!=1);
+ char *ptr;
+ int n=0;
+ ptr = fmt;
+ while (*ptr != '\0')
+ if (*ptr++ == '%') {
+
+ /* line cannot end with percent char */
+ if (*ptr == '\0') return 1;
+
+ /* '%s', '%S' and '%%' are allowed */
+ if (*ptr == 's' || *ptr == 'S' || *ptr == '%') ptr++;
+
+ /* or else '% 6.2lf' and such are allowed */
+ else {
+
+ /* optional padding character */
+ if (*ptr == ' ' || *ptr == '+' || *ptr == '-') ptr++;
+
+ /* This should take care of 'm.n' with all three optional */
+ while (*ptr >= '0' && *ptr <= '9') ptr++;
+ if (*ptr == '.') ptr++;
+ while (*ptr >= '0' && *ptr <= '9') ptr++;
+
+ /* Either 'le' or 'lf' must follow here */
+ if (*ptr++ != 'l') return 1;
+ if (*ptr == 'e' || *ptr == 'f') ptr++;
+ else return 1;
+ n++;
+ }
+ }
+
+ return (n!=1);
}
+
+
int
vdef_parse(gdes,str)
struct graph_desc_t *gdes;
};
return 0;
}
+
+
int
vdef_calc(im,gdi)
image_desc_t *im;