X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdaemon%2Fplugin.h;h=a9ee72d4c9328c2e9827468cb8dff27998894c95;hp=8bdb4c2b0a339d9758d5394954b75a18d6167998;hb=7111bb6df7628edce3a8e538b386fbe27633a191;hpb=79963d13c1884d1d92667cc502ad20758b084a12 diff --git a/src/daemon/plugin.h b/src/daemon/plugin.h index 8bdb4c2b..a9ee72d4 100644 --- a/src/daemon/plugin.h +++ b/src/daemon/plugin.h @@ -36,25 +36,19 @@ #include -#define PLUGIN_FLAGS_GLOBAL 0x0001 - -#ifndef DATA_MAX_NAME_LEN -#define DATA_MAX_NAME_LEN 128 -#endif - #define DS_TYPE_COUNTER 0 #define DS_TYPE_GAUGE 1 #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" + (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 @@ -83,6 +77,15 @@ /* * Public data types */ +struct identifier_s { + char *host; + char *plugin; + char *plugin_instance; + char *type; + char *type_instance; +}; +typedef struct identifier_s identifier_t; + typedef unsigned long long counter_t; typedef double gauge_t; typedef int64_t derive_t; @@ -111,9 +114,7 @@ struct value_list_s { typedef struct value_list_s value_list_t; #define VALUE_LIST_INIT \ - { NULL, 0, 0, plugin_get_interval(), "localhost", "", "", "", "", NULL } -#define VALUE_LIST_STATIC \ - { NULL, 0, 0, 0, "localhost", "", "", "", "", NULL } + { .values = NULL, .meta = NULL } struct data_source_s { char name[DATA_MAX_NAME_LEN]; @@ -219,7 +220,7 @@ void plugin_set_dir(const char *dir); * * ARGUMENTS * `name' Name of the plugin to load. - * `flags' Hints on how to handle this plugin. + * `global' Make this plugins symbols available for other shared libraries. * * RETURN VALUE * Returns zero upon success, a value greater than zero if no plugin was found @@ -229,7 +230,7 @@ void plugin_set_dir(const char *dir); * Re-loading an already loaded module is detected and zero is returned in * this case. */ -int plugin_load(const char *name, uint32_t flags); +int plugin_load(const char *name, _Bool global); int plugin_init_all(void); void plugin_read_all(void); @@ -440,7 +441,8 @@ cdtime_t plugin_get_interval(void); */ int plugin_thread_create(pthread_t *thread, const pthread_attr_t *attr, - void *(*start_routine)(void *), void *arg); + void *(*start_routine)(void *), void *arg, + char const *name); /* * Plugins need to implement this