summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e38bc99)
raw | patch | inline | side by side (parent: e38bc99)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 1 May 2008 23:23:35 +0000 (23:23 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 1 May 2008 23:23:35 +0000 (23:23 +0000) |
program/bindings/ruby/main.c | patch | blob | history | |
program/src/rrd.h | patch | blob | history | |
program/src/rrd_info.c | patch | blob | history | |
program/src/rrd_tool.c | patch | blob | history |
index e5a3e80052d4397a12db1d18ac284560b48573b3..b3e512e8f074a4f56a52c0c317d78a720c24fd8f 100644 (file)
free(data->value.u_str);
break;
case RD_I_BLO:
- rb_hash_aset(result, key, rb_str_new(data->value.u_blo.ptr,data->value.u_blo.size));
+ rb_hash_aset(result, key,
+ rb_str_new(data->value.u_blo.ptr,
+ data->value.u_blo.size));
free(data->value.u_blo.ptr);
break;
}
diff --git a/program/src/rrd.h b/program/src/rrd.h
index 3e1a08ad333a7e692eec5f5c6dd827962a899eb7..346836b2afa821bfccf3ea55e2a38ec59c7c5c66 100644 (file)
--- a/program/src/rrd.h
+++ b/program/src/rrd.h
/* rrd info interface */
typedef struct rrd_blob_t {
- unsigned long size; /* size of the blob */
- unsigned char *ptr; /* pointer */
+ unsigned long size; /* size of the blob */
+ unsigned char *ptr; /* pointer */
} rrd_blob_t;
enum info_type { RD_I_VAL = 0,
diff --git a/program/src/rrd_info.c b/program/src/rrd_info.c
index f9c4604274ab80325c679512e30b04f7f619c2e1..e0bcefa0a95b524a989f76e8934aecffde8000dd 100644 (file)
--- a/program/src/rrd_info.c
+++ b/program/src/rrd_info.c
break;
case RD_I_BLO:
next->value.u_blo.size = value.u_blo.size;
- next->value.u_blo.ptr = malloc(sizeof(unsigned char)*value.u_blo.size);
- memcpy(next->value.u_blo.ptr,value.u_blo.ptr,value.u_blo.size);
+ next->value.u_blo.ptr =
+ malloc(sizeof(unsigned char) * value.u_blo.size);
+ memcpy(next->value.u_blo.ptr, value.u_blo.ptr, value.u_blo.size);
break;
}
return (next);
case RD_I_STR:
printf("\"%s\"\n", data->value.u_str);
break;
- case RD_I_BLO:
+ case RD_I_BLO:
printf("BLOB_SIZE:%lu\n", data->value.u_blo.size);
fwrite(data->value.u_blo.ptr, data->value.u_blo.size, 1, stdout);
break;
diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c
index b16a1942a585ac5b95bbccdcda5da9481c4bd6fb..5eaf10588ae7ddcf1009f48ee23518aeb988ddc6 100644 (file)
--- a/program/src/rrd_tool.c
+++ b/program/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 */
+
if (grinfo = rrd_graph_v(argc - 1, &argv[1])) {
info_print(grinfo);
info_free(grinfo);