summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 682dfca)
raw | patch | inline | side by side (parent: 682dfca)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 1 Nov 2007 00:39:13 +0000 (01:39 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 1 Nov 2007 00:39:13 +0000 (01:39 +0100) |
src/utils_threshold.c | patch | blob | history | |
src/utils_threshold.h | [new file with mode: 0644] | patch | blob |
diff --git a/src/utils_threshold.c b/src/utils_threshold.c
index b036f993d72f5a0cf1c5018ec8633b2349281b08..03bc4233b330776fa3cc2ae232518b97579c10a2 100644 (file)
--- a/src/utils_threshold.c
+++ b/src/utils_threshold.c
threshold_t th;
+ if (threshold_tree == NULL)
+ {
+ threshold_tree = avl_create ((void *) strcmp);
+ if (threshold_tree == NULL)
+ {
+ ERROR ("ut_config: avl_create failed.");
+ return (-1);
+ }
+ }
+
memset (&th, '\0', sizeof (th));
th.min = NAN;
th.max = NAN;
diff --git a/src/utils_threshold.h b/src/utils_threshold.h
--- /dev/null
+++ b/src/utils_threshold.h
@@ -0,0 +1,30 @@
+/**
+ * collectd - src/utils_threshold.h
+ * Copyright (C) 2007 Florian octo Forster
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; only version 2 of the License is applicable.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Florian octo Forster <octo at verplant.org>
+ **/
+
+#ifndef UTILS_THRESHOLD_H
+#define UTILS_THRESHOLD_H 1
+
+#include "collectd.h"
+#include "liboconfig/oconfig.h"
+
+int ut_config (const oconfig_item_t *ci);
+
+#endif /* UTILS_THRESHOLD_H */