summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4a43ce)
raw | patch | inline | side by side (parent: e4a43ce)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 9 Dec 2007 15:42:14 +0000 (16:42 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 9 Dec 2007 15:42:14 +0000 (16:42 +0100) |
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index 6b17290f32dbe08a9a4bb6406cbc8fef35efdd01..7cf54c375ca52f269cf090d284950ef72c56ae86 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
}
} /* void plugin_log */
-void plugin_complain (int level, complain_t *c, const char *format, ...)
-{
- char message[512];
- va_list ap;
-
- if (c->delay > 0)
- {
- c->delay--;
- return;
- }
-
- if (c->interval < interval_g)
- c->interval = interval_g;
- else
- c->interval *= 2;
-
- if (c->interval > 86400)
- c->interval = 86400;
-
- c->delay = c->interval / interval_g;
-
- va_start (ap, format);
- vsnprintf (message, 512, format, ap);
- message[511] = '\0';
- va_end (ap);
-
- plugin_log (level, message);
-}
-
-void plugin_relief (int level, complain_t *c, const char *format, ...)
-{
- char message[512];
- va_list ap;
-
- if (c->interval == 0)
- return;
-
- c->interval = 0;
-
- va_start (ap, format);
- vsnprintf (message, 512, format, ap);
- message[511] = '\0';
- va_end (ap);
-
- plugin_log (level, message);
-}
-
const data_set_t *plugin_get_ds (const char *name)
{
data_set_t *ds;
diff --git a/src/plugin.h b/src/plugin.h
index 96eb0cb5633cf1cbe5fe6153b176f46040b49c5e..428c4f09319c5818c7ad89985a2561d12dd5cc4e 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
};
typedef struct data_set_s data_set_t;
-typedef struct complain_s
-{
- unsigned int interval; /* how long we wait for reporting this error again */
- unsigned int delay; /* how many more iterations we still need to wait */
-} complain_t;
-
typedef struct notification_s
{
int severity;
# define DEBUG(...) /* noop */
#endif /* ! COLLECT_DEBUG */
-/* TODO: Move plugin_{complain,relief} into `utils_complain.[ch]'. -octo */
-void plugin_complain (int level, complain_t *c, const char *format, ...);
-void plugin_relief (int level, complain_t *c, const char *format, ...);
-
const data_set_t *plugin_get_ds (const char *name);
#endif /* PLUGIN_H */