diff --git a/src/plugin.h b/src/plugin.h
index 6e363673474b6c20049cdb3f8bc6e70420a92d36..45e9b494fc60634b568ee6a7f0d9bc4bc263656f 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
+#ifndef PLUGIN_H
+#define PLUGIN_H
+
/**
* collectd - src/plugin.h
/**
* collectd - src/plugin.h
- * Copyright (C) 2005 Florian octo Forster
+ * Copyright (C) 2005,2006 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
*
* 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
* Florian octo Forster <octo at verplant.org>
**/
* Florian octo Forster <octo at verplant.org>
**/
-#ifndef PLUGIN_H
-#define PLUGIN_H
+/*
+ *
+ */
+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;
/*
* NAME
/*
* NAME
* NOTES
* If `dir' is NULL the compiled in default `PLUGINDIR' is used.
*/
* NOTES
* If `dir' is NULL the compiled in default `PLUGINDIR' is used.
*/
-void plugin_set_dir (char *dir);
+void plugin_set_dir (const char *dir);
/*
* NAME
/*
* NAME
* NOTES
* No attempt is made to re-load an already loaded module.
*/
* NOTES
* No attempt is made to re-load an already loaded module.
*/
-int plugin_load (char *type);
+int plugin_load (const char *type);
int plugin_load_all (char *dir);
void plugin_init_all (void);
int plugin_load_all (char *dir);
void plugin_init_all (void);
-void plugin_read_all (void);
+void plugin_read_all (const int *loop);
+
+void plugin_shutdown_all (void);
void plugin_register (char *type,
void (*init) (void),
void (*read) (void),
void (*write) (char *, char *, char *));
void plugin_register (char *type,
void (*init) (void),
void (*read) (void),
void (*write) (char *, char *, char *));
-#ifdef HAVE_LIBRRD
+int plugin_register_shutdown (char *, void (*) (void));
+
+/*
+ * NAME
+ * plugin_write
+ *
+ * DESCRIPTION
+ * Searches the plugin for `type' in the plugin-list. If found, and a `write'
+ * function is registered, it's called. If either the plugin is not found or
+ * the plugin doesn't provide a `write' function this function will return
+ * without further notice.
+ *
+ * ARGUMENTS
+ * `host' Host(name) from which the data originates.
+ * `type' Name of the plugin.
+ * `inst' Instance (passed to the plugin's `write' function.
+ * `val' Values for the RRD files. Also passed to the plugin.
+ */
void plugin_write (char *host, char *type, char *inst, char *val);
void plugin_write (char *host, char *type, char *inst, char *val);
-#endif /* HAVE_LIBRRD */
+
void plugin_submit (char *type, char *inst, char *val);
void plugin_submit (char *type, char *inst, char *val);
+
+void plugin_complain (int level, complain_t *c, const char *format, ...);
+void plugin_relief (int level, complain_t *c, const char *format, ...);
+
#endif /* PLUGIN_H */
#endif /* PLUGIN_H */