summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 24eb52a)
raw | patch | inline | side by side (parent: 24eb52a)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 18 May 2008 15:11:52 +0000 (15:11 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 18 May 2008 15:11:52 +0000 (15:11 +0000) |
src/rrd_dump.c | patch | blob | history | |
src/rrd_tool.c | patch | blob | history |
diff --git a/src/rrd_dump.c b/src/rrd_dump.c
index bb83815ca4745dc64aef51c3eec1592dda5c5ad6..7b972e9dc360689ffe95e872aaaaa10eee713c2d 100644 (file)
--- a/src/rrd_dump.c
+++ b/src/rrd_dump.c
int rrd_dump_opt_r(
const char *filename,
char *outname,
- int opt_noheader
-)
+ int opt_noheader)
{
unsigned int i, ii, ix, iii = 0;
time_t now;
out_file = stdout;
}
- if (!opt_noheader){
- fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", out_file);
- fputs
- ("<!DOCTYPE rrd SYSTEM \"http://oss.oetiker.ch/rrdtool/rrdtool.dtd\">\n",
- out_file);
+ if (!opt_noheader) {
+ fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", out_file);
+ fputs
+ ("<!DOCTYPE rrd SYSTEM \"http://oss.oetiker.ch/rrdtool/rrdtool.dtd\">\n",
+ out_file);
}
fputs("<!-- Round Robin Database Dump -->", out_file);
fputs("<rrd>", out_file);
const char *filename,
char *outname)
{
- return rrd_dump_opt_r(filename,outname,0);
+ return rrd_dump_opt_r(filename, outname, 0);
}
int rrd_dump(
{
int rc;
int opt_noheader = 0;
+
/* init rrd clean */
optind = 0;
opterr = 0; /* initialize getopt */
-
+
while (42) {
- int opt;
+ int opt;
int option_index = 0;
static struct option long_options[] = {
{"no-header", no_argument, 0, 'n'},
opt_noheader = 1;
break;
- default:
+ default:
rrd_set_error("usage rrdtool %s [--no-header|-n] "
- "file.rrd [file.xml]", argv[0]);
+ "file.rrd [file.xml]", argv[0]);
return (-1);
break;
}
}
if ((argc - optind) == 2) {
- rc = rrd_dump_opt_r(argv[optind], argv[optind+1],opt_noheader);
+ rc = rrd_dump_opt_r(argv[optind], argv[optind + 1], opt_noheader);
} else {
- rc = rrd_dump_opt_r(argv[optind], NULL,opt_noheader);
+ rc = rrd_dump_opt_r(argv[optind], NULL, opt_noheader);
}
return rc;
}
-
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
index c981e4a7397258de2709b80972a9a925ae00755f..b594a5f491d6b52c5745fe3c2b60d28fb74e8e31 100644 (file)
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
} else if (strcmp("graphv", argv[1]) == 0) {
info_t *grinfo = NULL; /* 1 to distinguish it from the NULL that rrd_graph sends in */
+
grinfo = rrd_graph_v(argc - 1, &argv[1]);
if (grinfo) {
info_print(grinfo);