+ if ((f==0)&&(i!=gdp->ndash-1)) {
+ rrd_set_error("unexpected end at : %s",dashes); return NULL;}
+ }
+ }
+ char* dashoffset=getKeyValueArgument("dash-offset",1,pa);
+ if (dashoffset) {
+ char* x;
+ if (getDouble(dashes,&gdp->offset,&x)) {
+ rrd_set_error("Could not parse dash-offset: %s",dashoffset); return NULL; }
+ }
+ }
+
+ /* here now the positional(=legacy) parsers which are EXCLUSIVE - SO ELSE IF !!!
+ * we also only parse the extra here and assign just further down
+ * TODO maybe we can generalize this a bit more...
+ */
+ if (bitscmp(PARSE_VNAMERRDDSCF)) {
+ if ((!vname)||(!rrd)) {
+ /* get the first unused argument */
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (!first) { rrd_set_error("No argument for definition of vdef/rrd in %s",pa->arg_orig); return NULL; }
+ dprintfparsed("got positional vname and rrd: %s - %s\n",first->key,first->value);
+ if (!vname) {vname=first->key;}
+ if (!rrd) {rrd=first->value; }
+ }
+ /* and now look for datasource */
+ if (!ds) {
+ /* get the first unused argument */
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (!first) { rrd_set_error("No argument for definition of DS in %s",pa->arg_orig); return NULL; }
+ dprintfparsed("got positional ds: %s - \n",first->value);
+ ds=first->value;
+ }
+ /* and for CF */
+ if (!cf) {
+ /* get the first unused argument */
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (!first) { rrd_set_error("No argument for definition of CF in %s",pa->arg_orig); return NULL; }
+ dprintfparsed("got positional cf: %s - \n",first->value);
+ cf=first->value;
+ }
+ } else if (bitscmp(PARSE_VNAMECOLORLEGEND)) {
+ /* vname */
+ if (!vname) {
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (first) { vname=first->value;
+ } else { rrd_set_error("No positional VNAME"); return NULL; }
+ }
+ /* fraction added into the parsing mix for TICK */
+ if ((bitscmp(PARSE_VNAMECOLORFRACTIONLEGEND))&&(!fraction)) {
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (first) { fraction=first->value;
+ } else { rrd_set_error("No positional FRACTION"); return NULL; }
+ }
+ /* legend */
+ if (!legend) {
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (first) { legend=first->value;
+ dprintfparsed("got positional legend: %s - \n",first->value);
+ } else { rrd_set_error("No positional legend found"); return NULL; }
+ }
+ } else if (bitscmp(PARSE_VNAMERPN)) {
+ if ((!vname)||(!rpn)) {
+ /* get the first unused argument */
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (!first) { rrd_set_error("No argument for definition of vdef/rrd in %s",pa->arg_orig); return NULL; }
+ dprintfparsed("got positional vname and rpn: %s - %s\n",first->key,first->value);
+ if (!vname) {vname=first->key;}
+ if (!rpn) {rpn=first->value; }
+ }
+ } else if (bitscmp(PARSE_VNAMEREFPOS)) {
+ if ((!vname)) {
+ /* get the first unused argument */
+ keyvalue_t* first=getFirstUnusedArgument(1,pa);
+ if (!first) { rrd_set_error("No argument for definition of vdef/rrd in %s",pa->arg_orig); return NULL; }
+ dprintfparsed("got positional vname and rrd: %s - %s\n",first->key,first->value);
+ if (!vname) {vname=first->value;}
+ }
+ }
+
+ /* and set some of those late assignments to accomodate the legacy parser*/
+ /* first split vname into color */
+ if (vname) {
+ /* check for color */
+ char *h1=strchr(vname,'#');
+ char* h2=NULL;
+ if (h1) {
+ *h1=0;h1++;
+ dprintfparsed("got positional color: %s - \n",h1);
+ h2=strchr(h1,'#');
+ if (h2) {
+ *h2=0;h2++;
+ dprintfparsed("got positional color2: %s - \n",h2);
+ }
+ }
+ if (bitscmp(PARSE_COLOR) && (! color) && (h1)) { color=h1;}
+ if (bitscmp(PARSE_COLOR2) && (! color2) && (h2)) { color2=h2;}
+ }
+
+ /* check if we are reusing the vname */
+ if (vname) {
+ int idx=find_var(im, vname);
+ dprintfparsed("got positional index %i for %s - \n",idx,vname);
+
+ /* some handling */
+ if (bitscmp(PARSE_VNAMEDEF)) {
+ if (idx>=0) {
+ rrd_set_error("trying to reuse vname %s",vname); return NULL; }
+ } else if (bitscmp(PARSE_VNAMEREF)) {
+ if (idx>=0) {
+ gdp->vidx=idx;
+ } else if (bitscmp(PARSE_VNAMEREFNUM)) {
+ if (!bitscmp(PARSE_VNAMEREFNUMNOPARSE)) {
+ double val;
+ char *x;
+ int f=getDouble(vname,&val,&x);
+ if (f) {
+ rrd_set_error("error parsing number %s",vname); return NULL;
+ }
+ gdp->yrule=val;