summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5478abf)
raw | patch | inline | side by side (parent: 5478abf)
author | Florian Forster <sifnfors@informatik.stud.uni-erlangen.de> | |
Thu, 12 Jun 2008 13:25:16 +0000 (15:25 +0200) | ||
committer | Florian Forster <sifnfors@informatik.stud.uni-erlangen.de> | |
Thu, 12 Jun 2008 13:25:16 +0000 (15:25 +0200) |
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index 784024c11ed5c11a78aca799a69507b39c7f782c..27074a75e108131e297fd60b15d644e62ceb595c 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
return (ds);
} /* data_set_t *plugin_get_ds */
-int plugin_notification_meta_add (notification_t *n,
+static int plugin_notification_meta_add (notification_t *n,
const char *name,
enum notification_meta_type_e type,
const void *value)
return (0);
} /* int plugin_notification_meta_add */
+int plugin_notification_meta_add_string (notification_t *n,
+ const char *name,
+ const char *value)
+{
+ return (plugin_notification_meta_add (n, name, NM_TYPE_STRING, value));
+}
+
+int plugin_notification_meta_add_signed_int (notification_t *n,
+ const char *name,
+ int64_t value)
+{
+ return (plugin_notification_meta_add (n, name, NM_TYPE_SIGNED_INT, &value));
+}
+
+int plugin_notification_meta_add_unsigned_int (notification_t *n,
+ const char *name,
+ uint64_t value)
+{
+ return (plugin_notification_meta_add (n, name, NM_TYPE_UNSIGNED_INT, &value));
+}
+
+int plugin_notification_meta_add_double (notification_t *n,
+ const char *name,
+ double value)
+{
+ return (plugin_notification_meta_add (n, name, NM_TYPE_DOUBLE, &value));
+}
+
+int plugin_notification_meta_add_boolean (notification_t *n,
+ const char *name,
+ bool value)
+{
+ return (plugin_notification_meta_add (n, name, NM_TYPE_BOOLEAN, &value));
+}
+
int plugin_notification_meta_free (notification_t *n)
{
notification_meta_t *this;
notification_meta_t *next;
+ if (n == NULL)
+ {
+ ERROR ("plugin_notification_meta_free: n == NULL!");
+ return (-1);
+ }
+
this = n->meta;
n->meta = NULL;
while (this != NULL)
diff --git a/src/plugin.h b/src/plugin.h
index 99b224358205f87193f5512cb9622fb4bf52752f..7aac79fc260eb925f56a05ac413dd99b1548b6e2 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
const data_set_t *plugin_get_ds (const char *name);
-int plugin_notification_meta_add (notification_t *n,
- const char *name,
- enum notification_meta_type_e type,
- const void *value);
+int plugin_notification_meta_add_string (notification_t *n,
+ const char *name,
+ const char *value);
+int plugin_notification_meta_add_signed_int (notification_t *n,
+ const char *name,
+ int64_t value);
+int plugin_notification_meta_add_unsigned_int (notification_t *n,
+ const char *name,
+ uint64_t value);
+int plugin_notification_meta_add_double (notification_t *n,
+ const char *name,
+ double value);
+int plugin_notification_meta_add_boolean (notification_t *n,
+ const char *name,
+ bool value);
int plugin_notification_meta_free (notification_t *n);
#endif /* PLUGIN_H */