summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 38b9a40)
raw | patch | inline | side by side (parent: 38b9a40)
author | Florian Forster <octo@collectd.org> | |
Wed, 28 Sep 2016 19:27:54 +0000 (21:27 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 28 Sep 2016 19:27:54 +0000 (21:27 +0200) |
That is, user_data_t* passed to register_* functions. The actual callbacks
are still getting a user_data_t* since they, in theory, would be able to
modify the pointer stored in .data.
Issue: #1954
are still getting a user_data_t* since they, in theory, would be able to
modify the pointer stored in .data.
Issue: #1954
src/daemon/plugin.c | patch | blob | history | |
src/daemon/plugin.h | patch | blob | history |
diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c
index d6cf877a387c7521a5e331a309f64375197aec17..1fbd77dfcadf6a22d8b2d484eb3c361352337e97 100644 (file)
--- a/src/daemon/plugin.c
+++ b/src/daemon/plugin.c
} /* }}} void log_list_callbacks */
static int create_register_callback (llist_t **list, /* {{{ */
- const char *name, void *callback, user_data_t *ud)
+ const char *name, void *callback, user_data_t const *ud)
{
callback_func_t *cf;
int plugin_register_complex_read (const char *group, const char *name,
plugin_read_cb callback,
cdtime_t interval,
- user_data_t *user_data)
+ user_data_t const *user_data)
{
read_func_t *rf;
int status;
} /* int plugin_register_complex_read */
int plugin_register_write (const char *name,
- plugin_write_cb callback, user_data_t *ud)
+ plugin_write_cb callback, user_data_t const *ud)
{
return (create_register_callback (&list_write, name,
(void *) callback, ud));
} /* static char *plugin_flush_callback_name */
int plugin_register_flush (const char *name,
- plugin_flush_cb callback, user_data_t *ud)
+ plugin_flush_cb callback, user_data_t const *ud)
{
int status;
plugin_ctx_t ctx = plugin_get_ctx ();
} /* int plugin_register_flush */
int plugin_register_missing (const char *name,
- plugin_missing_cb callback, user_data_t *ud)
+ plugin_missing_cb callback, user_data_t const *ud)
{
return (create_register_callback (&list_missing, name,
(void *) callback, ud));
} /* int plugin_register_data_set */
int plugin_register_log (const char *name,
- plugin_log_cb callback, user_data_t *ud)
+ plugin_log_cb callback, user_data_t const *ud)
{
return (create_register_callback (&list_log, name,
(void *) callback, ud));
} /* int plugin_register_log */
int plugin_register_notification (const char *name,
- plugin_notification_cb callback, user_data_t *ud)
+ plugin_notification_cb callback, user_data_t const *ud)
{
return (create_register_callback (&list_notification, name,
(void *) callback, ud));
diff --git a/src/daemon/plugin.h b/src/daemon/plugin.h
index de42c068f536bf462d86659b30d677b9efaaeb1f..d3038a395ea5f1c6ec52ce9eff27d3667e8a53b4 100644 (file)
--- a/src/daemon/plugin.h
+++ b/src/daemon/plugin.h
int plugin_register_complex_read (const char *group, const char *name,
plugin_read_cb callback,
cdtime_t interval,
- user_data_t *user_data);
+ user_data_t const *user_data);
int plugin_register_write (const char *name,
- plugin_write_cb callback, user_data_t *user_data);
+ plugin_write_cb callback, user_data_t const *user_data);
int plugin_register_flush (const char *name,
- plugin_flush_cb callback, user_data_t *user_data);
+ plugin_flush_cb callback, user_data_t const *user_data);
int plugin_register_missing (const char *name,
- plugin_missing_cb callback, user_data_t *user_data);
+ plugin_missing_cb callback, user_data_t const *user_data);
int plugin_register_shutdown (const char *name,
plugin_shutdown_cb callback);
int plugin_register_data_set (const data_set_t *ds);
int plugin_register_log (const char *name,
- plugin_log_cb callback, user_data_t *user_data);
+ plugin_log_cb callback, user_data_t const *user_data);
int plugin_register_notification (const char *name,
- plugin_notification_cb callback, user_data_t *user_data);
+ plugin_notification_cb callback, user_data_t const *user_data);
int plugin_unregister_config (const char *name);
int plugin_unregister_complex_config (const char *name);