X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.h;h=868f44aba41d81f46fd384de7805ffa92f1a09fe;hb=43f0e999f0816b6de916208f5b23297b68e7f397;hp=0ccb198c90e9d4bdd2eccdf2ec9486f0017639bc;hpb=c66b2e7d3985a636bea145637ca7171208f0a637;p=collectd.git diff --git a/src/plugin.h b/src/plugin.h index 0ccb198c..868f44ab 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -26,6 +26,8 @@ #include "configfile.h" #include "meta_data.h" +#define PLUGIN_FLAGS_GLOBAL 0x0001 + #define DATA_MAX_NAME_LEN 64 #define DS_TYPE_COUNTER 0 @@ -33,6 +35,13 @@ #define DS_TYPE_DERIVE 2 #define DS_TYPE_ABSOLUTE 3 +#define DS_TYPE_TO_STRING(t) (t == DS_TYPE_COUNTER) ? "counter" : \ + (t == DS_TYPE_GAUGE) ? "gauge" : \ + (t == DS_TYPE_DERIVE) ? "derive" : \ + (t == DS_TYPE_ABSOLUTE) ? "absolute" : \ + "unknown" + + #ifndef LOG_ERR # define LOG_ERR 3 #endif @@ -193,7 +202,7 @@ void plugin_set_dir (const char *dir); * * ARGUMENTS * `name' Name of the plugin to load. - * `mr' Types of functions to request from the plugin. + * `flags' Hints on how to handle this plugin. * * RETURN VALUE * Returns zero upon success, a value greater than zero if no plugin was found @@ -202,7 +211,7 @@ void plugin_set_dir (const char *dir); * NOTES * No attempt is made to re-load an already loaded module. */ -int plugin_load (const char *name); +int plugin_load (const char *name, uint32_t flags); void plugin_init_all (void); void plugin_read_all (void); @@ -275,7 +284,6 @@ int plugin_unregister_config (const char *name); int plugin_unregister_complex_config (const char *name); int plugin_unregister_init (const char *name); int plugin_unregister_read (const char *name); -int plugin_unregister_complex_read (const char *name, void **user_data); int plugin_unregister_write (const char *name); int plugin_unregister_flush (const char *name); int plugin_unregister_shutdown (const char *name);