summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8376d76)
raw | patch | inline | side by side (parent: 8376d76)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 29 Mar 2010 19:10:58 +0000 (19:10 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 29 Mar 2010 19:10:58 +0000 (19:10 +0000) |
A simple helper function to turn an "enum cf_en" to a string. The returned
pointer points to static memory and doesn't need to be freed. -- Florian
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2061 a5681a0c-68f1-0310-ab6d-d61299d08faa
pointer points to static memory and doesn't need to be freed. -- Florian
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2061 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_format.c | patch | blob | history | |
src/rrd_tool.h | patch | blob | history |
diff --git a/src/rrd_format.c b/src/rrd_format.c
index 18e1ecd7360ba40685a052ee654e4043cd5c7bb7..501b2676d95b6661966b85eadc9ba2b849285f99 100644 (file)
--- a/src/rrd_format.c
+++ b/src/rrd_format.c
return (enum cf_en)(-1);
}
+const char *cf_to_string (enum cf_en cf)
+{
+ switch (cf)
+ {
+ case CF_AVERAGE: return "AVERAGE";
+ case CF_MINIMUM: return "MIN";
+ case CF_MAXIMUM: return "MAX";
+ case CF_LAST: return "LAST";
+ case CF_HWPREDICT: return "HWPREDICT";
+ case CF_SEASONAL: return "SEASONAL";
+ case CF_DEVPREDICT: return "DEVPREDICT";
+ case CF_DEVSEASONAL: return "DEVSEASONAL";
+ case CF_FAILURES: return "FAILURES";
+ case CF_MHWPREDICT: return "MHWPREDICT";
+
+ default:
+ return NULL;
+ }
+} /* char *cf_to_string */
+
#undef converter
long ds_match(
diff --git a/src/rrd_tool.h b/src/rrd_tool.h
index b58e04c9de14c396a158a99c80daac0ae3411d74..7d8368a6a45ebdbba57be8eca32ad109aa97c3d2 100644 (file)
--- a/src/rrd_tool.h
+++ b/src/rrd_tool.h
char *a,
char *b);
+ const char *cf_to_string (enum cf_en cf);
+
#endif /* _RRD_TOOL_H */
#ifdef __cplusplus