projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more fixes by fritz
[rrdtool.git]
/
src
/
rrd_graph_helper.c
diff --git
a/src/rrd_graph_helper.c
b/src/rrd_graph_helper.c
index
4847812
..
0ab38fe
100644
(file)
--- a/
src/rrd_graph_helper.c
+++ b/
src/rrd_graph_helper.c
@@
-1,8
+1,8
@@
/****************************************************************************
/****************************************************************************
- * RRDtool 1.2.
x Copyright Tobias Oetiker, 1997 -
2005
+ * RRDtool 1.2.
0 Copyright by Tobi Oetiker, 1997-
2005
****************************************************************************
* rrd_graph_helper.c commandline parser functions
****************************************************************************
* rrd_graph_helper.c commandline parser functions
- * this code
was probably written
n by Alex van den Bogaerdt
+ * this code
initially writte
n by Alex van den Bogaerdt
****************************************************************************/
#include "rrd_graph.h"
****************************************************************************/
#include "rrd_graph.h"
@@
-97,9
+97,9
@@
rrd_parse_color(char *string, graph_desc_t *gdp) {
sscanf(string, "#%02x%02x%02x%n%02x%n%*s%n",
&r,&g,&b,&i1,&a,&i2,&i3);
sscanf(string, "#%02x%02x%02x%n%02x%n%*s%n",
&r,&g,&b,&i1,&a,&i2,&i3);
- if (i3) return 1; /* garbage after color */
- if (!i2) a=0xFF;
- if (!i1) return 1; /* no color after '#' */
+ if (i3) return 1;
/* garbage after color */
+ if (!i2) a=0xFF;
/* default no transparency */
+ if (!i1) return 1; /* no color after '#' */
gdp->col = r<<24|g<<16|b<<8|a;
return 0;
}
gdp->col = r<<24|g<<16|b<<8|a;
return 0;
}
@@
-163,10
+163,10
@@
rrd_parse_print(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc_t
}
if (rrd_parse_legend(line,eaten,gdp)) return 1;
}
if (rrd_parse_legend(line,eaten,gdp)) return 1;
-
-
/* Why is there a separate structure member "format" ???
*/
+ /* for *PRINT the legend itself gets rendered later. We only
+
get the format at this juncture
*/
strcpy(gdp->format,gdp->legend);
strcpy(gdp->format,gdp->legend);
-
+ gdp->legend[0]='\0';
return 0;
}
return 0;
}
@@
-175,7
+175,7
@@
rrd_parse_shift(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc_t
char *l = strdup(line + *eaten), *p;
int rc = 1;
char *l = strdup(line + *eaten), *p;
int rc = 1;
- p = strchr(l, '
,
');
+ p = strchr(l, '
:
');
if (p == NULL) {
rrd_set_error("Invalid SHIFT syntax");
goto out;
if (p == NULL) {
rrd_set_error("Invalid SHIFT syntax");
goto out;
@@
-347,7
+347,9
@@
rrd_parse_PVHLAST(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc
/* PART, HRULE, VRULE and TICK cannot be stacked. We're finished */
if ( (gdp->gf == GF_HRULE)
|| (gdp->gf == GF_VRULE)
/* PART, HRULE, VRULE and TICK cannot be stacked. We're finished */
if ( (gdp->gf == GF_HRULE)
|| (gdp->gf == GF_VRULE)
+#ifdef WITH_PIECHART
|| (gdp->gf == GF_PART)
|| (gdp->gf == GF_PART)
+#endif
|| (gdp->gf == GF_TICK)
) return 0;
|| (gdp->gf == GF_TICK)
) return 0;
@@
-368,6
+370,10
@@
rrd_parse_PVHLAST(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc
return 1;
}
}
return 1;
}
}
+ /* have simpler code in the drawing section */
+ if ( gdp->gf == GF_STACK ){
+ gdp->stack=1;
+ }
return 0;
}
return 0;
}
@@
-587,12
+593,14
@@
rrd_graph_script(int argc, char *argv[], image_desc_t *im, int optno) {
case GF_COMMENT: /* text */
if (rrd_parse_legend(argv[i],&eaten,gdp)) return;
break;
case GF_COMMENT: /* text */
if (rrd_parse_legend(argv[i],&eaten,gdp)) return;
break;
+ case GF_STACK: /* vname-or-value[#color[:legend]] */
+#ifdef WITH_PIECHART
case GF_PART: /* value[#color[:legend]] */
case GF_PART: /* value[#color[:legend]] */
+#endif
case GF_VRULE: /* value#color[:legend] */
case GF_HRULE: /* value#color[:legend] */
case GF_LINE: /* vname-or-value[#color[:legend]][:STACK] */
case GF_AREA: /* vname-or-value[#color[:legend]][:STACK] */
case GF_VRULE: /* value#color[:legend] */
case GF_HRULE: /* value#color[:legend] */
case GF_LINE: /* vname-or-value[#color[:legend]][:STACK] */
case GF_AREA: /* vname-or-value[#color[:legend]][:STACK] */
- case GF_STACK: /* vname-or-value[#color[:legend]] */
case GF_TICK: /* vname#color[:num[:legend]] */
if (rrd_parse_PVHLAST(argv[i],&eaten,gdp,im)) return;
break;
case GF_TICK: /* vname#color[:num[:legend]] */
if (rrd_parse_PVHLAST(argv[i],&eaten,gdp,im)) return;
break;