From e3f63afc6fc07e04540a42e69bdeab4928f1cd49 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 9 Dec 2007 16:42:14 +0100 Subject: [PATCH] src/plugin.[ch]: Removed the complain functions. --- src/plugin.c | 47 ----------------------------------------------- src/plugin.h | 10 ---------- 2 files changed, 57 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 6b17290f..7cf54c37 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -769,53 +769,6 @@ void plugin_log (int level, const char *format, ...) } } /* 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 96eb0cb5..428c4f09 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -97,12 +97,6 @@ struct data_set_s }; 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; @@ -218,10 +212,6 @@ void plugin_log (int level, const char *format, ...); # 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 */ -- 2.30.2