summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 68ab7da)
raw | patch | inline | side by side (parent: 68ab7da)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 2 Dec 2008 22:30:43 +0000 (23:30 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 2 Dec 2008 22:30:43 +0000 (23:30 +0100) |
They're non-standard and cause a lot of trouble.
src/exec.c | patch | blob | history | |
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history |
diff --git a/src/exec.c b/src/exec.c
index 711ec996861897bfa87ecb9e5adf1e6bb1078aca..a78f902fdef5634b11baaae07045a8ea85578ee5 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
for (meta = n->meta; meta != NULL; meta = meta->next)
{
if (meta->type == NM_TYPE_STRING)
- fprintf (fh, "%s: %s\n", meta->name, meta->value_string);
+ fprintf (fh, "%s: %s\n", meta->name, meta->nm_value.nm_string);
else if (meta->type == NM_TYPE_SIGNED_INT)
- fprintf (fh, "%s: %"PRIi64"\n", meta->name, meta->value_signed_int);
+ fprintf (fh, "%s: %"PRIi64"\n", meta->name, meta->nm_value.nm_signed_int);
else if (meta->type == NM_TYPE_UNSIGNED_INT)
- fprintf (fh, "%s: %"PRIu64"\n", meta->name, meta->value_unsigned_int);
+ fprintf (fh, "%s: %"PRIu64"\n", meta->name, meta->nm_value.nm_unsigned_int);
else if (meta->type == NM_TYPE_DOUBLE)
- fprintf (fh, "%s: %e\n", meta->name, meta->value_double);
+ fprintf (fh, "%s: %e\n", meta->name, meta->nm_value.nm_double);
else if (meta->type == NM_TYPE_BOOLEAN)
fprintf (fh, "%s: %s\n", meta->name,
- meta->value_boolean ? "true" : "false");
+ meta->nm_value.nm_boolean ? "true" : "false");
}
fprintf (fh, "\n%s\n", n->message);
diff --git a/src/plugin.c b/src/plugin.c
index 1ec254417069a14cd3f9b8248476807edc91610a..a887327760269e22e6b16d6bfb738ea4259b9f27 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
{
case NM_TYPE_STRING:
{
- meta->value_string = strdup ((const char *) value);
- if (meta->value_string == NULL)
+ meta->nm_value.nm_string = strdup ((const char *) value);
+ if (meta->nm_value.nm_string == NULL)
{
ERROR ("plugin_notification_meta_add: strdup failed.");
sfree (meta);
}
case NM_TYPE_SIGNED_INT:
{
- meta->value_signed_int = *((int64_t *) value);
+ meta->nm_value.nm_signed_int = *((int64_t *) value);
break;
}
case NM_TYPE_UNSIGNED_INT:
{
- meta->value_unsigned_int = *((uint64_t *) value);
+ meta->nm_value.nm_unsigned_int = *((uint64_t *) value);
break;
}
case NM_TYPE_DOUBLE:
{
- meta->value_double = *((double *) value);
+ meta->nm_value.nm_double = *((double *) value);
break;
}
case NM_TYPE_BOOLEAN:
{
- meta->value_boolean = *((bool *) value);
+ meta->nm_value.nm_boolean = *((bool *) value);
break;
}
default:
{
if (meta->type == NM_TYPE_STRING)
plugin_notification_meta_add_string (dst, meta->name,
- meta->value_string);
+ meta->nm_value.nm_string);
else if (meta->type == NM_TYPE_SIGNED_INT)
plugin_notification_meta_add_signed_int (dst, meta->name,
- meta->value_signed_int);
+ meta->nm_value.nm_signed_int);
else if (meta->type == NM_TYPE_UNSIGNED_INT)
plugin_notification_meta_add_unsigned_int (dst, meta->name,
- meta->value_unsigned_int);
+ meta->nm_value.nm_unsigned_int);
else if (meta->type == NM_TYPE_DOUBLE)
plugin_notification_meta_add_double (dst, meta->name,
- meta->value_double);
+ meta->nm_value.nm_double);
else if (meta->type == NM_TYPE_BOOLEAN)
plugin_notification_meta_add_boolean (dst, meta->name,
- meta->value_boolean);
+ meta->nm_value.nm_boolean);
}
return (0);
if (this->type == NM_TYPE_STRING)
{
- free ((char *)this->value_string);
- this->value_string = NULL;
+ free ((char *)this->nm_value.nm_string);
+ this->nm_value.nm_string = NULL;
}
sfree (this);
diff --git a/src/plugin.h b/src/plugin.h
index 3ffde461b07da1baf684a2189bf0f6eba90e6214..dc3bbb0809fb3da3cabcd73dca44060799ab470e 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
enum notification_meta_type_e type;
union
{
- const char *value_string;
- int64_t value_signed_int;
- uint64_t value_unsigned_int;
- double value_double;
- bool value_boolean;
- };
+ const char *nm_string;
+ int64_t nm_signed_int;
+ uint64_t nm_unsigned_int;
+ double nm_double;
+ bool nm_boolean;
+ } nm_value;
struct notification_meta_s *next;
} notification_meta_t;