+ if (j) {
+ tmpstr[j]='\0';
+ }
+ /* We now have:
+ * tmpstr[0] containing vname
+ * tmpstr[j] if j!=0 then containing color
+ * i size of vname + color
+ * j if j!=0 then size of vname
+ */
+
+ /* Number or vname ?
+ * If it is an existing vname, that's OK, provided that it is a
+ * valid type (need time for VRULE, not a float)
+ * Else see if it parses as a number.
+ */
+ dprintf("- examining string '%s'\n",tmpstr);
+ if ((gdp->vidx=find_var(im,tmpstr))>=0) {
+ dprintf("- found vname: '%s' vidx %li\n",tmpstr,gdp->vidx);
+ switch (gdp->gf) {
+#ifdef WITH_PIECHART
+ case GF_PART:
+#endif
+ case GF_VRULE:
+ case GF_HRULE:
+ if (im->gdes[gdp->vidx].gf != GF_VDEF) {
+ rrd_set_error("Using vname %s of wrong type in line %s\n",im->gdes[gdp->gf].vname,line);
+ return 1;
+ }
+ break;
+ default:;
+ }
+ } else {
+ dprintf("- it is not an existing vname\n");
+ switch (gdp->gf) {
+ case GF_VRULE:
+ k=0;sscanf(tmpstr,"%li%n",&gdp->xrule,&k);
+ if (((j!=0)&&(k==j))||((j==0)&&(k==i))) {
+ dprintf("- found time: %li\n",gdp->xrule);
+ } else {
+ dprintf("- is is not a valid number: %li\n",gdp->xrule);
+ rrd_set_error("parameter '%s' does not represent time in line %s\n",tmpstr,line);
+ return 1;
+ }
+ default:
+ k=0;sscanf(tmpstr,"%lf%n",&gdp->yrule,&k);
+ if (((j!=0)&&(k==j))||((j==0)&&(k==i))) {
+ dprintf("- found number: %f\n",gdp->yrule);
+ } else {
+ dprintf("- is is not a valid number: %li\n",gdp->xrule);
+ rrd_set_error("parameter '%s' does not represent a number in line %s\n",tmpstr,line);
+ return 1;
+ }
+ }
+ }
+
+ if (j) {
+ j++;
+ dprintf("- examining color '%s'\n",&tmpstr[j]);