From cf6aca1619c32422a43fa3d82e0674f6b7b49fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 21 Mar 2016 18:11:21 +0100 Subject: [PATCH] core: add pointer in some callbacks (closes #406) This pointer is the first argument received by callbacks, and the existing argument "data" is now automatically freed by WeeChat when the object containing the callback is removed. With this new pointer, the linked list of callbacks in scripts has been removed. This will improve speed of scripts (using a lot of hooks), reduce memory used by scripts and reduce time to unload scripts. Following functions are affected in the C API: * exec_on_files * config_new * config_new_section * config_new_option * hook_command * hook_command_run * hook_timer * hook_fd * hook_process * hook_process_hashtable * hook_connect * hook_print * hook_signal * hook_hsignal * hook_config * hook_completion * hook_modifier * hook_info * hook_info_hashtable * hook_infolist * hook_hdata * hook_focus * unhook_all_plugin * buffer_new * bar_item_new * upgrade_new * upgrade_read --- ChangeLog.asciidoc | 1 + ReleaseNotes.asciidoc | 44 + doc/de/autogen/plugin_api/hdata.asciidoc | 125 +- doc/en/autogen/plugin_api/hdata.asciidoc | 125 +- doc/en/weechat_dev.en.asciidoc | 1 - doc/fr/autogen/plugin_api/hdata.asciidoc | 125 +- doc/fr/weechat_dev.fr.asciidoc | 1 - doc/it/autogen/plugin_api/hdata.asciidoc | 125 +- doc/ja/autogen/plugin_api/hdata.asciidoc | 125 +- doc/ja/weechat_dev.ja.asciidoc | 1 - doc/pl/autogen/plugin_api/hdata.asciidoc | 125 +- po/POTFILES.in | 2 - po/srcfiles.cmake | 2 - src/core/wee-command.c | 118 +- src/core/wee-command.h | 9 +- src/core/wee-completion.c | 180 ++- src/core/wee-completion.h | 3 +- src/core/wee-config-file.c | 284 ++-- src/core/wee-config-file.h | 93 +- src/core/wee-config.c | 1269 ++++++++++++----- src/core/wee-debug.c | 21 +- src/core/wee-hook.c | 293 ++-- src/core/wee-hook.h | 83 +- src/core/wee-input.c | 3 +- src/core/wee-network.c | 89 +- src/core/wee-proxy.c | 16 +- src/core/wee-proxy.h | 4 +- src/core/wee-secure.c | 66 +- src/core/wee-upgrade-file.c | 68 +- src/core/wee-upgrade-file.h | 19 +- src/core/wee-upgrade.c | 20 +- src/core/wee-util.c | 7 +- src/core/wee-util.h | 4 +- src/gui/curses/gui-curses-color.c | 26 +- src/gui/curses/gui-curses-key.c | 3 +- src/gui/curses/gui-curses-main.c | 5 +- src/gui/curses/gui-curses-mouse.c | 5 +- src/gui/curses/gui-curses-window.c | 6 +- src/gui/curses/gui-curses.h | 2 +- src/gui/gui-bar-item.c | 186 ++- src/gui/gui-bar-item.h | 13 +- src/gui/gui-bar-window.c | 4 +- src/gui/gui-bar-window.h | 3 +- src/gui/gui-bar.c | 126 +- src/gui/gui-bar.h | 3 +- src/gui/gui-buffer.c | 64 +- src/gui/gui-buffer.h | 31 +- src/gui/gui-chat.c | 10 +- src/gui/gui-chat.h | 3 +- src/gui/gui-color.c | 25 +- src/gui/gui-completion.c | 27 +- src/gui/gui-completion.h | 6 +- src/gui/gui-filter.c | 4 +- src/gui/gui-filter.h | 3 +- src/gui/gui-focus.c | 6 +- src/gui/gui-history.c | 4 +- src/gui/gui-history.h | 3 +- src/gui/gui-hotlist.c | 13 +- src/gui/gui-hotlist.h | 3 +- src/gui/gui-key.c | 23 +- src/gui/gui-key.h | 3 +- src/gui/gui-layout.c | 12 +- src/gui/gui-layout.h | 9 +- src/gui/gui-line.c | 12 +- src/gui/gui-line.h | 9 +- src/gui/gui-nicklist.c | 14 +- src/gui/gui-nicklist.h | 6 +- src/gui/gui-window.c | 12 +- src/gui/gui-window.h | 9 +- src/plugins/CMakeLists.txt | 3 +- src/plugins/Makefile.am | 2 - src/plugins/alias/alias-command.c | 6 +- src/plugins/alias/alias-completion.c | 12 +- src/plugins/alias/alias-config.c | 76 +- src/plugins/alias/alias-info.c | 14 +- src/plugins/alias/alias.c | 8 +- src/plugins/aspell/weechat-aspell-bar-item.c | 14 +- src/plugins/aspell/weechat-aspell-command.c | 6 +- .../aspell/weechat-aspell-completion.c | 11 +- src/plugins/aspell/weechat-aspell-config.c | 138 +- src/plugins/aspell/weechat-aspell-info.c | 6 +- src/plugins/aspell/weechat-aspell-speller.c | 9 +- src/plugins/aspell/weechat-aspell.c | 32 +- src/plugins/charset/charset.c | 81 +- src/plugins/exec/exec-buffer.c | 12 +- src/plugins/exec/exec-command.c | 12 +- src/plugins/exec/exec-completion.c | 6 +- src/plugins/exec/exec-config.c | 37 +- src/plugins/exec/exec.c | 23 +- src/plugins/exec/exec.h | 3 +- src/plugins/fifo/fifo-command.c | 6 +- src/plugins/fifo/fifo-info.c | 6 +- src/plugins/fifo/fifo.c | 17 +- src/plugins/guile/weechat-guile-api.c | 694 +++++---- src/plugins/guile/weechat-guile-api.h | 6 +- src/plugins/guile/weechat-guile.c | 71 +- src/plugins/irc/irc-bar-item.c | 69 +- src/plugins/irc/irc-buffer.c | 13 +- src/plugins/irc/irc-buffer.h | 8 +- src/plugins/irc/irc-channel.c | 29 +- src/plugins/irc/irc-channel.h | 9 +- src/plugins/irc/irc-color.c | 6 +- src/plugins/irc/irc-color.h | 3 +- src/plugins/irc/irc-command.c | 533 +++---- src/plugins/irc/irc-command.h | 6 + src/plugins/irc/irc-completion.c | 96 +- src/plugins/irc/irc-config.c | 1055 +++++++++----- src/plugins/irc/irc-config.h | 12 +- src/plugins/irc/irc-debug.c | 7 +- src/plugins/irc/irc-ignore.c | 4 +- src/plugins/irc/irc-ignore.h | 3 +- src/plugins/irc/irc-info.c | 173 ++- src/plugins/irc/irc-input.c | 8 +- src/plugins/irc/irc-input.h | 8 +- src/plugins/irc/irc-message.c | 6 +- src/plugins/irc/irc-nick.c | 4 +- src/plugins/irc/irc-nick.h | 5 +- src/plugins/irc/irc-notify.c | 20 +- src/plugins/irc/irc-notify.h | 9 +- src/plugins/irc/irc-protocol.c | 7 +- src/plugins/irc/irc-raw.c | 7 +- src/plugins/irc/irc-redirect.c | 22 +- src/plugins/irc/irc-redirect.h | 12 +- src/plugins/irc/irc-server.c | 116 +- src/plugins/irc/irc-server.h | 27 +- src/plugins/irc/irc-upgrade.c | 25 +- src/plugins/irc/irc.c | 44 +- src/plugins/javascript/weechat-js-api.cpp | 763 +++++----- src/plugins/javascript/weechat-js-api.h | 6 +- src/plugins/javascript/weechat-js.cpp | 73 +- src/plugins/logger/logger-config.c | 152 +- src/plugins/logger/logger-info.c | 15 +- src/plugins/logger/logger.c | 64 +- src/plugins/logger/logger.h | 3 +- src/plugins/lua/weechat-lua-api.c | 693 +++++---- src/plugins/lua/weechat-lua-api.h | 6 +- src/plugins/lua/weechat-lua.c | 70 +- src/plugins/perl/weechat-perl-api.c | 692 +++++---- src/plugins/perl/weechat-perl-api.h | 6 +- src/plugins/perl/weechat-perl.c | 83 +- src/plugins/plugin-api.c | 411 +++--- src/plugins/plugin-config.c | 62 +- src/plugins/plugin-script-api.c | 908 +++++------- src/plugins/plugin-script-api.h | 132 +- src/plugins/plugin-script-callback.c | 202 --- src/plugins/plugin-script-callback.h | 50 - src/plugins/plugin-script.c | 393 +++-- src/plugins/plugin-script.h | 43 +- src/plugins/plugin.c | 21 +- src/plugins/plugin.h | 3 +- src/plugins/python/weechat-python-api.c | 682 +++++---- src/plugins/python/weechat-python-api.h | 6 +- src/plugins/python/weechat-python.c | 81 +- src/plugins/relay/irc/relay-irc.c | 43 +- src/plugins/relay/relay-buffer.c | 12 +- src/plugins/relay/relay-buffer.h | 8 +- src/plugins/relay/relay-client.c | 34 +- src/plugins/relay/relay-client.h | 5 +- src/plugins/relay/relay-command.c | 17 +- src/plugins/relay/relay-completion.c | 18 +- src/plugins/relay/relay-config.c | 222 ++- src/plugins/relay/relay-config.h | 2 +- src/plugins/relay/relay-info.c | 20 +- src/plugins/relay/relay-raw.c | 7 +- src/plugins/relay/relay-server.c | 7 +- src/plugins/relay/relay-upgrade.c | 13 +- src/plugins/relay/relay.c | 14 +- src/plugins/relay/weechat/relay-weechat-msg.c | 3 +- .../relay/weechat/relay-weechat-protocol.c | 35 +- .../relay/weechat/relay-weechat-protocol.h | 15 +- src/plugins/relay/weechat/relay-weechat.c | 33 +- src/plugins/ruby/weechat-ruby-api.c | 710 ++++----- src/plugins/ruby/weechat-ruby-api.h | 6 +- src/plugins/ruby/weechat-ruby.c | 73 +- src/plugins/script/script-action.c | 38 +- src/plugins/script/script-buffer.c | 244 ++-- src/plugins/script/script-buffer.h | 9 +- src/plugins/script/script-command.c | 6 +- src/plugins/script/script-completion.c | 42 +- src/plugins/script/script-config.c | 202 ++- src/plugins/script/script-info.c | 17 +- src/plugins/script/script-repo.c | 29 +- src/plugins/script/script-repo.h | 3 +- src/plugins/script/script.c | 42 +- src/plugins/tcl/weechat-tcl-api.c | 701 +++++---- src/plugins/tcl/weechat-tcl-api.h | 6 +- src/plugins/tcl/weechat-tcl.c | 73 +- src/plugins/trigger/trigger-buffer.c | 17 +- src/plugins/trigger/trigger-callback.c | 43 +- src/plugins/trigger/trigger-callback.h | 44 +- src/plugins/trigger/trigger-command.c | 6 +- src/plugins/trigger/trigger-completion.c | 66 +- src/plugins/trigger/trigger-config.c | 129 +- src/plugins/trigger/trigger.c | 24 +- src/plugins/weechat-plugin.h | 307 ++-- src/plugins/xfer/xfer-buffer.c | 12 +- src/plugins/xfer/xfer-buffer.h | 6 +- src/plugins/xfer/xfer-chat.c | 20 +- src/plugins/xfer/xfer-chat.h | 2 +- src/plugins/xfer/xfer-command.c | 14 +- src/plugins/xfer/xfer-completion.c | 6 +- src/plugins/xfer/xfer-config.c | 136 +- src/plugins/xfer/xfer-info.c | 14 +- src/plugins/xfer/xfer-network.c | 35 +- src/plugins/xfer/xfer-upgrade.c | 16 +- src/plugins/xfer/xfer.c | 35 +- tests/tests.cpp | 6 +- 207 files changed, 9596 insertions(+), 7472 deletions(-) delete mode 100644 src/plugins/plugin-script-callback.c delete mode 100644 src/plugins/plugin-script-callback.h diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 72607e8fa..84032abf9 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -23,6 +23,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * core: move irc bar item "away" to core, move options "irc.look.item_away_message" and "irc.color.item_away" to core (issue #692) +* api: add pointer in callbacks used in scripting API (issue #406) * irc: add option irc.network.sasl_fail_unavailable (issue #600, issue #697) * irc: add multiple targets and support of "-server" in command /ctcp (issue #204, issue #493) diff --git a/ReleaseNotes.asciidoc b/ReleaseNotes.asciidoc index 5e582e5f4..e19fedb09 100644 --- a/ReleaseNotes.asciidoc +++ b/ReleaseNotes.asciidoc @@ -20,6 +20,50 @@ https://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog] [[1.5]] == Version 1.5 (under dev) +[[1.5_callbacks_pointer]] +=== Pointer in callbacks + +A pointer has been added in all callbacks used by scripts, so the callbacks +will receive an extra 'const void *pointer' before the 'void *data' +(in the C API only, not scripting API). + +This is used to remove linked list of callbacks in scrips (improve speed, +reduce memory usage). + +Following functions are changed in the C API: + +* exec_on_files +* config_new +* config_new_section +* config_new_option +* hook_command +* hook_command_run +* hook_timer +* hook_fd +* hook_process +* hook_process_hashtable +* hook_connect +* hook_print +* hook_signal +* hook_hsignal +* hook_config +* hook_completion +* hook_modifier +* hook_info +* hook_info_hashtable +* hook_infolist +* hook_hdata +* hook_focus +* unhook_all_plugin +* buffer_new +* bar_item_new +* upgrade_new +* upgrade_read + +The function `unhook_all` is renamed to `unhook_all_plugin` (in C API only, not +scripting API) and has a new argument `const char *subplugin` to remove only +hooks created by this "subplugin" (script). + [[1.5_bar_item_away]] === Bar item "away" diff --git a/doc/de/autogen/plugin_api/hdata.asciidoc b/doc/de/autogen/plugin_api/hdata.asciidoc index 6ea804573..369a1fe8d 100644 --- a/doc/de/autogen/plugin_api/hdata.asciidoc +++ b/doc/de/autogen/plugin_api/hdata.asciidoc @@ -2,21 +2,6 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[hdata_guile_callback]]<>: Callback eines Skripts -** Erweiterung: guile -** Variablen: -*** 'script' (pointer, hdata: "guile_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "guile_callback") -*** 'next_callback' (pointer, hdata: "guile_callback") * [[hdata_guile_script]]<>: Liste der Skripten ** Erweiterung: guile ** Variablen: @@ -29,7 +14,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "guile_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "guile_script") *** 'next_script' (pointer, hdata: "guile_script") @@ -229,21 +213,6 @@ ** Listen: *** 'irc_servers' *** 'last_irc_server' -* [[hdata_javascript_callback]]<>: Callback eines Skripts -** Erweiterung: javascript -** Variablen: -*** 'script' (pointer, hdata: "javascript_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "javascript_callback") -*** 'next_callback' (pointer, hdata: "javascript_callback") * [[hdata_javascript_script]]<>: Liste der Skripten ** Erweiterung: javascript ** Variablen: @@ -256,28 +225,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "javascript_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "javascript_script") *** 'next_script' (pointer, hdata: "javascript_script") ** Listen: *** 'last_script' *** 'scripts' -* [[hdata_lua_callback]]<>: Callback eines Skripts -** Erweiterung: lua -** Variablen: -*** 'script' (pointer, hdata: "lua_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "lua_callback") -*** 'next_callback' (pointer, hdata: "lua_callback") * [[hdata_lua_script]]<>: Liste der Skripten ** Erweiterung: lua ** Variablen: @@ -290,28 +243,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "lua_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "lua_script") *** 'next_script' (pointer, hdata: "lua_script") ** Listen: *** 'last_script' *** 'scripts' -* [[hdata_perl_callback]]<>: Callback eines Skripts -** Erweiterung: perl -** Variablen: -*** 'script' (pointer, hdata: "perl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "perl_callback") -*** 'next_callback' (pointer, hdata: "perl_callback") * [[hdata_perl_script]]<>: Liste der Skripten ** Erweiterung: perl ** Variablen: @@ -324,28 +261,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "perl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "perl_script") *** 'next_script' (pointer, hdata: "perl_script") ** Listen: *** 'last_script' *** 'scripts' -* [[hdata_python_callback]]<>: Callback eines Skripts -** Erweiterung: python -** Variablen: -*** 'script' (pointer, hdata: "python_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "python_callback") -*** 'next_callback' (pointer, hdata: "python_callback") * [[hdata_python_script]]<>: Liste der Skripten ** Erweiterung: python ** Variablen: @@ -358,28 +279,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "python_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "python_script") *** 'next_script' (pointer, hdata: "python_script") ** Listen: *** 'last_script' *** 'scripts' -* [[hdata_ruby_callback]]<>: Callback eines Skripts -** Erweiterung: ruby -** Variablen: -*** 'script' (pointer, hdata: "ruby_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "ruby_callback") -*** 'next_callback' (pointer, hdata: "ruby_callback") * [[hdata_ruby_script]]<>: Liste der Skripten ** Erweiterung: ruby ** Variablen: @@ -392,7 +297,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "ruby_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "ruby_script") *** 'next_script' (pointer, hdata: "ruby_script") @@ -428,21 +332,6 @@ ** Listen: *** 'last_script_repo' *** 'scripts_repo' -* [[hdata_tcl_callback]]<>: Callback eines Skripts -** Erweiterung: tcl -** Variablen: -*** 'script' (pointer, hdata: "tcl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "tcl_callback") -*** 'next_callback' (pointer, hdata: "tcl_callback") * [[hdata_tcl_script]]<>: Liste der Skripten ** Erweiterung: tcl ** Variablen: @@ -455,7 +344,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "tcl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "tcl_script") *** 'next_script' (pointer, hdata: "tcl_script") @@ -487,6 +375,7 @@ *** 'plugin' (pointer, hdata: "plugin") *** 'name' (string) *** 'build_callback' (pointer) +*** 'build_callback_pointer' (pointer) *** 'build_callback_data' (pointer) *** 'prev_item' (pointer, hdata: "bar_item") *** 'next_item' (pointer, hdata: "bar_item") @@ -540,6 +429,7 @@ *** 'clear' (integer) *** 'filter' (integer) *** 'close_callback' (pointer) +*** 'close_callback_pointer' (pointer) *** 'close_callback_data' (pointer) *** 'closing' (integer) *** 'title' (string) @@ -558,9 +448,11 @@ *** 'nicklist_nicks_count' (integer) *** 'nicklist_visible_count' (integer) *** 'nickcmp_callback' (pointer) +*** 'nickcmp_callback_pointer' (pointer) *** 'nickcmp_callback_data' (pointer) *** 'input' (integer) *** 'input_callback' (pointer) +*** 'input_callback_pointer' (pointer) *** 'input_callback_data' (pointer) *** 'input_get_unknown_commands' (integer) *** 'input_buffer' (string) @@ -644,6 +536,7 @@ *** 'filename' (string) *** 'file' (pointer) *** 'callback_reload' (pointer) +*** 'callback_reload_pointer' (pointer) *** 'callback_reload_data' (pointer) *** 'sections' (pointer, hdata: "config_section") *** 'last_section' (pointer, hdata: "config_section") @@ -668,10 +561,13 @@ *** 'value' (pointer) *** 'null_value_allowed' (integer) *** 'callback_check_value' (pointer) +*** 'callback_check_value_pointer' (pointer) *** 'callback_check_value_data' (pointer) *** 'callback_change' (pointer) +*** 'callback_change_pointer' (pointer) *** 'callback_change_data' (pointer) *** 'callback_delete' (pointer) +*** 'callback_delete_pointer' (pointer) *** 'callback_delete_data' (pointer) *** 'loaded' (integer) *** 'prev_option' (pointer, hdata: "config_option") @@ -684,14 +580,19 @@ *** 'user_can_add_options' (integer) *** 'user_can_delete_options' (integer) *** 'callback_read' (pointer) +*** 'callback_read_pointer' (pointer) *** 'callback_read_data' (pointer) *** 'callback_write' (pointer) +*** 'callback_write_pointer' (pointer) *** 'callback_write_data' (pointer) *** 'callback_write_default' (pointer) +*** 'callback_write_default_pointer' (pointer) *** 'callback_write_default_data' (pointer) *** 'callback_create_option' (pointer) +*** 'callback_create_option_pointer' (pointer) *** 'callback_create_option_data' (pointer) *** 'callback_delete_option' (pointer) +*** 'callback_delete_option_pointer' (pointer) *** 'callback_delete_option_data' (pointer) *** 'options' (pointer, hdata: "config_option") *** 'last_option' (pointer, hdata: "config_option") diff --git a/doc/en/autogen/plugin_api/hdata.asciidoc b/doc/en/autogen/plugin_api/hdata.asciidoc index 904f694ee..0850501a6 100644 --- a/doc/en/autogen/plugin_api/hdata.asciidoc +++ b/doc/en/autogen/plugin_api/hdata.asciidoc @@ -2,21 +2,6 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[hdata_guile_callback]]<>: callback of a script -** plugin: guile -** variables: -*** 'script' (pointer, hdata: "guile_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "guile_callback") -*** 'next_callback' (pointer, hdata: "guile_callback") * [[hdata_guile_script]]<>: list of scripts ** plugin: guile ** variables: @@ -29,7 +14,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "guile_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "guile_script") *** 'next_script' (pointer, hdata: "guile_script") @@ -229,21 +213,6 @@ ** lists: *** 'irc_servers' *** 'last_irc_server' -* [[hdata_javascript_callback]]<>: callback of a script -** plugin: javascript -** variables: -*** 'script' (pointer, hdata: "javascript_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "javascript_callback") -*** 'next_callback' (pointer, hdata: "javascript_callback") * [[hdata_javascript_script]]<>: list of scripts ** plugin: javascript ** variables: @@ -256,28 +225,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "javascript_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "javascript_script") *** 'next_script' (pointer, hdata: "javascript_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_lua_callback]]<>: callback of a script -** plugin: lua -** variables: -*** 'script' (pointer, hdata: "lua_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "lua_callback") -*** 'next_callback' (pointer, hdata: "lua_callback") * [[hdata_lua_script]]<>: list of scripts ** plugin: lua ** variables: @@ -290,28 +243,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "lua_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "lua_script") *** 'next_script' (pointer, hdata: "lua_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_perl_callback]]<>: callback of a script -** plugin: perl -** variables: -*** 'script' (pointer, hdata: "perl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "perl_callback") -*** 'next_callback' (pointer, hdata: "perl_callback") * [[hdata_perl_script]]<>: list of scripts ** plugin: perl ** variables: @@ -324,28 +261,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "perl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "perl_script") *** 'next_script' (pointer, hdata: "perl_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_python_callback]]<>: callback of a script -** plugin: python -** variables: -*** 'script' (pointer, hdata: "python_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "python_callback") -*** 'next_callback' (pointer, hdata: "python_callback") * [[hdata_python_script]]<>: list of scripts ** plugin: python ** variables: @@ -358,28 +279,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "python_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "python_script") *** 'next_script' (pointer, hdata: "python_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_ruby_callback]]<>: callback of a script -** plugin: ruby -** variables: -*** 'script' (pointer, hdata: "ruby_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "ruby_callback") -*** 'next_callback' (pointer, hdata: "ruby_callback") * [[hdata_ruby_script]]<>: list of scripts ** plugin: ruby ** variables: @@ -392,7 +297,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "ruby_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "ruby_script") *** 'next_script' (pointer, hdata: "ruby_script") @@ -428,21 +332,6 @@ ** lists: *** 'last_script_repo' *** 'scripts_repo' -* [[hdata_tcl_callback]]<>: callback of a script -** plugin: tcl -** variables: -*** 'script' (pointer, hdata: "tcl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "tcl_callback") -*** 'next_callback' (pointer, hdata: "tcl_callback") * [[hdata_tcl_script]]<>: list of scripts ** plugin: tcl ** variables: @@ -455,7 +344,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "tcl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "tcl_script") *** 'next_script' (pointer, hdata: "tcl_script") @@ -487,6 +375,7 @@ *** 'plugin' (pointer, hdata: "plugin") *** 'name' (string) *** 'build_callback' (pointer) +*** 'build_callback_pointer' (pointer) *** 'build_callback_data' (pointer) *** 'prev_item' (pointer, hdata: "bar_item") *** 'next_item' (pointer, hdata: "bar_item") @@ -540,6 +429,7 @@ *** 'clear' (integer) *** 'filter' (integer) *** 'close_callback' (pointer) +*** 'close_callback_pointer' (pointer) *** 'close_callback_data' (pointer) *** 'closing' (integer) *** 'title' (string) @@ -558,9 +448,11 @@ *** 'nicklist_nicks_count' (integer) *** 'nicklist_visible_count' (integer) *** 'nickcmp_callback' (pointer) +*** 'nickcmp_callback_pointer' (pointer) *** 'nickcmp_callback_data' (pointer) *** 'input' (integer) *** 'input_callback' (pointer) +*** 'input_callback_pointer' (pointer) *** 'input_callback_data' (pointer) *** 'input_get_unknown_commands' (integer) *** 'input_buffer' (string) @@ -644,6 +536,7 @@ *** 'filename' (string) *** 'file' (pointer) *** 'callback_reload' (pointer) +*** 'callback_reload_pointer' (pointer) *** 'callback_reload_data' (pointer) *** 'sections' (pointer, hdata: "config_section") *** 'last_section' (pointer, hdata: "config_section") @@ -668,10 +561,13 @@ *** 'value' (pointer) *** 'null_value_allowed' (integer) *** 'callback_check_value' (pointer) +*** 'callback_check_value_pointer' (pointer) *** 'callback_check_value_data' (pointer) *** 'callback_change' (pointer) +*** 'callback_change_pointer' (pointer) *** 'callback_change_data' (pointer) *** 'callback_delete' (pointer) +*** 'callback_delete_pointer' (pointer) *** 'callback_delete_data' (pointer) *** 'loaded' (integer) *** 'prev_option' (pointer, hdata: "config_option") @@ -684,14 +580,19 @@ *** 'user_can_add_options' (integer) *** 'user_can_delete_options' (integer) *** 'callback_read' (pointer) +*** 'callback_read_pointer' (pointer) *** 'callback_read_data' (pointer) *** 'callback_write' (pointer) +*** 'callback_write_pointer' (pointer) *** 'callback_write_data' (pointer) *** 'callback_write_default' (pointer) +*** 'callback_write_default_pointer' (pointer) *** 'callback_write_default_data' (pointer) *** 'callback_create_option' (pointer) +*** 'callback_create_option_pointer' (pointer) *** 'callback_create_option_data' (pointer) *** 'callback_delete_option' (pointer) +*** 'callback_delete_option_pointer' (pointer) *** 'callback_delete_option_data' (pointer) *** 'options' (pointer, hdata: "config_option") *** 'last_option' (pointer, hdata: "config_option") diff --git a/doc/en/weechat_dev.en.asciidoc b/doc/en/weechat_dev.en.asciidoc index d9d7207a5..45e832d2e 100644 --- a/doc/en/weechat_dev.en.asciidoc +++ b/doc/en/weechat_dev.en.asciidoc @@ -176,7 +176,6 @@ WeeChat "core" is located in following directories: | plugin-config.c | Plugin configuration options (file plugins.conf) | plugin-script.c | Common functions used by script plugins | plugin-script-api.c | Script API functions: wrappers around some plugin API functions -| plugin-script-callback.c | Callback management for scripts | weechat-plugin.h | Header designed to be distributed with WeeChat plugins, in order to compile them | alias/ | Alias plugin | alias.c | Main alias functions diff --git a/doc/fr/autogen/plugin_api/hdata.asciidoc b/doc/fr/autogen/plugin_api/hdata.asciidoc index fcabef755..16e23bd84 100644 --- a/doc/fr/autogen/plugin_api/hdata.asciidoc +++ b/doc/fr/autogen/plugin_api/hdata.asciidoc @@ -2,21 +2,6 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[hdata_guile_callback]]<>: callback d'un script -** extension: guile -** variables: -*** 'script' (pointer, hdata: "guile_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "guile_callback") -*** 'next_callback' (pointer, hdata: "guile_callback") * [[hdata_guile_script]]<>: liste des scripts ** extension: guile ** variables: @@ -29,7 +14,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "guile_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "guile_script") *** 'next_script' (pointer, hdata: "guile_script") @@ -229,21 +213,6 @@ ** listes: *** 'irc_servers' *** 'last_irc_server' -* [[hdata_javascript_callback]]<>: callback d'un script -** extension: javascript -** variables: -*** 'script' (pointer, hdata: "javascript_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "javascript_callback") -*** 'next_callback' (pointer, hdata: "javascript_callback") * [[hdata_javascript_script]]<>: liste des scripts ** extension: javascript ** variables: @@ -256,28 +225,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "javascript_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "javascript_script") *** 'next_script' (pointer, hdata: "javascript_script") ** listes: *** 'last_script' *** 'scripts' -* [[hdata_lua_callback]]<>: callback d'un script -** extension: lua -** variables: -*** 'script' (pointer, hdata: "lua_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "lua_callback") -*** 'next_callback' (pointer, hdata: "lua_callback") * [[hdata_lua_script]]<>: liste des scripts ** extension: lua ** variables: @@ -290,28 +243,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "lua_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "lua_script") *** 'next_script' (pointer, hdata: "lua_script") ** listes: *** 'last_script' *** 'scripts' -* [[hdata_perl_callback]]<>: callback d'un script -** extension: perl -** variables: -*** 'script' (pointer, hdata: "perl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "perl_callback") -*** 'next_callback' (pointer, hdata: "perl_callback") * [[hdata_perl_script]]<>: liste des scripts ** extension: perl ** variables: @@ -324,28 +261,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "perl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "perl_script") *** 'next_script' (pointer, hdata: "perl_script") ** listes: *** 'last_script' *** 'scripts' -* [[hdata_python_callback]]<>: callback d'un script -** extension: python -** variables: -*** 'script' (pointer, hdata: "python_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "python_callback") -*** 'next_callback' (pointer, hdata: "python_callback") * [[hdata_python_script]]<>: liste des scripts ** extension: python ** variables: @@ -358,28 +279,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "python_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "python_script") *** 'next_script' (pointer, hdata: "python_script") ** listes: *** 'last_script' *** 'scripts' -* [[hdata_ruby_callback]]<>: callback d'un script -** extension: ruby -** variables: -*** 'script' (pointer, hdata: "ruby_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "ruby_callback") -*** 'next_callback' (pointer, hdata: "ruby_callback") * [[hdata_ruby_script]]<>: liste des scripts ** extension: ruby ** variables: @@ -392,7 +297,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "ruby_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "ruby_script") *** 'next_script' (pointer, hdata: "ruby_script") @@ -428,21 +332,6 @@ ** listes: *** 'last_script_repo' *** 'scripts_repo' -* [[hdata_tcl_callback]]<>: callback d'un script -** extension: tcl -** variables: -*** 'script' (pointer, hdata: "tcl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "tcl_callback") -*** 'next_callback' (pointer, hdata: "tcl_callback") * [[hdata_tcl_script]]<>: liste des scripts ** extension: tcl ** variables: @@ -455,7 +344,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "tcl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "tcl_script") *** 'next_script' (pointer, hdata: "tcl_script") @@ -487,6 +375,7 @@ *** 'plugin' (pointer, hdata: "plugin") *** 'name' (string) *** 'build_callback' (pointer) +*** 'build_callback_pointer' (pointer) *** 'build_callback_data' (pointer) *** 'prev_item' (pointer, hdata: "bar_item") *** 'next_item' (pointer, hdata: "bar_item") @@ -540,6 +429,7 @@ *** 'clear' (integer) *** 'filter' (integer) *** 'close_callback' (pointer) +*** 'close_callback_pointer' (pointer) *** 'close_callback_data' (pointer) *** 'closing' (integer) *** 'title' (string) @@ -558,9 +448,11 @@ *** 'nicklist_nicks_count' (integer) *** 'nicklist_visible_count' (integer) *** 'nickcmp_callback' (pointer) +*** 'nickcmp_callback_pointer' (pointer) *** 'nickcmp_callback_data' (pointer) *** 'input' (integer) *** 'input_callback' (pointer) +*** 'input_callback_pointer' (pointer) *** 'input_callback_data' (pointer) *** 'input_get_unknown_commands' (integer) *** 'input_buffer' (string) @@ -644,6 +536,7 @@ *** 'filename' (string) *** 'file' (pointer) *** 'callback_reload' (pointer) +*** 'callback_reload_pointer' (pointer) *** 'callback_reload_data' (pointer) *** 'sections' (pointer, hdata: "config_section") *** 'last_section' (pointer, hdata: "config_section") @@ -668,10 +561,13 @@ *** 'value' (pointer) *** 'null_value_allowed' (integer) *** 'callback_check_value' (pointer) +*** 'callback_check_value_pointer' (pointer) *** 'callback_check_value_data' (pointer) *** 'callback_change' (pointer) +*** 'callback_change_pointer' (pointer) *** 'callback_change_data' (pointer) *** 'callback_delete' (pointer) +*** 'callback_delete_pointer' (pointer) *** 'callback_delete_data' (pointer) *** 'loaded' (integer) *** 'prev_option' (pointer, hdata: "config_option") @@ -684,14 +580,19 @@ *** 'user_can_add_options' (integer) *** 'user_can_delete_options' (integer) *** 'callback_read' (pointer) +*** 'callback_read_pointer' (pointer) *** 'callback_read_data' (pointer) *** 'callback_write' (pointer) +*** 'callback_write_pointer' (pointer) *** 'callback_write_data' (pointer) *** 'callback_write_default' (pointer) +*** 'callback_write_default_pointer' (pointer) *** 'callback_write_default_data' (pointer) *** 'callback_create_option' (pointer) +*** 'callback_create_option_pointer' (pointer) *** 'callback_create_option_data' (pointer) *** 'callback_delete_option' (pointer) +*** 'callback_delete_option_pointer' (pointer) *** 'callback_delete_option_data' (pointer) *** 'options' (pointer, hdata: "config_option") *** 'last_option' (pointer, hdata: "config_option") diff --git a/doc/fr/weechat_dev.fr.asciidoc b/doc/fr/weechat_dev.fr.asciidoc index 2bcb4617a..fa4486ddc 100644 --- a/doc/fr/weechat_dev.fr.asciidoc +++ b/doc/fr/weechat_dev.fr.asciidoc @@ -177,7 +177,6 @@ Le cœur de WeeChat est situé dans les répertoires suivants : | plugin-config.c | Options de configuration des extensions (fichier plugins.conf) | plugin-script.c | Fonctions communes utilisés par les extensions pour les scripts | plugin-script-api.c | Fonctions pour l'API script : enveloppes autour de quelques fonctions de l'API extension -| plugin-script-callback.c | Gestion des "callbacks" pour les scripts | weechat-plugin.h | En-tête destiné à être distribué avec les extensions WeeChat, pour les compiler | alias/ | Extension Alias | alias.c | Fonctions principales pour les alias diff --git a/doc/it/autogen/plugin_api/hdata.asciidoc b/doc/it/autogen/plugin_api/hdata.asciidoc index c49a21e7d..05366191f 100644 --- a/doc/it/autogen/plugin_api/hdata.asciidoc +++ b/doc/it/autogen/plugin_api/hdata.asciidoc @@ -2,21 +2,6 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[hdata_guile_callback]]<>: callback di uno script -** plugin: guile -** variables: -*** 'script' (pointer, hdata: "guile_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "guile_callback") -*** 'next_callback' (pointer, hdata: "guile_callback") * [[hdata_guile_script]]<>: elenco degli script ** plugin: guile ** variables: @@ -29,7 +14,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "guile_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "guile_script") *** 'next_script' (pointer, hdata: "guile_script") @@ -229,21 +213,6 @@ ** lists: *** 'irc_servers' *** 'last_irc_server' -* [[hdata_javascript_callback]]<>: callback di uno script -** plugin: javascript -** variables: -*** 'script' (pointer, hdata: "javascript_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "javascript_callback") -*** 'next_callback' (pointer, hdata: "javascript_callback") * [[hdata_javascript_script]]<>: elenco degli script ** plugin: javascript ** variables: @@ -256,28 +225,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "javascript_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "javascript_script") *** 'next_script' (pointer, hdata: "javascript_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_lua_callback]]<>: callback di uno script -** plugin: lua -** variables: -*** 'script' (pointer, hdata: "lua_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "lua_callback") -*** 'next_callback' (pointer, hdata: "lua_callback") * [[hdata_lua_script]]<>: elenco degli script ** plugin: lua ** variables: @@ -290,28 +243,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "lua_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "lua_script") *** 'next_script' (pointer, hdata: "lua_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_perl_callback]]<>: callback di uno script -** plugin: perl -** variables: -*** 'script' (pointer, hdata: "perl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "perl_callback") -*** 'next_callback' (pointer, hdata: "perl_callback") * [[hdata_perl_script]]<>: elenco degli script ** plugin: perl ** variables: @@ -324,28 +261,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "perl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "perl_script") *** 'next_script' (pointer, hdata: "perl_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_python_callback]]<>: callback di uno script -** plugin: python -** variables: -*** 'script' (pointer, hdata: "python_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "python_callback") -*** 'next_callback' (pointer, hdata: "python_callback") * [[hdata_python_script]]<>: elenco degli script ** plugin: python ** variables: @@ -358,28 +279,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "python_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "python_script") *** 'next_script' (pointer, hdata: "python_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_ruby_callback]]<>: callback di uno script -** plugin: ruby -** variables: -*** 'script' (pointer, hdata: "ruby_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "ruby_callback") -*** 'next_callback' (pointer, hdata: "ruby_callback") * [[hdata_ruby_script]]<>: elenco degli script ** plugin: ruby ** variables: @@ -392,7 +297,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "ruby_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "ruby_script") *** 'next_script' (pointer, hdata: "ruby_script") @@ -428,21 +332,6 @@ ** lists: *** 'last_script_repo' *** 'scripts_repo' -* [[hdata_tcl_callback]]<>: callback di uno script -** plugin: tcl -** variables: -*** 'script' (pointer, hdata: "tcl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "tcl_callback") -*** 'next_callback' (pointer, hdata: "tcl_callback") * [[hdata_tcl_script]]<>: elenco degli script ** plugin: tcl ** variables: @@ -455,7 +344,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "tcl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "tcl_script") *** 'next_script' (pointer, hdata: "tcl_script") @@ -487,6 +375,7 @@ *** 'plugin' (pointer, hdata: "plugin") *** 'name' (string) *** 'build_callback' (pointer) +*** 'build_callback_pointer' (pointer) *** 'build_callback_data' (pointer) *** 'prev_item' (pointer, hdata: "bar_item") *** 'next_item' (pointer, hdata: "bar_item") @@ -540,6 +429,7 @@ *** 'clear' (integer) *** 'filter' (integer) *** 'close_callback' (pointer) +*** 'close_callback_pointer' (pointer) *** 'close_callback_data' (pointer) *** 'closing' (integer) *** 'title' (string) @@ -558,9 +448,11 @@ *** 'nicklist_nicks_count' (integer) *** 'nicklist_visible_count' (integer) *** 'nickcmp_callback' (pointer) +*** 'nickcmp_callback_pointer' (pointer) *** 'nickcmp_callback_data' (pointer) *** 'input' (integer) *** 'input_callback' (pointer) +*** 'input_callback_pointer' (pointer) *** 'input_callback_data' (pointer) *** 'input_get_unknown_commands' (integer) *** 'input_buffer' (string) @@ -644,6 +536,7 @@ *** 'filename' (string) *** 'file' (pointer) *** 'callback_reload' (pointer) +*** 'callback_reload_pointer' (pointer) *** 'callback_reload_data' (pointer) *** 'sections' (pointer, hdata: "config_section") *** 'last_section' (pointer, hdata: "config_section") @@ -668,10 +561,13 @@ *** 'value' (pointer) *** 'null_value_allowed' (integer) *** 'callback_check_value' (pointer) +*** 'callback_check_value_pointer' (pointer) *** 'callback_check_value_data' (pointer) *** 'callback_change' (pointer) +*** 'callback_change_pointer' (pointer) *** 'callback_change_data' (pointer) *** 'callback_delete' (pointer) +*** 'callback_delete_pointer' (pointer) *** 'callback_delete_data' (pointer) *** 'loaded' (integer) *** 'prev_option' (pointer, hdata: "config_option") @@ -684,14 +580,19 @@ *** 'user_can_add_options' (integer) *** 'user_can_delete_options' (integer) *** 'callback_read' (pointer) +*** 'callback_read_pointer' (pointer) *** 'callback_read_data' (pointer) *** 'callback_write' (pointer) +*** 'callback_write_pointer' (pointer) *** 'callback_write_data' (pointer) *** 'callback_write_default' (pointer) +*** 'callback_write_default_pointer' (pointer) *** 'callback_write_default_data' (pointer) *** 'callback_create_option' (pointer) +*** 'callback_create_option_pointer' (pointer) *** 'callback_create_option_data' (pointer) *** 'callback_delete_option' (pointer) +*** 'callback_delete_option_pointer' (pointer) *** 'callback_delete_option_data' (pointer) *** 'options' (pointer, hdata: "config_option") *** 'last_option' (pointer, hdata: "config_option") diff --git a/doc/ja/autogen/plugin_api/hdata.asciidoc b/doc/ja/autogen/plugin_api/hdata.asciidoc index 9873e30e9..791eac688 100644 --- a/doc/ja/autogen/plugin_api/hdata.asciidoc +++ b/doc/ja/autogen/plugin_api/hdata.asciidoc @@ -2,21 +2,6 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[hdata_guile_callback]]<>: スクリプトのコールバック -** プラグイン: guile -** 変数: -*** 'script' (pointer, hdata: "guile_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "guile_callback") -*** 'next_callback' (pointer, hdata: "guile_callback") * [[hdata_guile_script]]<>: スクリプトのリスト ** プラグイン: guile ** 変数: @@ -29,7 +14,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "guile_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "guile_script") *** 'next_script' (pointer, hdata: "guile_script") @@ -229,21 +213,6 @@ ** リスト: *** 'irc_servers' *** 'last_irc_server' -* [[hdata_javascript_callback]]<>: スクリプトのコールバック -** プラグイン: javascript -** 変数: -*** 'script' (pointer, hdata: "javascript_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "javascript_callback") -*** 'next_callback' (pointer, hdata: "javascript_callback") * [[hdata_javascript_script]]<>: スクリプトのリスト ** プラグイン: javascript ** 変数: @@ -256,28 +225,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "javascript_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "javascript_script") *** 'next_script' (pointer, hdata: "javascript_script") ** リスト: *** 'last_script' *** 'scripts' -* [[hdata_lua_callback]]<>: スクリプトのコールバック -** プラグイン: lua -** 変数: -*** 'script' (pointer, hdata: "lua_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "lua_callback") -*** 'next_callback' (pointer, hdata: "lua_callback") * [[hdata_lua_script]]<>: スクリプトのリスト ** プラグイン: lua ** 変数: @@ -290,28 +243,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "lua_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "lua_script") *** 'next_script' (pointer, hdata: "lua_script") ** リスト: *** 'last_script' *** 'scripts' -* [[hdata_perl_callback]]<>: スクリプトのコールバック -** プラグイン: perl -** 変数: -*** 'script' (pointer, hdata: "perl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "perl_callback") -*** 'next_callback' (pointer, hdata: "perl_callback") * [[hdata_perl_script]]<>: スクリプトのリスト ** プラグイン: perl ** 変数: @@ -324,28 +261,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "perl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "perl_script") *** 'next_script' (pointer, hdata: "perl_script") ** リスト: *** 'last_script' *** 'scripts' -* [[hdata_python_callback]]<>: スクリプトのコールバック -** プラグイン: python -** 変数: -*** 'script' (pointer, hdata: "python_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "python_callback") -*** 'next_callback' (pointer, hdata: "python_callback") * [[hdata_python_script]]<>: スクリプトのリスト ** プラグイン: python ** 変数: @@ -358,28 +279,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "python_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "python_script") *** 'next_script' (pointer, hdata: "python_script") ** リスト: *** 'last_script' *** 'scripts' -* [[hdata_ruby_callback]]<>: スクリプトのコールバック -** プラグイン: ruby -** 変数: -*** 'script' (pointer, hdata: "ruby_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "ruby_callback") -*** 'next_callback' (pointer, hdata: "ruby_callback") * [[hdata_ruby_script]]<>: スクリプトのリスト ** プラグイン: ruby ** 変数: @@ -392,7 +297,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "ruby_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "ruby_script") *** 'next_script' (pointer, hdata: "ruby_script") @@ -428,21 +332,6 @@ ** リスト: *** 'last_script_repo' *** 'scripts_repo' -* [[hdata_tcl_callback]]<>: スクリプトのコールバック -** プラグイン: tcl -** 変数: -*** 'script' (pointer, hdata: "tcl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "tcl_callback") -*** 'next_callback' (pointer, hdata: "tcl_callback") * [[hdata_tcl_script]]<>: スクリプトのリスト ** プラグイン: tcl ** 変数: @@ -455,7 +344,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "tcl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "tcl_script") *** 'next_script' (pointer, hdata: "tcl_script") @@ -487,6 +375,7 @@ *** 'plugin' (pointer, hdata: "plugin") *** 'name' (string) *** 'build_callback' (pointer) +*** 'build_callback_pointer' (pointer) *** 'build_callback_data' (pointer) *** 'prev_item' (pointer, hdata: "bar_item") *** 'next_item' (pointer, hdata: "bar_item") @@ -540,6 +429,7 @@ *** 'clear' (integer) *** 'filter' (integer) *** 'close_callback' (pointer) +*** 'close_callback_pointer' (pointer) *** 'close_callback_data' (pointer) *** 'closing' (integer) *** 'title' (string) @@ -558,9 +448,11 @@ *** 'nicklist_nicks_count' (integer) *** 'nicklist_visible_count' (integer) *** 'nickcmp_callback' (pointer) +*** 'nickcmp_callback_pointer' (pointer) *** 'nickcmp_callback_data' (pointer) *** 'input' (integer) *** 'input_callback' (pointer) +*** 'input_callback_pointer' (pointer) *** 'input_callback_data' (pointer) *** 'input_get_unknown_commands' (integer) *** 'input_buffer' (string) @@ -644,6 +536,7 @@ *** 'filename' (string) *** 'file' (pointer) *** 'callback_reload' (pointer) +*** 'callback_reload_pointer' (pointer) *** 'callback_reload_data' (pointer) *** 'sections' (pointer, hdata: "config_section") *** 'last_section' (pointer, hdata: "config_section") @@ -668,10 +561,13 @@ *** 'value' (pointer) *** 'null_value_allowed' (integer) *** 'callback_check_value' (pointer) +*** 'callback_check_value_pointer' (pointer) *** 'callback_check_value_data' (pointer) *** 'callback_change' (pointer) +*** 'callback_change_pointer' (pointer) *** 'callback_change_data' (pointer) *** 'callback_delete' (pointer) +*** 'callback_delete_pointer' (pointer) *** 'callback_delete_data' (pointer) *** 'loaded' (integer) *** 'prev_option' (pointer, hdata: "config_option") @@ -684,14 +580,19 @@ *** 'user_can_add_options' (integer) *** 'user_can_delete_options' (integer) *** 'callback_read' (pointer) +*** 'callback_read_pointer' (pointer) *** 'callback_read_data' (pointer) *** 'callback_write' (pointer) +*** 'callback_write_pointer' (pointer) *** 'callback_write_data' (pointer) *** 'callback_write_default' (pointer) +*** 'callback_write_default_pointer' (pointer) *** 'callback_write_default_data' (pointer) *** 'callback_create_option' (pointer) +*** 'callback_create_option_pointer' (pointer) *** 'callback_create_option_data' (pointer) *** 'callback_delete_option' (pointer) +*** 'callback_delete_option_pointer' (pointer) *** 'callback_delete_option_data' (pointer) *** 'options' (pointer, hdata: "config_option") *** 'last_option' (pointer, hdata: "config_option") diff --git a/doc/ja/weechat_dev.ja.asciidoc b/doc/ja/weechat_dev.ja.asciidoc index f9aabc04e..adc203ecd 100644 --- a/doc/ja/weechat_dev.ja.asciidoc +++ b/doc/ja/weechat_dev.ja.asciidoc @@ -181,7 +181,6 @@ WeeChat "core" は以下のディレクトリに配置されています: | plugin-config.c | プラグイン設定オプション (plugins.conf ファイル) | plugin-script.c | スクリプトプラグインの共用関数 | plugin-script-api.c | スクリプト API 関数: 一部のプラグイン API 関数のラッパー -| plugin-script-callback.c | スクリプト用のコールバック管理 | weechat-plugin.h | WeeChat プラグインと一緒に配布されるヘッダファイル、プラグインのコンパイルに必要 | alias/ | alias プラグイン | alias.c | alias の主要関数 diff --git a/doc/pl/autogen/plugin_api/hdata.asciidoc b/doc/pl/autogen/plugin_api/hdata.asciidoc index c90a4311c..20487fb8e 100644 --- a/doc/pl/autogen/plugin_api/hdata.asciidoc +++ b/doc/pl/autogen/plugin_api/hdata.asciidoc @@ -2,21 +2,6 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[hdata_guile_callback]]<>: callback skryptu -** wtyczka: guile -** zmienne: -*** 'script' (pointer, hdata: "guile_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "guile_callback") -*** 'next_callback' (pointer, hdata: "guile_callback") * [[hdata_guile_script]]<>: lista skryptów ** wtyczka: guile ** zmienne: @@ -29,7 +14,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "guile_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "guile_script") *** 'next_script' (pointer, hdata: "guile_script") @@ -229,21 +213,6 @@ ** listy: *** 'irc_servers' *** 'last_irc_server' -* [[hdata_javascript_callback]]<>: callback skryptu -** wtyczka: javascript -** zmienne: -*** 'script' (pointer, hdata: "javascript_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "javascript_callback") -*** 'next_callback' (pointer, hdata: "javascript_callback") * [[hdata_javascript_script]]<>: lista skryptów ** wtyczka: javascript ** zmienne: @@ -256,28 +225,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "javascript_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "javascript_script") *** 'next_script' (pointer, hdata: "javascript_script") ** listy: *** 'last_script' *** 'scripts' -* [[hdata_lua_callback]]<>: callback skryptu -** wtyczka: lua -** zmienne: -*** 'script' (pointer, hdata: "lua_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "lua_callback") -*** 'next_callback' (pointer, hdata: "lua_callback") * [[hdata_lua_script]]<>: lista skryptów ** wtyczka: lua ** zmienne: @@ -290,28 +243,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "lua_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "lua_script") *** 'next_script' (pointer, hdata: "lua_script") ** listy: *** 'last_script' *** 'scripts' -* [[hdata_perl_callback]]<>: callback skryptu -** wtyczka: perl -** zmienne: -*** 'script' (pointer, hdata: "perl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "perl_callback") -*** 'next_callback' (pointer, hdata: "perl_callback") * [[hdata_perl_script]]<>: lista skryptów ** wtyczka: perl ** zmienne: @@ -324,28 +261,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "perl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "perl_script") *** 'next_script' (pointer, hdata: "perl_script") ** listy: *** 'last_script' *** 'scripts' -* [[hdata_python_callback]]<>: callback skryptu -** wtyczka: python -** zmienne: -*** 'script' (pointer, hdata: "python_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "python_callback") -*** 'next_callback' (pointer, hdata: "python_callback") * [[hdata_python_script]]<>: lista skryptów ** wtyczka: python ** zmienne: @@ -358,28 +279,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "python_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "python_script") *** 'next_script' (pointer, hdata: "python_script") ** listy: *** 'last_script' *** 'scripts' -* [[hdata_ruby_callback]]<>: callback skryptu -** wtyczka: ruby -** zmienne: -*** 'script' (pointer, hdata: "ruby_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "ruby_callback") -*** 'next_callback' (pointer, hdata: "ruby_callback") * [[hdata_ruby_script]]<>: lista skryptów ** wtyczka: ruby ** zmienne: @@ -392,7 +297,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "ruby_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "ruby_script") *** 'next_script' (pointer, hdata: "ruby_script") @@ -428,21 +332,6 @@ ** listy: *** 'last_script_repo' *** 'scripts_repo' -* [[hdata_tcl_callback]]<>: callback skryptu -** wtyczka: tcl -** zmienne: -*** 'script' (pointer, hdata: "tcl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "tcl_callback") -*** 'next_callback' (pointer, hdata: "tcl_callback") * [[hdata_tcl_script]]<>: lista skryptów ** wtyczka: tcl ** zmienne: @@ -455,7 +344,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "tcl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "tcl_script") *** 'next_script' (pointer, hdata: "tcl_script") @@ -487,6 +375,7 @@ *** 'plugin' (pointer, hdata: "plugin") *** 'name' (string) *** 'build_callback' (pointer) +*** 'build_callback_pointer' (pointer) *** 'build_callback_data' (pointer) *** 'prev_item' (pointer, hdata: "bar_item") *** 'next_item' (pointer, hdata: "bar_item") @@ -540,6 +429,7 @@ *** 'clear' (integer) *** 'filter' (integer) *** 'close_callback' (pointer) +*** 'close_callback_pointer' (pointer) *** 'close_callback_data' (pointer) *** 'closing' (integer) *** 'title' (string) @@ -558,9 +448,11 @@ *** 'nicklist_nicks_count' (integer) *** 'nicklist_visible_count' (integer) *** 'nickcmp_callback' (pointer) +*** 'nickcmp_callback_pointer' (pointer) *** 'nickcmp_callback_data' (pointer) *** 'input' (integer) *** 'input_callback' (pointer) +*** 'input_callback_pointer' (pointer) *** 'input_callback_data' (pointer) *** 'input_get_unknown_commands' (integer) *** 'input_buffer' (string) @@ -644,6 +536,7 @@ *** 'filename' (string) *** 'file' (pointer) *** 'callback_reload' (pointer) +*** 'callback_reload_pointer' (pointer) *** 'callback_reload_data' (pointer) *** 'sections' (pointer, hdata: "config_section") *** 'last_section' (pointer, hdata: "config_section") @@ -668,10 +561,13 @@ *** 'value' (pointer) *** 'null_value_allowed' (integer) *** 'callback_check_value' (pointer) +*** 'callback_check_value_pointer' (pointer) *** 'callback_check_value_data' (pointer) *** 'callback_change' (pointer) +*** 'callback_change_pointer' (pointer) *** 'callback_change_data' (pointer) *** 'callback_delete' (pointer) +*** 'callback_delete_pointer' (pointer) *** 'callback_delete_data' (pointer) *** 'loaded' (integer) *** 'prev_option' (pointer, hdata: "config_option") @@ -684,14 +580,19 @@ *** 'user_can_add_options' (integer) *** 'user_can_delete_options' (integer) *** 'callback_read' (pointer) +*** 'callback_read_pointer' (pointer) *** 'callback_read_data' (pointer) *** 'callback_write' (pointer) +*** 'callback_write_pointer' (pointer) *** 'callback_write_data' (pointer) *** 'callback_write_default' (pointer) +*** 'callback_write_default_pointer' (pointer) *** 'callback_write_default_data' (pointer) *** 'callback_create_option' (pointer) +*** 'callback_create_option_pointer' (pointer) *** 'callback_create_option_data' (pointer) *** 'callback_delete_option' (pointer) +*** 'callback_delete_option_pointer' (pointer) *** 'callback_delete_option_data' (pointer) *** 'options' (pointer, hdata: "config_option") *** 'last_option' (pointer, hdata: "config_option") diff --git a/po/POTFILES.in b/po/POTFILES.in index f524a6fc1..237b3c201 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -219,8 +219,6 @@ ./src/plugins/plugin-script-api.c ./src/plugins/plugin-script-api.h ./src/plugins/plugin-script.c -./src/plugins/plugin-script-callback.c -./src/plugins/plugin-script-callback.h ./src/plugins/plugin-script.h ./src/plugins/python/weechat-python-api.c ./src/plugins/python/weechat-python-api.h diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index f8e4f01d9..c11daa7cc 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -220,8 +220,6 @@ SET(WEECHAT_SOURCES ./src/plugins/plugin-script-api.c ./src/plugins/plugin-script-api.h ./src/plugins/plugin-script.c -./src/plugins/plugin-script-callback.c -./src/plugins/plugin-script-callback.h ./src/plugins/plugin-script.h ./src/plugins/python/weechat-python-api.c ./src/plugins/python/weechat-python-api.h diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 9d72741a3..ac6bd6ce6 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -180,6 +180,7 @@ COMMAND_CALLBACK(bar) struct t_gui_window *ptr_window; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -547,6 +548,7 @@ COMMAND_CALLBACK(buffer) int i, error_main_buffer, num_buffers, count, prev_number, clear_number; /* make C compiler happy */ + (void) pointer; (void) data; if ((argc == 1) @@ -1293,6 +1295,7 @@ COMMAND_CALLBACK(color) struct t_gui_color_palette *color_palette; /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -1484,6 +1487,7 @@ COMMAND_CALLBACK(command) struct t_gui_buffer *ptr_buffer; /* make C compiler happy */ + (void) pointer; (void) data; COMMAND_MIN_ARGS(3, ""); @@ -1548,6 +1552,7 @@ COMMAND_CALLBACK(cursor) int x, y; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -1636,6 +1641,7 @@ COMMAND_CALLBACK(debug) int debug; /* make C compiler happy */ + (void) pointer; (void) data; if ((argc == 1) @@ -1820,6 +1826,7 @@ COMMAND_CALLBACK(eval) struct t_hashtable *pointers, *options; /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -1996,6 +2003,7 @@ COMMAND_CALLBACK(filter) struct t_gui_filter *ptr_filter; /* make C compiler happy */ + (void) pointer; (void) data; if ((argc == 1) @@ -2466,6 +2474,7 @@ COMMAND_CALLBACK(help) char empty_string[1] = { '\0' }, str_format[64]; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -2856,6 +2865,7 @@ COMMAND_CALLBACK(history) int n, n_total, n_user, displayed; /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -2908,6 +2918,7 @@ COMMAND_CALLBACK(history) COMMAND_CALLBACK(input) { /* make C compiler happy */ + (void) pointer; (void) data; COMMAND_MIN_ARGS(2, ""); @@ -3280,6 +3291,7 @@ COMMAND_CALLBACK(key) int old_keys_count, keys_added, i, context, rc; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -3697,6 +3709,7 @@ COMMAND_CALLBACK(layout) int flag_buffers, flag_windows, layout_is_current; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -3884,9 +3897,10 @@ COMMAND_CALLBACK(layout) */ int -command_mouse_timer_cb (void *data, int remaining_calls) +command_mouse_timer_cb (const void *pointer, void *data, int remaining_calls) { /* make C compiler happy */ + (void) pointer; (void) data; (void) remaining_calls; @@ -3911,7 +3925,8 @@ command_mouse_timer (const char *delay) seconds = strtol (delay, &error, 10); if (error && !error[0] && (seconds > 0)) { - hook_timer (NULL, seconds * 1000, 0, 1, &command_mouse_timer_cb, NULL); + hook_timer (NULL, seconds * 1000, 0, 1, + &command_mouse_timer_cb, NULL, NULL); } } @@ -3922,6 +3937,7 @@ command_mouse_timer (const char *delay) COMMAND_CALLBACK(mouse) { /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -3984,6 +4000,7 @@ COMMAND_CALLBACK(mute) struct t_gui_buffer *mute_buffer, *ptr_buffer, *gui_chat_mute_buffer_old; /* make C compiler happy */ + (void) pointer; (void) data; if (argc < 2) @@ -4369,6 +4386,7 @@ COMMAND_CALLBACK(plugin) char **plugin_argv, *full_name; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -4481,6 +4499,7 @@ COMMAND_CALLBACK(print) long value; /* make C compiler happy */ + (void) pointer; (void) data; ptr_buffer = buffer; @@ -4711,6 +4730,7 @@ COMMAND_CALLBACK(proxy) struct t_proxy *ptr_proxy; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -4833,6 +4853,7 @@ COMMAND_CALLBACK(quit) char *pos_args; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -4884,7 +4905,9 @@ command_reload_file (struct t_config_file *config_file) if (config_file->callback_reload) rc = (int) (config_file->callback_reload) - (config_file->callback_reload_data, config_file); + (config_file->callback_reload_pointer, + config_file->callback_reload_data, + config_file); else rc = config_file_reload (config_file); @@ -4913,6 +4936,7 @@ COMMAND_CALLBACK(reload) int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -4951,13 +4975,16 @@ COMMAND_CALLBACK(reload) */ int -command_repeat_timer_cb (void *data, int remaining_calls) +command_repeat_timer_cb (const void *pointer, void *data, int remaining_calls) { char **repeat_args; int i; struct t_gui_buffer *ptr_buffer; - repeat_args = (char **)data; + /* make C compiler happy */ + (void) data; + + repeat_args = (char **)pointer; if (!repeat_args) return WEECHAT_RC_ERROR; @@ -4997,6 +5024,7 @@ COMMAND_CALLBACK(repeat) char *error, *command, **repeat_args; /* make C compiler happy */ + (void) pointer; (void) data; COMMAND_MIN_ARGS(3, ""); @@ -5060,7 +5088,7 @@ COMMAND_CALLBACK(repeat) repeat_args[0] = strdup (buffer->full_name); repeat_args[1] = command; hook_timer (NULL, interval, 0, count - 1, - &command_repeat_timer_cb, repeat_args); + &command_repeat_timer_cb, repeat_args, NULL); } } else @@ -5104,6 +5132,7 @@ COMMAND_CALLBACK(save) int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -5166,6 +5195,7 @@ COMMAND_CALLBACK(secure) int passphrase_was_set, count_encrypted; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -5587,6 +5617,7 @@ COMMAND_CALLBACK(set) struct t_weelist_item *item; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -5817,6 +5848,7 @@ COMMAND_CALLBACK(unset) int mask, length, number_reset, number_removed; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -5912,6 +5944,7 @@ COMMAND_CALLBACK(upgrade) int confirm_ok, index_args, rc, quit; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -6090,6 +6123,7 @@ COMMAND_CALLBACK(uptime) char string[512]; /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -6239,6 +6273,7 @@ COMMAND_CALLBACK(version) int send_to_buffer_as_input, translated_string; /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -6267,16 +6302,17 @@ COMMAND_CALLBACK(version) */ int -command_wait_timer_cb (void *data, int remaining_calls) +command_wait_timer_cb (const void *pointer, void *data, int remaining_calls) { char **timer_args; int i; struct t_gui_buffer *ptr_buffer; /* make C compiler happy */ + (void) data; (void) remaining_calls; - timer_args = (char **)data; + timer_args = (char **)pointer; if (!timer_args) return WEECHAT_RC_ERROR; @@ -6314,6 +6350,7 @@ COMMAND_CALLBACK(wait) char **timer_args; /* make C compiler happy */ + (void) pointer; (void) data; COMMAND_MIN_ARGS(3, ""); @@ -6372,7 +6409,7 @@ COMMAND_CALLBACK(wait) /* schedule command, execute it after "delay" milliseconds */ hook_timer (NULL, delay, 0, 1, - &command_wait_timer_cb, timer_args); + &command_wait_timer_cb, timer_args, NULL); return WEECHAT_RC_OK; } @@ -6389,6 +6426,7 @@ COMMAND_CALLBACK(window) int win_args; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -6761,7 +6799,7 @@ command_init () N_(" -all: set or remove away status on all connected servers\n" "message: message for away (if no message is given, away status is " "removed)"), - "-all", &command_away, NULL); + "-all", &command_away, NULL, NULL); hook_command ( NULL, "bar", N_("manage bars"), @@ -6833,7 +6871,7 @@ command_init () " || show %(bars_names)" " || toggle %(bars_names)" " || scroll %(bars_names) %(windows_numbers)|*", - &command_bar, NULL); + &command_bar, NULL, NULL); hook_command ( NULL, "buffer", N_("manage buffers"), @@ -6930,7 +6968,7 @@ command_init () " || get %(buffer_properties_get)" " || %(buffers_plugins_names)|%(buffers_names)|%(irc_channels)|" "%(irc_privates)|%(buffers_numbers)|-|-1|+|+1", - &command_buffer, NULL); + &command_buffer, NULL, NULL); hook_command ( NULL, "color", N_("define color aliases and display palette of colors"), @@ -6967,7 +7005,7 @@ command_init () " || term2rgb" " || rgb2term" " || -o", - &command_color, NULL); + &command_color, NULL, NULL); /* * give high priority (50000) so that an alias will not take precedence * over this command @@ -6985,7 +7023,7 @@ command_init () "-buffer %(buffers_plugins_names) " "%(plugins_names)|" PLUGIN_CORE " %(plugins_commands)" " || %(plugins_names)|" PLUGIN_CORE " %(plugins_commands)", - &command_command, NULL); + &command_command, NULL, NULL); hook_command ( NULL, "cursor", N_("free movement of cursor on screen to execute actions on specific " @@ -7023,7 +7061,7 @@ command_init () "go %(cursor_areas)" " || move up|down|left|right|area_up|area_down|area_left|area_right" " || stop", - &command_cursor, NULL); + &command_cursor, NULL, NULL); hook_command ( NULL, "debug", N_("control debug for core/plugins"), @@ -7069,7 +7107,7 @@ command_init () " || tags" " || term" " || windows", - &command_debug, NULL); + &command_debug, NULL, NULL); hook_command ( NULL, "eval", N_("evaluate expression"), @@ -7160,7 +7198,7 @@ command_init () " /eval -n -c abcd =~ (?-i)^abc ==> 1\n" " /eval -n -c abcd !~ abc ==> 0"), "-n|-s|-c -n|-s|-c", - &command_eval, NULL); + &command_eval, NULL, NULL); hook_command ( NULL, "filter", N_("filter messages in buffers, to hide/show them according to tags or " @@ -7243,7 +7281,7 @@ command_init () " || add %(filters_names) %(buffers_plugins_names)|*" " || rename %(filters_names) %(filters_names)" " || del %(filters_names)|-all", - &command_filter, NULL); + &command_filter, NULL, NULL); hook_command ( NULL, "help", N_("display help about commands and options"), @@ -7257,7 +7295,7 @@ command_init () "-list %(plugins_names)|" PLUGIN_CORE "|%*" " || -listfull %(plugins_names)|" PLUGIN_CORE "|%*" " || %(commands)|%(config_options)", - &command_help, NULL); + &command_help, NULL, NULL); hook_command ( NULL, "history", N_("show buffer command history"), @@ -7265,7 +7303,7 @@ command_init () N_("clear: clear history\n" "value: number of history entries to show"), "clear", - &command_history, NULL); + &command_history, NULL, NULL); /* * give high priority (50000) so that an alias will not take precedence * over this command @@ -7348,7 +7386,7 @@ command_init () "grab_mouse|grab_mouse_area|set_unread|set_unread_current_buffer|" "switch_active_buffer|switch_active_buffer_previous|" "zoom_merged_buffer|insert|send|paste_start|paste_stop", - &command_input, NULL); + &command_input, NULL, NULL); hook_command ( NULL, "key", N_("bind/unbind keys"), @@ -7426,7 +7464,7 @@ command_init () " || resetctxt %(keys_contexts) %(keys_codes_for_reset)" " || resetall %- %(keys_contexts)" " || missing %(keys_contexts)", - &command_key, NULL); + &command_key, NULL, NULL); hook_command ( NULL, "layout", N_("manage buffers/windows layouts"), @@ -7456,7 +7494,7 @@ command_init () " || leave" " || del %(layouts_names)|buffers|windows buffers|windows" " || rename %(layouts_names) %(layouts_names)", - &command_layout, NULL); + &command_layout, NULL, NULL); hook_command ( NULL, "mouse", N_("mouse control"), @@ -7475,7 +7513,7 @@ command_init () " toggle mouse for 5 seconds:\n" " /mouse toggle 5"), "enable|disable|toggle", - &command_mouse, NULL); + &command_mouse, NULL, NULL); hook_command ( NULL, "mute", N_("execute a command silently"), @@ -7501,7 +7539,7 @@ command_init () "-core|-current %(commands)|%*" " || -buffer %(buffers_plugins_names) %(commands)|%*" " || %(commands)|%*", - &command_mute, NULL); + &command_mute, NULL, NULL); hook_command ( NULL, "plugin", N_("list/load/unload plugins"), @@ -7528,7 +7566,7 @@ command_init () " || autoload" " || reload %(plugins_names)|* -a|-s" " || unload %(plugins_names)", - &command_plugin, NULL); + &command_plugin, NULL, NULL); hook_command ( NULL, "print", N_("display text on a buffer"), @@ -7582,7 +7620,7 @@ command_init () " || -stdout" " || -stderr" " || -beep", - &command_print, NULL); + &command_print, NULL, NULL); hook_command ( NULL, "proxy", N_("manage proxies"), @@ -7618,7 +7656,7 @@ command_init () " || add %(proxies_names) http|socks4|socks5" " || del %(proxies_names)" " || set %(proxies_names) %(proxies_options)", - &command_proxy, NULL); + &command_proxy, NULL, NULL); hook_command ( NULL, "quit", N_("quit WeeChat"), @@ -7634,7 +7672,7 @@ command_init () "layout can be saved (see option " "\"weechat.look.save_layout_on_exit\")."), "", - &command_quit, NULL); + &command_quit, NULL, NULL); hook_command ( NULL, "reload", N_("reload configuration files from disk"), @@ -7643,7 +7681,7 @@ command_init () "\n" "Without argument, all files (WeeChat and plugins) are reloaded."), "%(config_files)|%*", - &command_reload, NULL); + &command_reload, NULL, NULL); hook_command ( NULL, "repeat", N_("execute a command several times"), @@ -7659,7 +7697,7 @@ command_init () " scroll 2 pages up:\n" " /repeat 2 /window page_up"), "%- %(commands)", - &command_repeat, NULL); + &command_repeat, NULL, NULL); hook_command ( NULL, "save", N_("save configuration files to disk"), @@ -7671,7 +7709,7 @@ command_init () "By default all configuration files are saved to disk on /quit " "command (see option \"weechat.look.save_config_on_exit\")."), "%(config_files)|%*", - &command_save, NULL); + &command_save, NULL, NULL); hook_command ( NULL, "secure", N_("manage secured data (passwords or private data encrypted in file " @@ -7723,7 +7761,7 @@ command_init () " || decrypt -discard" " || set %(secured_data)" " || del %(secured_data)", - &command_secure, NULL); + &command_secure, NULL, NULL); hook_command ( NULL, "set", N_("set config options and environment variables"), @@ -7762,7 +7800,7 @@ command_init () "%(config_options) %(config_option_values)" " || diff %(config_options)|%*" " || env %(env_vars) %(env_value)", - &command_set, NULL); + &command_set, NULL, NULL); hook_command ( NULL, "unset", N_("unset/reset config options"), @@ -7782,7 +7820,7 @@ command_init () " /unset -mask weechat.color.*"), "%(config_options)" " || -mask %(config_options)", - &command_unset, NULL); + &command_unset, NULL, NULL); hook_command ( NULL, "upgrade", N_("upgrade WeeChat without disconnecting from servers"), @@ -7823,7 +7861,7 @@ command_init () "It is possible to restore WeeChat session on another machine if you " "copy the content of directory \"~/.weechat\"."), "%(filename)|-dummy|-quit", - &command_upgrade, NULL); + &command_upgrade, NULL, NULL); hook_command ( NULL, "uptime", N_("show WeeChat uptime"), @@ -7831,7 +7869,7 @@ command_init () N_(" -o: send uptime to current buffer as input (English string)\n" "-ol: send uptime to current buffer as input (translated string)"), "-o|-ol", - &command_uptime, NULL); + &command_uptime, NULL, NULL); hook_command ( NULL, "version", N_("show WeeChat version and compilation date"), @@ -7843,7 +7881,7 @@ command_init () "all buffers (otherwise the irc command /version is used on irc " "buffers)."), "-o|-ol", - &command_version, NULL); + &command_version, NULL, NULL); hook_command ( NULL, "wait", N_("schedule a command execution in future"), @@ -7870,7 +7908,7 @@ command_init () " say 'hello' in 2 minutes:\n" " /wait 2m hello"), "%- %(commands)", - &command_wait, NULL); + &command_wait, NULL, NULL); hook_command ( NULL, "window", N_("manage windows"), @@ -7976,7 +8014,7 @@ command_init () " || merge all|-window %(windows_numbers)" " || bare" " || %(windows_numbers)", - &command_window, NULL); + &command_window, NULL, NULL); } /* diff --git a/src/core/wee-command.h b/src/core/wee-command.h index 3c58aa7e4..365fe7a3f 100644 --- a/src/core/wee-command.h +++ b/src/core/wee-command.h @@ -23,7 +23,8 @@ #define COMMAND_CALLBACK(__command) \ int \ - command_##__command (void *data, struct t_gui_buffer *buffer, \ + command_##__command (const void *pointer, void *data, \ + struct t_gui_buffer *buffer, \ int argc, char **argv, char **argv_eol) /* @@ -34,9 +35,11 @@ */ #define COMMAND_EMPTY(__command) \ int \ - command_##__command (void *data, struct t_gui_buffer *buffer, \ + command_##__command (const void *pointer, void *data, \ + struct t_gui_buffer *buffer, \ int argc, char **argv, char **argv_eol) \ { \ + (void) pointer; \ (void) data; \ (void) buffer; \ (void) argc; \ @@ -80,8 +83,6 @@ struct t_gui_buffer; -extern int command_reload (void *data, struct t_gui_buffer *buffer, - int argc, char **argv, char **argv_eol); extern void command_init (); extern void command_startup (int plugins_loaded); extern void command_version_display (struct t_gui_buffer *buffer, diff --git a/src/core/wee-completion.c b/src/core/wee-completion.c index c99265983..a1faeeae8 100644 --- a/src/core/wee-completion.c +++ b/src/core/wee-completion.c @@ -64,7 +64,7 @@ extern char **environ; */ int -completion_list_add_bars_names_cb (void *data, +completion_list_add_bars_names_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -72,6 +72,7 @@ completion_list_add_bars_names_cb (void *data, struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -90,7 +91,7 @@ completion_list_add_bars_names_cb (void *data, */ int -completion_list_add_bars_options_cb (void *data, +completion_list_add_bars_options_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -98,6 +99,7 @@ completion_list_add_bars_options_cb (void *data, int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -116,7 +118,7 @@ completion_list_add_bars_options_cb (void *data, */ int -completion_list_add_buffers_names_cb (void *data, +completion_list_add_buffers_names_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -124,6 +126,7 @@ completion_list_add_buffers_names_cb (void *data, struct t_gui_buffer *ptr_buffer; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -143,7 +146,7 @@ completion_list_add_buffers_names_cb (void *data, */ int -completion_list_add_buffers_numbers_cb (void *data, +completion_list_add_buffers_numbers_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -152,6 +155,7 @@ completion_list_add_buffers_numbers_cb (void *data, char str_number[32]; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -172,7 +176,7 @@ completion_list_add_buffers_numbers_cb (void *data, */ int -completion_list_add_buffers_plugins_names_cb (void *data, +completion_list_add_buffers_plugins_names_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -180,6 +184,7 @@ completion_list_add_buffers_plugins_names_cb (void *data, struct t_gui_buffer *ptr_buffer; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -199,7 +204,7 @@ completion_list_add_buffers_plugins_names_cb (void *data, */ int -completion_list_add_buffer_properties_set_cb (void *data, +completion_list_add_buffer_properties_set_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -207,6 +212,7 @@ completion_list_add_buffer_properties_set_cb (void *data, int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -226,7 +232,7 @@ completion_list_add_buffer_properties_set_cb (void *data, */ int -completion_list_add_buffer_properties_get_cb (void *data, +completion_list_add_buffer_properties_get_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -234,6 +240,7 @@ completion_list_add_buffer_properties_get_cb (void *data, int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -265,7 +272,7 @@ completion_list_add_buffer_properties_get_cb (void *data, */ int -completion_list_add_windows_numbers_cb (void *data, +completion_list_add_windows_numbers_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -274,6 +281,7 @@ completion_list_add_windows_numbers_cb (void *data, char str_number[32]; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -293,7 +301,7 @@ completion_list_add_windows_numbers_cb (void *data, */ int -completion_list_add_colors_cb (void *data, +completion_list_add_colors_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -304,6 +312,7 @@ completion_list_add_colors_cb (void *data, struct t_gui_color_palette *color_palette; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -367,12 +376,13 @@ completion_list_map_add_palette_color_cb (void *data, */ int -completion_list_add_palette_colors_cb (void *data, +completion_list_add_palette_colors_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -389,7 +399,7 @@ completion_list_add_palette_colors_cb (void *data, */ int -completion_list_add_config_files_cb (void *data, +completion_list_add_config_files_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -397,6 +407,7 @@ completion_list_add_config_files_cb (void *data, struct t_config_file *ptr_config_file; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -416,7 +427,7 @@ completion_list_add_config_files_cb (void *data, */ int -completion_list_add_filename_cb (void *data, +completion_list_add_filename_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -430,6 +441,7 @@ completion_list_add_filename_cb (void *data, struct stat statbuf; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -549,7 +561,7 @@ end: */ int -completion_list_add_filters_cb (void *data, +completion_list_add_filters_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -557,6 +569,7 @@ completion_list_add_filters_cb (void *data, struct t_gui_filter *ptr_filter; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -576,7 +589,7 @@ completion_list_add_filters_cb (void *data, */ int -completion_list_add_commands_cb (void *data, +completion_list_add_commands_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -584,6 +597,7 @@ completion_list_add_commands_cb (void *data, struct t_hook *ptr_hook; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -607,7 +621,7 @@ completion_list_add_commands_cb (void *data, */ int -completion_list_add_infos_cb (void *data, +completion_list_add_infos_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -615,6 +629,7 @@ completion_list_add_infos_cb (void *data, struct t_hook *ptr_hook; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -638,7 +653,7 @@ completion_list_add_infos_cb (void *data, */ int -completion_list_add_infolists_cb (void *data, +completion_list_add_infolists_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -646,6 +661,7 @@ completion_list_add_infolists_cb (void *data, struct t_hook *ptr_hook; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -669,7 +685,7 @@ completion_list_add_infolists_cb (void *data, */ int -completion_list_add_nicks_cb (void *data, +completion_list_add_nicks_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -679,6 +695,7 @@ completion_list_add_nicks_cb (void *data, int count_before; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -719,7 +736,7 @@ completion_list_add_nicks_cb (void *data, */ int -completion_list_add_config_options_cb (void *data, +completion_list_add_config_options_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -731,6 +748,7 @@ completion_list_add_config_options_cb (void *data, char *option_full_name; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -770,7 +788,7 @@ completion_list_add_config_options_cb (void *data, */ int -completion_list_add_plugins_cb (void *data, +completion_list_add_plugins_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -778,6 +796,7 @@ completion_list_add_plugins_cb (void *data, struct t_weechat_plugin *ptr_plugin; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -797,7 +816,8 @@ completion_list_add_plugins_cb (void *data, */ void -completion_list_add_plugins_installed_exec_cb (void *data, const char *filename) +completion_list_add_plugins_installed_exec_cb (void *data, + const char *filename) { struct t_gui_completion *completion; const char *pos, *pos2; @@ -831,7 +851,7 @@ completion_list_add_plugins_installed_exec_cb (void *data, const char *filename) */ int -completion_list_add_plugins_installed_cb (void *data, +completion_list_add_plugins_installed_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -840,6 +860,7 @@ completion_list_add_plugins_installed_cb (void *data, int length; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -858,8 +879,8 @@ completion_list_add_plugins_installed_cb (void *data, plugin_path2 : ((plugin_path) ? plugin_path : CONFIG_STRING(config_plugin_path)), 0, - completion, - &completion_list_add_plugins_installed_exec_cb); + &completion_list_add_plugins_installed_exec_cb, + completion); if (plugin_path) free (plugin_path); if (plugin_path2) @@ -872,8 +893,9 @@ completion_list_add_plugins_installed_cb (void *data, if (dir_name) { snprintf (dir_name, length, "%s/plugins", WEECHAT_LIBDIR); - util_exec_on_files (dir_name, 0, completion, - &completion_list_add_plugins_installed_exec_cb); + util_exec_on_files (dir_name, 0, + &completion_list_add_plugins_installed_exec_cb, + completion); free (dir_name); } @@ -887,7 +909,7 @@ completion_list_add_plugins_installed_cb (void *data, */ int -completion_list_add_plugins_commands_cb (void *data, +completion_list_add_plugins_commands_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -898,6 +920,7 @@ completion_list_add_plugins_commands_cb (void *data, struct t_hook *ptr_hook; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -951,7 +974,7 @@ completion_list_add_plugins_commands_cb (void *data, */ int -completion_list_add_config_option_values_cb (void *data, +completion_list_add_config_option_values_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -965,7 +988,6 @@ completion_list_add_config_option_values_cb (void *data, struct t_config_option *option_found; /* make C compiler happy */ - (void) data; (void) completion_item; (void) buffer; @@ -1122,7 +1144,8 @@ completion_list_add_config_option_values_cb (void *data, break; case CONFIG_OPTION_TYPE_COLOR: completion_list_add_colors_cb ( - data, completion_item, buffer, completion); + pointer, data, completion_item, buffer, + completion); gui_completion_list_add (completion, "++1", 0, WEECHAT_LIST_POS_END); gui_completion_list_add (completion, "--1", @@ -1175,7 +1198,7 @@ completion_list_add_config_option_values_cb (void *data, */ int -completion_list_add_weechat_commands_cb (void *data, +completion_list_add_weechat_commands_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1183,6 +1206,7 @@ completion_list_add_weechat_commands_cb (void *data, struct t_hook *ptr_hook; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1209,7 +1233,7 @@ completion_list_add_weechat_commands_cb (void *data, */ int -completion_list_add_proxies_names_cb (void *data, +completion_list_add_proxies_names_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1217,6 +1241,7 @@ completion_list_add_proxies_names_cb (void *data, struct t_proxy *ptr_proxy; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1236,7 +1261,7 @@ completion_list_add_proxies_names_cb (void *data, */ int -completion_list_add_proxies_options_cb (void *data, +completion_list_add_proxies_options_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1244,6 +1269,7 @@ completion_list_add_proxies_options_cb (void *data, int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1262,7 +1288,7 @@ completion_list_add_proxies_options_cb (void *data, */ int -completion_list_add_keys_contexts_cb (void *data, +completion_list_add_keys_contexts_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1270,6 +1296,7 @@ completion_list_add_keys_contexts_cb (void *data, int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1288,7 +1315,7 @@ completion_list_add_keys_contexts_cb (void *data, */ int -completion_list_add_keys_codes_cb (void *data, +completion_list_add_keys_codes_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1298,6 +1325,7 @@ completion_list_add_keys_codes_cb (void *data, char *expanded_name; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1325,7 +1353,7 @@ completion_list_add_keys_codes_cb (void *data, */ int -completion_list_add_keys_codes_for_reset_cb (void *data, +completion_list_add_keys_codes_for_reset_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1335,6 +1363,7 @@ completion_list_add_keys_codes_for_reset_cb (void *data, char *expanded_name; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1385,7 +1414,7 @@ completion_list_add_keys_codes_for_reset_cb (void *data, */ int -completion_list_add_cursor_areas_cb (void *data, +completion_list_add_cursor_areas_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1394,6 +1423,7 @@ completion_list_add_cursor_areas_cb (void *data, struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1425,7 +1455,7 @@ completion_list_add_cursor_areas_cb (void *data, */ int -completion_list_add_layouts_names_cb (void *data, +completion_list_add_layouts_names_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1433,6 +1463,7 @@ completion_list_add_layouts_names_cb (void *data, struct t_gui_layout *ptr_layout; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1470,12 +1501,13 @@ completion_list_map_add_secured_data_cb (void *data, */ int -completion_list_add_secured_data_cb (void *data, +completion_list_add_secured_data_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1492,7 +1524,7 @@ completion_list_add_secured_data_cb (void *data, */ int -completion_list_add_env_vars_cb (void *data, +completion_list_add_env_vars_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1501,6 +1533,7 @@ completion_list_add_env_vars_cb (void *data, char *pos, *name; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1528,7 +1561,7 @@ completion_list_add_env_vars_cb (void *data, */ int -completion_list_add_env_value_cb (void *data, +completion_list_add_env_value_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -1537,6 +1570,7 @@ completion_list_add_env_value_cb (void *data, int argc, arg_index; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -1574,106 +1608,106 @@ completion_init () { hook_completion (NULL, "buffers_names", /* formerly "%b" */ N_("names of buffers"), - &completion_list_add_buffers_names_cb, NULL); + &completion_list_add_buffers_names_cb, NULL, NULL); hook_completion (NULL, "buffers_numbers", N_("numbers of buffers"), - &completion_list_add_buffers_numbers_cb, NULL); + &completion_list_add_buffers_numbers_cb, NULL, NULL); hook_completion (NULL, "buffers_plugins_names", /* formerly "%B" */ N_("names of buffers (including plugins names)"), - &completion_list_add_buffers_plugins_names_cb, NULL); + &completion_list_add_buffers_plugins_names_cb, NULL, NULL); hook_completion (NULL, "buffer_properties_set", N_("properties that can be set on a buffer"), - &completion_list_add_buffer_properties_set_cb, NULL); + &completion_list_add_buffer_properties_set_cb, NULL, NULL); hook_completion (NULL, "buffer_properties_get", N_("properties that can be read on a buffer"), - &completion_list_add_buffer_properties_get_cb, NULL); + &completion_list_add_buffer_properties_get_cb, NULL, NULL); hook_completion (NULL, "windows_numbers", N_("numbers of windows"), - &completion_list_add_windows_numbers_cb, NULL); + &completion_list_add_windows_numbers_cb, NULL, NULL); hook_completion (NULL, "colors", N_("color names"), - &completion_list_add_colors_cb, NULL); + &completion_list_add_colors_cb, NULL, NULL); hook_completion (NULL, "palette_colors", N_("palette colors"), - &completion_list_add_palette_colors_cb, NULL); + &completion_list_add_palette_colors_cb, NULL, NULL); hook_completion (NULL, "config_files", /* formerly "%c" */ N_("configuration files"), - &completion_list_add_config_files_cb, NULL); + &completion_list_add_config_files_cb, NULL, NULL); hook_completion (NULL, "filename", /* formerly "%f" */ N_("filename"), - &completion_list_add_filename_cb, NULL); + &completion_list_add_filename_cb, NULL, NULL); hook_completion (NULL, "filters_names", /* formerly "%F" */ N_("names of filters"), - &completion_list_add_filters_cb, NULL); + &completion_list_add_filters_cb, NULL, NULL); hook_completion (NULL, "commands", /* formerly "%h" */ N_("commands (weechat and plugins)"), - &completion_list_add_commands_cb, NULL); + &completion_list_add_commands_cb, NULL, NULL); hook_completion (NULL, "infos", /* formerly "%i" */ N_("names of infos hooked"), - &completion_list_add_infos_cb, NULL); + &completion_list_add_infos_cb, NULL, NULL); hook_completion (NULL, "infolists", /* formerly "%I" */ N_("names of infolists hooked"), - &completion_list_add_infolists_cb, NULL); + &completion_list_add_infolists_cb, NULL, NULL); hook_completion (NULL, "nicks", /* formerly "%n" */ N_("nicks in nicklist of current buffer"), - &completion_list_add_nicks_cb, NULL); + &completion_list_add_nicks_cb, NULL, NULL); hook_completion (NULL, "config_options", /* formerly "%o" */ N_("configuration options"), - &completion_list_add_config_options_cb, NULL); + &completion_list_add_config_options_cb, NULL, NULL); hook_completion (NULL, "plugins_names", /* formerly "%p" */ N_("names of plugins"), - &completion_list_add_plugins_cb, NULL); + &completion_list_add_plugins_cb, NULL, NULL); hook_completion (NULL, "plugins_installed", N_("names of plugins installed"), - &completion_list_add_plugins_installed_cb, NULL); + &completion_list_add_plugins_installed_cb, NULL, NULL); hook_completion (NULL, "plugins_commands", /* formerly "%P" */ N_("commands defined by plugins"), - &completion_list_add_plugins_commands_cb, NULL); + &completion_list_add_plugins_commands_cb, NULL, NULL); hook_completion (NULL, "bars_names", /* formerly "%r" */ N_("names of bars"), - &completion_list_add_bars_names_cb, NULL); + &completion_list_add_bars_names_cb, NULL, NULL); hook_completion (NULL, "config_option_values", /* formerly "%v" */ N_("values for a configuration option"), - &completion_list_add_config_option_values_cb, NULL); + &completion_list_add_config_option_values_cb, NULL, NULL); hook_completion (NULL, "weechat_commands", /* formerly "%w" */ N_("weechat commands"), - &completion_list_add_weechat_commands_cb, NULL); + &completion_list_add_weechat_commands_cb, NULL, NULL); hook_completion (NULL, "proxies_names", /* formerly "%y" */ N_("names of proxies"), - &completion_list_add_proxies_names_cb, NULL); + &completion_list_add_proxies_names_cb, NULL, NULL); hook_completion (NULL, "proxies_options", N_("options for proxies"), - &completion_list_add_proxies_options_cb, NULL); + &completion_list_add_proxies_options_cb, NULL, NULL); hook_completion (NULL, "bars_options", N_("options for bars"), - &completion_list_add_bars_options_cb, NULL); + &completion_list_add_bars_options_cb, NULL, NULL); hook_completion (NULL, "keys_contexts", /* TRANSLATORS: "key" means "key on the keyboard" */ N_("key contexts"), - &completion_list_add_keys_contexts_cb, NULL); + &completion_list_add_keys_contexts_cb, NULL, NULL); hook_completion (NULL, "keys_codes", /* TRANSLATORS: "key" means "key on the keyboard" */ N_("key codes"), - &completion_list_add_keys_codes_cb, NULL); + &completion_list_add_keys_codes_cb, NULL, NULL); hook_completion (NULL, "keys_codes_for_reset", /* TRANSLATORS: "key" means "key on the keyboard" */ N_("key codes that can be reset (keys added, redefined " "or removed)"), - &completion_list_add_keys_codes_for_reset_cb, NULL); + &completion_list_add_keys_codes_for_reset_cb, NULL, NULL); hook_completion (NULL, "cursor_areas", N_("areas (\"chat\" or bar name) for free cursor " "movement"), - &completion_list_add_cursor_areas_cb, NULL); + &completion_list_add_cursor_areas_cb, NULL, NULL); hook_completion (NULL, "layouts_names", N_("names of layouts"), - &completion_list_add_layouts_names_cb, NULL); + &completion_list_add_layouts_names_cb, NULL, NULL); hook_completion (NULL, "secured_data", N_("names of secured data (file sec.conf, section data)"), - &completion_list_add_secured_data_cb, NULL); + &completion_list_add_secured_data_cb, NULL, NULL); hook_completion (NULL, "env_vars", N_("environment variables"), - &completion_list_add_env_vars_cb, NULL); + &completion_list_add_env_vars_cb, NULL, NULL); hook_completion (NULL, "env_value", N_("value of an environment variable"), - &completion_list_add_env_value_cb, NULL); + &completion_list_add_env_value_cb, NULL, NULL); } diff --git a/src/core/wee-completion.h b/src/core/wee-completion.h index 2fc54b0c8..1763b341f 100644 --- a/src/core/wee-completion.h +++ b/src/core/wee-completion.h @@ -23,7 +23,8 @@ struct t_gui_buffer; struct t_gui_completion; -extern int completion_list_add_filename_cb (void *data, +extern int completion_list_add_filename_cb (const void *pointer, + void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion); diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 6b265e060..bcea8d2ac 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -160,8 +160,10 @@ config_file_config_insert (struct t_config_file *config_file) struct t_config_file * config_file_new (struct t_weechat_plugin *plugin, const char *name, - int (*callback_reload)(void *data, + int (*callback_reload)(const void *pointer, + void *data, struct t_config_file *config_file), + const void *callback_reload_pointer, void *callback_reload_data) { struct t_config_file *new_config_file; @@ -203,6 +205,7 @@ config_file_new (struct t_weechat_plugin *plugin, const char *name, } new_config_file->file = NULL; new_config_file->callback_reload = callback_reload; + new_config_file->callback_reload_pointer = callback_reload_pointer; new_config_file->callback_reload_data = callback_reload_data; new_config_file->sections = NULL; new_config_file->last_section = NULL; @@ -299,30 +302,40 @@ config_file_section_insert_in_config (struct t_config_section *section) struct t_config_section * config_file_new_section (struct t_config_file *config_file, const char *name, int user_can_add_options, int user_can_delete_options, - int (*callback_read)(void *data, + int (*callback_read)(const void *pointer, + void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value), + const void *callback_read_pointer, void *callback_read_data, - int (*callback_write)(void *data, + int (*callback_write)(const void *pointer, + void *data, struct t_config_file *config_file, const char *section_name), + const void *callback_write_pointer, void *callback_write_data, - int (*callback_write_default)(void *data, + int (*callback_write_default)(const void *pointer, + void *data, struct t_config_file *config_file, const char *section_name), + const void *callback_write_default_pointer, void *callback_write_default_data, - int (*callback_create_option)(void *data, + int (*callback_create_option)(const void *pointer, + void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value), + const void *callback_create_option_pointer, void *callback_create_option_data, - int (*callback_delete_option)(void *data, + int (*callback_delete_option)(const void *pointer, + void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option), + const void *callback_delete_option_pointer, void *callback_delete_option_data) { struct t_config_section *new_section; @@ -346,14 +359,19 @@ config_file_new_section (struct t_config_file *config_file, const char *name, new_section->user_can_add_options = user_can_add_options; new_section->user_can_delete_options = user_can_delete_options; new_section->callback_read = callback_read; + new_section->callback_read_pointer = callback_read_pointer; new_section->callback_read_data = callback_read_data; new_section->callback_write = callback_write; + new_section->callback_write_pointer = callback_write_pointer; new_section->callback_write_data = callback_write_data; new_section->callback_write_default = callback_write_default; + new_section->callback_write_default_pointer = callback_write_default_pointer; new_section->callback_write_default_data = callback_write_default_data; new_section->callback_create_option = callback_create_option; + new_section->callback_create_option_pointer = callback_create_option_pointer; new_section->callback_create_option_data = callback_create_option_data; new_section->callback_delete_option = callback_delete_option; + new_section->callback_delete_option_pointer = callback_delete_option_pointer; new_section->callback_delete_option_data = callback_delete_option_data; new_section->options = NULL; new_section->last_option = NULL; @@ -575,10 +593,13 @@ config_file_option_malloc () new_option->value = NULL; new_option->null_value_allowed = 0; new_option->callback_check_value = NULL; + new_option->callback_check_value_pointer = NULL; new_option->callback_check_value_data = NULL; new_option->callback_change = NULL; + new_option->callback_change_pointer = NULL; new_option->callback_change_data = NULL; new_option->callback_delete = NULL; + new_option->callback_delete_pointer = NULL; new_option->callback_delete_data = NULL; new_option->loaded = 0; new_option->prev_option = NULL; @@ -602,15 +623,21 @@ config_file_new_option (struct t_config_file *config_file, const char *default_value, const char *value, int null_value_allowed, - int (*callback_check_value)(void *data, + int (*callback_check_value)(const void *pointer, + void *data, struct t_config_option *option, const char *value), + const void *callback_check_value_pointer, void *callback_check_value_data, - void (*callback_change)(void *data, + void (*callback_change)(const void *pointer, + void *data, struct t_config_option *option), + const void *callback_change_pointer, void *callback_change_data, - void (*callback_delete)(void *data, + void (*callback_delete)(const void *pointer, + void *data, struct t_config_option *option), + const void *callback_delete_pointer, void *callback_delete_data) { struct t_config_option *new_option; @@ -833,10 +860,13 @@ config_file_new_option (struct t_config_file *config_file, } new_option->null_value_allowed = null_value_allowed; new_option->callback_check_value = callback_check_value; + new_option->callback_check_value_pointer = callback_check_value_pointer; new_option->callback_check_value_data = callback_check_value_data; new_option->callback_change = callback_change; + new_option->callback_change_pointer = callback_change_pointer; new_option->callback_change_data = callback_change_data; new_option->callback_delete = callback_delete; + new_option->callback_delete_pointer = callback_delete_pointer; new_option->callback_delete_data = callback_delete_data; new_option->loaded = 1; @@ -1216,7 +1246,10 @@ config_file_option_reset (struct t_config_option *option, int run_callback) if ((rc == WEECHAT_CONFIG_OPTION_SET_OK_CHANGED) && run_callback && option->callback_change) { - (void)(option->callback_change)(option->callback_change_data, option); + (void) (option->callback_change) ( + option->callback_change_pointer, + option->callback_change_data, + option); } /* run config hook(s) */ @@ -1253,11 +1286,14 @@ config_file_option_set (struct t_config_option *option, const char *value, if (option->callback_check_value) { - if (!(int)(option->callback_check_value) - (option->callback_check_value_data, - option, - value)) + if (!(int)(option->callback_check_value) ( + option->callback_check_value_pointer, + option->callback_check_value_data, + option, + value)) + { return WEECHAT_CONFIG_OPTION_SET_ERROR; + } } if (value) @@ -1529,7 +1565,10 @@ config_file_option_set (struct t_config_option *option, const char *value, if ((rc == WEECHAT_CONFIG_OPTION_SET_OK_CHANGED) && run_callback && option->callback_change) { - (void)(option->callback_change)(option->callback_change_data, option); + (void) (option->callback_change) ( + option->callback_change_pointer, + option->callback_change_data, + option); } /* run config hook(s) */ @@ -1580,7 +1619,10 @@ config_file_option_set_null (struct t_config_option *option, int run_callback) if ((rc == WEECHAT_CONFIG_OPTION_SET_OK_CHANGED) && run_callback && option->callback_change) { - (void)(option->callback_change)(option->callback_change_data, option); + (void) (option->callback_change) ( + option->callback_change_pointer, + option->callback_change_data, + option); } /* run config hook(s) */ @@ -1619,20 +1661,22 @@ config_file_option_unset (struct t_config_option *option) /* delete option */ if (option->callback_delete) { - (void)(option->callback_delete) - (option->callback_delete_data, - option); + (void) (option->callback_delete) ( + option->callback_delete_pointer, + option->callback_delete_data, + option); } option_full_name = config_file_option_full_name (option); if (option->section->callback_delete_option) { - rc = (int)(option->section->callback_delete_option) - (option->section->callback_delete_option_data, - option->config_file, - option->section, - option); + rc = (int) (option->section->callback_delete_option) ( + option->section->callback_delete_option_pointer, + option->section->callback_delete_option_data, + option->config_file, + option->section, + option); } else { @@ -2015,12 +2059,13 @@ config_file_option_set_with_string (const char *option_name, const char *value) if (ptr_section->user_can_add_options && ptr_section->callback_create_option) { - rc = (int)(ptr_section->callback_create_option) - (ptr_section->callback_create_option_data, - ptr_config, - ptr_section, - pos_option, - value); + rc = (int) (ptr_section->callback_create_option) ( + ptr_section->callback_create_option_pointer, + ptr_section->callback_create_option_data, + ptr_config, + ptr_section, + pos_option, + value); } } } @@ -2429,16 +2474,20 @@ config_file_write_internal (struct t_config_file *config_file, /* call write callback if defined for section */ if (default_options && ptr_section->callback_write_default) { - if ((ptr_section->callback_write_default) (ptr_section->callback_write_default_data, - config_file, - ptr_section->name) != WEECHAT_CONFIG_WRITE_OK) + if ((ptr_section->callback_write_default) ( + ptr_section->callback_write_default_pointer, + ptr_section->callback_write_default_data, + config_file, + ptr_section->name) != WEECHAT_CONFIG_WRITE_OK) goto error; } else if (!default_options && ptr_section->callback_write) { - if ((ptr_section->callback_write) (ptr_section->callback_write_data, - config_file, - ptr_section->name) != WEECHAT_CONFIG_WRITE_OK) + if ((ptr_section->callback_write) ( + ptr_section->callback_write_pointer, + ptr_section->callback_write_data, + config_file, + ptr_section->name) != WEECHAT_CONFIG_WRITE_OK) goto error; } else @@ -2688,7 +2737,8 @@ config_file_read_internal (struct t_config_file *config_file, int reload) { ptr_option = NULL; rc = (ptr_section->callback_read) - (ptr_section->callback_read_data, + (ptr_section->callback_read_pointer, + ptr_section->callback_read_data, config_file, ptr_section, ptr_option_name, @@ -2713,12 +2763,13 @@ config_file_read_internal (struct t_config_file *config_file, int reload) if (ptr_section && ptr_section->callback_create_option) { - rc = (int)(ptr_section->callback_create_option) - (ptr_section->callback_create_option_data, - config_file, - ptr_section, - ptr_option_name, - (undefined_value) ? NULL : pos); + rc = (int) (ptr_section->callback_create_option) ( + ptr_section->callback_create_option_pointer, + ptr_section->callback_create_option_data, + config_file, + ptr_section, + ptr_option_name, + (undefined_value) ? NULL : pos); } } } @@ -2859,6 +2910,12 @@ config_file_option_free_data (struct t_config_option *option) free (option->default_value); if (option->value) free (option->value); + if (option->callback_check_value_data) + free (option->callback_check_value_data); + if (option->callback_change_data) + free (option->callback_change_data); + if (option->callback_delete_data) + free (option->callback_delete_data); } /* @@ -2934,6 +2991,16 @@ config_file_section_free (struct t_config_section *section) config_file_section_free_options (section); if (section->name) free (section->name); + if (section->callback_read_data) + free (section->callback_read_data); + if (section->callback_write_data) + free (section->callback_write_data); + if (section->callback_write_default_data) + free (section->callback_write_default_data); + if (section->callback_create_option_data) + free (section->callback_create_option_data); + if (section->callback_delete_option_data) + free (section->callback_delete_option_data); /* remove section from list */ if (ptr_config->last_section == section) @@ -2990,6 +3057,10 @@ config_file_free (struct t_config_file *config_file) if (config_file->next_config) (config_file->next_config)->prev_config = config_file->prev_config; + /* free data */ + if (config_file->callback_reload_data) + free (config_file->callback_reload_data); + free (config_file); config_files = new_config_files; @@ -3034,11 +3105,13 @@ config_file_free_all_plugin (struct t_weechat_plugin *plugin) */ struct t_hdata * -config_file_hdata_config_file_cb (void *data, const char *hdata_name) +config_file_hdata_config_file_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_config", "next_config", @@ -3050,6 +3123,7 @@ config_file_hdata_config_file_cb (void *data, const char *hdata_name) HDATA_VAR(struct t_config_file, filename, STRING, 0, NULL, NULL); HDATA_VAR(struct t_config_file, file, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_file, callback_reload, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_file, callback_reload_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_file, callback_reload_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_file, sections, POINTER, 0, NULL, "config_section"); HDATA_VAR(struct t_config_file, last_section, POINTER, 0, NULL, "config_section"); @@ -3066,11 +3140,13 @@ config_file_hdata_config_file_cb (void *data, const char *hdata_name) */ struct t_hdata * -config_file_hdata_config_section_cb (void *data, const char *hdata_name) +config_file_hdata_config_section_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_section", "next_section", @@ -3082,14 +3158,19 @@ config_file_hdata_config_section_cb (void *data, const char *hdata_name) HDATA_VAR(struct t_config_section, user_can_add_options, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, user_can_delete_options, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_read, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_section, callback_read_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_read_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_write, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_section, callback_write_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_write_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_write_default, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_section, callback_write_default_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_write_default_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_create_option, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_section, callback_create_option_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_create_option_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_delete_option, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_section, callback_delete_option_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, callback_delete_option_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_section, options, POINTER, 0, NULL, "config_option"); HDATA_VAR(struct t_config_section, last_option, POINTER, 0, NULL, "config_option"); @@ -3104,11 +3185,13 @@ config_file_hdata_config_section_cb (void *data, const char *hdata_name) */ struct t_hdata * -config_file_hdata_config_option_cb (void *data, const char *hdata_name) +config_file_hdata_config_option_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_option", "next_option", @@ -3128,10 +3211,13 @@ config_file_hdata_config_option_cb (void *data, const char *hdata_name) HDATA_VAR(struct t_config_option, value, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, null_value_allowed, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, callback_check_value, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_option, callback_check_value_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, callback_check_value_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, callback_change, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_option, callback_change_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, callback_change_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, callback_delete, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_config_option, callback_delete_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, callback_delete_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, loaded, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_config_option, prev_option, POINTER, 0, NULL, hdata_name); @@ -3350,6 +3436,7 @@ config_file_print_log () log_printf (" filename . . . . . . . : '%s'", ptr_config_file->filename); log_printf (" file . . . . . . . . . : 0x%lx", ptr_config_file->file); log_printf (" callback_reload. . . . : 0x%lx", ptr_config_file->callback_reload); + log_printf (" callback_reload_pointer: 0x%lx", ptr_config_file->callback_reload_pointer); log_printf (" callback_reload_data . : 0x%lx", ptr_config_file->callback_reload_data); log_printf (" sections . . . . . . . : 0x%lx", ptr_config_file->sections); log_printf (" last_section . . . . . : 0x%lx", ptr_config_file->last_section); @@ -3361,45 +3448,50 @@ config_file_print_log () { log_printf (""); log_printf (" [section (addr:0x%lx)]", ptr_section); - log_printf (" config_file. . . . . . . . : 0x%lx", ptr_section->config_file); - log_printf (" name . . . . . . . . . . . : '%s'", ptr_section->name); - log_printf (" callback_read. . . . . . . : 0x%lx", ptr_section->callback_read); - log_printf (" callback_read_data . . . . : 0x%lx", ptr_section->callback_read_data); - log_printf (" callback_write . . . . . . : 0x%lx", ptr_section->callback_write); - log_printf (" callback_write_data. . . . : 0x%lx", ptr_section->callback_write_data); - log_printf (" callback_write_default . . : 0x%lx", ptr_section->callback_write_default); - log_printf (" callback_write_default_data: 0x%lx", ptr_section->callback_write_default_data); - log_printf (" callback_create_option. . .: 0x%lx", ptr_section->callback_create_option); - log_printf (" callback_create_option_data: 0x%lx", ptr_section->callback_create_option_data); - log_printf (" callback_delete_option. . .: 0x%lx", ptr_section->callback_delete_option); - log_printf (" callback_delete_option_data: 0x%lx", ptr_section->callback_delete_option_data); - log_printf (" options. . . . . . . . . . : 0x%lx", ptr_section->options); - log_printf (" last_option. . . . . . . . : 0x%lx", ptr_section->last_option); - log_printf (" prev_section . . . . . . . : 0x%lx", ptr_section->prev_section); - log_printf (" next_section . . . . . . . : 0x%lx", ptr_section->next_section); + log_printf (" config_file . . . . . . . . . : 0x%lx", ptr_section->config_file); + log_printf (" name. . . . . . . . . . . . . : '%s'", ptr_section->name); + log_printf (" callback_read . . . . . . . . : 0x%lx", ptr_section->callback_read); + log_printf (" callback_read_pointer . . . . : 0x%lx", ptr_section->callback_read_pointer); + log_printf (" callback_read_data. . . . . . : 0x%lx", ptr_section->callback_read_data); + log_printf (" callback_write. . . . . . . . : 0x%lx", ptr_section->callback_write); + log_printf (" callback_write_pointer. . . . : 0x%lx", ptr_section->callback_write_pointer); + log_printf (" callback_write_data . . . . . : 0x%lx", ptr_section->callback_write_data); + log_printf (" callback_write_default. . . . : 0x%lx", ptr_section->callback_write_default); + log_printf (" callback_write_default_pointer: 0x%lx", ptr_section->callback_write_default_pointer); + log_printf (" callback_write_default_data . : 0x%lx", ptr_section->callback_write_default_data); + log_printf (" callback_create_option. . . . : 0x%lx", ptr_section->callback_create_option); + log_printf (" callback_create_option_pointer: 0x%lx", ptr_section->callback_create_option_pointer); + log_printf (" callback_create_option_data . : 0x%lx", ptr_section->callback_create_option_data); + log_printf (" callback_delete_option. . . . : 0x%lx", ptr_section->callback_delete_option); + log_printf (" callback_delete_option_pointer: 0x%lx", ptr_section->callback_delete_option_pointer); + log_printf (" callback_delete_option_data . : 0x%lx", ptr_section->callback_delete_option_data); + log_printf (" options . . . . . . . . . . . : 0x%lx", ptr_section->options); + log_printf (" last_option . . . . . . . . . : 0x%lx", ptr_section->last_option); + log_printf (" prev_section. . . . . . . . . : 0x%lx", ptr_section->prev_section); + log_printf (" next_section. . . . . . . . . : 0x%lx", ptr_section->next_section); for (ptr_option = ptr_section->options; ptr_option; ptr_option = ptr_option->next_option) { log_printf (""); log_printf (" [option (addr:0x%lx)]", ptr_option); - log_printf (" config_file. . . . . : 0x%lx", ptr_option->config_file); - log_printf (" section. . . . . . . : 0x%lx", ptr_option->section); - log_printf (" name . . . . . . . . : '%s'", ptr_option->name); - log_printf (" parent_name. . . . . : '%s'", ptr_option->parent_name); - log_printf (" type . . . . . . . . : %d", ptr_option->type); - log_printf (" description. . . . . : '%s'", ptr_option->description); - log_printf (" string_values. . . . : 0x%lx", ptr_option->string_values); - log_printf (" min. . . . . . . . . : %d", ptr_option->min); - log_printf (" max. . . . . . . . . : %d", ptr_option->max); + log_printf (" config_file. . . . . . . . . : 0x%lx", ptr_option->config_file); + log_printf (" section. . . . . . . . . . . : 0x%lx", ptr_option->section); + log_printf (" name . . . . . . . . . . . . : '%s'", ptr_option->name); + log_printf (" parent_name. . . . . . . . . : '%s'", ptr_option->parent_name); + log_printf (" type . . . . . . . . . . . . : %d", ptr_option->type); + log_printf (" description. . . . . . . . . : '%s'", ptr_option->description); + log_printf (" string_values. . . . . . . . : 0x%lx", ptr_option->string_values); + log_printf (" min. . . . . . . . . . . . . : %d", ptr_option->min); + log_printf (" max. . . . . . . . . . . . . : %d", ptr_option->max); switch (ptr_option->type) { case CONFIG_OPTION_TYPE_BOOLEAN: - log_printf (" default value. . . . : %s", + log_printf (" default value. . . . . . . . : %s", (ptr_option->default_value) ? ((CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ? "on" : "off") : "null"); - log_printf (" value (boolean). . . : %s", + log_printf (" value (boolean). . . . . . . : %s", (ptr_option->value) ? ((CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE) ? "on" : "off") : "null"); @@ -3407,61 +3499,69 @@ config_file_print_log () case CONFIG_OPTION_TYPE_INTEGER: if (ptr_option->string_values) { - log_printf (" default value. . . . : '%s'", + log_printf (" default value. . . . . . . . : '%s'", (ptr_option->default_value) ? ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)] : "null"); - log_printf (" value (integer/str). : '%s'", + log_printf (" value (integer/str). . . . . : '%s'", (ptr_option->value) ? ptr_option->string_values[CONFIG_INTEGER(ptr_option)] : "null"); } else { if (ptr_option->default_value) - log_printf (" default value. . . . : %d", + log_printf (" default value. . . . . . . . : %d", CONFIG_INTEGER_DEFAULT(ptr_option)); else - log_printf (" default value. . . . : null"); + log_printf (" default value. . . . . . . . : null"); if (ptr_option->value) - log_printf (" value (integer). . . : %d", + log_printf (" value (integer). . . . . . . : %d", CONFIG_INTEGER(ptr_option)); else - log_printf (" value (integer). . . : null"); + log_printf (" value (integer). . . . . . . : null"); } break; case CONFIG_OPTION_TYPE_STRING: if (ptr_option->default_value) - log_printf (" default value. . . . : '%s'", + log_printf (" default value. . . . . . . . : '%s'", CONFIG_STRING_DEFAULT(ptr_option)); else - log_printf (" default value. . . . : null"); + log_printf (" default value. . . . . . . . : null"); if (ptr_option->value) - log_printf (" value (string) . . . : '%s'", + log_printf (" value (string) . . . . . . . : '%s'", CONFIG_STRING(ptr_option)); else - log_printf (" value (string) . . . : null"); + log_printf (" value (string) . . . . . . . : null"); break; case CONFIG_OPTION_TYPE_COLOR: if (ptr_option->default_value) - log_printf (" default value. . . . : %d ('%s')", + log_printf (" default value. . . . . . . . : %d ('%s')", CONFIG_COLOR_DEFAULT(ptr_option), gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option))); else - log_printf (" default value. . . . : null"); + log_printf (" default value. . . . . . . . : null"); if (ptr_option->value) - log_printf (" value (color). . . . : %d ('%s')", + log_printf (" value (color). . . . . . . . : %d ('%s')", CONFIG_COLOR(ptr_option), gui_color_get_name (CONFIG_COLOR(ptr_option))); else - log_printf (" value (color). . . . : null"); + log_printf (" value (color). . . . . . . . : null"); break; case CONFIG_NUM_OPTION_TYPES: break; } - log_printf (" null_value_allowed . : %d", ptr_option->null_value_allowed); - log_printf (" callback_change. . . : 0x%lx", ptr_option->callback_change); - log_printf (" loaded . . . . . . . : %d", ptr_option->loaded); - log_printf (" prev_option. . . . . : 0x%lx", ptr_option->prev_option); - log_printf (" next_option. . . . . : 0x%lx", ptr_option->next_option); + log_printf (" null_value_allowed . . . . . : %d", ptr_option->null_value_allowed); + log_printf (" callback_check_value . . . . : 0x%lx", ptr_option->callback_check_value); + log_printf (" callback_check_value_pointer : 0x%lx", ptr_option->callback_check_value_pointer); + log_printf (" callback_check_value_data. . : 0x%lx", ptr_option->callback_check_value_data); + log_printf (" callback_change. . . . . . . : 0x%lx", ptr_option->callback_change); + log_printf (" callback_change_pointer. . . : 0x%lx", ptr_option->callback_change_pointer); + log_printf (" callback_change_data . . . . : 0x%lx", ptr_option->callback_change_data); + log_printf (" callback_delete. . . . . . . : 0x%lx", ptr_option->callback_delete); + log_printf (" callback_delete_pointer. . . : 0x%lx", ptr_option->callback_delete_pointer); + log_printf (" callback_delete_data . . . . : 0x%lx", ptr_option->callback_delete_data); + log_printf (" loaded . . . . . . . . . . . : %d", ptr_option->loaded); + log_printf (" prev_option. . . . . . . . . : 0x%lx", ptr_option->prev_option); + log_printf (" next_option. . . . . . . . . : 0x%lx", ptr_option->next_option); } } } diff --git a/src/core/wee-config-file.h b/src/core/wee-config-file.h index 2d637743e..2b662443f 100644 --- a/src/core/wee-config-file.h +++ b/src/core/wee-config-file.h @@ -49,8 +49,10 @@ struct t_config_file /* (example: "weechat.conf") */ FILE *file; /* file pointer */ int (*callback_reload) /* callback for reloading file */ - (void *data, + (const void *pointer, + void *data, struct t_config_file *config_file); + const void *callback_reload_pointer; /* pointer sent to callback */ void *callback_reload_data; /* data sent to callback */ struct t_config_section *sections; /* config sections */ struct t_config_section *last_section; /* last config section */ @@ -65,34 +67,44 @@ struct t_config_section int user_can_add_options; /* user can add with /set ? */ int user_can_delete_options; /* user can del with /unset ? */ int (*callback_read) /* called to read a line from */ - (void *data, /* config file (only for some */ - struct t_config_file *config_file, /* special sections) */ + (const void *pointer, /* config file (only for some */ + void *data, /* special sections) */ + struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value); + const void *callback_read_pointer; /* pointer sent to read callback */ void *callback_read_data; /* data sent to read callback */ int (*callback_write) /* called to write options */ - (void *data, /* in config file (only for some */ - struct t_config_file *config_file, /* special sections) */ - const char *section_name); - void *callback_write_data; /* data sent to write callback */ - int (*callback_write_default) /* called to write default */ - (void *data, /* options in config file */ + (const void *pointer, /* in config file (only for some */ + void *data, /* special sections) */ struct t_config_file *config_file, const char *section_name); + const void *callback_write_pointer; /* pointer sent to write cb */ + void *callback_write_data; /* data sent to write callback */ + int (*callback_write_default) /* called to write default */ + (const void *pointer, /* options in config file */ + void *data, + struct t_config_file *config_file, + const char *section_name); + const void *callback_write_default_pointer; /* ptr sent to write def.cb */ void *callback_write_default_data; /* data sent to write def. callb.*/ int (*callback_create_option) /* called to create option in */ - (void *data, /* section */ + (const void *pointer, /* section */ + void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value); + const void *callback_create_option_pointer; /* ptr sent to create cb */ void *callback_create_option_data; /* data sent to create callback */ int (*callback_delete_option) /* called to delete option in */ - (void *data, /* section */ + (const void *pointer, /* section */ + void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option); + const void *callback_delete_option_pointer; /* ptr sent to delete cb */ void *callback_delete_option_data; /* data sent to delete callback */ struct t_config_option *options; /* options in section */ struct t_config_option *last_option; /* last option in section */ @@ -125,17 +137,23 @@ struct t_config_option void *value; /* value */ int null_value_allowed; /* null value allowed ? */ int (*callback_check_value) /* called to check value before */ - (void *data, /* assigning new value */ + (const void *pointer, /* assigning new value */ + void *data, struct t_config_option *option, const char *value); + const void *callback_check_value_pointer; /* pointer sent to check cb */ void *callback_check_value_data; /* data sent to check callback */ void (*callback_change) /* called when value is changed */ - (void *data, + (const void *pointer, + void *data, struct t_config_option *option); + const void *callback_change_pointer; /* pointer sent to change cb */ void *callback_change_data; /* data sent to change callback */ void (*callback_delete) /* called when option is deleted */ - (void *data, + (const void *pointer, + void *data, struct t_config_option *option); + const void *callback_delete_pointer; /* pointer sent to delete cb */ void *callback_delete_data; /* data sent to delete callback */ int loaded; /* 1 if opt was found in config */ struct t_config_option *prev_option; /* link to previous option */ @@ -148,37 +166,49 @@ extern struct t_config_file *last_config_file; extern struct t_config_file *config_file_search (const char *name); extern struct t_config_file *config_file_new (struct t_weechat_plugin *plugin, const char *name, - int (*callback_reload)(void *data, + int (*callback_reload)(const void *pointer, + void *data, struct t_config_file *config_file), - void *callback_data); + const void *callback_reload_pointer, + void *callback_reload_data); extern struct t_config_section *config_file_new_section (struct t_config_file *config_file, const char *name, int user_can_add_options, int user_can_delete_options, - int (*callback_read)(void *data, + int (*callback_read)(const void *pointer, + void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value), + const void *callback_read_pointer, void *callback_read_data, - int (*callback_write)(void *data, + int (*callback_write)(const void *pointer, + void *data, struct t_config_file *config_file, const char *section_name), + const void *callback_write_pointer, void *callback_write_data, - int (*callback_write_default)(void *data, + int (*callback_write_default)(const void *pointer, + void *data, struct t_config_file *config_file, const char *section_name), + const void *callback_write_default_pointer, void *callback_write_default_data, - int (*callback_create_option)(void *data, + int (*callback_create_option)(const void *pointer, + void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value), + const void *callback_create_option_pointer, void *callback_create_option_data, - int (*callback_delete_option)(void *data, + int (*callback_delete_option)(const void *pointer, + void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option), + const void *callback_delete_option_pointer, void *callback_delete_option_data); extern struct t_config_section *config_file_search_section (struct t_config_file *config_file, const char *section_name); @@ -191,15 +221,21 @@ extern struct t_config_option *config_file_new_option (struct t_config_file *con const char *default_value, const char *value, int null_value_allowed, - int (*callback_check_value)(void *data, + int (*callback_check_value)(const void *pointer, + void *data, struct t_config_option *option, const char *value), + const void *callback_check_value_pointer, void *callback_check_value_data, - void (*callback_change)(void *data, + void (*callback_change)(const void *pointer, + void *data, struct t_config_option *option), + const void *callback_change_pointer, void *callback_change_data, - void (*callback_delete)(void *data, + void (*callback_delete)(const void *pointer, + void *data, struct t_config_option *option), + const void *callback_delete_pointer, void *callback_delete_data); extern struct t_config_option *config_file_search_option (struct t_config_file *config_file, struct t_config_section *section, @@ -255,11 +291,14 @@ extern void config_file_section_free (struct t_config_section *section); extern void config_file_free (struct t_config_file *config_file); extern void config_file_free_all (); extern void config_file_free_all_plugin (struct t_weechat_plugin *plugin); -extern struct t_hdata *config_file_hdata_config_file_cb (void *data, +extern struct t_hdata *config_file_hdata_config_file_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *config_file_hdata_config_section_cb (void *data, +extern struct t_hdata *config_file_hdata_config_section_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *config_file_hdata_config_option_cb (void *data, +extern struct t_hdata *config_file_hdata_config_option_cb (const void *pointer, + void *data, const char *hdata_name); extern int config_file_add_to_infolist (struct t_infolist *infolist, const char *option_name); diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 7868d2c2f..798bfea7a 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -314,9 +314,11 @@ int config_word_chars_input_count = 0; */ void -config_change_sys_rlimit (void *data, struct t_config_option *option) +config_change_sys_rlimit (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -346,9 +348,11 @@ config_change_save_config_layout_on_exit () */ void -config_change_save_config_on_exit (void *data, struct t_config_option *option) +config_change_save_config_on_exit (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -368,9 +372,11 @@ config_change_save_config_on_exit (void *data, struct t_config_option *option) */ void -config_change_save_layout_on_exit (void *data, struct t_config_option *option) +config_change_save_layout_on_exit (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -382,9 +388,11 @@ config_change_save_layout_on_exit (void *data, struct t_config_option *option) */ void -config_change_window_title (void *data, struct t_config_option *option) +config_change_window_title (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -494,9 +502,11 @@ config_set_word_chars (const char *str_word_chars, */ void -config_change_word_chars_highlight (void *data, struct t_config_option *option) +config_change_word_chars_highlight (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -510,9 +520,11 @@ config_change_word_chars_highlight (void *data, struct t_config_option *option) */ void -config_change_word_chars_input (void *data, struct t_config_option *option) +config_change_word_chars_input (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -526,9 +538,11 @@ config_change_word_chars_input (void *data, struct t_config_option *option) */ void -config_change_buffers (void *data, struct t_config_option *option) +config_change_buffers (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -540,9 +554,11 @@ config_change_buffers (void *data, struct t_config_option *option) */ void -config_change_buffer_content (void *data, struct t_config_option *option) +config_change_buffer_content (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -555,9 +571,11 @@ config_change_buffer_content (void *data, struct t_config_option *option) */ void -config_change_mouse (void *data, struct t_config_option *option) +config_change_mouse (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -575,9 +593,11 @@ config_change_mouse (void *data, struct t_config_option *option) */ void -config_change_buffer_auto_renumber (void *data, struct t_config_option *option) +config_change_buffer_auto_renumber (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -590,9 +610,11 @@ config_change_buffer_auto_renumber (void *data, struct t_config_option *option) */ void -config_change_buffer_notify_default (void *data, struct t_config_option *option) +config_change_buffer_notify_default (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -604,9 +626,11 @@ config_change_buffer_notify_default (void *data, struct t_config_option *option) */ void -config_change_buffer_time_format (void *data, struct t_config_option *option) +config_change_buffer_time_format (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -641,9 +665,11 @@ config_compute_prefix_max_length_all_buffers () */ void -config_change_nick_prefix_suffix (void *data, struct t_config_option *option) +config_change_nick_prefix_suffix (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -660,9 +686,11 @@ config_change_nick_prefix_suffix (void *data, struct t_config_option *option) */ void -config_change_prefix_same_nick (void *data, struct t_config_option *option) +config_change_prefix_same_nick (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -678,9 +706,11 @@ config_change_prefix_same_nick (void *data, struct t_config_option *option) */ void -config_change_eat_newline_glitch (void *data, struct t_config_option *option) +config_change_eat_newline_glitch (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -704,12 +734,14 @@ config_change_eat_newline_glitch (void *data, struct t_config_option *option) */ void -config_change_emphasized_attributes (void *data, struct t_config_option *option) +config_change_emphasized_attributes (const void *pointer, void *data, + struct t_config_option *option) { int i; const char *ptr_attr; /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -732,9 +764,11 @@ config_change_emphasized_attributes (void *data, struct t_config_option *option) */ void -config_change_highlight_regex (void *data, struct t_config_option *option) +config_change_highlight_regex (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -767,12 +801,14 @@ config_change_highlight_regex (void *data, struct t_config_option *option) */ void -config_change_highlight_tags (void *data, struct t_config_option *option) +config_change_highlight_tags (const void *pointer, void *data, + struct t_config_option *option) { int i; char **tags_array; /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -814,9 +850,11 @@ config_change_highlight_tags (void *data, struct t_config_option *option) */ void -config_change_hotlist_sort (void *data, struct t_config_option *option) +config_change_hotlist_sort (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -829,9 +867,11 @@ config_change_hotlist_sort (void *data, struct t_config_option *option) */ void -config_change_item_away (void *data, struct t_config_option *option) +config_change_item_away (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -843,9 +883,11 @@ config_change_item_away (void *data, struct t_config_option *option) */ void -config_change_paste_bracketed (void *data, struct t_config_option *option) +config_change_paste_bracketed (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -858,9 +900,11 @@ config_change_paste_bracketed (void *data, struct t_config_option *option) */ void -config_change_read_marker (void *data, struct t_config_option *option) +config_change_read_marker (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -872,9 +916,11 @@ config_change_read_marker (void *data, struct t_config_option *option) */ void -config_change_prefix (void *data, struct t_config_option *option) +config_change_prefix (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -886,9 +932,11 @@ config_change_prefix (void *data, struct t_config_option *option) */ void -config_change_prefix_align_min (void *data, struct t_config_option *option) +config_change_prefix_align_min (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -901,10 +949,12 @@ config_change_prefix_align_min (void *data, struct t_config_option *option) */ int -config_check_prefix_align_more (void *data, struct t_config_option *option, +config_check_prefix_align_more (const void *pointer, void *data, + struct t_config_option *option, const char *value) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -916,11 +966,12 @@ config_check_prefix_align_more (void *data, struct t_config_option *option, */ int -config_check_prefix_buffer_align_more (void *data, +config_check_prefix_buffer_align_more (const void *pointer, void *data, struct t_config_option *option, const char *value) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -932,10 +983,12 @@ config_check_prefix_buffer_align_more (void *data, */ int -config_check_separator (void *data, struct t_config_option *option, +config_check_separator (const void *pointer, void *data, + struct t_config_option *option, const char *value) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -947,9 +1000,11 @@ config_check_separator (void *data, struct t_config_option *option, */ void -config_change_tab_width (void *data, struct t_config_option *option) +config_change_tab_width (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -964,9 +1019,11 @@ config_change_tab_width (void *data, struct t_config_option *option) */ void -config_change_color (void *data, struct t_config_option *option) +config_change_color (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -982,9 +1039,11 @@ config_change_color (void *data, struct t_config_option *option) */ void -config_change_nick_colors (void *data, struct t_config_option *option) +config_change_nick_colors (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -996,10 +1055,11 @@ config_change_nick_colors (void *data, struct t_config_option *option) */ void -config_change_network_gnutls_ca_file (void *data, +config_change_network_gnutls_ca_file (const void *pointer, void *data, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -1012,10 +1072,12 @@ config_change_network_gnutls_ca_file (void *data, */ int -config_check_proxy_curl (void *data, struct t_config_option *option, +config_check_proxy_curl (const void *pointer, void *data, + struct t_config_option *option, const char *value) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -1035,9 +1097,11 @@ config_check_proxy_curl (void *data, struct t_config_option *option, */ void -config_change_plugin_extension (void *data, struct t_config_option *option) +config_change_plugin_extension (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -1063,7 +1127,8 @@ config_change_plugin_extension (void *data, struct t_config_option *option) */ int -config_day_change_timer_cb (void *data, int remaining_calls) +config_day_change_timer_cb (const void *pointer, void *data, + int remaining_calls) { struct timeval tv_time; struct tm *local_time; @@ -1072,6 +1137,7 @@ config_day_change_timer_cb (void *data, int remaining_calls) char str_time[256]; /* make C compiler happy */ + (void) pointer; (void) data; (void) remaining_calls; @@ -1154,11 +1220,13 @@ config_weechat_init_after_read () */ int -config_weechat_reload_cb (void *data, struct t_config_file *config_file) +config_weechat_reload_cb (const void *pointer, void *data, + struct t_config_file *config_file) { int i, rc; /* make C compiler happy */ + (void) pointer; (void) data; /* remove all keys */ @@ -1233,10 +1301,11 @@ config_weechat_debug_set_all () */ void -config_weechat_debug_change_cb (void *data, +config_weechat_debug_change_cb (const void *pointer, void *data, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -1248,7 +1317,7 @@ config_weechat_debug_change_cb (void *data, */ int -config_weechat_debug_create_option_cb (void *data, +config_weechat_debug_create_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, @@ -1258,6 +1327,7 @@ config_weechat_debug_create_option_cb (void *data, int rc; /* make C compiler happy */ + (void) pointer; (void) data; rc = WEECHAT_CONFIG_OPTION_SET_ERROR; @@ -1284,9 +1354,10 @@ config_weechat_debug_create_option_cb (void *data, config_file, section, option_name, "integer", _("debug level for plugin (\"core\" for WeeChat core)"), - NULL, 0, 32, "0", value, 0, NULL, NULL, - &config_weechat_debug_change_cb, NULL, - NULL, NULL); + NULL, 0, 32, "0", value, 0, + NULL, NULL, NULL, + &config_weechat_debug_change_cb, NULL, NULL, + NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -1306,12 +1377,13 @@ config_weechat_debug_create_option_cb (void *data, */ int -config_weechat_debug_delete_option_cb (void *data, +config_weechat_debug_delete_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -1330,7 +1402,7 @@ config_weechat_debug_delete_option_cb (void *data, int config_weechat_debug_set (const char *plugin_name, const char *value) { - return config_weechat_debug_create_option_cb (NULL, + return config_weechat_debug_create_option_cb (NULL, NULL, weechat_config_file, weechat_config_section_debug, plugin_name, @@ -1342,13 +1414,14 @@ config_weechat_debug_set (const char *plugin_name, const char *value) */ void -config_weechat_palette_change_cb (void *data, +config_weechat_palette_change_cb (const void *pointer, void *data, struct t_config_option *option) { char *error; int number; /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -1365,7 +1438,7 @@ config_weechat_palette_change_cb (void *data, */ int -config_weechat_palette_create_option_cb (void *data, +config_weechat_palette_create_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, @@ -1376,6 +1449,7 @@ config_weechat_palette_create_option_cb (void *data, int rc, number; /* make C compiler happy */ + (void) pointer; (void) data; rc = WEECHAT_CONFIG_OPTION_SET_ERROR; @@ -1406,9 +1480,10 @@ config_weechat_palette_create_option_cb (void *data, config_file, section, option_name, "string", _("alias for color"), - NULL, 0, 0, "", value, 0, NULL, NULL, - &config_weechat_palette_change_cb, NULL, - NULL, NULL); + NULL, 0, 0, "", value, 0, + NULL, NULL, NULL, + &config_weechat_palette_change_cb, NULL, NULL, + NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; if (ptr_option) @@ -1434,7 +1509,7 @@ config_weechat_palette_create_option_cb (void *data, */ int -config_weechat_palette_delete_option_cb (void *data, +config_weechat_palette_delete_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option) @@ -1443,6 +1518,7 @@ config_weechat_palette_delete_option_cb (void *data, int number; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -1462,7 +1538,8 @@ config_weechat_palette_delete_option_cb (void *data, */ int -config_weechat_proxy_read_cb (void *data, struct t_config_file *config_file, +config_weechat_proxy_read_cb (const void *pointer, void *data, + struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) { @@ -1471,6 +1548,7 @@ config_weechat_proxy_read_cb (void *data, struct t_config_file *config_file, int index_option; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; @@ -1539,7 +1617,8 @@ config_weechat_proxy_read_cb (void *data, struct t_config_file *config_file, */ int -config_weechat_bar_read_cb (void *data, struct t_config_file *config_file, +config_weechat_bar_read_cb (const void *pointer, void *data, + struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) { @@ -1548,6 +1627,7 @@ config_weechat_bar_read_cb (void *data, struct t_config_file *config_file, int index_option; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -1617,7 +1697,8 @@ config_weechat_bar_read_cb (void *data, struct t_config_file *config_file, */ int -config_weechat_layout_read_cb (void *data, struct t_config_file *config_file, +config_weechat_layout_read_cb (const void *pointer, void *data, + struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) { @@ -1629,6 +1710,7 @@ config_weechat_layout_read_cb (void *data, struct t_config_file *config_file, struct t_gui_layout_window *parent; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -1781,7 +1863,8 @@ config_weechat_layout_write_tree (struct t_config_file *config_file, */ int -config_weechat_layout_write_cb (void *data, struct t_config_file *config_file, +config_weechat_layout_write_cb (const void *pointer, void *data, + struct t_config_file *config_file, const char *section_name) { struct t_gui_layout *ptr_layout; @@ -1789,6 +1872,7 @@ config_weechat_layout_write_cb (void *data, struct t_config_file *config_file, char option_name[1024]; /* make C compiler happy */ + (void) pointer; (void) data; if (!config_file_write_line (config_file, section_name, NULL)) @@ -1839,9 +1923,11 @@ config_weechat_layout_write_cb (void *data, struct t_config_file *config_file, */ void -config_weechat_notify_change_cb (void *data, struct t_config_option *option) +config_weechat_notify_change_cb (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -1853,7 +1939,7 @@ config_weechat_notify_change_cb (void *data, struct t_config_option *option) */ int -config_weechat_notify_create_option_cb (void *data, +config_weechat_notify_create_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, @@ -1863,6 +1949,7 @@ config_weechat_notify_create_option_cb (void *data, int rc; /* make C compiler happy */ + (void) pointer; (void) data; rc = WEECHAT_CONFIG_OPTION_SET_ERROR; @@ -1889,9 +1976,10 @@ config_weechat_notify_create_option_cb (void *data, config_file, section, option_name, "integer", _("Notify level for buffer"), "none|highlight|message|all", - 0, 0, "", value, 0, NULL, NULL, - &config_weechat_notify_change_cb, NULL, - NULL, NULL); + 0, 0, "", value, 0, + NULL, NULL, NULL, + &config_weechat_notify_change_cb, NULL, NULL, + NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -1911,12 +1999,13 @@ config_weechat_notify_create_option_cb (void *data, */ int -config_weechat_notify_delete_option_cb (void *data, +config_weechat_notify_delete_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -1960,12 +2049,13 @@ config_weechat_notify_set (struct t_gui_buffer *buffer, const char *notify) return 0; /* create/update option */ - return (config_weechat_notify_create_option_cb (NULL, - weechat_config_file, - weechat_config_section_notify, - buffer->full_name, - (value < 0) ? - NULL : gui_buffer_notify_string[value]) != WEECHAT_CONFIG_OPTION_SET_ERROR) ? 1 : 0; + return (config_weechat_notify_create_option_cb ( + NULL, NULL, + weechat_config_file, + weechat_config_section_notify, + buffer->full_name, + (value < 0) ? + NULL : gui_buffer_notify_string[value]) != WEECHAT_CONFIG_OPTION_SET_ERROR) ? 1 : 0; } /* @@ -1973,7 +2063,7 @@ config_weechat_notify_set (struct t_gui_buffer *buffer, const char *notify) */ int -config_weechat_filter_read_cb (void *data, +config_weechat_filter_read_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) @@ -1982,6 +2072,7 @@ config_weechat_filter_read_cb (void *data, int argc; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -2009,12 +2100,14 @@ config_weechat_filter_read_cb (void *data, */ int -config_weechat_filter_write_cb (void *data, struct t_config_file *config_file, +config_weechat_filter_write_cb (const void *pointer, void *data, + struct t_config_file *config_file, const char *section_name) { struct t_gui_filter *ptr_filter; /* make C compiler happy */ + (void) pointer; (void) data; if (!config_file_write_line (config_file, section_name, NULL)) @@ -2041,7 +2134,8 @@ config_weechat_filter_write_cb (void *data, struct t_config_file *config_file, */ int -config_weechat_key_read_cb (void *data, struct t_config_file *config_file, +config_weechat_key_read_cb (const void *pointer, void *data, + struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) { @@ -2049,6 +2143,7 @@ config_weechat_key_read_cb (void *data, struct t_config_file *config_file, char *pos; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; @@ -2083,7 +2178,8 @@ config_weechat_key_read_cb (void *data, struct t_config_file *config_file, */ int -config_weechat_key_write_cb (void *data, struct t_config_file *config_file, +config_weechat_key_write_cb (const void *pointer, void *data, + struct t_config_file *config_file, const char *section_name) { struct t_gui_key *ptr_key; @@ -2091,6 +2187,7 @@ config_weechat_key_write_cb (void *data, struct t_config_file *config_file, int rc, context; /* make C compiler happy */ + (void) pointer; (void) data; if (!config_file_write_line (config_file, section_name, NULL)) @@ -2138,18 +2235,20 @@ config_weechat_init_options () int i; char section_name[128]; - weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_NAME, - &config_weechat_reload_cb, NULL); + weechat_config_file = config_file_new ( + NULL, WEECHAT_CONFIG_NAME, &config_weechat_reload_cb, NULL, NULL); if (!weechat_config_file) return 0; /* debug */ - ptr_section = config_file_new_section (weechat_config_file, "debug", - 1, 1, - NULL, NULL, NULL, NULL, - NULL, NULL, - &config_weechat_debug_create_option_cb, NULL, - &config_weechat_debug_delete_option_cb, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "debug", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &config_weechat_debug_create_option_cb, NULL, NULL, + &config_weechat_debug_delete_option_cb, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -2161,8 +2260,11 @@ config_weechat_init_options () /* startup */ ptr_section = config_file_new_section (weechat_config_file, "startup", 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -2174,23 +2276,27 @@ config_weechat_init_options () "command_after_plugins", "string", N_("command executed when WeeChat starts, after loading plugins " "(note: content is evaluated, see /help eval)"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_command_before_plugins = config_file_new_option ( weechat_config_file, ptr_section, "command_before_plugins", "string", N_("command executed when WeeChat starts, before loading plugins " "(note: content is evaluated, see /help eval)"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_display_logo = config_file_new_option ( weechat_config_file, ptr_section, "display_logo", "boolean", N_("display WeeChat logo at startup"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_display_version = config_file_new_option ( weechat_config_file, ptr_section, "display_version", "boolean", N_("display WeeChat version at startup"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_sys_rlimit = config_file_new_option ( weechat_config_file, ptr_section, "sys_rlimit", "string", @@ -2199,14 +2305,20 @@ config_weechat_init_options () "(RLIMIT_XXX) in lower case (see man setrlimit for values); limit " "-1 means \"unlimited\"; example: set unlimited size for core file " "and max 1GB of virtual memory: \"core:-1,as:1000000000\""), - NULL, 0, 0, "", NULL, 0, NULL, NULL, - &config_change_sys_rlimit, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_sys_rlimit, NULL, NULL, + NULL, NULL, NULL); /* look */ - ptr_section = config_file_new_section (weechat_config_file, "look", - 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "look", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -2219,50 +2331,71 @@ config_weechat_init_options () N_("alignment for end of lines (all lines after the first): they " "are starting under this data (time, buffer, prefix, suffix, " "message (default))"), - "time|buffer|prefix|suffix|message", 0, 0, "message", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + "time|buffer|prefix|suffix|message", 0, 0, "message", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_bar_more_down = config_file_new_option ( weechat_config_file, ptr_section, "bar_more_down", "string", N_("string displayed when bar can be scrolled down " "(for bars with filling different from \"horizontal\")"), - NULL, 0, 0, "++", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "++", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_bar_more_left = config_file_new_option ( weechat_config_file, ptr_section, "bar_more_left", "string", N_("string displayed when bar can be scrolled to the left " "(for bars with filling \"horizontal\")"), - NULL, 0, 0, "<<", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "<<", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_bar_more_right = config_file_new_option ( weechat_config_file, ptr_section, "bar_more_right", "string", N_("string displayed when bar can be scrolled to the right " "(for bars with filling \"horizontal\")"), - NULL, 0, 0, ">>", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, ">>", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_bar_more_up = config_file_new_option ( weechat_config_file, ptr_section, "bar_more_up", "string", N_("string displayed when bar can be scrolled up " "(for bars with filling different from \"horizontal\")"), - NULL, 0, 0, "--", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "--", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_bare_display_exit_on_input = config_file_new_option ( weechat_config_file, ptr_section, "bare_display_exit_on_input", "boolean", N_("exit the bare display mode on any changes in input"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_bare_display_time_format = config_file_new_option ( weechat_config_file, ptr_section, "bare_display_time_format", "string", N_("time format in bare display mode (see man strftime for date/time " "specifiers)"), - NULL, 0, 0, "%H:%M", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "%H:%M", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_buffer_auto_renumber = config_file_new_option ( weechat_config_file, ptr_section, "buffer_auto_renumber", "boolean", N_("automatically renumber buffers to have only consecutive numbers " "and start with number 1; if disabled, gaps between buffer numbers " "are allowed and the first buffer can have a number greater than 1"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, - &config_change_buffer_auto_renumber, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_auto_renumber, NULL, NULL, + NULL, NULL, NULL); config_look_buffer_notify_default = config_file_new_option ( weechat_config_file, ptr_section, "buffer_notify_default", "integer", @@ -2272,7 +2405,9 @@ config_weechat_init_options () "message=messages+highlights, highlight=highlights only, " "none=never display in hotlist"), "none|highlight|message|all", 0, 0, "all", NULL, 0, - NULL, NULL, &config_change_buffer_notify_default, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_buffer_notify_default, NULL, NULL, + NULL, NULL, NULL); config_look_buffer_position = config_file_new_option ( weechat_config_file, ptr_section, "buffer_position", "integer", @@ -2281,31 +2416,36 @@ config_weechat_init_options () "number in the list (after the end of list if no number is " "available); this option is used only if the buffer has no layout " "number"), - "end|first_gap", 0, 0, "end", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + "end|first_gap", 0, 0, "end", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_buffer_search_case_sensitive = config_file_new_option ( weechat_config_file, ptr_section, "buffer_search_case_sensitive", "boolean", N_("default text search in buffer: case sensitive or not"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_buffer_search_force_default = config_file_new_option ( weechat_config_file, ptr_section, "buffer_search_force_default", "boolean", N_("force default values for text search in buffer (instead of using " "values from last search in buffer)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_buffer_search_regex = config_file_new_option ( weechat_config_file, ptr_section, "buffer_search_regex", "boolean", N_("default text search in buffer: if enabled, search POSIX extended " "regular expression, otherwise search simple string"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_buffer_search_where = config_file_new_option ( weechat_config_file, ptr_section, "buffer_search_where", "integer", N_("default text search in buffer: in message, prefix, prefix and " "message"), "prefix|message|prefix_message", 0, 0, "prefix_message", - NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_buffer_time_format = config_file_new_option ( weechat_config_file, ptr_section, "buffer_time_format", "string", @@ -2315,56 +2455,83 @@ config_weechat_init_options () "use colors with format \"${color:xxx}\", see /help eval); for " "example time using grayscale (requires support of 256 colors): " "\"${color:252}%H${color:245}%M${color:240}%S\""), - NULL, 0, 0, "%H:%M:%S", NULL, 0, NULL, NULL, &config_change_buffer_time_format, NULL, NULL, NULL); + NULL, 0, 0, "%H:%M:%S", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_time_format, NULL, NULL, + NULL, NULL, NULL); config_look_color_basic_force_bold = config_file_new_option ( weechat_config_file, ptr_section, "color_basic_force_bold", "boolean", N_("force \"bold\" attribute for light colors and \"darkgray\" in " "basic colors (this option is disabled by default: bold is used " "only if terminal has less than 16 colors)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_look_color_inactive_buffer = config_file_new_option ( weechat_config_file, ptr_section, "color_inactive_buffer", "boolean", N_("use a different color for lines in inactive buffer (when line is " "from a merged buffer not selected)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_color_inactive_message = config_file_new_option ( weechat_config_file, ptr_section, "color_inactive_message", "boolean", N_("use a different color for inactive message (when window is not " "current window, or if line is from a merged buffer not selected)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_color_inactive_prefix = config_file_new_option ( weechat_config_file, ptr_section, "color_inactive_prefix", "boolean", N_("use a different color for inactive prefix (when window is not " "current window, or if line is from a merged buffer not selected)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_color_inactive_prefix_buffer = config_file_new_option ( weechat_config_file, ptr_section, "color_inactive_prefix_buffer", "boolean", N_("use a different color for inactive buffer name in prefix (when " "window is not current window, or if line is from a merged buffer " "not selected)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_color_inactive_time = config_file_new_option ( weechat_config_file, ptr_section, "color_inactive_time", "boolean", N_("use a different color for inactive time (when window is not " "current window, or if line is from a merged buffer not selected)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_color_inactive_window = config_file_new_option ( weechat_config_file, ptr_section, "color_inactive_window", "boolean", N_("use a different color for lines in inactive window (when window " "is not current window)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_color_nick_offline = config_file_new_option ( weechat_config_file, ptr_section, "color_nick_offline", "boolean", N_("use a different color for offline nicks (not in nicklist any more)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_color_pairs_auto_reset = config_file_new_option ( weechat_config_file, ptr_section, "color_pairs_auto_reset", "integer", @@ -2372,7 +2539,8 @@ config_weechat_init_options () "pairs is lower or equal to this number (-1 = disable automatic " "reset, and then a manual \"/color reset\" is needed when table " "is full)"), - NULL, -1, 256, "5", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, -1, 256, "5", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_color_real_white = config_file_new_option ( weechat_config_file, ptr_section, "color_real_white", "boolean", @@ -2381,37 +2549,47 @@ config_weechat_init_options () "white background, you should turn on this option to " "see real white instead of default term foreground " "color)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_look_command_chars = config_file_new_option ( weechat_config_file, ptr_section, "command_chars", "string", N_("chars used to determine if input string is a command or not: " "input must start with one of these chars; the slash (\"/\") is " "always considered as command prefix (example: \".$\")"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_command_incomplete = config_file_new_option ( weechat_config_file, ptr_section, "command_incomplete", "boolean", N_("if set, incomplete and unambiguous commands are allowed, for " "example /he for /help"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_confirm_quit = config_file_new_option ( weechat_config_file, ptr_section, "confirm_quit", "boolean", N_("if set, /quit command must be confirmed with extra argument " "\"-yes\" (see /help quit)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_confirm_upgrade = config_file_new_option ( weechat_config_file, ptr_section, "confirm_upgrade", "boolean", N_("if set, /upgrade command must be confirmed with extra argument " "\"-yes\" (see /help upgrade)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_day_change = config_file_new_option ( weechat_config_file, ptr_section, "day_change", "boolean", N_("display special message when day changes"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_day_change_message_1date = config_file_new_option ( weechat_config_file, ptr_section, "day_change_message_1date", "string", @@ -2420,7 +2598,10 @@ config_weechat_init_options () "(for example at beginning of buffer) (see man strftime for " "date/time specifiers) (note: content is evaluated, so you can use " "colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, "-- %a, %d %b %Y --", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "-- %a, %d %b %Y --", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_day_change_message_2dates = config_file_new_option ( weechat_config_file, ptr_section, "day_change_message_2dates", "string", @@ -2431,8 +2612,10 @@ config_weechat_init_options () "(see man strftime for date/time specifiers) (note: content is " "evaluated, so you can use colors with format \"${color:xxx}\", " "see /help eval)"), - NULL, 0, 0, "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --", NULL, 0, NULL, NULL, - &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_eat_newline_glitch = config_file_new_option ( weechat_config_file, ptr_section, "eat_newline_glitch", "boolean", @@ -2441,8 +2624,10 @@ config_weechat_init_options () "text when you copy/paste text from WeeChat to another application " "(this option is disabled by default because it can cause serious " "display bugs)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, - &config_change_eat_newline_glitch, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_eat_newline_glitch, NULL, NULL, + NULL, NULL, NULL); config_look_emphasized_attributes = config_file_new_option ( weechat_config_file, ptr_section, "emphasized_attributes", "string", @@ -2450,7 +2635,10 @@ config_weechat_init_options () "\"*\" for bold, \"!\" for reverse, \"/\" for italic, \"_\" for " "underline); if the string is empty, the colors " "weechat.color.emphasized* are used"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_emphasized_attributes, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_emphasized_attributes, NULL, NULL, + NULL, NULL, NULL); config_look_highlight = config_file_new_option ( weechat_config_file, ptr_section, "highlight", "string", @@ -2458,7 +2646,8 @@ config_weechat_init_options () "comparison (use \"(?-i)\" at beginning of words to make them case " "sensitive), words may begin or end with \"*\" for partial match; " "example: \"test,(?-i)*toto*,flash*\""), - NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_highlight_regex = config_file_new_option ( weechat_config_file, ptr_section, "highlight_regex", "string", @@ -2468,7 +2657,10 @@ config_weechat_init_options () "and \"|\"), regular expression is case insensitive (use \"(?-i)\" " "at beginning to make it case sensitive), examples: " "\"flashcode|flashy\", \"(?-i)FlashCode|flashy\""), - NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_highlight_regex, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_highlight_regex, NULL, NULL, + NULL, NULL, NULL); config_look_highlight_tags = config_file_new_option ( weechat_config_file, ptr_section, "highlight_tags", "string", @@ -2478,7 +2670,10 @@ config_weechat_init_options () "examples: \"nick_flashcode\" for messages from nick \"FlashCode\", " "\"irc_notice+nick_toto*\" for notices from a nick starting with " "\"toto\""), - NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_highlight_tags, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_highlight_tags, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_add_conditions = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_add_conditions", "string", @@ -2489,65 +2684,94 @@ config_weechat_init_options () "by default a buffer is added to hotlist if you are away, or if the " "buffer is not visible on screen (not displayed in any window)"), NULL, 0, 0, "${away} || ${buffer.num_displayed} == 0", - NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_hotlist_buffer_separator = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_buffer_separator", "string", N_("string displayed between buffers in hotlist"), - NULL, 0, 0, ", ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, ", ", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_count_max = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_count_max", "integer", N_("max number of messages count to display in hotlist for a buffer " "(0 = never display messages count)"), - NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_count_min_msg = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_count_min_msg", "integer", N_("display messages count if number of messages is greater or equal " "to this value"), - NULL, 1, 100, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 1, 100, "2", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_names_count = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_count", "integer", N_("max number of names in hotlist (0 = no name displayed, only buffer " "numbers)"), - NULL, 0, GUI_BUFFERS_MAX, "3", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, GUI_BUFFERS_MAX, "3", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_names_length = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_length", "integer", N_("max length of names in hotlist (0 = no limit)"), - NULL, 0, 32, "0", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 32, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_names_level = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_level", "integer", N_("level for displaying names in hotlist (combination " "of: 1=join/part, 2=message, 4=private, 8=highlight, " "for example: 12=private+highlight)"), - NULL, 1, 15, "12", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 1, 15, "12", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_names_merged_buffers = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_merged_buffers", "boolean", N_("if set, force display of names in hotlist for merged buffers"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_prefix = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_prefix", "string", N_("text displayed at the beginning of the hotlist"), - NULL, 0, 0, "H: ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "H: ", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_remove = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_remove", "integer", N_("remove buffers in hotlist: buffer = remove buffer by buffer, " "merged = remove all visible merged buffers at once"), "buffer|merged", - 0, 0, "merged", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + 0, 0, "merged", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_hotlist_short_names = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_short_names", "boolean", N_("if set, uses short names to display buffer names in hotlist (start " "after first '.' in name)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_sort = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_sort", "integer", @@ -2557,133 +2781,174 @@ config_weechat_init_options () "asc = ascending sort, desc = descending sort"), "group_time_asc|group_time_desc|group_number_asc|" "group_number_desc|number_asc|number_desc", - 0, 0, "group_time_asc", NULL, 0, NULL, NULL, &config_change_hotlist_sort, NULL, NULL, NULL); + 0, 0, "group_time_asc", NULL, 0, + NULL, NULL, NULL, + &config_change_hotlist_sort, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_suffix = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_suffix", "string", N_("text displayed at the end of the hotlist"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_hotlist_unique_numbers = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_unique_numbers", "boolean", N_("keep only unique numbers in hotlist (this applies only on hotlist " "items where name is NOT displayed after number)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_input_cursor_scroll = config_file_new_option ( weechat_config_file, ptr_section, "input_cursor_scroll", "integer", N_("number of chars displayed after end of input line when scrolling " "to display end of line"), - NULL, 0, 100, "20", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 100, "20", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_input_share = config_file_new_option ( weechat_config_file, ptr_section, "input_share", "integer", N_("share commands, text, or both in input for all buffers (there is " "still local history for each buffer)"), "none|commands|text|all", - 0, 0, "none", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + 0, 0, "none", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_input_share_overwrite = config_file_new_option ( weechat_config_file, ptr_section, "input_share_overwrite", "boolean", N_("if set and input is shared, always overwrite input in target " "buffer"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_input_undo_max = config_file_new_option ( weechat_config_file, ptr_section, "input_undo_max", "integer", N_("max number of \"undo\" for command line, by buffer (0 = undo " "disabled)"), - NULL, 0, 65535, "32", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 65535, "32", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_item_away_message = config_file_new_option ( weechat_config_file, ptr_section, "item_away_message", "boolean", N_("display server away message in away bar item"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, - &config_change_item_away, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_item_away, NULL, NULL, + NULL, NULL, NULL); config_look_item_buffer_filter = config_file_new_option ( weechat_config_file, ptr_section, "item_buffer_filter", "string", N_("string used to show that some lines are filtered in current buffer " "(bar item \"buffer_filter\")"), - NULL, 0, 0, "*", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "*", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_item_buffer_zoom = config_file_new_option ( weechat_config_file, ptr_section, "item_buffer_zoom", "string", N_("string used to show zoom on merged buffer " "(bar item \"buffer_zoom\")"), - NULL, 0, 0, "!", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "!", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_item_mouse_status = config_file_new_option ( weechat_config_file, ptr_section, "item_mouse_status", "string", N_("string used to show if mouse is enabled " "(bar item \"mouse_status\")"), - NULL, 0, 0, "M", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "M", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_item_time_format = config_file_new_option ( weechat_config_file, ptr_section, "item_time_format", "string", N_("time format for \"time\" bar item (see man strftime for date/time " "specifiers)"), - NULL, 0, 0, "%H:%M", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "%H:%M", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_jump_current_to_previous_buffer = config_file_new_option ( weechat_config_file, ptr_section, "jump_current_to_previous_buffer", "boolean", N_("jump to previous buffer displayed when jumping to current buffer " "number with /buffer *N (where N is a buffer number), to easily " "switch to another buffer, then come back to current buffer"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_jump_previous_buffer_when_closing = config_file_new_option ( weechat_config_file, ptr_section, "jump_previous_buffer_when_closing", "boolean", N_("jump to previously visited buffer when closing a buffer (if " "disabled, then jump to buffer number - 1)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_jump_smart_back_to_buffer = config_file_new_option ( weechat_config_file, ptr_section, "jump_smart_back_to_buffer", "boolean", N_("jump back to initial buffer after reaching end of hotlist"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_key_bind_safe = config_file_new_option ( weechat_config_file, ptr_section, "key_bind_safe", "boolean", N_("allow only binding of \"safe\" keys (beginning with a ctrl or meta " "code)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_key_grab_delay = config_file_new_option ( weechat_config_file, ptr_section, "key_grab_delay", "integer", N_("default delay (in milliseconds) to grab a key (using default key " "alt-k); this delay can be overridden in the /input command (see " "/help input)"), - NULL, 1, 10000, "800", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 1, 10000, "800", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_mouse = config_file_new_option ( weechat_config_file, ptr_section, "mouse", "boolean", N_("enable mouse support"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_mouse, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &config_change_mouse, NULL, NULL, + NULL, NULL, NULL); config_look_mouse_timer_delay = config_file_new_option ( weechat_config_file, ptr_section, "mouse_timer_delay", "integer", N_("delay (in milliseconds) to grab a mouse event: WeeChat will " "wait this delay before processing event"), - NULL, 1, 10000, "100", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 1, 10000, "100", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_nick_prefix = config_file_new_option ( weechat_config_file, ptr_section, "nick_prefix", "string", N_("text to display before nick in prefix of message, example: \"<\""), - NULL, 0, 0, "", NULL, 0, NULL, NULL, - &config_change_nick_prefix_suffix, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_nick_prefix_suffix, NULL, NULL, + NULL, NULL, NULL); config_look_nick_suffix = config_file_new_option ( weechat_config_file, ptr_section, "nick_suffix", "string", N_("text to display after nick in prefix of message, example: \">\""), - NULL, 0, 0, "", NULL, 0, NULL, NULL, - &config_change_nick_prefix_suffix, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_nick_prefix_suffix, NULL, NULL, + NULL, NULL, NULL); config_look_paste_auto_add_newline = config_file_new_option ( weechat_config_file, ptr_section, "paste_auto_add_newline", "boolean", N_("automatically add a newline at the end of pasted text if there " "are at least two lines and if a confirmation is asked"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_paste_bracketed = config_file_new_option ( weechat_config_file, ptr_section, "paste_bracketed", "boolean", @@ -2692,82 +2957,108 @@ config_weechat_init_options () "with control sequences so that WeeChat can differentiate pasted " "text from typed-in text (\"ESC[200~\", followed by the pasted text, " "followed by \"ESC[201~\")"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_paste_bracketed, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_paste_bracketed, NULL, NULL, + NULL, NULL, NULL); config_look_paste_bracketed_timer_delay = config_file_new_option ( weechat_config_file, ptr_section, "paste_bracketed_timer_delay", "integer", N_("force end of bracketed paste after this delay (in seconds) if the " "control sequence for end of bracketed paste (\"ESC[201~\") was not " "received in time"), - NULL, 1, 60, "10", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 1, 60, "10", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_paste_max_lines = config_file_new_option ( weechat_config_file, ptr_section, "paste_max_lines", "integer", N_("max number of lines for paste without asking user " "(-1 = disable this feature)"), - NULL, -1, INT_MAX, "1", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, -1, INT_MAX, "1", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_error", "string", /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ N_("prefix for error messages (note: content is evaluated, so you can " "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_ERROR_DEFAULT, - NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, GUI_CHAT_PREFIX_ERROR_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_network", "string", /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ N_("prefix for network messages (note: content is evaluated, so you can " "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_NETWORK_DEFAULT, - NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, GUI_CHAT_PREFIX_NETWORK_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_action", "string", /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ N_("prefix for action messages (note: content is evaluated, so you can " "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_ACTION_DEFAULT, - NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, GUI_CHAT_PREFIX_ACTION_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_join", "string", /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ N_("prefix for join messages (note: content is evaluated, so you can " "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_JOIN_DEFAULT, - NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, GUI_CHAT_PREFIX_JOIN_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_quit", "string", /* TRANSLATORS: string "${color:xxx}" must NOT be translated */ N_("prefix for quit messages (note: content is evaluated, so you can " "use colors with format \"${color:xxx}\", see /help eval)"), - NULL, 0, 0, GUI_CHAT_PREFIX_QUIT_DEFAULT, - NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, GUI_CHAT_PREFIX_QUIT_DEFAULT, NULL, 0, + NULL, NULL, NULL, + &config_change_prefix, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_align = config_file_new_option ( weechat_config_file, ptr_section, "prefix_align", "integer", N_("prefix alignment (none, left, right (default))"), - "none|left|right", 0, 0, "right", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + "none|left|right", 0, 0, "right", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_align_max = config_file_new_option ( weechat_config_file, ptr_section, "prefix_align_max", "integer", N_("max size for prefix (0 = no max size)"), - NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 128, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_align_min = config_file_new_option ( weechat_config_file, ptr_section, "prefix_align_min", "integer", N_("min size for prefix"), - NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_prefix_align_min, NULL, NULL, NULL); + NULL, 0, 128, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_prefix_align_min, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_align_more = config_file_new_option ( weechat_config_file, ptr_section, "prefix_align_more", "string", N_("char to display if prefix is truncated (must be exactly one char " "on screen)"), NULL, 0, 0, "+", NULL, 0, - &config_check_prefix_align_more, NULL, &config_change_buffers, NULL, NULL, NULL); + &config_check_prefix_align_more, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_align_more_after = config_file_new_option ( weechat_config_file, ptr_section, "prefix_align_more_after", "boolean", @@ -2775,26 +3066,36 @@ config_weechat_init_options () "replacing the space that should be displayed here); if disabled, " "the truncature char replaces last char of text"), NULL, 0, 0, "on", NULL, 0, - NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_buffer_align = config_file_new_option ( weechat_config_file, ptr_section, "prefix_buffer_align", "integer", N_("prefix alignment for buffer name, when many buffers are merged " "with same number (none, left, right (default))"), - "none|left|right", 0, 0, "right", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + "none|left|right", 0, 0, "right", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_buffer_align_max = config_file_new_option ( weechat_config_file, ptr_section, "prefix_buffer_align_max", "integer", N_("max size for buffer name, when many buffers are merged with same " "number (0 = no max size)"), - NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 128, "0", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_buffer_align_more = config_file_new_option ( weechat_config_file, ptr_section, "prefix_buffer_align_more", "string", N_("char to display if buffer name is truncated (when many buffers are " "merged with same number) (must be exactly one char on screen)"), NULL, 0, 0, "+", NULL, 0, - &config_check_prefix_buffer_align_more, NULL, &config_change_buffers, NULL, NULL, NULL); + &config_check_prefix_buffer_align_more, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_buffer_align_more_after = config_file_new_option ( weechat_config_file, ptr_section, "prefix_buffer_align_more_after", "boolean", @@ -2802,7 +3103,9 @@ config_weechat_init_options () "replacing the space that should be displayed here); if disabled, " "the truncature char replaces last char of text"), NULL, 0, 0, "on", NULL, 0, - NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_same_nick = config_file_new_option ( weechat_config_file, ptr_section, "prefix_same_nick", "string", @@ -2810,81 +3113,108 @@ config_weechat_init_options () "message: use a space \" \" to hide prefix, another string to " "display this string instead of prefix, or an empty string to " "disable feature (display prefix)"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_prefix_same_nick, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_prefix_same_nick, NULL, NULL, + NULL, NULL, NULL); config_look_prefix_suffix = config_file_new_option ( weechat_config_file, ptr_section, "prefix_suffix", "string", N_("string displayed after prefix"), - NULL, 0, 0, "|", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "|", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_quote_nick_prefix = config_file_new_option ( weechat_config_file, ptr_section, "quote_nick_prefix", "string", N_("text to display before nick when quoting a message (see /help " "cursor)"), - NULL, 0, 0, "<", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "<", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_quote_nick_suffix = config_file_new_option ( weechat_config_file, ptr_section, "quote_nick_suffix", "string", N_("text to display after nick when quoting a message (see /help " "cursor)"), - NULL, 0, 0, ">", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, ">", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_quote_time_format = config_file_new_option ( weechat_config_file, ptr_section, "quote_time_format", "string", N_("time format when quoting a message (see /help cursor)"), - NULL, 0, 0, "%H:%M:%S", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%H:%M:%S", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_read_marker = config_file_new_option ( weechat_config_file, ptr_section, "read_marker", "integer", N_("use a marker (line or char) on buffers to show first unread line"), "none|line|char", - 0, 0, "line", NULL, 0, NULL, NULL, &config_change_read_marker, NULL, NULL, NULL); + 0, 0, "line", NULL, 0, + NULL, NULL, NULL, + &config_change_read_marker, NULL, NULL, + NULL, NULL, NULL); config_look_read_marker_always_show = config_file_new_option ( weechat_config_file, ptr_section, "read_marker_always_show", "boolean", N_("always show read marker, even if it is after last buffer line"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_read_marker_string = config_file_new_option ( weechat_config_file, ptr_section, "read_marker_string", "string", N_("string used to draw read marker line (string is repeated until " "end of line)"), - NULL, 0, 0, "- ", NULL, 0, NULL, NULL, &config_change_read_marker, NULL, NULL, NULL); + NULL, 0, 0, "- ", NULL, 0, + NULL, NULL, NULL, + &config_change_read_marker, NULL, NULL, + NULL, NULL, NULL); config_look_save_config_on_exit = config_file_new_option ( weechat_config_file, ptr_section, "save_config_on_exit", "boolean", N_("save configuration file on exit"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_save_config_on_exit, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_save_config_on_exit, NULL, NULL, + NULL, NULL, NULL); config_look_save_layout_on_exit = config_file_new_option ( weechat_config_file, ptr_section, "save_layout_on_exit", "integer", N_("save layout on exit (buffers, windows, or both)"), - "none|buffers|windows|all", 0, 0, "none", NULL, 0, NULL, NULL, - &config_change_save_layout_on_exit, NULL, NULL, NULL); + "none|buffers|windows|all", 0, 0, "none", NULL, 0, + NULL, NULL, NULL, + &config_change_save_layout_on_exit, NULL, NULL, + NULL, NULL, NULL); config_look_scroll_amount = config_file_new_option ( weechat_config_file, ptr_section, "scroll_amount", "integer", N_("how many lines to scroll by with scroll_up and " "scroll_down"), - NULL, 1, INT_MAX, "3", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 1, INT_MAX, "3", NULL, 0, + NULL, NULL, NULL, + &config_change_buffer_content, NULL, NULL, + NULL, NULL, NULL); config_look_scroll_bottom_after_switch = config_file_new_option ( weechat_config_file, ptr_section, "scroll_bottom_after_switch", "boolean", N_("scroll to bottom of window after switch to another buffer (do not " "remember scroll position in windows); the scroll is done only for " "buffers with formatted content (not free content)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_scroll_page_percent = config_file_new_option ( weechat_config_file, ptr_section, "scroll_page_percent", "integer", N_("percent of screen to scroll when scrolling one page up or down " "(for example 100 means one page, 50 half-page)"), - NULL, 1, 100, "100", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 1, 100, "100", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_search_text_not_found_alert = config_file_new_option ( weechat_config_file, ptr_section, "search_text_not_found_alert", "boolean", N_("alert user when text sought is not found in buffer"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_separator_horizontal = config_file_new_option ( weechat_config_file, ptr_section, "separator_horizontal", "string", @@ -2893,7 +3223,9 @@ config_weechat_init_options () "with URL selection under some terminals); " "width on screen must be exactly one char"), NULL, 0, 0, "-", NULL, 0, - &config_check_separator, NULL, &config_change_buffers, NULL, NULL, NULL); + &config_check_separator, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_separator_vertical = config_file_new_option ( weechat_config_file, ptr_section, "separator_vertical", "string", @@ -2901,44 +3233,58 @@ config_weechat_init_options () "(empty value will draw a real line with ncurses); " "width on screen must be exactly one char"), NULL, 0, 0, "", NULL, 0, - &config_check_separator, NULL, &config_change_buffers, NULL, NULL, NULL); + &config_check_separator, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_tab_width = config_file_new_option ( weechat_config_file, ptr_section, "tab_width", "integer", N_("number of spaces used to display tabs in messages"), - NULL, 1, TAB_MAX_WIDTH, "1", NULL, 0, NULL, NULL, - &config_change_tab_width, NULL, NULL, NULL); + NULL, 1, TAB_MAX_WIDTH, "1", NULL, 0, + NULL, NULL, NULL, + &config_change_tab_width, NULL, NULL, + NULL, NULL, NULL); config_look_time_format = config_file_new_option ( weechat_config_file, ptr_section, "time_format", "string", N_("time format for dates converted to strings and displayed in " "messages (see man strftime for date/time specifiers)"), - NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_window_auto_zoom = config_file_new_option ( weechat_config_file, ptr_section, "window_auto_zoom", "boolean", N_("automatically zoom on current window if the terminal becomes too " "small to display all windows (use alt-z to unzoom windows when the " "terminal is big enough)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_window_separator_horizontal = config_file_new_option ( weechat_config_file, ptr_section, "window_separator_horizontal", "boolean", N_("display an horizontal separator between windows"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_window_separator_vertical = config_file_new_option ( weechat_config_file, ptr_section, "window_separator_vertical", "boolean", N_("display a vertical separator between windows"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, + &config_change_buffers, NULL, NULL, + NULL, NULL, NULL); config_look_window_title = config_file_new_option ( weechat_config_file, ptr_section, "window_title", "string", N_("title for window (terminal for Curses GUI), set on startup; " "an empty string will keep title unchanged " "(note: content is evaluated, see /help eval)"), - NULL, 0, 0, "WeeChat ${info:version}", NULL, 0, NULL, NULL, - &config_change_window_title, NULL, NULL, NULL); + NULL, 0, 0, "WeeChat ${info:version}", NULL, 0, + NULL, NULL, NULL, + &config_change_window_title, NULL, NULL, + NULL, NULL, NULL); config_look_word_chars_highlight = config_file_new_option ( weechat_config_file, ptr_section, "word_chars_highlight", "string", @@ -2951,8 +3297,10 @@ config_weechat_init_options () "matches any char; unicode chars are allowed with the format " "\\u1234, for example \\u00A0 for unbreakable space " "(see /help print for supported formats)"), - NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, NULL, NULL, - &config_change_word_chars_highlight, NULL, NULL, NULL); + NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, + NULL, NULL, NULL, + &config_change_word_chars_highlight, NULL, NULL, + NULL, NULL, NULL); config_look_word_chars_input = config_file_new_option ( weechat_config_file, ptr_section, "word_chars_input", "string", @@ -2965,16 +3313,20 @@ config_weechat_init_options () "matches any char; unicode chars are allowed with the format " "\\u1234, for example \\u00A0 for unbreakable space " "(see /help print for supported formats)"), - NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, NULL, NULL, - &config_change_word_chars_input, NULL, NULL, NULL); + NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, + NULL, NULL, NULL, + &config_change_word_chars_input, NULL, NULL, + NULL, NULL, NULL); /* palette */ - ptr_section = config_file_new_section (weechat_config_file, "palette", - 1, 1, - NULL, NULL, NULL, NULL, - NULL, NULL, - &config_weechat_palette_create_option_cb, NULL, - &config_weechat_palette_delete_option_cb, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "palette", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &config_weechat_palette_create_option_cb, NULL, NULL, + &config_weechat_palette_delete_option_cb, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -2984,8 +3336,11 @@ config_weechat_init_options () /* colors */ ptr_section = config_file_new_section (weechat_config_file, "color", 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3000,82 +3355,108 @@ config_weechat_init_options () "bar_more", "color", N_("text color for '+' when scrolling bars"), NULL, -1, 0, "lightmagenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); /* chat area */ config_color_chat = config_file_new_option ( weechat_config_file, ptr_section, "chat", "color", N_("text color for chat"), NULL, GUI_COLOR_CHAT, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_bg", "color", N_("background color for chat"), NULL, -1, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_buffer = config_file_new_option ( weechat_config_file, ptr_section, "chat_buffer", "color", N_("text color for buffer names"), NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_channel = config_file_new_option ( weechat_config_file, ptr_section, "chat_channel", "color", N_("text color for channel names"), NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_day_change = config_file_new_option ( weechat_config_file, ptr_section, "chat_day_change", "color", N_("text color for message displayed when the day has changed"), NULL, GUI_COLOR_CHAT_DAY_CHANGE, 0, "cyan", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_delimiters = config_file_new_option ( weechat_config_file, ptr_section, "chat_delimiters", "color", N_("text color for delimiters"), NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_highlight = config_file_new_option ( weechat_config_file, ptr_section, "chat_highlight", "color", N_("text color for highlighted prefix"), NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_highlight_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_highlight_bg", "color", N_("background color for highlighted prefix"), NULL, -1, 0, "magenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_host = config_file_new_option ( weechat_config_file, ptr_section, "chat_host", "color", N_("text color for hostnames"), NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_inactive_buffer = config_file_new_option ( weechat_config_file, ptr_section, "chat_inactive_buffer", "color", N_("text color for chat when line is inactive (buffer is merged with " "other buffers and is not selected)"), NULL, GUI_COLOR_CHAT_INACTIVE_BUFFER, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_inactive_window = config_file_new_option ( weechat_config_file, ptr_section, "chat_inactive_window", "color", N_("text color for chat when window is inactive (not current selected " "window)"), NULL, GUI_COLOR_CHAT_INACTIVE_WINDOW, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick", "color", N_("text color for nicks in chat window"), NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_colors = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_colors", "string", @@ -3085,7 +3466,9 @@ config_weechat_init_options () "\"lightred:blue\")"), NULL, 0, 0, "cyan,magenta,green,brown,lightblue,default,lightcyan," "lightmagenta,lightgreen,blue", NULL, 0, - NULL, NULL, &config_change_nick_colors, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_nick_colors, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_offline = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_offline", "color", @@ -3093,58 +3476,76 @@ config_weechat_init_options () "color is used only if option weechat.look.color_nick_offline is " "enabled"), NULL, GUI_COLOR_CHAT_NICK_OFFLINE, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_offline_highlight = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_offline_highlight", "color", N_("text color for offline nick with highlight; this color is used " "only if option weechat.look.color_nick_offline is enabled"), NULL, -1, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_offline_highlight_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_offline_highlight_bg", "color", N_("background color for offline nick with highlight; this color is " "used only if option weechat.look.color_nick_offline is enabled"), NULL, -1, 0, "blue", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_other = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_other", "color", N_("text color for other nick in private buffer"), NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "cyan", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_prefix = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_prefix", "color", N_("color for nick prefix (string displayed before nick in prefix)"), - NULL, GUI_COLOR_CHAT_NICK_PREFIX, 0, "green", NULL, 0, NULL, NULL, - &config_change_color, NULL, NULL, NULL); + NULL, GUI_COLOR_CHAT_NICK_PREFIX, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_self = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_self", "color", N_("text color for local nick in chat window"), NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_nick_suffix = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_suffix", "color", N_("color for nick suffix (string displayed after nick in prefix)"), - NULL, GUI_COLOR_CHAT_NICK_SUFFIX, 0, "green", NULL, 0, NULL, NULL, - &config_change_color, NULL, NULL, NULL); + NULL, GUI_COLOR_CHAT_NICK_SUFFIX, 0, "green", NULL, 0, + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_error", "color", N_("text color for error prefix"), NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix_buffer = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_buffer", "color", N_("text color for buffer name (before prefix, when many buffers are " "merged with same number)"), NULL, GUI_COLOR_CHAT_PREFIX_BUFFER, 0, "brown", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix_buffer_inactive_buffer = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_buffer_inactive_buffer", "color", @@ -3152,104 +3553,138 @@ config_weechat_init_options () "buffers are merged with same number and if buffer is not " "selected)"), NULL, GUI_COLOR_CHAT_PREFIX_BUFFER_INACTIVE_BUFFER, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_network", "color", N_("text color for network prefix"), NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_action", "color", N_("text color for action prefix"), NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_join", "color", N_("text color for join prefix"), NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_quit", "color", N_("text color for quit prefix"), NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix_more = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_more", "color", N_("text color for '+' when prefix is too long"), NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_prefix_suffix = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_suffix", "color", N_("text color for suffix (after prefix)"), NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_read_marker = config_file_new_option ( weechat_config_file, ptr_section, "chat_read_marker", "color", N_("text color for unread data marker"), NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "magenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_read_marker_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_read_marker_bg", "color", N_("background color for unread data marker"), NULL, -1, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_server = config_file_new_option ( weechat_config_file, ptr_section, "chat_server", "color", N_("text color for server names"), NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_tags = config_file_new_option ( weechat_config_file, ptr_section, "chat_tags", "color", N_("text color for tags after messages (displayed with command /debug " "tags)"), NULL, GUI_COLOR_CHAT_TAGS, 0, "red", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_text_found = config_file_new_option ( weechat_config_file, ptr_section, "chat_text_found", "color", N_("text color for marker on lines where text sought is found"), NULL, GUI_COLOR_CHAT_TEXT_FOUND, 0, "yellow", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_text_found_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_text_found_bg", "color", N_("background color for marker on lines where text sought is found"), NULL, -1, 0, "lightmagenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_time = config_file_new_option ( weechat_config_file, ptr_section, "chat_time", "color", N_("text color for time in chat window"), NULL, GUI_COLOR_CHAT_TIME, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_time_delimiters = config_file_new_option ( weechat_config_file, ptr_section, "chat_time_delimiters", "color", N_("text color for time delimiters"), NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_value = config_file_new_option ( weechat_config_file, ptr_section, "chat_value", "color", N_("text color for values"), NULL, GUI_COLOR_CHAT_VALUE, 0, "cyan", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_chat_value_null = config_file_new_option ( weechat_config_file, ptr_section, "chat_value_null", "color", N_("text color for null values (undefined)"), NULL, GUI_COLOR_CHAT_VALUE_NULL, 0, "blue", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); /* emphasis (chat/bars) */ config_color_emphasized = config_file_new_option ( weechat_config_file, ptr_section, @@ -3258,7 +3693,9 @@ config_weechat_init_options () "this option is used only if option weechat.look.emphasized_attributes " "is an empty string (default value)"), NULL, GUI_COLOR_EMPHASIS, 0, "yellow", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_emphasized_bg = config_file_new_option ( weechat_config_file, ptr_section, "emphasized_bg", "color", @@ -3266,40 +3703,52 @@ config_weechat_init_options () "text); used only if option weechat.look.emphasized_attributes is an " "empty string (default value)"), NULL, -1, 0, "magenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); /* input bar */ config_color_input_actions = config_file_new_option ( weechat_config_file, ptr_section, "input_actions", "color", N_("text color for actions in input line"), NULL, -1, 0, "lightgreen", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_input_text_not_found = config_file_new_option ( weechat_config_file, ptr_section, "input_text_not_found", "color", N_("text color for unsuccessful text search in input line"), NULL, -1, 0, "red", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); /* items */ config_color_item_away = config_file_new_option ( weechat_config_file, ptr_section, "item_away", "color", N_("text color for away item"), - NULL, -1, 0, "yellow", NULL, 0, NULL, NULL, - &config_change_item_away, NULL, NULL, NULL); + NULL, -1, 0, "yellow", NULL, 0, + NULL, NULL, NULL, + &config_change_item_away, NULL, NULL, + NULL, NULL, NULL); /* nicklist bar */ config_color_nicklist_away = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_away", "color", N_("text color for away nicknames"), NULL, -1, 0, "cyan", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_nicklist_group = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_group", "color", N_("text color for groups in nicklist"), NULL, -1, 0, "green", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); /* general color settings */ config_color_separator = config_file_new_option ( weechat_config_file, ptr_section, @@ -3307,112 +3756,149 @@ config_weechat_init_options () N_("color for window separators (when split) and separators beside bars " "(like nicklist)"), NULL, GUI_COLOR_SEPARATOR, 0, "blue", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); /* status bar */ config_color_status_count_highlight = config_file_new_option ( weechat_config_file, ptr_section, "status_count_highlight", "color", N_("text color for count of highlight messages in hotlist (status bar)"), NULL, -1, 0, "magenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_count_msg = config_file_new_option ( weechat_config_file, ptr_section, "status_count_msg", "color", N_("text color for count of messages in hotlist (status bar)"), NULL, -1, 0, "brown", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_count_other = config_file_new_option ( weechat_config_file, ptr_section, "status_count_other", "color", N_("text color for count of other messages in hotlist (status bar)"), NULL, -1, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_count_private = config_file_new_option ( weechat_config_file, ptr_section, "status_count_private", "color", N_("text color for count of private messages in hotlist (status bar)"), NULL, -1, 0, "green", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_data_highlight = config_file_new_option ( weechat_config_file, ptr_section, "status_data_highlight", "color", N_("text color for buffer with highlight (status bar)"), NULL, -1, 0, "lightmagenta", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_data_msg = config_file_new_option ( weechat_config_file, ptr_section, "status_data_msg", "color", N_("text color for buffer with new messages (status bar)"), NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_data_other = config_file_new_option ( weechat_config_file, ptr_section, "status_data_other", "color", N_("text color for buffer with new data (not messages) " "(status bar)"), NULL, -1, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_data_private = config_file_new_option ( weechat_config_file, ptr_section, "status_data_private", "color", N_("text color for buffer with private message (status bar)"), NULL, -1, 0, "lightgreen", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_filter = config_file_new_option ( weechat_config_file, ptr_section, "status_filter", "color", N_("text color for filter indicator in status bar"), NULL, -1, 0, "green", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_more = config_file_new_option ( weechat_config_file, ptr_section, "status_more", "color", N_("text color for buffer with new data (status bar)"), NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_mouse = config_file_new_option ( weechat_config_file, ptr_section, "status_mouse", "color", N_("text color for mouse indicator in status bar"), NULL, -1, 0, "green", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_name = config_file_new_option ( weechat_config_file, ptr_section, "status_name", "color", N_("text color for current buffer name in status bar"), NULL, -1, 0, "white", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_name_ssl = config_file_new_option ( weechat_config_file, ptr_section, "status_name_ssl", "color", N_("text color for current buffer name in status bar, if data are " "secured with a protocol like SSL"), NULL, -1, 0, "lightgreen", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_nicklist_count = config_file_new_option ( weechat_config_file, ptr_section, "status_nicklist_count", "color", N_("text color for number of nicks in nicklist (status bar)"), NULL, -1, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_number = config_file_new_option ( weechat_config_file, ptr_section, "status_number", "color", N_("text color for current buffer number in status bar"), NULL, -1, 0, "yellow", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); config_color_status_time = config_file_new_option ( weechat_config_file, ptr_section, "status_time", "color", N_("text color for time (status bar)"), NULL, -1, 0, "default", NULL, 0, - NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, NULL, NULL, + &config_change_color, NULL, NULL, + NULL, NULL, NULL); /* completion */ ptr_section = config_file_new_section (weechat_config_file, "completion", 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3424,7 +3910,8 @@ config_weechat_init_options () "base_word_until_cursor", "boolean", N_("if enabled, the base word to complete ends at char before cursor; " "otherwise the base word ends at first space after cursor"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_command_inline = config_file_new_option ( weechat_config_file, ptr_section, "command_inline", "boolean", @@ -3433,7 +3920,8 @@ config_weechat_init_options () "first); note: when this option is enabled, there is no more " "automatic completion of paths beginning with '/' (outside " "commands arguments)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_default_template = config_file_new_option ( weechat_config_file, ptr_section, "default_template", "string", @@ -3441,63 +3929,75 @@ config_weechat_init_options () "codes and values: plugin API reference, function " "\"weechat_hook_command\")"), NULL, 0, 0, "%(nicks)|%(irc_channels)", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_add_space = config_file_new_option ( weechat_config_file, ptr_section, "nick_add_space", "boolean", N_("add space after nick completion (when nick is not first word on " "command line)"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_completer = config_file_new_option ( weechat_config_file, ptr_section, "nick_completer", "string", N_("string inserted after nick completion (when nick is first word on " "command line)"), - NULL, 0, 0, ":", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, ":", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_first_only = config_file_new_option ( weechat_config_file, ptr_section, "nick_first_only", "boolean", N_("complete only with first nick found"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_ignore_chars = config_file_new_option ( weechat_config_file, ptr_section, "nick_ignore_chars", "string", N_("chars ignored for nick completion"), - NULL, 0, 0, "[]`_-^", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "[]`_-^", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_alert = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_alert", "boolean", N_("alert user when a partial completion occurs"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_command = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_command", "boolean", N_("partially complete command names (stop when many commands found " "begin with same letters)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_command_arg = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_command_arg", "boolean", N_("partially complete command arguments (stop when many arguments " "found begin with same prefix)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_count = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_count", "boolean", N_("display count for each partial completion in bar item"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_other = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_other", "boolean", N_("partially complete outside commands (stop when many words found " "begin with same letters)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* history */ ptr_section = config_file_new_section (weechat_config_file, "history", 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3509,7 +4009,8 @@ config_weechat_init_options () "display_default", "integer", N_("maximum number of commands to display by default in " "history listing (0 = unlimited)"), - NULL, 0, INT_MAX, "5", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "5", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_history_max_buffer_lines_minutes = config_file_new_option ( weechat_config_file, ptr_section, "max_buffer_lines_minutes", "integer", @@ -3517,32 +4018,39 @@ config_weechat_init_options () "(0 = unlimited); examples: 1440 = one day, 10080 = one week, " "43200 = one month, 525600 = one year; use 0 ONLY if option " "weechat.history.max_buffer_lines_number is NOT set to 0"), - NULL, 0, INT_MAX, "0", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "0", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_history_max_buffer_lines_number = config_file_new_option ( weechat_config_file, ptr_section, "max_buffer_lines_number", "integer", N_("maximum number of lines in history per buffer " "(0 = unlimited); use 0 ONLY if option " "weechat.history.max_buffer_lines_minutes is NOT set to 0"), - NULL, 0, INT_MAX, "4096", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "4096", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_history_max_commands = config_file_new_option ( weechat_config_file, ptr_section, "max_commands", "integer", N_("maximum number of user commands in history (0 = " "unlimited, NOT RECOMMENDED: no limit in memory usage)"), - NULL, 0, INT_MAX, "100", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "100", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_history_max_visited_buffers = config_file_new_option ( weechat_config_file, ptr_section, "max_visited_buffers", "integer", N_("maximum number of visited buffers to keep in memory"), - NULL, 0, 1000, "50", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 1000, "50", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* proxies */ - ptr_section = config_file_new_section (weechat_config_file, "proxy", - 0, 0, - &config_weechat_proxy_read_cb, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "proxy", + 0, 0, + &config_weechat_proxy_read_cb, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3554,8 +4062,11 @@ config_weechat_init_options () /* network */ ptr_section = config_file_new_section (weechat_config_file, "network", 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3567,19 +4078,23 @@ config_weechat_init_options () "connection_timeout", "integer", N_("timeout (in seconds) for connection to a remote host (made in a " "child process)"), - NULL, 1, INT_MAX, "60", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 1, INT_MAX, "60", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_network_gnutls_ca_file = config_file_new_option ( weechat_config_file, ptr_section, "gnutls_ca_file", "string", N_("file containing the certificate authorities (\"%h\" will be " "replaced by WeeChat home, \"~/.weechat\" by default)"), - NULL, 0, 0, CA_FILE, NULL, 0, NULL, NULL, - &config_change_network_gnutls_ca_file, NULL, NULL, NULL); + NULL, 0, 0, CA_FILE, NULL, 0, + NULL, NULL, NULL, + &config_change_network_gnutls_ca_file, NULL, NULL, + NULL, NULL, NULL); config_network_gnutls_handshake_timeout = config_file_new_option ( weechat_config_file, ptr_section, "gnutls_handshake_timeout", "integer", N_("timeout (in seconds) for gnutls handshake"), - NULL, 1, INT_MAX, "30", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 1, INT_MAX, "30", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_network_proxy_curl = config_file_new_option ( weechat_config_file, ptr_section, "proxy_curl", "string", @@ -3587,13 +4102,18 @@ config_weechat_init_options () "list of scripts and in scripts calling function hook_process); the " "proxy must be defined with command /proxy"), NULL, 0, 0, "", NULL, 0, - &config_check_proxy_curl, NULL, NULL, NULL, NULL, NULL); + &config_check_proxy_curl, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); /* plugin */ ptr_section = config_file_new_section (weechat_config_file, "plugin", 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3608,37 +4128,46 @@ config_weechat_init_options () "\"!\" is a negative value to prevent a plugin from being loaded, " "wildcard \"*\" is allowed in names (examples: \"*\" or " "\"*,!lua,!tcl\")"), - NULL, 0, 0, "*", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "*", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_plugin_debug = config_file_new_option ( weechat_config_file, ptr_section, "debug", "boolean", N_("enable debug messages by default in all plugins (option disabled " "by default, which is highly recommended)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_plugin_extension = config_file_new_option ( weechat_config_file, ptr_section, "extension", "string", N_("comma separated list of file name extensions for plugins"), - NULL, 0, 0, ".so,.dll", NULL, 0, NULL, NULL, - &config_change_plugin_extension, NULL, NULL, NULL); + NULL, 0, 0, ".so,.dll", NULL, 0, + NULL, NULL, NULL, + &config_change_plugin_extension, NULL, NULL, + NULL, NULL, NULL); config_plugin_path = config_file_new_option ( weechat_config_file, ptr_section, "path", "string", N_("path for searching plugins (\"%h\" will be replaced by " "WeeChat home, \"~/.weechat\" by default)"), - NULL, 0, 0, "%h/plugins", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%h/plugins", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_plugin_save_config_on_unload = config_file_new_option ( weechat_config_file, ptr_section, "save_config_on_unload", "boolean", N_("save configuration files when unloading plugins"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* bars */ - ptr_section = config_file_new_section (weechat_config_file, "bar", - 0, 0, - &config_weechat_bar_read_cb, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "bar", + 0, 0, + &config_weechat_bar_read_cb, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3648,11 +4177,14 @@ config_weechat_init_options () weechat_config_section_bar = ptr_section; /* layout */ - ptr_section = config_file_new_section (weechat_config_file, "layout", - 0, 0, - &config_weechat_layout_read_cb, NULL, - &config_weechat_layout_write_cb, NULL, - NULL, NULL, NULL, NULL, NULL, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "layout", + 0, 0, + &config_weechat_layout_read_cb, NULL, NULL, + &config_weechat_layout_write_cb, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3660,13 +4192,14 @@ config_weechat_init_options () } /* notify */ - ptr_section = config_file_new_section (weechat_config_file, "notify", - 1, 1, - NULL, NULL, - NULL, NULL, - NULL, NULL, - &config_weechat_notify_create_option_cb, NULL, - &config_weechat_notify_delete_option_cb, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "notify", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &config_weechat_notify_create_option_cb, NULL, NULL, + &config_weechat_notify_delete_option_cb, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3676,12 +4209,14 @@ config_weechat_init_options () weechat_config_section_notify = ptr_section; /* filters */ - ptr_section = config_file_new_section (weechat_config_file, "filter", - 0, 0, - &config_weechat_filter_read_cb, NULL, - &config_weechat_filter_write_cb, NULL, - &config_weechat_filter_write_cb, NULL, - NULL, NULL, NULL, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, "filter", + 0, 0, + &config_weechat_filter_read_cb, NULL, NULL, + &config_weechat_filter_write_cb, NULL, NULL, + &config_weechat_filter_write_cb, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3695,12 +4230,14 @@ config_weechat_init_options () "key%s%s", (i == GUI_KEY_CONTEXT_DEFAULT) ? "" : "_", (i == GUI_KEY_CONTEXT_DEFAULT) ? "" : gui_key_context_string[i]); - ptr_section = config_file_new_section (weechat_config_file, section_name, - 0, 0, - &config_weechat_key_read_cb, NULL, - &config_weechat_key_write_cb, NULL, - &config_weechat_key_write_cb, NULL, - NULL, NULL, NULL, NULL); + ptr_section = config_file_new_section ( + weechat_config_file, section_name, + 0, 0, + &config_weechat_key_read_cb, NULL, NULL, + &config_weechat_key_write_cb, NULL, NULL, + &config_weechat_key_write_cb, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -3749,18 +4286,18 @@ config_weechat_init () 60, /* when second is 00 */ 0, &config_day_change_timer_cb, - NULL); + NULL, NULL); } if (!config_highlight_regex) - config_change_highlight_regex (NULL, NULL); + config_change_highlight_regex (NULL, NULL, NULL); if (!config_highlight_tags) - config_change_highlight_tags (NULL, NULL); + config_change_highlight_tags (NULL, NULL, NULL); if (!config_plugin_extensions) - config_change_plugin_extension (NULL, NULL); + config_change_plugin_extension (NULL, NULL, NULL); if (!config_word_chars_highlight) - config_change_word_chars_highlight (NULL, NULL); + config_change_word_chars_highlight (NULL, NULL, NULL); if (!config_word_chars_input) - config_change_word_chars_input (NULL, NULL); + config_change_word_chars_input (NULL, NULL, NULL); return rc; } diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index 879c5cc6b..1aaa436a7 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -127,10 +127,12 @@ debug_dump (int crash) */ int -debug_dump_cb (void *data, const char *signal, const char *type_data, +debug_dump_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -324,7 +326,8 @@ debug_hdata_hash_list_map_cb (void *data, */ void -debug_hdata_map_cb (void *data, struct t_hashtable *hashtable, +debug_hdata_map_cb (void *data, + struct t_hashtable *hashtable, const void *key, const void *value) { struct t_hdata *ptr_hdata; @@ -345,13 +348,11 @@ debug_hdata_map_cb (void *data, struct t_hashtable *hashtable, ptr_hdata->hash_list->items_count); /* display lists */ - hashtable_map (ptr_hdata->hash_list, - &debug_hdata_hash_list_map_cb, NULL); + hashtable_map (ptr_hdata->hash_list, &debug_hdata_hash_list_map_cb, NULL); /* display vars */ list = weelist_new (); - hashtable_map (ptr_hdata->hash_var, - &debug_hdata_hash_var_map_cb, list); + hashtable_map (ptr_hdata->hash_var, &debug_hdata_hash_var_map_cb, list); for (ptr_item = list->items; ptr_item; ptr_item = ptr_item->next_item) { @@ -510,10 +511,12 @@ debug_infolists () */ int -debug_libs_cb (void *data, const char *signal, const char *type_data, +debug_libs_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -648,8 +651,8 @@ debug_init () * plugins (they should anyway because this function is called before load * of plugins) */ - hook_signal (NULL, "2000|debug_dump", &debug_dump_cb, NULL); - hook_signal (NULL, "2000|debug_libs", &debug_libs_cb, NULL); + hook_signal (NULL, "2000|debug_dump", &debug_dump_cb, NULL, NULL); + hook_signal (NULL, "2000|debug_libs", &debug_libs_cb, NULL, NULL); } /* diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index 4e0959b16..dd33e4bbb 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -364,7 +364,8 @@ hook_get_priority_and_name (const char *string, void hook_init_data (struct t_hook *hook, struct t_weechat_plugin *plugin, - int type, int priority, void *callback_data) + int type, int priority, + const void *callback_pointer, void *callback_data) { hook->plugin = plugin; hook->subplugin = NULL; @@ -372,6 +373,7 @@ hook_init_data (struct t_hook *hook, struct t_weechat_plugin *plugin, hook->deleted = 0; hook->running = 0; hook->priority = priority; + hook->callback_pointer = callback_pointer; hook->callback_data = callback_data; hook->hook_data = NULL; @@ -648,7 +650,9 @@ hook_command (struct t_weechat_plugin *plugin, const char *command, const char *description, const char *args, const char *args_description, const char *completion, - t_hook_callback_command *callback, void *callback_data) + t_hook_callback_command *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_command *new_hook_command; @@ -681,7 +685,7 @@ hook_command (struct t_weechat_plugin *plugin, const char *command, hook_get_priority_and_name (command, &priority, &ptr_command); hook_init_data (new_hook, plugin, HOOK_TYPE_COMMAND, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_command; new_hook_command->callback = callback; @@ -859,7 +863,12 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, /* execute the command! */ ptr_hook->running++; rc = (int) (HOOK_COMMAND(ptr_hook, callback)) - (ptr_hook->callback_data, buffer, argc, argv, argv_eol); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + buffer, + argc, + argv, + argv_eol); ptr_hook->running--; if (rc == WEECHAT_RC_ERROR) rc = HOOK_COMMAND_EXEC_ERROR; @@ -883,8 +892,11 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, */ struct t_hook * -hook_command_run (struct t_weechat_plugin *plugin, const char *command, - t_hook_callback_command_run *callback, void *callback_data) +hook_command_run (struct t_weechat_plugin *plugin, + const char *command, + t_hook_callback_command_run *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_command_run *new_hook_command_run; @@ -906,7 +918,7 @@ hook_command_run (struct t_weechat_plugin *plugin, const char *command, hook_get_priority_and_name (command, &priority, &ptr_command); hook_init_data (new_hook, plugin, HOOK_TYPE_COMMAND_RUN, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_command_run; new_hook_command_run->callback = callback; @@ -968,9 +980,11 @@ hook_command_run_exec (struct t_gui_buffer *buffer, const char *command) if (hook_matching) { ptr_hook->running = 1; - rc = (HOOK_COMMAND_RUN(ptr_hook, callback)) (ptr_hook->callback_data, - buffer, - ptr_command); + rc = (HOOK_COMMAND_RUN(ptr_hook, callback)) ( + ptr_hook->callback_pointer, + ptr_hook->callback_data, + buffer, + ptr_command); ptr_hook->running = 0; if (rc == WEECHAT_RC_OK_EAT) { @@ -1055,6 +1069,7 @@ hook_timer_init (struct t_hook *hook) struct t_hook * hook_timer (struct t_weechat_plugin *plugin, long interval, int align_second, int max_calls, t_hook_callback_timer *callback, + const void *callback_pointer, void *callback_data) { struct t_hook *new_hook; @@ -1074,7 +1089,7 @@ hook_timer (struct t_weechat_plugin *plugin, long interval, int align_second, } hook_init_data (new_hook, plugin, HOOK_TYPE_TIMER, HOOK_PRIORITY_DEFAULT, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_timer; new_hook_timer->callback = callback; @@ -1237,7 +1252,8 @@ hook_timer_exec () { ptr_hook->running = 1; (void) (HOOK_TIMER(ptr_hook, callback)) - (ptr_hook->callback_data, + (ptr_hook->callback_pointer, + ptr_hook->callback_data, (HOOK_TIMER(ptr_hook, remaining_calls) > 0) ? HOOK_TIMER(ptr_hook, remaining_calls) - 1 : -1); ptr_hook->running = 0; @@ -1296,7 +1312,9 @@ hook_search_fd (int fd) struct t_hook * hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read, int flag_write, int flag_exception, - t_hook_callback_fd *callback, void *callback_data) + t_hook_callback_fd *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_fd *new_hook_fd; @@ -1315,7 +1333,7 @@ hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read, } hook_init_data (new_hook, plugin, HOOK_TYPE_FD, HOOK_PRIORITY_DEFAULT, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_fd; new_hook_fd->callback = callback; @@ -1415,8 +1433,10 @@ hook_fd_exec () if (found) { ptr_hook->running = 1; - (void) (HOOK_FD(ptr_hook, callback)) (ptr_hook->callback_data, - HOOK_FD(ptr_hook, fd)); + (void) (HOOK_FD(ptr_hook, callback)) ( + ptr_hook->callback_pointer, + ptr_hook->callback_data, + HOOK_FD(ptr_hook, fd)); ptr_hook->running = 0; } } @@ -1435,9 +1455,12 @@ hook_fd_exec () struct t_hook * hook_process_hashtable (struct t_weechat_plugin *plugin, - const char *command, struct t_hashtable *options, + const char *command, + struct t_hashtable *options, int timeout, - t_hook_callback_process *callback, void *callback_data) + t_hook_callback_process *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_process *new_hook_process; @@ -1470,7 +1493,7 @@ hook_process_hashtable (struct t_weechat_plugin *plugin, goto error; hook_init_data (new_hook, plugin, HOOK_TYPE_PROCESS, HOOK_PRIORITY_DEFAULT, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_process; new_hook_process->callback = callback; @@ -1548,11 +1571,14 @@ error: struct t_hook * hook_process (struct t_weechat_plugin *plugin, - const char *command, int timeout, - t_hook_callback_process *callback, void *callback_data) + const char *command, + int timeout, + t_hook_callback_process *callback, + const void *callback_pointer, + void *callback_data) { return hook_process_hashtable (plugin, command, NULL, timeout, - callback, callback_data); + callback, callback_pointer, callback_data); } /* @@ -1733,7 +1759,8 @@ hook_process_send_buffers (struct t_hook *hook_process, int callback_rc) /* send buffers to callback */ (void) (HOOK_PROCESS(hook_process, callback)) - (hook_process->callback_data, + (hook_process->callback_pointer, + hook_process->callback_data, HOOK_PROCESS(hook_process, command), callback_rc, (HOOK_PROCESS(hook_process, buffer_size[HOOK_PROCESS_STDOUT]) > 0) ? @@ -1801,11 +1828,15 @@ hook_process_child_read (struct t_hook *hook_process, int fd, */ int -hook_process_child_read_stdout_cb (void *arg_hook_process, int fd) +hook_process_child_read_stdout_cb (const void *pointer, void *data, int fd) { struct t_hook *hook_process; - hook_process = (struct t_hook *)arg_hook_process; + /* make C compiler happy */ + (void) data; + + hook_process = (struct t_hook *)pointer; + hook_process_child_read (hook_process, fd, HOOK_PROCESS_STDOUT, &(HOOK_PROCESS(hook_process, hook_fd[HOOK_PROCESS_STDOUT]))); return WEECHAT_RC_OK; @@ -1816,11 +1847,15 @@ hook_process_child_read_stdout_cb (void *arg_hook_process, int fd) */ int -hook_process_child_read_stderr_cb (void *arg_hook_process, int fd) +hook_process_child_read_stderr_cb (const void *pointer, void *data, int fd) { struct t_hook *hook_process; - hook_process = (struct t_hook *)arg_hook_process; + /* make C compiler happy */ + (void) data; + + hook_process = (struct t_hook *)pointer; + hook_process_child_read (hook_process, fd, HOOK_PROCESS_STDERR, &(HOOK_PROCESS(hook_process, hook_fd[HOOK_PROCESS_STDERR]))); return WEECHAT_RC_OK; @@ -1883,6 +1918,7 @@ hook_process_child_read_until_eof (struct t_hook *hook_process) { (void) hook_process_child_read_stdout_cb ( hook_process, + NULL, HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDOUT])); } @@ -1890,6 +1926,7 @@ hook_process_child_read_until_eof (struct t_hook *hook_process) { (void) hook_process_child_read_stderr_cb ( hook_process, + NULL, HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDERR])); } @@ -1905,15 +1942,16 @@ hook_process_child_read_until_eof (struct t_hook *hook_process) */ int -hook_process_timer_cb (void *arg_hook_process, int remaining_calls) +hook_process_timer_cb (const void *pointer, void *data, int remaining_calls) { struct t_hook *hook_process; int status, rc; /* make C compiler happy */ + (void) data; (void) remaining_calls; - hook_process = (struct t_hook *)arg_hook_process; + hook_process = (struct t_hook *)pointer; if (hook_process->deleted) return WEECHAT_RC_OK; @@ -2007,7 +2045,8 @@ hook_process_run (struct t_hook *hook_process) /* fork failed */ case -1: (void) (HOOK_PROCESS(hook_process, callback)) - (hook_process->callback_data, + (hook_process->callback_pointer, + hook_process->callback_data, HOOK_PROCESS(hook_process, command), WEECHAT_HOOK_PROCESS_ERROR, NULL, NULL); @@ -2048,7 +2087,7 @@ hook_process_run (struct t_hook *hook_process) HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDOUT]), 1, 0, 0, &hook_process_child_read_stdout_cb, - hook_process); + hook_process, NULL); } if (HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDERR]) >= 0) @@ -2058,7 +2097,7 @@ hook_process_run (struct t_hook *hook_process) HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDERR]), 1, 0, 0, &hook_process_child_read_stderr_cb, - hook_process); + hook_process, NULL); } timeout = HOOK_PROCESS(hook_process, timeout); @@ -2082,7 +2121,8 @@ hook_process_run (struct t_hook *hook_process) HOOK_PROCESS(hook_process, hook_timer) = hook_timer (hook_process->plugin, interval, 0, max_calls, &hook_process_timer_cb, - hook_process); + hook_process, + NULL); return; error: @@ -2094,7 +2134,8 @@ error: close (pipes[i][1]); } (void) (HOOK_PROCESS(hook_process, callback)) - (hook_process->callback_data, + (hook_process->callback_pointer, + hook_process->callback_data, HOOK_PROCESS(hook_process, command), WEECHAT_HOOK_PROCESS_ERROR, NULL, NULL); @@ -2112,7 +2153,9 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy, const char *address, int port, int ipv6, int retry, void *gnutls_sess, void *gnutls_cb, int gnutls_dhkey_size, const char *gnutls_priorities, const char *local_hostname, - t_hook_callback_connect *callback, void *callback_data) + t_hook_callback_connect *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_connect *new_hook_connect; @@ -2142,7 +2185,7 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy, } hook_init_data (new_hook, plugin, HOOK_TYPE_CONNECT, HOOK_PRIORITY_DEFAULT, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_connect; new_hook_connect->callback = callback; @@ -2208,7 +2251,9 @@ hook_connect_gnutls_verify_certificates (gnutls_session_t tls_session) && (*(HOOK_CONNECT(ptr_hook, gnutls_sess)) == tls_session)) { rc = (int) (HOOK_CONNECT(ptr_hook, gnutls_cb)) - (ptr_hook->callback_data, tls_session, NULL, 0, + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + tls_session, NULL, 0, NULL, 0, NULL, WEECHAT_HOOK_CONNECT_GNUTLS_CB_VERIFY_CERT); break; @@ -2249,7 +2294,9 @@ hook_connect_gnutls_set_certificates (gnutls_session_t tls_session, && (*(HOOK_CONNECT(ptr_hook, gnutls_sess)) == tls_session)) { rc = (int) (HOOK_CONNECT(ptr_hook, gnutls_cb)) - (ptr_hook->callback_data, tls_session, req_ca, nreq, + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + tls_session, req_ca, nreq, pk_algos, pk_algos_len, answer, WEECHAT_HOOK_CONNECT_GNUTLS_CB_SET_CERT); break; @@ -2270,7 +2317,9 @@ hook_connect_gnutls_set_certificates (gnutls_session_t tls_session, struct t_hook * hook_print (struct t_weechat_plugin *plugin, struct t_gui_buffer *buffer, const char *tags, const char *message, int strip_colors, - t_hook_callback_print *callback, void *callback_data) + t_hook_callback_print *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_print *new_hook_print; @@ -2291,7 +2340,7 @@ hook_print (struct t_weechat_plugin *plugin, struct t_gui_buffer *buffer, } hook_init_data (new_hook, plugin, HOOK_TYPE_PRINT, HOOK_PRIORITY_DEFAULT, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_print; new_hook_print->callback = callback; @@ -2375,7 +2424,8 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line) /* run callback */ ptr_hook->running = 1; (void) (HOOK_PRINT(ptr_hook, callback)) - (ptr_hook->callback_data, buffer, line->data->date, + (ptr_hook->callback_pointer, + ptr_hook->callback_data, buffer, line->data->date, line->data->tags_count, (const char **)line->data->tags_array, (int)line->data->displayed, (int)line->data->highlight, @@ -2404,7 +2454,9 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line) struct t_hook * hook_signal (struct t_weechat_plugin *plugin, const char *signal, - t_hook_callback_signal *callback, void *callback_data) + t_hook_callback_signal *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_signal *new_hook_signal; @@ -2426,7 +2478,7 @@ hook_signal (struct t_weechat_plugin *plugin, const char *signal, hook_get_priority_and_name (signal, &priority, &ptr_signal); hook_init_data (new_hook, plugin, HOOK_TYPE_SIGNAL, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_signal; new_hook_signal->callback = callback; @@ -2462,7 +2514,11 @@ hook_signal_send (const char *signal, const char *type_data, void *signal_data) { ptr_hook->running = 1; rc = (HOOK_SIGNAL(ptr_hook, callback)) - (ptr_hook->callback_data, signal, type_data, signal_data); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + signal, + type_data, + signal_data); ptr_hook->running = 0; if (rc == WEECHAT_RC_OK_EAT) @@ -2485,7 +2541,9 @@ hook_signal_send (const char *signal, const char *type_data, void *signal_data) struct t_hook * hook_hsignal (struct t_weechat_plugin *plugin, const char *signal, - t_hook_callback_hsignal *callback, void *callback_data) + t_hook_callback_hsignal *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_hsignal *new_hook_hsignal; @@ -2507,7 +2565,7 @@ hook_hsignal (struct t_weechat_plugin *plugin, const char *signal, hook_get_priority_and_name (signal, &priority, &ptr_signal); hook_init_data (new_hook, plugin, HOOK_TYPE_HSIGNAL, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_hsignal; new_hook_hsignal->callback = callback; @@ -2543,7 +2601,10 @@ hook_hsignal_send (const char *signal, struct t_hashtable *hashtable) { ptr_hook->running = 1; rc = (HOOK_HSIGNAL(ptr_hook, callback)) - (ptr_hook->callback_data, signal, hashtable); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + signal, + hashtable); ptr_hook->running = 0; if (rc == WEECHAT_RC_OK_EAT) @@ -2566,7 +2627,9 @@ hook_hsignal_send (const char *signal, struct t_hashtable *hashtable) struct t_hook * hook_config (struct t_weechat_plugin *plugin, const char *option, - t_hook_callback_config *callback, void *callback_data) + t_hook_callback_config *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_config *new_hook_config; @@ -2588,7 +2651,7 @@ hook_config (struct t_weechat_plugin *plugin, const char *option, hook_get_priority_and_name (option, &priority, &ptr_option); hook_init_data (new_hook, plugin, HOOK_TYPE_CONFIG, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_config; new_hook_config->callback = callback; @@ -2623,7 +2686,10 @@ hook_config_exec (const char *option, const char *value) { ptr_hook->running = 1; (void) (HOOK_CONFIG(ptr_hook, callback)) - (ptr_hook->callback_data, option, value); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + option, + value); ptr_hook->running = 0; } @@ -2642,7 +2708,9 @@ hook_config_exec (const char *option, const char *value) struct t_hook * hook_completion (struct t_weechat_plugin *plugin, const char *completion_item, const char *description, - t_hook_callback_completion *callback, void *callback_data) + t_hook_callback_completion *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_completion *new_hook_completion; @@ -2665,7 +2733,7 @@ hook_completion (struct t_weechat_plugin *plugin, const char *completion_item, hook_get_priority_and_name (completion_item, &priority, &ptr_completion_item); hook_init_data (new_hook, plugin, HOOK_TYPE_COMPLETION, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_completion; new_hook_completion->callback = callback; @@ -2731,7 +2799,11 @@ hook_completion_exec (struct t_weechat_plugin *plugin, { ptr_hook->running = 1; (void) (HOOK_COMPLETION(ptr_hook, callback)) - (ptr_hook->callback_data, completion_item, buffer, completion); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + completion_item, + buffer, + completion); ptr_hook->running = 0; } @@ -2749,7 +2821,9 @@ hook_completion_exec (struct t_weechat_plugin *plugin, struct t_hook * hook_modifier (struct t_weechat_plugin *plugin, const char *modifier, - t_hook_callback_modifier *callback, void *callback_data) + t_hook_callback_modifier *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_modifier *new_hook_modifier; @@ -2771,7 +2845,7 @@ hook_modifier (struct t_weechat_plugin *plugin, const char *modifier, hook_get_priority_and_name (modifier, &priority, &ptr_modifier); hook_init_data (new_hook, plugin, HOOK_TYPE_MODIFIER, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_modifier; new_hook_modifier->callback = callback; @@ -2820,7 +2894,10 @@ hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier, { ptr_hook->running = 1; new_msg = (HOOK_MODIFIER(ptr_hook, callback)) - (ptr_hook->callback_data, modifier, modifier_data, + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + modifier, + modifier_data, message_modified); ptr_hook->running = 0; @@ -2857,7 +2934,9 @@ hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier, struct t_hook * hook_info (struct t_weechat_plugin *plugin, const char *info_name, const char *description, const char *args_description, - t_hook_callback_info *callback, void *callback_data) + t_hook_callback_info *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_info *new_hook_info; @@ -2878,7 +2957,8 @@ hook_info (struct t_weechat_plugin *plugin, const char *info_name, } hook_get_priority_and_name (info_name, &priority, &ptr_info_name); - hook_init_data (new_hook, plugin, HOOK_TYPE_INFO, priority, callback_data); + hook_init_data (new_hook, plugin, HOOK_TYPE_INFO, priority, + callback_pointer, callback_data); new_hook->hook_data = new_hook_info; new_hook_info->callback = callback; @@ -2924,7 +3004,10 @@ hook_info_get (struct t_weechat_plugin *plugin, const char *info_name, { ptr_hook->running = 1; value = (HOOK_INFO(ptr_hook, callback)) - (ptr_hook->callback_data, info_name, arguments); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + info_name, + arguments); ptr_hook->running = 0; hook_exec_end (); @@ -2951,6 +3034,7 @@ hook_info_hashtable (struct t_weechat_plugin *plugin, const char *info_name, const char *description, const char *args_description, const char *output_description, t_hook_callback_info_hashtable *callback, + const void *callback_pointer, void *callback_data) { struct t_hook *new_hook; @@ -2973,7 +3057,7 @@ hook_info_hashtable (struct t_weechat_plugin *plugin, const char *info_name, hook_get_priority_and_name (info_name, &priority, &ptr_info_name); hook_init_data (new_hook, plugin, HOOK_TYPE_INFO_HASHTABLE, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_info_hashtable; new_hook_info_hashtable->callback = callback; @@ -3021,7 +3105,10 @@ hook_info_get_hashtable (struct t_weechat_plugin *plugin, const char *info_name, { ptr_hook->running = 1; value = (HOOK_INFO_HASHTABLE(ptr_hook, callback)) - (ptr_hook->callback_data, info_name, hashtable); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + info_name, + hashtable); ptr_hook->running = 0; hook_exec_end (); @@ -3047,7 +3134,9 @@ struct t_hook * hook_infolist (struct t_weechat_plugin *plugin, const char *infolist_name, const char *description, const char *pointer_description, const char *args_description, - t_hook_callback_infolist *callback, void *callback_data) + t_hook_callback_infolist *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_infolist *new_hook_infolist; @@ -3069,7 +3158,7 @@ hook_infolist (struct t_weechat_plugin *plugin, const char *infolist_name, hook_get_priority_and_name (infolist_name, &priority, &ptr_infolist_name); hook_init_data (new_hook, plugin, HOOK_TYPE_INFOLIST, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_infolist; new_hook_infolist->callback = callback; @@ -3117,7 +3206,11 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name, { ptr_hook->running = 1; value = (HOOK_INFOLIST(ptr_hook, callback)) - (ptr_hook->callback_data, infolist_name, pointer, arguments); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + infolist_name, + pointer, + arguments); ptr_hook->running = 0; hook_exec_end (); @@ -3142,7 +3235,9 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name, struct t_hook * hook_hdata (struct t_weechat_plugin *plugin, const char *hdata_name, const char *description, - t_hook_callback_hdata *callback, void *callback_data) + t_hook_callback_hdata *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_hdata *new_hook_hdata; @@ -3164,7 +3259,7 @@ hook_hdata (struct t_weechat_plugin *plugin, const char *hdata_name, hook_get_priority_and_name (hdata_name, &priority, &ptr_hdata_name); hook_init_data (new_hook, plugin, HOOK_TYPE_HDATA, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_hdata; new_hook_hdata->callback = callback; @@ -3213,7 +3308,8 @@ hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name) { ptr_hook->running = 1; value = (HOOK_HDATA(ptr_hook, callback)) - (ptr_hook->callback_data, + (ptr_hook->callback_pointer, + ptr_hook->callback_data, HOOK_HDATA(ptr_hook, hdata_name)); ptr_hook->running = 0; @@ -3237,8 +3333,11 @@ hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name) */ struct t_hook * -hook_focus (struct t_weechat_plugin *plugin, const char *area, - t_hook_callback_focus *callback, void *callback_data) +hook_focus (struct t_weechat_plugin *plugin, + const char *area, + t_hook_callback_focus *callback, + const void *callback_pointer, + void *callback_data) { struct t_hook *new_hook; struct t_hook_focus *new_hook_focus; @@ -3260,7 +3359,7 @@ hook_focus (struct t_weechat_plugin *plugin, const char *area, hook_get_priority_and_name (area, &priority, &ptr_area); hook_init_data (new_hook, plugin, HOOK_TYPE_FOCUS, priority, - callback_data); + callback_pointer, callback_data); new_hook->hook_data = new_hook_focus; new_hook_focus->callback = callback; @@ -3276,7 +3375,8 @@ hook_focus (struct t_weechat_plugin *plugin, const char *area, */ void -hook_focus_hashtable_map_cb (void *data, struct t_hashtable *hashtable, +hook_focus_hashtable_map_cb (void *data, + struct t_hashtable *hashtable, const void *key, const void *value) { struct t_hashtable *hashtable1; @@ -3295,7 +3395,8 @@ hook_focus_hashtable_map_cb (void *data, struct t_hashtable *hashtable, */ void -hook_focus_hashtable_map2_cb (void *data, struct t_hashtable *hashtable, +hook_focus_hashtable_map2_cb (void *data, + struct t_hashtable *hashtable, const void *key, const void *value) { struct t_hashtable *hashtable1; @@ -3364,7 +3465,9 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1, /* run callback for focus #1 */ ptr_hook->running = 1; hashtable_ret = (HOOK_FOCUS(ptr_hook, callback)) - (ptr_hook->callback_data, hashtable1); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + hashtable1); ptr_hook->running = 0; if (hashtable_ret) { @@ -3386,7 +3489,9 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1, { ptr_hook->running = 1; hashtable_ret = (HOOK_FOCUS(ptr_hook, callback)) - (ptr_hook->callback_data, hashtable2); + (ptr_hook->callback_pointer, + ptr_hook->callback_data, + hashtable2); ptr_hook->running = 0; if (hashtable_ret) { @@ -3410,7 +3515,8 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1, if (hashtable2) { - hashtable_map (hashtable2, &hook_focus_hashtable_map2_cb, hashtable1); + hashtable_map (hashtable2, + &hook_focus_hashtable_map2_cb, hashtable1); hashtable_free (hashtable2); } else @@ -3545,12 +3651,7 @@ unhook (struct t_hook *hook) plugin_get_name (hook->plugin)); } - /* free data */ - if (hook->subplugin) - { - free (hook->subplugin); - hook->subplugin = NULL; - } + /* free data specific to the hook */ if (hook->hook_data) { switch (hook->type) @@ -3951,6 +4052,18 @@ unhook (struct t_hook *hook) hook->hook_data = NULL; } + /* free data common to all hooks */ + if (hook->subplugin) + { + free (hook->subplugin); + hook->subplugin = NULL; + } + if (hook->callback_data) + { + free (hook->callback_data); + hook->callback_data = NULL; + } + /* remove hook from list (if there's no hook exec pending) */ if (hook_exec_recursion == 0) { @@ -3965,11 +4078,11 @@ unhook (struct t_hook *hook) } /* - * Unhooks everything for a plugin. + * Unhooks everything for a plugin/subplugin. */ void -unhook_all_plugin (struct t_weechat_plugin *plugin) +unhook_all_plugin (struct t_weechat_plugin *plugin, const char *subplugin) { int type; struct t_hook *ptr_hook, *next_hook; @@ -3981,7 +4094,14 @@ unhook_all_plugin (struct t_weechat_plugin *plugin) { next_hook = ptr_hook->next_hook; if (ptr_hook->plugin == plugin) - unhook (ptr_hook); + { + if (!subplugin + || (ptr_hook->subplugin && + strcmp (ptr_hook->subplugin, subplugin) == 0)) + { + unhook (ptr_hook); + } + } ptr_hook = next_hook; } } @@ -4045,6 +4165,10 @@ hook_add_to_infolist_pointer (struct t_infolist *infolist, struct t_hook *hook) return 0; if (!infolist_new_var_integer (ptr_item, "priority", hook->priority)) return 0; + if (!infolist_new_var_pointer (ptr_item, "callback_pointer", (void *)hook->callback_pointer)) + return 0; + if (!infolist_new_var_pointer (ptr_item, "callback_data", (void *)hook->callback_data)) + return 0; switch (hook->type) { case HOOK_TYPE_COMMAND: @@ -4521,6 +4645,7 @@ hook_print_log () log_printf (" deleted . . . . . . . . : %d", ptr_hook->deleted); log_printf (" running . . . . . . . . : %d", ptr_hook->running); log_printf (" priority. . . . . . . . : %d", ptr_hook->priority); + log_printf (" callback_pointer. . . . : 0x%lx", ptr_hook->callback_pointer); log_printf (" callback_data . . . . . : 0x%lx", ptr_hook->callback_data); if (ptr_hook->deleted) continue; diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h index d0fc10fc3..32e8e2947 100644 --- a/src/core/wee-hook.h +++ b/src/core/wee-hook.h @@ -133,6 +133,7 @@ struct t_hook int deleted; /* hook marked for deletion ? */ int running; /* 1 if hook is currently running */ int priority; /* priority (to sort hooks) */ + const void *callback_pointer; /* pointer sent to callback */ void *callback_data; /* data sent to callback */ /* hook data (depends on hook type) */ @@ -143,7 +144,8 @@ struct t_hook /* hook command */ -typedef int (t_hook_callback_command)(void *data, struct t_gui_buffer *buffer, +typedef int (t_hook_callback_command)(const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol); struct t_hook_command @@ -172,7 +174,7 @@ struct t_hook_command /* hook command run */ -typedef int (t_hook_callback_command_run)(void *data, +typedef int (t_hook_callback_command_run)(const void *pointer, void *data, struct t_gui_buffer *buffer, const char *command); @@ -184,7 +186,8 @@ struct t_hook_command_run /* hook timer */ -typedef int (t_hook_callback_timer)(void *data, int remaining_calls); +typedef int (t_hook_callback_timer)(const void *pointer, void *data, + int remaining_calls); struct t_hook_timer { @@ -199,7 +202,7 @@ struct t_hook_timer /* hook fd */ -typedef int (t_hook_callback_fd)(void *data, int fd); +typedef int (t_hook_callback_fd)(const void *pointer, void *data, int fd); struct t_hook_fd { @@ -212,9 +215,10 @@ struct t_hook_fd /* hook process */ -typedef int (t_hook_callback_process)(void *data, const char *command, - int return_code, const char *out, - const char *err); +typedef int (t_hook_callback_process)(const void *pointer, void *data, + const char *command, + int return_code, + const char *out, const char *err); struct t_hook_process { @@ -235,13 +239,14 @@ struct t_hook_process /* hook connect */ -typedef int (t_hook_callback_connect)(void *data, int status, - int gnutls_rc, int sock, +typedef int (t_hook_callback_connect)(const void *pointer, void *data, + int status, int gnutls_rc, int sock, const char *error, const char *ip_address); #ifdef HAVE_GNUTLS -typedef int (gnutls_callback_t)(void *data, gnutls_session_t tls_session, +typedef int (gnutls_callback_t)(const void *pointer, void *data, + gnutls_session_t tls_session, const gnutls_datum_t *req_ca, int nreq, const gnutls_pk_algorithm_t *pk_algos, int pk_algos_len, @@ -288,7 +293,8 @@ struct t_hook_connect /* hook print */ -typedef int (t_hook_callback_print)(void *data, struct t_gui_buffer *buffer, +typedef int (t_hook_callback_print)(const void *pointer, void *data, + struct t_gui_buffer *buffer, time_t date, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, @@ -306,8 +312,9 @@ struct t_hook_print /* hook signal */ -typedef int (t_hook_callback_signal)(void *data, const char *signal, - const char *type_data, void *signal_data); +typedef int (t_hook_callback_signal)(const void *pointer, void *data, + const char *signal, const char *type_data, + void *signal_data); struct t_hook_signal { @@ -318,7 +325,8 @@ struct t_hook_signal /* hook hsignal */ -typedef int (t_hook_callback_hsignal)(void *data, const char *signal, +typedef int (t_hook_callback_hsignal)(const void *pointer, void *data, + const char *signal, struct t_hashtable *hashtable); struct t_hook_hsignal @@ -330,8 +338,8 @@ struct t_hook_hsignal /* hook config */ -typedef int (t_hook_callback_config)(void *data, const char *option, - const char *value); +typedef int (t_hook_callback_config)(const void *pointer, void *data, + const char *option, const char *value); struct t_hook_config { @@ -342,7 +350,7 @@ struct t_hook_config /* hook completion */ -typedef int (t_hook_callback_completion)(void *data, +typedef int (t_hook_callback_completion)(const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion); @@ -356,7 +364,8 @@ struct t_hook_completion /* hook modifier */ -typedef char *(t_hook_callback_modifier)(void *data, const char *modifier, +typedef char *(t_hook_callback_modifier)(const void *pointer, void *data, + const char *modifier, const char *modifier_data, const char *string); @@ -368,7 +377,8 @@ struct t_hook_modifier /* hook info */ -typedef const char *(t_hook_callback_info)(void *data, const char *info_name, +typedef const char *(t_hook_callback_info)(const void *pointer, void *data, + const char *info_name, const char *arguments); struct t_hook_info @@ -381,7 +391,8 @@ struct t_hook_info /* hook info (hashtable) */ -typedef struct t_hashtable *(t_hook_callback_info_hashtable)(void *data, +typedef struct t_hashtable *(t_hook_callback_info_hashtable)(const void *pointer, + void *data, const char *info_name, struct t_hashtable *hashtable); @@ -396,9 +407,10 @@ struct t_hook_info_hashtable /* hook infolist */ -typedef struct t_infolist *(t_hook_callback_infolist)(void *data, +typedef struct t_infolist *(t_hook_callback_infolist)(const void *pointer, + void *data, const char *infolist_name, - void *pointer, + void *obj_pointer, const char *arguments); struct t_hook_infolist @@ -412,7 +424,8 @@ struct t_hook_infolist /* hook hdata */ -typedef struct t_hdata *(t_hook_callback_hdata)(void *data, +typedef struct t_hdata *(t_hook_callback_hdata)(const void *pointer, + void *data, const char *hdata_name); struct t_hook_hdata @@ -424,7 +437,8 @@ struct t_hook_hdata /* hook focus */ -typedef struct t_hashtable *(t_hook_callback_focus)(void *data, +typedef struct t_hashtable *(t_hook_callback_focus)(const void *pointer, + void *data, struct t_hashtable *info); struct t_hook_focus @@ -452,6 +466,7 @@ extern struct t_hook *hook_command (struct t_weechat_plugin *plugin, const char *args_description, const char *completion, t_hook_callback_command *callback, + const void *callback_pointer, void *callback_data); extern int hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, struct t_weechat_plugin *plugin, @@ -459,6 +474,7 @@ extern int hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, extern struct t_hook *hook_command_run (struct t_weechat_plugin *plugin, const char *command, t_hook_callback_command_run *callback, + const void *callback_pointer, void *callback_data); extern int hook_command_run_exec (struct t_gui_buffer *buffer, const char *command); @@ -466,24 +482,28 @@ extern struct t_hook *hook_timer (struct t_weechat_plugin *plugin, long interval, int align_second, int max_calls, t_hook_callback_timer *callback, + const void *callback_pointer, void *callback_data); extern void hook_timer_exec (); extern struct t_hook *hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read, int flag_write, int flag_exception, t_hook_callback_fd *callback, + const void *callback_pointer, void *callback_data); extern void hook_fd_exec (); extern struct t_hook *hook_process (struct t_weechat_plugin *plugin, const char *command, int timeout, t_hook_callback_process *callback, + const void *callback_pointer, void *callback_data); extern struct t_hook *hook_process_hashtable (struct t_weechat_plugin *plugin, const char *command, struct t_hashtable *options, int timeout, t_hook_callback_process *callback, + const void *callback_pointer, void *callback_data); extern struct t_hook *hook_connect (struct t_weechat_plugin *plugin, const char *proxy, const char *address, @@ -493,6 +513,7 @@ extern struct t_hook *hook_connect (struct t_weechat_plugin *plugin, const char *gnutls_priorities, const char *local_hostname, t_hook_callback_connect *callback, + const void *callback_pointer, void *callback_data); #ifdef HAVE_GNUTLS extern int hook_connect_gnutls_verify_certificates (gnutls_session_t tls_session); @@ -511,30 +532,35 @@ extern struct t_hook *hook_print (struct t_weechat_plugin *plugin, const char *tags, const char *message, int strip_colors, t_hook_callback_print *callback, + const void *callback_pointer, void *callback_data); extern void hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line); extern struct t_hook *hook_signal (struct t_weechat_plugin *plugin, const char *signal, t_hook_callback_signal *callback, + const void *callback_pointer, void *callback_data); extern int hook_signal_send (const char *signal, const char *type_data, void *signal_data); extern struct t_hook *hook_hsignal (struct t_weechat_plugin *plugin, const char *signal, t_hook_callback_hsignal *callback, + const void *callback_pointer, void *callback_data); extern int hook_hsignal_send (const char *signal, struct t_hashtable *hashtable); extern struct t_hook *hook_config (struct t_weechat_plugin *plugin, const char *option, t_hook_callback_config *callback, + const void *callback_pointer, void *callback_data); extern void hook_config_exec (const char *option, const char *value); extern struct t_hook *hook_completion (struct t_weechat_plugin *plugin, const char *completion_item, const char *description, t_hook_callback_completion *callback, + const void *callback_pointer, void *callback_data); extern const char *hook_completion_get_string (struct t_gui_completion *completion, const char *property); @@ -548,6 +574,7 @@ extern void hook_completion_exec (struct t_weechat_plugin *plugin, extern struct t_hook *hook_modifier (struct t_weechat_plugin *plugin, const char *modifier, t_hook_callback_modifier *callback, + const void *callback_pointer, void *callback_data); extern char *hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier, @@ -558,6 +585,7 @@ extern struct t_hook *hook_info (struct t_weechat_plugin *plugin, const char *description, const char *args_description, t_hook_callback_info *callback, + const void *callback_pointer, void *callback_data); extern const char *hook_info_get (struct t_weechat_plugin *plugin, const char *info_name, @@ -568,6 +596,7 @@ extern struct t_hook *hook_info_hashtable (struct t_weechat_plugin *plugin, const char *args_description, const char *output_description, t_hook_callback_info_hashtable *callback, + const void *callback_pointer, void *callback_data); extern struct t_hashtable *hook_info_get_hashtable (struct t_weechat_plugin *plugin, const char *info_name, @@ -578,6 +607,7 @@ extern struct t_hook *hook_infolist (struct t_weechat_plugin *plugin, const char *pointer_description, const char *args_description, t_hook_callback_infolist *callback, + const void *callback_pointer, void *callback_data); extern struct t_infolist *hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name, @@ -587,19 +617,22 @@ extern struct t_hook *hook_hdata (struct t_weechat_plugin *plugin, const char *hdata_name, const char *description, t_hook_callback_hdata *callback, + const void *callback_pointer, void *callback_data); extern struct t_hdata *hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name); extern struct t_hook *hook_focus (struct t_weechat_plugin *plugin, const char *area, t_hook_callback_focus *callback, + const void *callback_pointer, void *callback_data); extern struct t_hashtable *hook_focus_get_data (struct t_hashtable *hashtable_focus1, struct t_hashtable *hashtable_focus2); extern void hook_set (struct t_hook *hook, const char *property, const char *value); extern void unhook (struct t_hook *hook); -extern void unhook_all_plugin (struct t_weechat_plugin *plugin); +extern void unhook_all_plugin (struct t_weechat_plugin *plugin, + const char *subplugin); extern void unhook_all (); extern int hook_add_to_infolist (struct t_infolist *infolist, struct t_hook *hook, diff --git a/src/core/wee-input.c b/src/core/wee-input.c index 8927d55d4..7be24b810 100644 --- a/src/core/wee-input.c +++ b/src/core/wee-input.c @@ -48,7 +48,8 @@ input_exec_data (struct t_gui_buffer *buffer, const char *data) { if (buffer->input_callback) { - (void)(buffer->input_callback) (buffer->input_callback_data, + (void)(buffer->input_callback) (buffer->input_callback_pointer, + buffer->input_callback_data, buffer, data); } diff --git a/src/core/wee-network.c b/src/core/wee-network.c index d68bbefcd..f9ced9c03 100644 --- a/src/core/wee-network.c +++ b/src/core/wee-network.c @@ -1233,19 +1233,22 @@ end: */ int -network_connect_child_timer_cb (void *arg_hook_connect, int remaining_calls) +network_connect_child_timer_cb (const void *pointer, void *data, + int remaining_calls) { struct t_hook *hook_connect; /* make C compiler happy */ + (void) data; (void) remaining_calls; - hook_connect = (struct t_hook *)arg_hook_connect; + hook_connect = (struct t_hook *)pointer; HOOK_CONNECT(hook_connect, hook_child_timer) = NULL; (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_TIMEOUT, 0, -1, NULL, NULL); unhook (hook_connect); @@ -1262,15 +1265,17 @@ network_connect_child_timer_cb (void *arg_hook_connect, int remaining_calls) #ifdef HAVE_GNUTLS int -network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd) +network_connect_gnutls_handshake_fd_cb (const void *pointer, void *data, + int fd) { struct t_hook *hook_connect; int rc, direction, flags; /* make C compiler happy */ + (void) data; (void) fd; - hook_connect = (struct t_hook *)arg_hook_connect; + hook_connect = (struct t_hook *)pointer; rc = gnutls_handshake (*HOOK_CONNECT(hook_connect, gnutls_sess)); @@ -1290,7 +1295,8 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd) else if (rc != GNUTLS_E_SUCCESS) { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR, rc, HOOK_CONNECT(hook_connect, sock), gnutls_strerror (rc), @@ -1321,10 +1327,11 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd) #endif /* LIBGNUTLS_VERSION_NUMBER < 0x02090a */ unhook (HOOK_CONNECT(hook_connect, handshake_hook_fd)); (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, - WEECHAT_HOOK_CONNECT_OK, 0, - HOOK_CONNECT(hook_connect, sock), - NULL, HOOK_CONNECT(hook_connect, handshake_ip_address)); + (hook_connect->callback_pointer, + hook_connect->callback_data, + WEECHAT_HOOK_CONNECT_OK, 0, + HOOK_CONNECT(hook_connect, sock), + NULL, HOOK_CONNECT(hook_connect, handshake_ip_address)); unhook (hook_connect); } @@ -1338,25 +1345,28 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd) #ifdef HAVE_GNUTLS int -network_connect_gnutls_handshake_timer_cb (void *arg_hook_connect, +network_connect_gnutls_handshake_timer_cb (const void *pointer, + void *data, int remaining_calls) { struct t_hook *hook_connect; /* make C compiler happy */ + (void) data; (void) remaining_calls; - hook_connect = (struct t_hook *)arg_hook_connect; + hook_connect = (struct t_hook *)pointer; HOOK_CONNECT(hook_connect, handshake_hook_timer) = NULL; (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, - WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR, - GNUTLS_E_EXPIRED, - HOOK_CONNECT(hook_connect, sock), - gnutls_strerror (GNUTLS_E_EXPIRED), - HOOK_CONNECT(hook_connect, handshake_ip_address)); + (hook_connect->callback_pointer, + hook_connect->callback_data, + WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR, + GNUTLS_E_EXPIRED, + HOOK_CONNECT(hook_connect, sock), + gnutls_strerror (GNUTLS_E_EXPIRED), + HOOK_CONNECT(hook_connect, handshake_ip_address)); unhook (hook_connect); return WEECHAT_RC_OK; @@ -1368,7 +1378,7 @@ network_connect_gnutls_handshake_timer_cb (void *arg_hook_connect, */ int -network_connect_child_read_cb (void *arg_hook_connect, int fd) +network_connect_child_read_cb (const void *pointer, void *data, int fd) { struct t_hook *hook_connect; char buffer[1], buf_size[6], *cb_error, *cb_ip_address, *error; @@ -1389,9 +1399,10 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd) #endif /* HOOK_CONNECT_MAX_SOCKETS */ /* make C compiler happy */ + (void) data; (void) fd; - hook_connect = (struct t_hook *)arg_hook_connect; + hook_connect = (struct t_hook *)pointer; cb_error = NULL; cb_ip_address = NULL; @@ -1507,19 +1518,20 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd) HOOK_CONNECT(hook_connect, sock), (!direction ? 1 : 0), (direction ? 1 : 0), 0, &network_connect_gnutls_handshake_fd_cb, - hook_connect); + hook_connect, NULL); HOOK_CONNECT(hook_connect, handshake_hook_timer) = hook_timer (hook_connect->plugin, CONFIG_INTEGER(config_network_gnutls_handshake_timeout) * 1000, 0, 1, &network_connect_gnutls_handshake_timer_cb, - hook_connect); + hook_connect, NULL); return WEECHAT_RC_OK; } else if (rc != GNUTLS_E_SUCCESS) { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR, rc, sock, gnutls_strerror (rc), @@ -1583,14 +1595,18 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd) } } (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, buffer[0] - '0', 0, + (hook_connect->callback_pointer, + hook_connect->callback_data, + buffer[0] - '0', 0, sock, cb_error, cb_ip_address); unhook (hook_connect); } else { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, WEECHAT_HOOK_CONNECT_MEMORY_ERROR, + (hook_connect->callback_pointer, + hook_connect->callback_data, + WEECHAT_HOOK_CONNECT_MEMORY_ERROR, 0, sock, cb_error, cb_ip_address); unhook (hook_connect); } @@ -1628,7 +1644,8 @@ network_connect_with_fork (struct t_hook *hook_connect) if (gnutls_init (HOOK_CONNECT(hook_connect, gnutls_sess), GNUTLS_CLIENT) != GNUTLS_E_SUCCESS) { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, 0, -1, NULL, NULL); unhook (hook_connect); @@ -1641,7 +1658,8 @@ network_connect_with_fork (struct t_hook *hook_connect) if (rc != GNUTLS_E_SUCCESS) { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, 0, -1, _("set server name indication (SNI) failed"), NULL); unhook (hook_connect); @@ -1653,7 +1671,8 @@ network_connect_with_fork (struct t_hook *hook_connect) if (rc != GNUTLS_E_SUCCESS) { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, 0, -1, _("invalid priorities"), NULL); unhook (hook_connect); @@ -1671,7 +1690,8 @@ network_connect_with_fork (struct t_hook *hook_connect) if (pipe (child_pipe) < 0) { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_MEMORY_ERROR, 0, -1, NULL, NULL); unhook (hook_connect); @@ -1685,7 +1705,8 @@ network_connect_with_fork (struct t_hook *hook_connect) if (socketpair (AF_LOCAL, SOCK_DGRAM, 0, child_socket) < 0) { (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_MEMORY_ERROR, 0, -1, NULL, NULL); unhook (hook_connect); @@ -1706,7 +1727,8 @@ network_connect_with_fork (struct t_hook *hook_connect) /* fork failed */ case -1: (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, + (hook_connect->callback_pointer, + hook_connect->callback_data, WEECHAT_HOOK_CONNECT_MEMORY_ERROR, 0, -1, NULL, NULL); unhook (hook_connect); @@ -1734,10 +1756,11 @@ network_connect_with_fork (struct t_hook *hook_connect) CONFIG_INTEGER(config_network_connection_timeout) * 1000, 0, 1, &network_connect_child_timer_cb, - hook_connect); + hook_connect, + NULL); HOOK_CONNECT(hook_connect, hook_fd) = hook_fd (hook_connect->plugin, HOOK_CONNECT(hook_connect, child_read), 1, 0, 0, &network_connect_child_read_cb, - hook_connect); + hook_connect, NULL); } diff --git a/src/core/wee-proxy.c b/src/core/wee-proxy.c index d9aa3183b..df24dffb3 100644 --- a/src/core/wee-proxy.c +++ b/src/core/wee-proxy.c @@ -308,7 +308,7 @@ proxy_create_option (const char *proxy_name, int index_option, option_name, "integer", N_("proxy type (http (default), socks4, socks5)"), "http|socks4|socks5", 0, 0, value, NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); break; case PROXY_OPTION_IPV6: ptr_option = config_file_new_option ( @@ -316,7 +316,7 @@ proxy_create_option (const char *proxy_name, int index_option, option_name, "boolean", N_("connect to proxy using ipv6"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); break; case PROXY_OPTION_ADDRESS: ptr_option = config_file_new_option ( @@ -324,7 +324,7 @@ proxy_create_option (const char *proxy_name, int index_option, option_name, "string", N_("proxy server address (IP or hostname)"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); break; case PROXY_OPTION_PORT: ptr_option = config_file_new_option ( @@ -332,7 +332,7 @@ proxy_create_option (const char *proxy_name, int index_option, option_name, "integer", N_("port for connecting to proxy server"), NULL, 0, 65535, value, NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); break; case PROXY_OPTION_USERNAME: ptr_option = config_file_new_option ( @@ -341,7 +341,7 @@ proxy_create_option (const char *proxy_name, int index_option, N_("username for proxy server " "(note: content is evaluated, see /help eval)"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); break; case PROXY_OPTION_PASSWORD: ptr_option = config_file_new_option ( @@ -350,7 +350,7 @@ proxy_create_option (const char *proxy_name, int index_option, N_("password for proxy server " "(note: content is evaluated, see /help eval)"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); break; case PROXY_NUM_OPTIONS: break; @@ -621,11 +621,13 @@ proxy_free_all () */ struct t_hdata * -proxy_hdata_proxy_cb (void *data, const char *hdata_name) +proxy_hdata_proxy_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_proxy", "next_proxy", diff --git a/src/core/wee-proxy.h b/src/core/wee-proxy.h index 732d6d876..92574a400 100644 --- a/src/core/wee-proxy.h +++ b/src/core/wee-proxy.h @@ -82,7 +82,9 @@ extern struct t_proxy *proxy_new (const char *name, extern void proxy_use_temp_proxies (); extern void proxy_free (struct t_proxy *proxy); extern void proxy_free_all (); -extern struct t_hdata *proxy_hdata_proxy_cb (void *data, const char *hdata_name); +extern struct t_hdata *proxy_hdata_proxy_cb (const void *pointer, + void *data, + const char *hdata_name); extern int proxy_add_to_infolist (struct t_infolist *infolist, struct t_proxy *proxy); extern void proxy_print_log (); diff --git a/src/core/wee-secure.c b/src/core/wee-secure.c index 4931dd06d..d64e201ea 100644 --- a/src/core/wee-secure.c +++ b/src/core/wee-secure.c @@ -657,13 +657,14 @@ secure_get_passphrase_from_file (const char *filename) */ int -secure_check_crypt_passphrase_file (void *data, +secure_check_crypt_passphrase_file (const void *pointer, void *data, struct t_config_option *option, const char *value) { char *passphrase; /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -696,9 +697,11 @@ secure_check_crypt_passphrase_file (void *data, */ int -secure_reload_cb (void *data, struct t_config_file *config_file) +secure_reload_cb (const void *pointer, void *data, + struct t_config_file *config_file) { /* make C compiler happy */ + (void) pointer; (void) data; if (secure_hashtable_data_encrypted->items_count > 0) @@ -724,7 +727,7 @@ secure_reload_cb (void *data, struct t_config_file *config_file) */ int -secure_data_read_cb (void *data, +secure_data_read_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) @@ -733,6 +736,7 @@ secure_data_read_cb (void *data, int length_buffer, length_decrypted, rc; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -924,10 +928,12 @@ secure_data_write_map_encrypted_cb (void *data, */ int -secure_data_write_cb (void *data, struct t_config_file *config_file, +secure_data_write_cb (const void *pointer, void *data, + struct t_config_file *config_file, const char *section_name) { /* make C compiler happy */ + (void) pointer; (void) data; /* write name of section */ @@ -983,15 +989,18 @@ secure_init_options () struct t_config_section *ptr_section; secure_config_file = config_file_new (NULL, SECURE_CONFIG_NAME, - &secure_reload_cb, NULL); + &secure_reload_cb, NULL, NULL); if (!secure_config_file) return 0; /* crypt */ ptr_section = config_file_new_section (secure_config_file, "crypt", 0, 0, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (secure_config_file); @@ -1004,13 +1013,13 @@ secure_init_options () N_("cipher used to crypt data (the number after algorithm is the size " "of the key in bits)"), "aes128|aes192|aes256", 0, 0, "aes256", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); secure_config_crypt_hash_algo = config_file_new_option ( secure_config_file, ptr_section, "hash_algo", "integer", N_("hash algorithm used to check the decrypted data"), "sha224|sha256|sha384|sha512", 0, 0, "sha256", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); secure_config_crypt_passphrase_file = config_file_new_option ( secure_config_file, ptr_section, "passphrase_file", "string", @@ -1023,7 +1032,9 @@ secure_init_options () "outside WeeChat home (for example in your home); example: " "\"~/.weechat-passphrase\""), NULL, 0, 0, "", NULL, 0, - &secure_check_crypt_passphrase_file, NULL, NULL, NULL, NULL, NULL); + &secure_check_crypt_passphrase_file, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); secure_config_crypt_salt = config_file_new_option ( secure_config_file, ptr_section, "salt", "boolean", @@ -1032,15 +1043,18 @@ secure_init_options () "file sec.conf will be different on each write of the file; if you " "put the file sec.conf in a version control system, then you " "can turn off this option to have always same content in file"), - NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* data */ - ptr_section = config_file_new_section (secure_config_file, "data", - 0, 0, - &secure_data_read_cb, NULL, - &secure_data_write_cb, NULL, - &secure_data_write_cb, NULL, - NULL, NULL, NULL, NULL); + ptr_section = config_file_new_section ( + secure_config_file, "data", + 0, 0, + &secure_data_read_cb, NULL, NULL, + &secure_data_write_cb, NULL, NULL, + &secure_data_write_cb, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { config_file_free (secure_config_file); @@ -1079,16 +1093,14 @@ secure_init () secure_hashtable_data = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!secure_hashtable_data) return 0; secure_hashtable_data_encrypted = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!secure_hashtable_data_encrypted) { hashtable_free (secure_hashtable_data); @@ -1264,10 +1276,12 @@ secure_buffer_display () */ int -secure_buffer_input_cb (void *data, struct t_gui_buffer *buffer, +secure_buffer_input_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, const char *input_data) { /* make C compiler happy */ + (void) pointer; (void) data; if (string_strcasecmp (input_data, "q") == 0) @@ -1283,9 +1297,11 @@ secure_buffer_input_cb (void *data, struct t_gui_buffer *buffer, */ int -secure_buffer_close_cb (void *data, struct t_gui_buffer *buffer) +secure_buffer_close_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer) { /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -1322,8 +1338,8 @@ secure_buffer_open () if (!secure_buffer) { secure_buffer = gui_buffer_new (NULL, SECURE_BUFFER_NAME, - &secure_buffer_input_cb, NULL, - &secure_buffer_close_cb, NULL); + &secure_buffer_input_cb, NULL, NULL, + &secure_buffer_close_cb, NULL, NULL); if (secure_buffer) { if (!secure_buffer->short_name) diff --git a/src/core/wee-upgrade-file.c b/src/core/wee-upgrade-file.c index 4623c340f..07b2d88d4 100644 --- a/src/core/wee-upgrade-file.c +++ b/src/core/wee-upgrade-file.c @@ -184,7 +184,14 @@ upgrade_file_write_buffer (struct t_upgrade_file *upgrade_file, void *pointer, */ struct t_upgrade_file * -upgrade_file_new (const char *filename, int write) +upgrade_file_new (const char *filename, + int (*callback_read)(const void *pointer, + void *data, + struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist), + const void *callback_read_pointer, + void *callback_read_data) { int length; struct t_upgrade_file *new_upgrade_file; @@ -205,12 +212,15 @@ upgrade_file_new (const char *filename, int write) } snprintf (new_upgrade_file->filename, length, "%s/%s.upgrade", weechat_home, filename); + new_upgrade_file->callback_read = callback_read; + new_upgrade_file->callback_read_pointer = callback_read_pointer; + new_upgrade_file->callback_read_data = callback_read_data; /* open file in read or write mode */ - if (write) - new_upgrade_file->file = fopen (new_upgrade_file->filename, "wb"); - else + if (callback_read) new_upgrade_file->file = fopen (new_upgrade_file->filename, "rb"); + else + new_upgrade_file->file = fopen (new_upgrade_file->filename, "wb"); if (!new_upgrade_file->file) { @@ -220,7 +230,7 @@ upgrade_file_new (const char *filename, int write) } /* change permissions if write mode */ - if (write) + if (!callback_read) { chmod (new_upgrade_file->filename, 0600); @@ -241,6 +251,7 @@ upgrade_file_new (const char *filename, int write) upgrade_files = new_upgrade_file; last_upgrade_file = new_upgrade_file; } + return new_upgrade_file; } @@ -704,11 +715,15 @@ upgrade_file_read_object (struct t_upgrade_file *upgrade_file) if (upgrade_file->callback_read) { - if ((int)(upgrade_file->callback_read) (upgrade_file->callback_read_data, - upgrade_file, - object_id, - infolist) == WEECHAT_RC_ERROR) + if ((int)(upgrade_file->callback_read) ( + upgrade_file->callback_read_pointer, + upgrade_file->callback_read_data, + upgrade_file, + object_id, + infolist) == WEECHAT_RC_ERROR) + { rc = 0; + } } end: @@ -733,21 +748,13 @@ end: */ int -upgrade_file_read (struct t_upgrade_file *upgrade_file, - int (*callback_read)(void *data, - struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist), - void *callback_read_data) +upgrade_file_read (struct t_upgrade_file *upgrade_file) { char *signature; - if (!upgrade_file) + if (!upgrade_file || !upgrade_file->callback_read) return 0; - upgrade_file->callback_read = callback_read; - upgrade_file->callback_read_data = callback_read_data; - signature = NULL; if (!upgrade_file_read_string (upgrade_file, &signature)) { @@ -776,12 +783,31 @@ upgrade_file_read (struct t_upgrade_file *upgrade_file, } /* - * Closes an upgrade file. + * Closes and frees an upgrade file. */ void upgrade_file_close (struct t_upgrade_file *upgrade_file) { - if (upgrade_file && upgrade_file->file) + if (!upgrade_file) + return; + + if (upgrade_file->filename) + free (upgrade_file->filename); + if (upgrade_file->file) fclose (upgrade_file->file); + if (upgrade_file->callback_read_data) + free (upgrade_file->callback_read_data); + + /* remove upgrade file list */ + if (upgrade_file->prev_upgrade) + (upgrade_file->prev_upgrade)->next_upgrade = upgrade_file->next_upgrade; + if (upgrade_file->next_upgrade) + (upgrade_file->next_upgrade)->prev_upgrade = upgrade_file->prev_upgrade; + if (upgrade_files == upgrade_file) + upgrade_files = upgrade_file->next_upgrade; + if (last_upgrade_file == upgrade_file) + last_upgrade_file = upgrade_file->prev_upgrade; + + free (upgrade_file); } diff --git a/src/core/wee-upgrade-file.h b/src/core/wee-upgrade-file.h index 5ad2139b3..eb0cd7d14 100644 --- a/src/core/wee-upgrade-file.h +++ b/src/core/wee-upgrade-file.h @@ -41,26 +41,29 @@ struct t_upgrade_file long last_read_pos; /* last read position */ int last_read_length; /* last read length */ int (*callback_read) /* callback called when reading */ - (void *data, /* file */ + (const void *pointer, /* file */ + void *data, struct t_upgrade_file *upgrade_file, int object_id, struct t_infolist *infolist); + const void *callback_read_pointer; /* pointer sent to callback */ void *callback_read_data; /* data sent to callback */ struct t_upgrade_file *prev_upgrade; /* link to previous upgrade file */ struct t_upgrade_file *next_upgrade; /* link to next upgrade file */ }; extern struct t_upgrade_file *upgrade_file_new (const char *filename, - int write); + int (*callback_read)(const void *pointer, + void *data, + struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist), + const void *callback_read_pointer, + void *callback_read_data); extern int upgrade_file_write_object (struct t_upgrade_file *upgrade_file, int object_id, struct t_infolist *infolist); -extern int upgrade_file_read (struct t_upgrade_file *upgrade_file, - int (*callback_read)(void *data, - struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist), - void *callback_read_data); +extern int upgrade_file_read (struct t_upgrade_file *upgrade_file); extern void upgrade_file_close (struct t_upgrade_file *upgrade_file); #endif /* WEECHAT_UPGRADE_FILE_H */ diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index fb3a33b20..00776a63a 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -379,7 +379,8 @@ upgrade_weechat_save () int rc; struct t_upgrade_file *upgrade_file; - upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME, 1); + upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME, + NULL, NULL, NULL); if (!upgrade_file) return 0; @@ -425,8 +426,8 @@ upgrade_weechat_read_buffer (struct t_infolist *infolist) upgrade_current_buffer = gui_buffer_new (NULL, infolist_string (infolist, "name"), - NULL, NULL, - NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL); } if (!upgrade_current_buffer) return; @@ -760,12 +761,13 @@ upgrade_weechat_read_hotlist (struct t_infolist *infolist) */ int -upgrade_weechat_read_cb (void *data, +upgrade_weechat_read_cb (const void *pointer, void *data, struct t_upgrade_file *upgrade_file, int object_id, struct t_infolist *infolist) { /* make C compiler happy */ + (void) pointer; (void) data; (void) upgrade_file; @@ -834,10 +836,13 @@ upgrade_weechat_load () upgrade_layout = gui_layout_alloc (GUI_LAYOUT_UPGRADE); - upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME, 0); + upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME, + &upgrade_weechat_read_cb, NULL, NULL); if (!upgrade_file) return 0; - rc = upgrade_file_read (upgrade_file, &upgrade_weechat_read_cb, NULL); + + rc = upgrade_file_read (upgrade_file); + upgrade_file_close (upgrade_file); if (!hotlist_reset) @@ -903,8 +908,7 @@ upgrade_weechat_end () /* remove .upgrade files */ util_exec_on_files (weechat_home, 0, - NULL, - &upgrade_weechat_remove_file_cb); + &upgrade_weechat_remove_file_cb, NULL); /* display message for end of /upgrade with duration */ gettimeofday (&tv_now, NULL); diff --git a/src/core/wee-util.c b/src/core/wee-util.c index f3c6c7a88..51c553e81 100644 --- a/src/core/wee-util.c +++ b/src/core/wee-util.c @@ -484,8 +484,9 @@ util_mkdir_parents (const char *directory, int mode) */ void -util_exec_on_files (const char *directory, int hidden_files, void *data, - void (*callback)(void *data, const char *filename)) +util_exec_on_files (const char *directory, int hidden_files, + void (*callback)(void *data, const char *filename), + void *callback_data) { char complete_filename[1024]; DIR *dir; @@ -507,7 +508,7 @@ util_exec_on_files (const char *directory, int hidden_files, void *data, lstat (complete_filename, &statbuf); if (!S_ISDIR(statbuf.st_mode)) { - (*callback) (data, complete_filename); + (*callback) (callback_data, complete_filename); } } } diff --git a/src/core/wee-util.h b/src/core/wee-util.h index ed4b8e042..47a24575f 100644 --- a/src/core/wee-util.h +++ b/src/core/wee-util.h @@ -45,9 +45,9 @@ extern int util_mkdir_home (const char *directory, int mode); extern int util_mkdir (const char *directory, int mode); extern int util_mkdir_parents (const char *directory, int mode); extern void util_exec_on_files (const char *directory, int hidden_files, - void *data, void (*callback)(void *data, - const char *filename)); + const char *filename), + void *callback_data); extern char *util_search_full_lib_name (const char *filename, const char *sys_directory); extern char *util_file_get_content (const char *filename); diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index e6f9b86fc..340efccb0 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -351,9 +351,11 @@ error: */ int -gui_color_timer_warning_pairs_full (void *data, int remaining_calls) +gui_color_timer_warning_pairs_full (const void *pointer, void *data, + int remaining_calls) { /* make C compiler happy */ + (void) pointer; (void) data; (void) remaining_calls; @@ -402,7 +404,7 @@ gui_color_get_pair (int fg, int bg) { /* display warning if auto reset of pairs is disabled */ hook_timer (NULL, 1, 0, 1, - &gui_color_timer_warning_pairs_full, NULL); + &gui_color_timer_warning_pairs_full, NULL, NULL); gui_color_warning_pairs_full = 1; } return 1; @@ -1034,9 +1036,10 @@ gui_color_buffer_display () */ int -gui_color_timer_cb (void *data, int remaining_calls) +gui_color_timer_cb (const void *pointer, void *data, int remaining_calls) { /* make C compiler happy */ + (void) pointer; (void) data; (void) remaining_calls; @@ -1101,7 +1104,7 @@ gui_color_switch_colors () if (gui_color_use_term_colors) { gui_color_hook_timer = hook_timer (NULL, 1000, 0, 0, - &gui_color_timer_cb, NULL); + &gui_color_timer_cb, NULL, NULL); } } @@ -1132,10 +1135,12 @@ gui_color_reset_pairs () */ int -gui_color_buffer_input_cb (void *data, struct t_gui_buffer *buffer, +gui_color_buffer_input_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, const char *input_data) { /* make C compiler happy */ + (void) pointer; (void) data; if (string_strcasecmp (input_data, "e") == 0) @@ -1164,9 +1169,11 @@ gui_color_buffer_input_cb (void *data, struct t_gui_buffer *buffer, */ int -gui_color_buffer_close_cb (void *data, struct t_gui_buffer *buffer) +gui_color_buffer_close_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer) { /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -1203,9 +1210,10 @@ gui_color_buffer_open () { if (!gui_color_buffer) { - gui_color_buffer = gui_buffer_new (NULL, GUI_COLOR_BUFFER_NAME, - &gui_color_buffer_input_cb, NULL, - &gui_color_buffer_close_cb, NULL); + gui_color_buffer = gui_buffer_new ( + NULL, GUI_COLOR_BUFFER_NAME, + &gui_color_buffer_input_cb, NULL, NULL, + &gui_color_buffer_close_cb, NULL, NULL); if (gui_color_buffer) { if (!gui_color_buffer->short_name) diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c index 263ac1661..cd267064a 100644 --- a/src/gui/curses/gui-curses-key.c +++ b/src/gui/curses/gui-curses-key.c @@ -507,12 +507,13 @@ gui_key_flush (int paste) */ int -gui_key_read_cb (void *data, int fd) +gui_key_read_cb (const void *pointer, void *data, int fd) { int ret, i, accept_paste, cancel_paste, text_added_to_buffer, pos; unsigned char buffer[4096]; /* make C compiler happy */ + (void) pointer; (void) data; (void) fd; diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 210e1e4f8..cc865666b 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -181,7 +181,8 @@ gui_main_init () /* create core buffer */ ptr_buffer = gui_buffer_new (NULL, GUI_BUFFER_MAIN, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL); if (ptr_buffer) { gui_init_ok = 1; @@ -388,7 +389,7 @@ gui_main_loop () /* hook stdin (read keyboard) */ hook_fd_keyboard = hook_fd (NULL, STDIN_FILENO, 1, 0, 0, - &gui_key_read_cb, NULL); + &gui_key_read_cb, NULL, NULL); gui_window_ask_refresh (1); diff --git a/src/gui/curses/gui-curses-mouse.c b/src/gui/curses/gui-curses-mouse.c index 945837137..8620bbeee 100644 --- a/src/gui/curses/gui-curses-mouse.c +++ b/src/gui/curses/gui-curses-mouse.c @@ -218,9 +218,10 @@ gui_mouse_grab_end (const char *mouse_key) */ int -gui_mouse_event_timer_cb (void *data, int remaining_calls) +gui_mouse_event_timer_cb (const void *pointer, void *data, int remaining_calls) { /* make C compiler happy */ + (void) pointer; (void) data; (void) remaining_calls; @@ -244,7 +245,7 @@ gui_mouse_event_init () gui_mouse_event_timer = hook_timer (NULL, CONFIG_INTEGER(config_look_mouse_timer_delay), 0, 1, - &gui_mouse_event_timer_cb, NULL); + &gui_mouse_event_timer_cb, NULL, NULL); } /* diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index aa96c397c..3a8804998 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -2362,9 +2362,11 @@ gui_window_refresh_screen (int full_refresh) */ int -gui_window_bare_display_timer_cb (void *data, int remaining_calls) +gui_window_bare_display_timer_cb (const void *pointer, void *data, + int remaining_calls) { /* make C compiler happy */ + (void) pointer; (void) data; if (gui_window_bare_display) @@ -2408,7 +2410,7 @@ gui_window_bare_display_toggle (const char *delay) gui_window_bare_display_timer = hook_timer ( NULL, seconds * 1000, 0, 1, - &gui_window_bare_display_timer_cb, NULL); + &gui_window_bare_display_timer_cb, NULL, NULL); } } } diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h index 43d80bfbb..cbf162c27 100644 --- a/src/gui/curses/gui-curses.h +++ b/src/gui/curses/gui-curses.h @@ -98,7 +98,7 @@ extern void gui_chat_calculate_line_diff (struct t_gui_window *window, /* key functions */ extern void gui_key_default_bindings (int context); -extern int gui_key_read_cb (void *data, int fd); +extern int gui_key_read_cb (const void *pointer, void *data, int fd); /* window functions */ extern void gui_window_read_terminal_size (); diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index b45987ae3..980d9cbe1 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -399,9 +399,13 @@ gui_bar_item_get_value (struct t_gui_bar *bar, struct t_gui_window *window, bar->items_name[item][subitem]); if (ptr_item && ptr_item->build_callback) { - item_value = (ptr_item->build_callback) (ptr_item->build_callback_data, - ptr_item, window, buffer, - NULL); + item_value = (ptr_item->build_callback) ( + ptr_item->build_callback_pointer, + ptr_item->build_callback_data, + ptr_item, + window, + buffer, + NULL); } if (item_value && !item_value[0]) { @@ -526,11 +530,13 @@ gui_bar_item_count_lines (char *string) struct t_gui_bar_item * gui_bar_item_new (struct t_weechat_plugin *plugin, const char *name, - char *(*build_callback)(void *data, + char *(*build_callback)(const void *pointer, + void *data, struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info), + const void *build_callback_pointer, void *build_callback_data) { struct t_gui_bar_item *new_bar_item; @@ -549,6 +555,7 @@ gui_bar_item_new (struct t_weechat_plugin *plugin, const char *name, new_bar_item->plugin = plugin; new_bar_item->name = strdup (name); new_bar_item->build_callback = build_callback; + new_bar_item->build_callback_pointer = build_callback_pointer; new_bar_item->build_callback_data = build_callback_data; /* add bar item to bar items queue */ @@ -685,6 +692,8 @@ gui_bar_item_free (struct t_gui_bar_item *item) /* free data */ if (item->name) free (item->name); + if (item->build_callback_data) + free (item->build_callback_data); free (item); } @@ -728,7 +737,8 @@ gui_bar_item_free_all_plugin (struct t_weechat_plugin *plugin) */ char * -gui_bar_item_input_paste_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_input_paste_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -737,6 +747,7 @@ gui_bar_item_input_paste_cb (void *data, struct t_gui_bar_item *item, int lines; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) buffer; @@ -763,7 +774,8 @@ gui_bar_item_input_paste_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_input_prompt_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_input_prompt_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -771,6 +783,7 @@ gui_bar_item_input_prompt_cb (void *data, struct t_gui_bar_item *item, const char *nick; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -789,7 +802,8 @@ gui_bar_item_input_prompt_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_input_search_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_input_search_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -797,6 +811,7 @@ gui_bar_item_input_search_cb (void *data, struct t_gui_bar_item *item, char str_search[1024]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -830,7 +845,8 @@ gui_bar_item_input_search_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_input_text_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_input_text_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -841,6 +857,7 @@ gui_bar_item_input_text_cb (void *data, struct t_gui_bar_item *item, int length, length_cursor, length_start_input, buf_pos; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -957,7 +974,8 @@ gui_bar_item_input_text_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_time_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_time_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -967,6 +985,7 @@ gui_bar_item_time_cb (void *data, struct t_gui_bar_item *item, char text_time[128], text_time2[128]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -992,7 +1011,8 @@ gui_bar_item_time_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_count_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_count_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1000,6 +1020,7 @@ gui_bar_item_buffer_count_cb (void *data, struct t_gui_bar_item *item, char buf[32]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1016,7 +1037,7 @@ gui_bar_item_buffer_count_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_last_number_cb (void *data, +gui_bar_item_buffer_last_number_cb (const void *pointer, void *data, struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, @@ -1025,6 +1046,7 @@ gui_bar_item_buffer_last_number_cb (void *data, char buf[32]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1042,7 +1064,8 @@ gui_bar_item_buffer_last_number_cb (void *data, */ char * -gui_bar_item_buffer_plugin_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_plugin_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1050,6 +1073,7 @@ gui_bar_item_buffer_plugin_cb (void *data, struct t_gui_bar_item *item, const char *plugin_name; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1068,7 +1092,8 @@ gui_bar_item_buffer_plugin_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_number_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_number_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1076,6 +1101,7 @@ gui_bar_item_buffer_number_cb (void *data, struct t_gui_bar_item *item, char str_number[64]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1096,7 +1122,8 @@ gui_bar_item_buffer_number_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_name_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_name_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1104,6 +1131,7 @@ gui_bar_item_buffer_name_cb (void *data, struct t_gui_bar_item *item, char str_name[256]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1125,7 +1153,7 @@ gui_bar_item_buffer_name_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_short_name_cb (void *data, +gui_bar_item_buffer_short_name_cb (const void *pointer, void *data, struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, @@ -1134,6 +1162,7 @@ gui_bar_item_buffer_short_name_cb (void *data, char str_short_name[256]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1158,12 +1187,14 @@ gui_bar_item_buffer_short_name_cb (void *data, */ char * -gui_bar_item_buffer_modes_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_modes_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1178,7 +1209,8 @@ gui_bar_item_buffer_modes_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_filter_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_filter_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1186,6 +1218,7 @@ gui_bar_item_buffer_filter_cb (void *data, struct t_gui_bar_item *item, char str_filter[512]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1213,7 +1246,7 @@ gui_bar_item_buffer_filter_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_nicklist_count_cb (void *data, +gui_bar_item_buffer_nicklist_count_cb (const void *pointer, void *data, struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, @@ -1222,6 +1255,7 @@ gui_bar_item_buffer_nicklist_count_cb (void *data, char str_count[64]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1243,7 +1277,8 @@ gui_bar_item_buffer_nicklist_count_cb (void *data, */ char * -gui_bar_item_buffer_zoom_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_zoom_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1252,6 +1287,7 @@ gui_bar_item_buffer_zoom_cb (void *data, struct t_gui_bar_item *item, char buf[512]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1275,7 +1311,8 @@ gui_bar_item_buffer_zoom_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_scroll_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_scroll_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1283,6 +1320,7 @@ gui_bar_item_scroll_cb (void *data, struct t_gui_bar_item *item, char str_scroll[512]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) buffer; @@ -1306,7 +1344,8 @@ gui_bar_item_scroll_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_hotlist_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_hotlist_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1318,6 +1357,7 @@ gui_bar_item_hotlist_cb (void *data, struct t_gui_bar_item *item, int priority, priority_min, priority_min_displayed, private; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1542,7 +1582,8 @@ gui_bar_item_hotlist_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_completion_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_completion_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1552,6 +1593,7 @@ gui_bar_item_completion_cb (void *data, struct t_gui_bar_item *item, struct t_gui_completion_word *ptr_completion_word; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1603,12 +1645,14 @@ gui_bar_item_completion_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_title_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_title_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1625,7 +1669,8 @@ gui_bar_item_buffer_title_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_buffer_nicklist_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1637,6 +1682,7 @@ gui_bar_item_buffer_nicklist_cb (void *data, struct t_gui_bar_item *item, char *str_nicklist; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1766,7 +1812,8 @@ gui_bar_item_buffer_nicklist_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_window_number_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_window_number_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1774,6 +1821,7 @@ gui_bar_item_window_number_cb (void *data, struct t_gui_bar_item *item, char str_number[64]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) buffer; @@ -1792,7 +1840,8 @@ gui_bar_item_window_number_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_mouse_status_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_mouse_status_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1800,6 +1849,7 @@ gui_bar_item_mouse_status_cb (void *data, struct t_gui_bar_item *item, char str_mouse[512]; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1821,7 +1871,8 @@ gui_bar_item_mouse_status_cb (void *data, struct t_gui_bar_item *item, */ char * -gui_bar_item_away_cb (void *data, struct t_gui_bar_item *item, +gui_bar_item_away_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -1831,6 +1882,7 @@ gui_bar_item_away_cb (void *data, struct t_gui_bar_item *item, int length; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -1867,7 +1919,8 @@ gui_bar_item_away_cb (void *data, struct t_gui_bar_item *item, */ struct t_hashtable * -gui_bar_item_focus_buffer_nicklist_cb (void *data, +gui_bar_item_focus_buffer_nicklist_cb (const void *pointer, + void *data, struct t_hashtable *info) { struct t_gui_nick_group *ptr_group; @@ -1880,6 +1933,7 @@ gui_bar_item_focus_buffer_nicklist_cb (void *data, char *error; /* make C compiler happy */ + (void) pointer; (void) data; str_bar_item_line = hashtable_get (info, "_bar_item_line"); @@ -1961,7 +2015,7 @@ gui_bar_item_focus_buffer_nicklist_cb (void *data, */ int -gui_bar_item_timer_cb (void *data, int remaining_calls) +gui_bar_item_timer_cb (const void *pointer, void *data, int remaining_calls) { time_t date; struct tm *local_time; @@ -1969,6 +2023,7 @@ gui_bar_item_timer_cb (void *data, int remaining_calls) char new_item_time_text[128]; /* make C compiler happy */ + (void) data; (void) remaining_calls; date = time (NULL); @@ -1987,7 +2042,7 @@ gui_bar_item_timer_cb (void *data, int remaining_calls) { snprintf (item_time_text, sizeof (item_time_text), "%s", new_item_time_text); - gui_bar_item_update ((char *)data); + gui_bar_item_update ((char *)pointer); } return WEECHAT_RC_OK; @@ -1998,15 +2053,17 @@ gui_bar_item_timer_cb (void *data, int remaining_calls) */ int -gui_bar_item_signal_cb (void *data, const char *signal, +gui_bar_item_signal_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) data; (void) signal; (void) type_data; (void) signal_data; - gui_bar_item_update ((char *)data); + gui_bar_item_update ((char *)pointer); return WEECHAT_RC_OK; } @@ -2025,7 +2082,7 @@ gui_bar_item_hook_signal (const char *signal, const char *item) { bar_item_hook->hook = hook_signal (NULL, signal, &gui_bar_item_signal_cb, - (void *)item); + (void *)item, NULL); bar_item_hook->next_hook = gui_bar_item_hooks; gui_bar_item_hooks = bar_item_hook; } @@ -2043,14 +2100,14 @@ gui_bar_item_init () /* input paste */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_INPUT_PASTE], - &gui_bar_item_input_paste_cb, NULL); + &gui_bar_item_input_paste_cb, NULL, NULL); gui_bar_item_hook_signal ("input_paste_pending", gui_bar_item_names[GUI_BAR_ITEM_INPUT_PASTE]); /* input prompt */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_INPUT_PROMPT], - &gui_bar_item_input_prompt_cb, NULL); + &gui_bar_item_input_prompt_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_INPUT_PROMPT]); gui_bar_item_hook_signal ("buffer_switch", @@ -2061,7 +2118,7 @@ gui_bar_item_init () /* input search */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_INPUT_SEARCH], - &gui_bar_item_input_search_cb, NULL); + &gui_bar_item_input_search_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_INPUT_SEARCH]); gui_bar_item_hook_signal ("input_search", @@ -2072,7 +2129,7 @@ gui_bar_item_init () /* input text */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_INPUT_TEXT], - &gui_bar_item_input_text_cb, NULL); + &gui_bar_item_input_text_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_INPUT_TEXT]); gui_bar_item_hook_signal ("buffer_switch", @@ -2083,14 +2140,16 @@ gui_bar_item_init () /* time */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_TIME], - &gui_bar_item_time_cb, NULL); - gui_bar_item_timer = hook_timer (NULL, 1000, 1, 0, &gui_bar_item_timer_cb, - gui_bar_item_names[GUI_BAR_ITEM_TIME]); + &gui_bar_item_time_cb, NULL, NULL); + gui_bar_item_timer = hook_timer (NULL, 1000, 1, 0, + &gui_bar_item_timer_cb, + gui_bar_item_names[GUI_BAR_ITEM_TIME], + NULL); /* buffer count */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_COUNT], - &gui_bar_item_buffer_count_cb, NULL); + &gui_bar_item_buffer_count_cb, NULL, NULL); gui_bar_item_hook_signal ("buffer_opened", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_COUNT]); gui_bar_item_hook_signal ("buffer_closed", @@ -2099,7 +2158,7 @@ gui_bar_item_init () /* last buffer number */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_LAST_NUMBER], - &gui_bar_item_buffer_last_number_cb, NULL); + &gui_bar_item_buffer_last_number_cb, NULL, NULL); gui_bar_item_hook_signal ("buffer_opened", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_LAST_NUMBER]); gui_bar_item_hook_signal ("buffer_closed", @@ -2114,7 +2173,7 @@ gui_bar_item_init () /* buffer plugin */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_PLUGIN], - &gui_bar_item_buffer_plugin_cb, NULL); + &gui_bar_item_buffer_plugin_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_PLUGIN]); gui_bar_item_hook_signal ("buffer_switch", @@ -2125,7 +2184,7 @@ gui_bar_item_init () /* buffer number */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NUMBER], - &gui_bar_item_buffer_number_cb, NULL); + &gui_bar_item_buffer_number_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NUMBER]); gui_bar_item_hook_signal ("buffer_switch", @@ -2142,7 +2201,7 @@ gui_bar_item_init () /* buffer name */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NAME], - &gui_bar_item_buffer_name_cb, NULL); + &gui_bar_item_buffer_name_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NAME]); gui_bar_item_hook_signal ("buffer_switch", @@ -2155,7 +2214,7 @@ gui_bar_item_init () /* buffer short name */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_SHORT_NAME], - &gui_bar_item_buffer_short_name_cb, NULL); + &gui_bar_item_buffer_short_name_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_SHORT_NAME]); gui_bar_item_hook_signal ("buffer_switch", @@ -2168,7 +2227,7 @@ gui_bar_item_init () /* buffer modes */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_MODES], - &gui_bar_item_buffer_modes_cb, NULL); + &gui_bar_item_buffer_modes_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_MODES]); gui_bar_item_hook_signal ("buffer_switch", @@ -2177,7 +2236,7 @@ gui_bar_item_init () /* buffer filter */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_FILTER], - &gui_bar_item_buffer_filter_cb, NULL); + &gui_bar_item_buffer_filter_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_FILTER]); gui_bar_item_hook_signal ("buffer_switch", @@ -2190,7 +2249,7 @@ gui_bar_item_init () /* buffer zoom */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_ZOOM], - &gui_bar_item_buffer_zoom_cb, NULL); + &gui_bar_item_buffer_zoom_cb, NULL, NULL); gui_bar_item_hook_signal ("buffer_zoomed", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_ZOOM]); gui_bar_item_hook_signal ("buffer_unzoomed", @@ -2201,7 +2260,7 @@ gui_bar_item_init () /* buffer nicklist count */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT], - &gui_bar_item_buffer_nicklist_count_cb, NULL); + &gui_bar_item_buffer_nicklist_count_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT]); gui_bar_item_hook_signal ("buffer_switch", @@ -2212,7 +2271,7 @@ gui_bar_item_init () /* scroll indicator */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_SCROLL], - &gui_bar_item_scroll_cb, NULL); + &gui_bar_item_scroll_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_SCROLL]); gui_bar_item_hook_signal ("buffer_switch", @@ -2223,7 +2282,7 @@ gui_bar_item_init () /* hotlist */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_HOTLIST], - &gui_bar_item_hotlist_cb, NULL); + &gui_bar_item_hotlist_cb, NULL, NULL); gui_bar_item_hook_signal ("hotlist_changed", gui_bar_item_names[GUI_BAR_ITEM_HOTLIST]); gui_bar_item_hook_signal ("buffer_moved", @@ -2234,14 +2293,14 @@ gui_bar_item_init () /* completion (possible words when a partial completion occurs) */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_COMPLETION], - &gui_bar_item_completion_cb, NULL); + &gui_bar_item_completion_cb, NULL, NULL); gui_bar_item_hook_signal ("partial_completion", gui_bar_item_names[GUI_BAR_ITEM_COMPLETION]); /* buffer title */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_TITLE], - &gui_bar_item_buffer_title_cb, NULL); + &gui_bar_item_buffer_title_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_TITLE]); gui_bar_item_hook_signal ("buffer_switch", @@ -2252,7 +2311,7 @@ gui_bar_item_init () /* buffer nicklist */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST], - &gui_bar_item_buffer_nicklist_cb, NULL); + &gui_bar_item_buffer_nicklist_cb, NULL, NULL); gui_bar_item_hook_signal ("nicklist_*", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST]); gui_bar_item_hook_signal ("window_switch", @@ -2261,12 +2320,13 @@ gui_bar_item_init () gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST]); snprintf (name, sizeof (name), "2000|%s", gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST]); - hook_focus (NULL, name, &gui_bar_item_focus_buffer_nicklist_cb, NULL); + hook_focus (NULL, name, + &gui_bar_item_focus_buffer_nicklist_cb, NULL, NULL); /* window number */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_WINDOW_NUMBER], - &gui_bar_item_window_number_cb, NULL); + &gui_bar_item_window_number_cb, NULL, NULL); gui_bar_item_hook_signal ("window_switch", gui_bar_item_names[GUI_BAR_ITEM_WINDOW_NUMBER]); gui_bar_item_hook_signal ("window_closed", @@ -2275,7 +2335,7 @@ gui_bar_item_init () /* mouse status */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_MOUSE_STATUS], - &gui_bar_item_mouse_status_cb, NULL); + &gui_bar_item_mouse_status_cb, NULL, NULL); gui_bar_item_hook_signal ("mouse_enabled", gui_bar_item_names[GUI_BAR_ITEM_MOUSE_STATUS]); gui_bar_item_hook_signal ("mouse_disabled", @@ -2284,7 +2344,7 @@ gui_bar_item_init () /* away message */ gui_bar_item_new (NULL, gui_bar_item_names[GUI_BAR_ITEM_AWAY], - &gui_bar_item_away_cb, NULL); + &gui_bar_item_away_cb, NULL, NULL); gui_bar_item_hook_signal ("buffer_localvar_*", gui_bar_item_names[GUI_BAR_ITEM_AWAY]); } @@ -2318,11 +2378,13 @@ gui_bar_item_end () */ struct t_hdata * -gui_bar_item_hdata_bar_item_cb (void *data, const char *hdata_name) +gui_bar_item_hdata_bar_item_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item", @@ -2332,6 +2394,7 @@ gui_bar_item_hdata_bar_item_cb (void *data, const char *hdata_name) HDATA_VAR(struct t_gui_bar_item, plugin, POINTER, 0, NULL, "plugin"); HDATA_VAR(struct t_gui_bar_item, name, STRING, 0, NULL, NULL); HDATA_VAR(struct t_gui_bar_item, build_callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_gui_bar_item, build_callback_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_bar_item, build_callback_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_bar_item, prev_item, POINTER, 0, NULL, hdata_name); HDATA_VAR(struct t_gui_bar_item, next_item, POINTER, 0, NULL, hdata_name); @@ -2368,6 +2431,8 @@ gui_bar_item_add_to_infolist (struct t_infolist *infolist, return 0; if (!infolist_new_var_pointer (ptr_item, "build_callback", bar_item->build_callback)) return 0; + if (!infolist_new_var_pointer (ptr_item, "build_callback_pointer", (void *)bar_item->build_callback_pointer)) + return 0; if (!infolist_new_var_pointer (ptr_item, "build_callback_data", bar_item->build_callback_data)) return 0; @@ -2391,6 +2456,7 @@ gui_bar_item_print_log () ptr_item->plugin, plugin_get_name (ptr_item->plugin)); log_printf (" name . . . . . . . . . : '%s'", ptr_item->name); log_printf (" build_callback . . . . : 0x%lx", ptr_item->build_callback); + log_printf (" build_callback_pointer : 0x%lx", ptr_item->build_callback_pointer); log_printf (" build_callback_data. . : 0x%lx", ptr_item->build_callback_data); log_printf (" prev_item. . . . . . . : 0x%lx", ptr_item->prev_item); log_printf (" next_item. . . . . . . : 0x%lx", ptr_item->next_item); diff --git a/src/gui/gui-bar-item.h b/src/gui/gui-bar-item.h index e5223ca62..21bfc2ca7 100644 --- a/src/gui/gui-bar-item.h +++ b/src/gui/gui-bar-item.h @@ -55,13 +55,15 @@ struct t_gui_bar_item { struct t_weechat_plugin *plugin; /* plugin */ char *name; /* bar item name */ - char *(*build_callback)(void *data, + char *(*build_callback)(const void *pointer, + void *data, struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info); /* callback called for building item */ - void *build_callback_data; /* data for callback */ + const void *build_callback_pointer; /* pointer for callback */ + void *build_callback_data; /* data for callback */ struct t_gui_bar_item *prev_item; /* link to previous bar item */ struct t_gui_bar_item *next_item; /* link to next bar item */ }; @@ -98,11 +100,13 @@ extern char *gui_bar_item_get_value (struct t_gui_bar *bar, extern int gui_bar_item_count_lines (char *string); extern struct t_gui_bar_item *gui_bar_item_new (struct t_weechat_plugin *plugin, const char *name, - char *(*build_callback)(void *data, + char *(*build_callback)(const void *pointer, + void *data, struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info), + const void *build_callback_pointer, void *build_callback_data); extern void gui_bar_item_update (const char *name); extern void gui_bar_item_free (struct t_gui_bar_item *item); @@ -110,7 +114,8 @@ extern void gui_bar_item_free_all (); extern void gui_bar_item_free_all_plugin (struct t_weechat_plugin *plugin); extern void gui_bar_item_init (); extern void gui_bar_item_end (); -extern struct t_hdata *gui_bar_item_hdata_bar_item_cb (void *data, +extern struct t_hdata *gui_bar_item_hdata_bar_item_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_bar_item_add_to_infolist (struct t_infolist *infolist, struct t_gui_bar_item *bar_item); diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c index f1fd037a1..e630565d1 100644 --- a/src/gui/gui-bar-window.c +++ b/src/gui/gui-bar-window.c @@ -1524,11 +1524,13 @@ gui_bar_window_scroll (struct t_gui_bar_window *bar_window, */ struct t_hdata * -gui_bar_window_hdata_bar_window_cb (void *data, const char *hdata_name) +gui_bar_window_hdata_bar_window_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_bar_window", "next_bar_window", diff --git a/src/gui/gui-bar-window.h b/src/gui/gui-bar-window.h index dff86ec56..1e625ee40 100644 --- a/src/gui/gui-bar-window.h +++ b/src/gui/gui-bar-window.h @@ -104,7 +104,8 @@ extern void gui_bar_window_scroll (struct t_gui_bar_window *bar_window, int add_x, int scroll_beginning, int scroll_end, int add, int percent, int value); -extern struct t_hdata *gui_bar_window_hdata_bar_window_cb (void *data, +extern struct t_hdata *gui_bar_window_hdata_bar_window_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_bar_window_add_to_infolist (struct t_infolist *infolist, struct t_gui_bar_window *bar_window); diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 31a7c2040..d656be48c 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -410,8 +410,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar, pointers = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + NULL, NULL); if (pointers) { hashtable_set (pointers, "window", window); @@ -421,8 +420,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar, extra_vars = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + NULL, NULL); if (extra_vars) { hashtable_set (extra_vars, "active", @@ -435,8 +433,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar, options = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + NULL, NULL); if (options) hashtable_set (options, "type", "condition"); @@ -827,10 +824,12 @@ gui_bar_set_items_array (struct t_gui_bar *bar, const char *items) */ int -gui_bar_config_check_type (void *data, struct t_config_option *option, +gui_bar_config_check_type (const void *pointer, void *data, + struct t_config_option *option, const char *value) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; (void) value; @@ -847,7 +846,8 @@ gui_bar_config_check_type (void *data, struct t_config_option *option, */ void -gui_bar_config_change_hidden (void *data, struct t_config_option *option) +gui_bar_config_change_hidden (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; struct t_gui_window *ptr_win; @@ -855,6 +855,7 @@ gui_bar_config_change_hidden (void *data, struct t_config_option *option) int bar_window_exists; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -909,13 +910,15 @@ gui_bar_config_change_hidden (void *data, struct t_config_option *option) */ void -gui_bar_config_change_priority (void *data, struct t_config_option *option) +gui_bar_config_change_priority (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; struct t_gui_window *ptr_win; struct t_gui_bar_window *bar_windows, *ptr_bar_win, *next_bar_win; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -964,9 +967,11 @@ gui_bar_config_change_priority (void *data, struct t_config_option *option) */ void -gui_bar_config_change_conditions (void *data, struct t_config_option *option) +gui_bar_config_change_conditions (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -978,11 +983,13 @@ gui_bar_config_change_conditions (void *data, struct t_config_option *option) */ void -gui_bar_config_change_position (void *data, struct t_config_option *option) +gui_bar_config_change_position (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -997,11 +1004,13 @@ gui_bar_config_change_position (void *data, struct t_config_option *option) */ void -gui_bar_config_change_filling (void *data, struct t_config_option *option) +gui_bar_config_change_filling (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -1020,7 +1029,8 @@ gui_bar_config_change_filling (void *data, struct t_config_option *option) */ int -gui_bar_config_check_size (void *data, struct t_config_option *option, +gui_bar_config_check_size (const void *pointer, void *data, + struct t_config_option *option, const char *value) { struct t_gui_bar *ptr_bar; @@ -1029,6 +1039,7 @@ gui_bar_config_check_size (void *data, struct t_config_option *option, int new_value; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -1086,11 +1097,13 @@ gui_bar_config_check_size (void *data, struct t_config_option *option, */ void -gui_bar_config_change_size (void *data, struct t_config_option *option) +gui_bar_config_change_size (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -1106,12 +1119,14 @@ gui_bar_config_change_size (void *data, struct t_config_option *option) */ void -gui_bar_config_change_size_max (void *data, struct t_config_option *option) +gui_bar_config_change_size_max (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; char value[32]; /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -1135,11 +1150,13 @@ gui_bar_config_change_size_max (void *data, struct t_config_option *option) */ void -gui_bar_config_change_color (void *data, struct t_config_option *option) +gui_bar_config_change_color (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -1152,11 +1169,13 @@ gui_bar_config_change_color (void *data, struct t_config_option *option) */ void -gui_bar_config_change_separator (void *data, struct t_config_option *option) +gui_bar_config_change_separator (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -1169,11 +1188,13 @@ gui_bar_config_change_separator (void *data, struct t_config_option *option) */ void -gui_bar_config_change_items (void *data, struct t_config_option *option) +gui_bar_config_change_items (const void *pointer, void *data, + struct t_config_option *option) { struct t_gui_bar *ptr_bar; /* make C compiler happy */ + (void) pointer; (void) data; ptr_bar = gui_bar_search_with_option_name (option->name); @@ -1390,7 +1411,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "boolean", N_("true if bar is hidden, false if it is displayed"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, &gui_bar_config_change_hidden, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_hidden, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_PRIORITY: ptr_option = config_file_new_option ( @@ -1398,7 +1421,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "integer", N_("bar priority (high number means bar displayed first)"), NULL, 0, INT_MAX, value, NULL, 0, - NULL, NULL, &gui_bar_config_change_priority, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_priority, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_TYPE: ptr_option = config_file_new_option ( @@ -1406,7 +1431,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "integer", N_("bar type (root, window, window_active, window_inactive)"), "root|window|window_active|window_inactive", 0, 0, value, NULL, 0, - &gui_bar_config_check_type, NULL, NULL, NULL, NULL, NULL); + &gui_bar_config_check_type, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_CONDITIONS: ptr_option = config_file_new_option ( @@ -1420,7 +1447,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value "(local variables for expression are ${active}, " "${inactive} and ${nicklist})"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, &gui_bar_config_change_conditions, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_conditions, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_POSITION: ptr_option = config_file_new_option ( @@ -1428,7 +1457,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "integer", N_("bar position (bottom, top, left, right)"), "bottom|top|left|right", 0, 0, value, NULL, 0, - NULL, NULL, &gui_bar_config_change_position, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_position, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_FILLING_TOP_BOTTOM: ptr_option = config_file_new_option ( @@ -1439,7 +1470,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value "top or bottom"), "horizontal|vertical|columns_horizontal|columns_vertical", 0, 0, value, NULL, 0, - NULL, NULL, &gui_bar_config_change_filling, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_filling, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_FILLING_LEFT_RIGHT: ptr_option = config_file_new_option ( @@ -1450,7 +1483,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value "left or right"), "horizontal|vertical|columns_horizontal|columns_vertical", 0, 0, value, NULL, 0, - NULL, NULL, &gui_bar_config_change_filling, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_filling, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_SIZE: ptr_option = config_file_new_option ( @@ -1458,9 +1493,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "integer", N_("bar size in chars (0 = auto size)"), NULL, 0, INT_MAX, value, NULL, 0, - &gui_bar_config_check_size, NULL, - &gui_bar_config_change_size, NULL, - NULL, NULL); + &gui_bar_config_check_size, NULL, NULL, + &gui_bar_config_change_size, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_SIZE_MAX: ptr_option = config_file_new_option ( @@ -1468,9 +1503,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "integer", N_("max bar size in chars (0 = no limit)"), NULL, 0, INT_MAX, value, NULL, 0, - NULL, NULL, - &gui_bar_config_change_size_max, NULL, - NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_size_max, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_COLOR_FG: ptr_option = config_file_new_option ( @@ -1478,9 +1513,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "color", N_("default text color for bar"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, - &gui_bar_config_change_color, NULL, - NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_color, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_COLOR_DELIM: ptr_option = config_file_new_option ( @@ -1488,9 +1523,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "color", N_("default delimiter color for bar"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, - &gui_bar_config_change_color, NULL, - NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_color, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_COLOR_BG: ptr_option = config_file_new_option ( @@ -1498,9 +1533,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "color", N_("default background color for bar"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, - &gui_bar_config_change_color, NULL, - NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_color, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_SEPARATOR: ptr_option = config_file_new_option ( @@ -1508,7 +1543,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "boolean", N_("separator line between bar and other bars/windows"), NULL, 0, 0, value, NULL, 0, - NULL, NULL, &gui_bar_config_change_separator, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_separator, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_OPTION_ITEMS: ptr_option = config_file_new_option ( @@ -1519,7 +1556,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value "\"@buffer:item\" can be used to force buffer used when " "displaying the bar item"), NULL, 0, 0, gui_bar_default_items (bar_name), value, 0, - NULL, NULL, &gui_bar_config_change_items, NULL, NULL, NULL); + NULL, NULL, NULL, + &gui_bar_config_change_items, NULL, NULL, + NULL, NULL, NULL); break; case GUI_BAR_NUM_OPTIONS: break; @@ -2263,11 +2302,12 @@ gui_bar_free_bar_windows (struct t_gui_bar *bar) */ struct t_hdata * -gui_bar_hdata_bar_cb (void *data, const char *hdata_name) +gui_bar_hdata_bar_cb (const void *pointer, void *data, const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_bar", "next_bar", diff --git a/src/gui/gui-bar.h b/src/gui/gui-bar.h index ff7e2a805..6a2af0fa3 100644 --- a/src/gui/gui-bar.h +++ b/src/gui/gui-bar.h @@ -153,7 +153,8 @@ extern int gui_bar_scroll (struct t_gui_bar *bar, struct t_gui_window *window, const char *scroll); extern void gui_bar_free (struct t_gui_bar *bar); extern void gui_bar_free_all (); -extern struct t_hdata *gui_bar_hdata_bar_cb (void *data, +extern struct t_hdata *gui_bar_hdata_bar_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_bar_add_to_infolist (struct t_infolist *infolist, struct t_gui_bar *bar); diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 60319c8d6..5a0d0c861 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -553,12 +553,16 @@ gui_buffer_input_buffer_init (struct t_gui_buffer *buffer) struct t_gui_buffer * gui_buffer_new (struct t_weechat_plugin *plugin, const char *name, - int (*input_callback)(void *data, + int (*input_callback)(const void *pointer, + void *data, struct t_gui_buffer *buffer, const char *input_data), + const void *input_callback_pointer, void *input_callback_data, - int (*close_callback)(void *data, + int (*close_callback)(const void *pointer, + void *data, struct t_gui_buffer *buffer), + const void *close_callback_pointer, void *close_callback_data) { struct t_gui_buffer *new_buffer; @@ -620,6 +624,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin, /* close callback */ new_buffer->close_callback = close_callback; + new_buffer->close_callback_pointer = close_callback_pointer; new_buffer->close_callback_data = close_callback_data; new_buffer->closing = 0; @@ -644,12 +649,14 @@ gui_buffer_new (struct t_weechat_plugin *plugin, new_buffer->nicklist_nicks_count = 0; new_buffer->nicklist_visible_count = 0; new_buffer->nickcmp_callback = NULL; + new_buffer->nickcmp_callback_pointer = NULL; new_buffer->nickcmp_callback_data = NULL; gui_nicklist_add_group (new_buffer, NULL, "root", NULL, 0); /* input */ new_buffer->input = 1; new_buffer->input_callback = input_callback; + new_buffer->input_callback_pointer = input_callback_pointer; new_buffer->input_callback_data = input_callback_data; new_buffer->input_get_unknown_commands = 0; gui_buffer_input_buffer_init (new_buffer); @@ -700,11 +707,11 @@ gui_buffer_new (struct t_weechat_plugin *plugin, new_buffer->highlight_tags_array = NULL; /* hotlist */ - new_buffer->hotlist_max_level_nicks = hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_INTEGER, - NULL, - NULL); + new_buffer->hotlist_max_level_nicks = hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_INTEGER, + NULL, NULL); /* keys */ new_buffer->keys = NULL; @@ -715,8 +722,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin, new_buffer->local_variables = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); hashtable_set (new_buffer->local_variables, "plugin", plugin_get_name (plugin)); hashtable_set (new_buffer->local_variables, "name", name); @@ -2034,6 +2040,10 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property, { buffer->close_callback = pointer; } + else if (string_strcasecmp (property, "close_callback_pointer") == 0) + { + buffer->close_callback_pointer = pointer; + } else if (string_strcasecmp (property, "close_callback_data") == 0) { buffer->close_callback_data = pointer; @@ -2042,6 +2052,10 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property, { buffer->nickcmp_callback = pointer; } + else if (string_strcasecmp (property, "nickcmp_callback_pointer") == 0) + { + buffer->nickcmp_callback_pointer = pointer; + } else if (string_strcasecmp (property, "nickcmp_callback_data") == 0) { buffer->nickcmp_callback_data = pointer; @@ -2050,6 +2064,10 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property, { buffer->input_callback = pointer; } + else if (string_strcasecmp (property, "input_callback_pointer") == 0) + { + buffer->input_callback_pointer = pointer; + } else if (string_strcasecmp (property, "input_callback_data") == 0) { buffer->input_callback_data = pointer; @@ -2581,7 +2599,9 @@ gui_buffer_close (struct t_gui_buffer *buffer) if (buffer->close_callback) { - (void)(buffer->close_callback) (buffer->close_callback_data, buffer); + (void)(buffer->close_callback) (buffer->close_callback_pointer, + buffer->close_callback_data, + buffer); } ptr_back_to_buffer = NULL; @@ -2743,6 +2763,12 @@ gui_buffer_close (struct t_gui_buffer *buffer) } free (buffer->highlight_tags_array); } + if (buffer->input_callback_data) + free (buffer->input_callback_data); + if (buffer->close_callback_data) + free (buffer->close_callback_data); + if (buffer->nickcmp_callback_data) + free (buffer->nickcmp_callback_data); /* remove buffer from buffers list */ if (buffer->prev_buffer) @@ -4030,11 +4056,13 @@ gui_buffer_visited_get_index_next () */ struct t_hdata * -gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name) +gui_buffer_hdata_buffer_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer", @@ -4060,6 +4088,7 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name) HDATA_VAR(struct t_gui_buffer, clear, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, filter, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, close_callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_gui_buffer, close_callback_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, close_callback_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, closing, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, title, STRING, 0, NULL, NULL); @@ -4078,9 +4107,11 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name) HDATA_VAR(struct t_gui_buffer, nicklist_nicks_count, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, nicklist_visible_count, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, nickcmp_callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_gui_buffer, nickcmp_callback_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, nickcmp_callback_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, input, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, input_callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_gui_buffer, input_callback_pointer, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, input_callback_data, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, input_get_unknown_commands, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, input_buffer, STRING, 0, NULL, NULL); @@ -4134,11 +4165,13 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_buffer_hdata_input_undo_cb (void *data, const char *hdata_name) +gui_buffer_hdata_input_undo_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_undo", "next_undo", @@ -4158,11 +4191,13 @@ gui_buffer_hdata_input_undo_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_buffer_hdata_buffer_visited_cb (void *data, const char *hdata_name) +gui_buffer_hdata_buffer_visited_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer", @@ -4457,6 +4492,7 @@ gui_buffer_print_log () log_printf (" clear . . . . . . . . . : %d", ptr_buffer->clear); log_printf (" filter. . . . . . . . . : %d", ptr_buffer->filter); log_printf (" close_callback. . . . . : 0x%lx", ptr_buffer->close_callback); + log_printf (" close_callback_pointer. : 0x%lx", ptr_buffer->close_callback_pointer); log_printf (" close_callback_data . . : 0x%lx", ptr_buffer->close_callback_data); log_printf (" closing . . . . . . . . : %d", ptr_buffer->closing); log_printf (" title . . . . . . . . . : '%s'", ptr_buffer->title); @@ -4477,9 +4513,11 @@ gui_buffer_print_log () log_printf (" nicklist_nicks_count. . : %d", ptr_buffer->nicklist_nicks_count); log_printf (" nicklist_visible_count. : %d", ptr_buffer->nicklist_visible_count); log_printf (" nickcmp_callback. . . . : 0x%lx", ptr_buffer->nickcmp_callback); + log_printf (" nickcmp_callback_pointer: 0x%lx", ptr_buffer->nickcmp_callback_pointer); log_printf (" nickcmp_callback_data . : 0x%lx", ptr_buffer->nickcmp_callback_data); log_printf (" input . . . . . . . . . : %d", ptr_buffer->input); log_printf (" input_callback. . . . . : 0x%lx", ptr_buffer->input_callback); + log_printf (" input_callback_pointer. : 0x%lx", ptr_buffer->input_callback_pointer); log_printf (" input_callback_data . . : 0x%lx", ptr_buffer->input_callback_data); log_printf (" input_get_unknown_cmd . : %d", ptr_buffer->input_get_unknown_commands); log_printf (" input_buffer. . . . . . : '%s'", ptr_buffer->input_buffer); diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h index 8e6b90b14..6414978c5 100644 --- a/src/gui/gui-buffer.h +++ b/src/gui/gui-buffer.h @@ -106,8 +106,10 @@ struct t_gui_buffer int filter; /* 1 if filters enabled for buffer */ /* close callback */ - int (*close_callback)(void *data, /* called when buffer is closed */ + int (*close_callback)(const void *pointer, /* called when buffer is */ + void *data, /* closed */ struct t_gui_buffer *buffer); + const void *close_callback_pointer; /* pointer for callback */ void *close_callback_data; /* data for callback */ int closing; /* 1 if the buffer is being closed */ @@ -133,17 +135,21 @@ struct t_gui_buffer int nicklist_groups_count; /* number of groups */ int nicklist_nicks_count; /* number of nicks */ int nicklist_visible_count; /* number of nicks/groups to display */ - int (*nickcmp_callback)(void *data, /* called to compare nicks (search */ - struct t_gui_buffer *buffer, /* in nicklist) */ + int (*nickcmp_callback)(const void *pointer, /* called to compare nicks */ + void *data, /* (search in nicklist) */ + struct t_gui_buffer *buffer, const char *nick1, const char *nick2); + const void *nickcmp_callback_pointer; /* pointer for callback */ void *nickcmp_callback_data; /* data for callback */ /* input */ int input; /* = 1 if input is enabled */ - int (*input_callback)(void *data, /* called when user send data */ + int (*input_callback)(const void *pointer, /* called when user sends */ + void *data, /* data */ struct t_gui_buffer *buffer, const char *input_data); + const void *input_callback_pointer; /* pointer for callback */ void *input_callback_data; /* data for callback */ /* to this buffer */ int input_get_unknown_commands; /* 1 if unknown commands are sent to */ @@ -241,12 +247,16 @@ extern void gui_buffer_notify_set_all (); extern void gui_buffer_input_buffer_init (struct t_gui_buffer *buffer); extern struct t_gui_buffer *gui_buffer_new (struct t_weechat_plugin *plugin, const char *name, - int (*input_callback)(void *data, + int (*input_callback)(const void *pointer, + void *data, struct t_gui_buffer *buffer, const char *input_data), + const void *input_callback_pointer, void *input_callback_data, - int (*close_callback)(void *data, + int (*close_callback)(const void *pointer, + void *data, struct t_gui_buffer *buffer), + const void *close_callback_pointer, void *close_callback_data); extern int gui_buffer_valid (struct t_gui_buffer *buffer); extern char *gui_buffer_string_replace_local_var (struct t_gui_buffer *buffer, @@ -333,11 +343,14 @@ extern void gui_buffer_visited_remove_by_buffer (struct t_gui_buffer *buffer); extern struct t_gui_buffer_visited *gui_buffer_visited_add (struct t_gui_buffer *buffer); extern int gui_buffer_visited_get_index_previous (); extern int gui_buffer_visited_get_index_next (); -extern struct t_hdata *gui_buffer_hdata_buffer_cb (void *data, +extern struct t_hdata *gui_buffer_hdata_buffer_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_buffer_hdata_input_undo_cb (void *data, +extern struct t_hdata *gui_buffer_hdata_input_undo_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_buffer_hdata_buffer_visited_cb (void *data, +extern struct t_hdata *gui_buffer_hdata_buffer_visited_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_buffer_add_to_infolist (struct t_infolist *infolist, struct t_gui_buffer *buffer); diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index d2dd538b2..d987c4c49 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -83,11 +83,11 @@ gui_chat_init () /* some hsignals */ hook_hsignal (NULL, "chat_quote_time_prefix_message", - &gui_chat_hsignal_quote_line_cb, NULL); + &gui_chat_hsignal_quote_line_cb, NULL, NULL); hook_hsignal (NULL, "chat_quote_prefix_message", - &gui_chat_hsignal_quote_line_cb, NULL); + &gui_chat_hsignal_quote_line_cb, NULL, NULL); hook_hsignal (NULL, "chat_quote_message", - &gui_chat_hsignal_quote_line_cb, NULL); + &gui_chat_hsignal_quote_line_cb, NULL, NULL); } /* @@ -980,7 +980,8 @@ gui_chat_print_lines_waiting_buffer (FILE *f) */ int -gui_chat_hsignal_quote_line_cb (void *data, const char *signal, +gui_chat_hsignal_quote_line_cb (const void *pointer, void *data, + const char *signal, struct t_hashtable *hashtable) { const char *date, *line, *prefix, *ptr_prefix, *message; @@ -994,6 +995,7 @@ gui_chat_hsignal_quote_line_cb (void *data, const char *signal, char str_time[128], *str, *error; /* make C compiler happy */ + (void) pointer; (void) data; if (!gui_current_window->buffer->input) diff --git a/src/gui/gui-chat.h b/src/gui/gui-chat.h index e52cd5af2..db2a84908 100644 --- a/src/gui/gui-chat.h +++ b/src/gui/gui-chat.h @@ -89,7 +89,8 @@ extern void gui_chat_printf_date_tags (struct t_gui_buffer *buffer, extern void gui_chat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...); extern void gui_chat_print_lines_waiting_buffer (FILE *f); -extern int gui_chat_hsignal_quote_line_cb (void *data, const char *signal, +extern int gui_chat_hsignal_quote_line_cb (const void *pointer, void *data, + const char *signal, struct t_hashtable *hashtable); extern void gui_chat_end (); diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index e2c9bb4c9..7ffd619a5 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -760,11 +760,10 @@ gui_color_decode (const char *string, const char *replacement) char * gui_color_decode_ansi_cb (void *data, const char *text) { - unsigned long keep_colors; char *text2, **items, *output, str_color[128]; - int i, length, num_items, value; + int i, keep_colors, length, num_items, value; - keep_colors = (unsigned long)data; + keep_colors = (data) ? 1 : 0;; /* if we don't keep colors of if text is empty, just return empty string */ if (!keep_colors || !text || !text[0]) @@ -1186,20 +1185,20 @@ gui_color_palette_alloc_structs () { if (!gui_color_hash_palette_color) { - gui_color_hash_palette_color = hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + gui_color_hash_palette_color = hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_POINTER, + NULL, NULL); gui_color_hash_palette_color->callback_free_value = &gui_color_palette_free_value_cb; } if (!gui_color_hash_palette_alias) { - gui_color_hash_palette_alias = hashtable_new (32, - WEECHAT_HASHTABLE_STRING, - WEECHAT_HASHTABLE_INTEGER, - NULL, - NULL); + gui_color_hash_palette_alias = hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_INTEGER, + NULL, NULL); } if (!gui_color_list_with_alias) { diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index 4ef7d37c6..22af93fb5 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -56,7 +56,8 @@ int gui_completion_freeze = 0; /* 1 to freeze completions (do not */ */ int -gui_completion_word_compare_cb (void *data, struct t_arraylist *arraylist, +gui_completion_word_compare_cb (void *data, + struct t_arraylist *arraylist, void *pointer1, void *pointer2) { struct t_gui_completion_word *completion_word1, *completion_word2; @@ -76,7 +77,8 @@ gui_completion_word_compare_cb (void *data, struct t_arraylist *arraylist, */ void -gui_completion_word_free_cb (void *data, struct t_arraylist *arraylist, +gui_completion_word_free_cb (void *data, + struct t_arraylist *arraylist, void *pointer) { struct t_gui_completion_word *completion_word; @@ -113,9 +115,10 @@ gui_completion_buffer_init (struct t_gui_completion *completion, completion->add_space = 1; completion->force_partial_completion = 0; - completion->list = arraylist_new (32, 1, 0, - &gui_completion_word_compare_cb, NULL, - &gui_completion_word_free_cb, NULL); + completion->list = arraylist_new ( + 32, 1, 0, + &gui_completion_word_compare_cb, NULL, + &gui_completion_word_free_cb, NULL); completion->word_found = NULL; completion->word_found_is_nick = 0; @@ -1239,7 +1242,8 @@ gui_completion_auto (struct t_gui_completion *completion) || (completion->base_word[0] == '~')) { if (completion->list->size == 0) - completion_list_add_filename_cb (NULL, NULL, NULL, completion); + completion_list_add_filename_cb (NULL, NULL, NULL, NULL, + completion); gui_completion_complete (completion); return; } @@ -1349,15 +1353,16 @@ gui_completion_get_string (struct t_gui_completion *completion, */ struct t_hdata * -gui_completion_hdata_completion_cb (void *data, const char *hdata_name) +gui_completion_hdata_completion_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; - hdata = hdata_new (NULL, hdata_name, NULL, NULL, - 0, 0, NULL, NULL); + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); if (hdata) { HDATA_VAR(struct t_gui_completion, buffer, POINTER, 0, NULL, "buffer"); @@ -1387,11 +1392,13 @@ gui_completion_hdata_completion_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_completion_hdata_completion_word_cb (void *data, const char *hdata_name) +gui_completion_hdata_completion_word_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item", diff --git a/src/gui/gui-completion.h b/src/gui/gui-completion.h index b80c8f1a3..1529e4dac 100644 --- a/src/gui/gui-completion.h +++ b/src/gui/gui-completion.h @@ -80,9 +80,11 @@ extern void gui_completion_search (struct t_gui_completion *completion, int pos); extern const char *gui_completion_get_string (struct t_gui_completion *completion, const char *property); -extern struct t_hdata *gui_completion_hdata_completion_cb (void *data, +extern struct t_hdata *gui_completion_hdata_completion_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_completion_hdata_completion_partial_cb (void *data, +extern struct t_hdata *gui_completion_hdata_completion_partial_cb (const void *pointer, + void *data, const char *hdata_name); extern void gui_completion_print_log (struct t_gui_completion *completion); diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c index b2da42a16..ab279483d 100644 --- a/src/gui/gui-filter.c +++ b/src/gui/gui-filter.c @@ -533,11 +533,13 @@ gui_filter_free_all () */ struct t_hdata * -gui_filter_hdata_filter_cb (void *data, const char *hdata_name) +gui_filter_hdata_filter_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_filter", "next_filter", diff --git a/src/gui/gui-filter.h b/src/gui/gui-filter.h index 0eb86bafc..9c383a263 100644 --- a/src/gui/gui-filter.h +++ b/src/gui/gui-filter.h @@ -69,7 +69,8 @@ extern int gui_filter_rename (struct t_gui_filter *filter, const char *new_name); extern void gui_filter_free (struct t_gui_filter *filter); extern void gui_filter_free_all (); -extern struct t_hdata *gui_filter_hdata_filter_cb (void *data, +extern struct t_hdata *gui_filter_hdata_filter_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_filter_add_to_infolist (struct t_infolist *infolist, struct t_gui_filter *filter); diff --git a/src/gui/gui-focus.c b/src/gui/gui-focus.c index 321296762..a712886e2 100644 --- a/src/gui/gui-focus.c +++ b/src/gui/gui-focus.c @@ -134,7 +134,8 @@ gui_focus_free_info (struct t_gui_focus_info *focus_info) */ void -gui_focus_buffer_localvar_map_cb (void *data, struct t_hashtable *hashtable, +gui_focus_buffer_localvar_map_cb (void *data, + struct t_hashtable *hashtable, const void *key, const void *value) { struct t_hashtable *hashtable_focus; @@ -171,8 +172,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key) hashtable = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!hashtable) return NULL; diff --git a/src/gui/gui-history.c b/src/gui/gui-history.c index 7c72ec9e8..9f07c4fb4 100644 --- a/src/gui/gui-history.c +++ b/src/gui/gui-history.c @@ -277,11 +277,13 @@ gui_history_hdata_history_update_cb (void *data, */ struct t_hdata * -gui_history_hdata_history_cb (void *data, const char *hdata_name) +gui_history_hdata_history_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_history", "next_history", diff --git a/src/gui/gui-history.h b/src/gui/gui-history.h index d4d17d00b..dc7e86434 100644 --- a/src/gui/gui-history.h +++ b/src/gui/gui-history.h @@ -39,7 +39,8 @@ extern void gui_history_global_add (const char *string); extern void gui_history_add (struct t_gui_buffer *buffer, const char *string); extern void gui_history_global_free (); extern void gui_history_buffer_free (struct t_gui_buffer *buffer); -extern struct t_hdata *gui_history_hdata_history_cb (void *data, +extern struct t_hdata *gui_history_hdata_history_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_history_add_to_infolist (struct t_infolist *infolist, struct t_gui_history *history); diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index 8c261ece6..e5ef86668 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -317,8 +317,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer, 32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + NULL, NULL); if (!gui_hotlist_hashtable_add_conditions_pointers) return NULL; } @@ -328,8 +327,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer, 32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!gui_hotlist_hashtable_add_conditions_vars) return NULL; } @@ -339,8 +337,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer, 32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!gui_hotlist_hashtable_add_conditions_options) return NULL; hashtable_set (gui_hotlist_hashtable_add_conditions_options, @@ -539,11 +536,13 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer, */ struct t_hdata * -gui_hotlist_hdata_hotlist_cb (void *data, const char *hdata_name) +gui_hotlist_hdata_hotlist_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_hotlist", "next_hotlist", diff --git a/src/gui/gui-hotlist.h b/src/gui/gui-hotlist.h index 79760908e..d3f9f58e4 100644 --- a/src/gui/gui-hotlist.h +++ b/src/gui/gui-hotlist.h @@ -61,7 +61,8 @@ extern void gui_hotlist_resort (); extern void gui_hotlist_clear (); extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer, int force_remove_buffer); -extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (void *data, +extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_hotlist_add_to_infolist (struct t_infolist *infolist, struct t_gui_hotlist *hotlist); diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 436d878af..51ae755e5 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -196,12 +196,14 @@ gui_key_grab_init (int grab_command, const char *delay) */ int -gui_key_grab_end_timer_cb (void *data, int remaining_calls) +gui_key_grab_end_timer_cb (const void *pointer, void *data, + int remaining_calls) { char *expanded_key, *expanded_key2; struct t_gui_key *ptr_key; /* make C compiler happy */ + (void) pointer; (void) data; (void) remaining_calls; @@ -1292,7 +1294,7 @@ gui_key_pressed (const char *key_str) if (gui_key_grab_count == 0) { hook_timer (NULL, gui_key_grab_delay, 0, 1, - &gui_key_grab_end_timer_cb, NULL); + &gui_key_grab_end_timer_cb, NULL, NULL); } gui_key_grab_count++; return 0; @@ -1740,9 +1742,11 @@ gui_key_paste_check (int bracketed_paste) */ int -gui_key_paste_bracketed_timer_cb (void *data, int remaining_calls) +gui_key_paste_bracketed_timer_cb (const void *pointer, void *data, + int remaining_calls) { /* make C compiler happy */ + (void) pointer; (void) data; (void) remaining_calls; @@ -1776,10 +1780,11 @@ void gui_key_paste_bracketed_timer_add () { gui_key_paste_bracketed_timer_remove (); - gui_key_paste_bracketed_timer = hook_timer (NULL, - CONFIG_INTEGER(config_look_paste_bracketed_timer_delay) * 1000, - 0, 1, - &gui_key_paste_bracketed_timer_cb, NULL); + gui_key_paste_bracketed_timer = hook_timer ( + NULL, + CONFIG_INTEGER(config_look_paste_bracketed_timer_delay) * 1000, + 0, 1, + &gui_key_paste_bracketed_timer_cb, NULL, NULL); } /* @@ -1870,13 +1875,15 @@ gui_key_end () */ struct t_hdata * -gui_key_hdata_key_cb (void *data, const char *hdata_name) +gui_key_hdata_key_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; int i; char str_list[128]; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_key", "next_key", diff --git a/src/gui/gui-key.h b/src/gui/gui-key.h index ccbfab515..acda6a991 100644 --- a/src/gui/gui-key.h +++ b/src/gui/gui-key.h @@ -129,7 +129,8 @@ extern void gui_key_paste_bracketed_stop (); extern void gui_key_paste_accept (); extern void gui_key_paste_cancel (); extern void gui_key_end (); -extern struct t_hdata *gui_key_hdata_key_cb (void *data, +extern struct t_hdata *gui_key_hdata_key_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_key_add_to_infolist (struct t_infolist *infolist, struct t_gui_key *key); diff --git a/src/gui/gui-layout.c b/src/gui/gui-layout.c index 8f335c9ec..d0a957239 100644 --- a/src/gui/gui-layout.c +++ b/src/gui/gui-layout.c @@ -883,11 +883,13 @@ gui_layout_remove_all () */ struct t_hdata * -gui_layout_hdata_layout_buffer_cb (void *data, const char *hdata_name) +gui_layout_hdata_layout_buffer_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_layout", "next_layout", @@ -908,11 +910,13 @@ gui_layout_hdata_layout_buffer_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_layout_hdata_layout_window_cb (void *data, const char *hdata_name) +gui_layout_hdata_layout_window_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); @@ -935,11 +939,13 @@ gui_layout_hdata_layout_window_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_layout_hdata_layout_cb (void *data, const char *hdata_name) +gui_layout_hdata_layout_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_layout", "next_layout", diff --git a/src/gui/gui-layout.h b/src/gui/gui-layout.h index 968af3afb..24833a253 100644 --- a/src/gui/gui-layout.h +++ b/src/gui/gui-layout.h @@ -113,11 +113,14 @@ extern void gui_layout_store_on_exit (); extern void gui_layout_free (struct t_gui_layout *layout); extern void gui_layout_remove (struct t_gui_layout *layout); extern void gui_layout_remove_all (); -extern struct t_hdata *gui_layout_hdata_layout_buffer_cb (void *data, +extern struct t_hdata *gui_layout_hdata_layout_buffer_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_layout_hdata_layout_window_cb (void *data, +extern struct t_hdata *gui_layout_hdata_layout_window_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_layout_hdata_layout_cb (void *data, +extern struct t_hdata *gui_layout_hdata_layout_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_layout_buffer_add_to_infolist (struct t_infolist *infolist, struct t_gui_layout_buffer *layout_buffer); diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index 14a529376..e5c1d30f7 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -1562,11 +1562,13 @@ gui_line_mix_buffers (struct t_gui_buffer *buffer) */ struct t_hdata * -gui_line_hdata_lines_cb (void *data, const char *hdata_name) +gui_line_hdata_lines_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); @@ -1591,11 +1593,13 @@ gui_line_hdata_lines_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_line_hdata_line_cb (void *data, const char *hdata_name) +gui_line_hdata_line_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_line", "next_line", @@ -1704,11 +1708,13 @@ gui_line_hdata_line_data_update_cb (void *data, */ struct t_hdata * -gui_line_hdata_line_data_cb (void *data, const char *hdata_name) +gui_line_hdata_line_data_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, NULL, NULL, diff --git a/src/gui/gui-line.h b/src/gui/gui-line.h index 015be32e1..1089b9b3a 100644 --- a/src/gui/gui-line.h +++ b/src/gui/gui-line.h @@ -113,11 +113,14 @@ extern void gui_line_add_y (struct t_gui_buffer *buffer, int y, const char *message); extern void gui_line_clear (struct t_gui_line *line); extern void gui_line_mix_buffers (struct t_gui_buffer *buffer); -extern struct t_hdata *gui_line_hdata_lines_cb (void *data, +extern struct t_hdata *gui_line_hdata_lines_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_line_hdata_line_cb (void *data, +extern struct t_hdata *gui_line_hdata_line_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_line_hdata_line_data_cb (void *data, +extern struct t_hdata *gui_line_hdata_line_data_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_line_add_to_infolist (struct t_infolist *infolist, struct t_gui_lines *lines, diff --git a/src/gui/gui-nicklist.c b/src/gui/gui-nicklist.c index 0c907ef6f..c81cd3c82 100644 --- a/src/gui/gui-nicklist.c +++ b/src/gui/gui-nicklist.c @@ -98,8 +98,7 @@ gui_nicklist_send_hsignal (const char *signal, struct t_gui_buffer *buffer, gui_nicklist_hsignal = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + NULL, NULL); } if (!gui_nicklist_hsignal) @@ -394,7 +393,8 @@ gui_nicklist_search_nick (struct t_gui_buffer *buffer, { if (buffer->nickcmp_callback) { - if ((buffer->nickcmp_callback) (buffer->nickcmp_callback_data, + if ((buffer->nickcmp_callback) (buffer->nickcmp_callback_pointer, + buffer->nickcmp_callback_data, buffer, ptr_nick->name, name) == 0) @@ -1036,11 +1036,13 @@ gui_nicklist_nick_set (struct t_gui_buffer *buffer, */ struct t_hdata * -gui_nicklist_hdata_nick_group_cb (void *data, const char *hdata_name) +gui_nicklist_hdata_nick_group_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_group", "next_group", @@ -1067,11 +1069,13 @@ gui_nicklist_hdata_nick_group_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_nicklist_hdata_nick_cb (void *data, const char *hdata_name) +gui_nicklist_hdata_nick_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_nick", "next_nick", diff --git a/src/gui/gui-nicklist.h b/src/gui/gui-nicklist.h index 03c8f59e3..1a2e316ca 100644 --- a/src/gui/gui-nicklist.h +++ b/src/gui/gui-nicklist.h @@ -108,9 +108,11 @@ extern void *gui_nicklist_nick_get_pointer (struct t_gui_buffer *buffer, extern void gui_nicklist_nick_set (struct t_gui_buffer *buffer, struct t_gui_nick *nick, const char *property, const char *value); -extern struct t_hdata *gui_nicklist_hdata_nick_group_cb (void *data, +extern struct t_hdata *gui_nicklist_hdata_nick_group_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_nicklist_hdata_nick_cb (void *data, +extern struct t_hdata *gui_nicklist_hdata_nick_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_nicklist_add_to_infolist (struct t_infolist *infolist, struct t_gui_buffer *buffer, diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c index 5d4e2270b..263fc938f 100644 --- a/src/gui/gui-window.c +++ b/src/gui/gui-window.c @@ -1797,11 +1797,13 @@ gui_window_zoom (struct t_gui_window *window) */ struct t_hdata * -gui_window_hdata_window_cb (void *data, const char *hdata_name) +gui_window_hdata_window_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_window", "next_window", @@ -1844,11 +1846,13 @@ gui_window_hdata_window_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_window_hdata_window_scroll_cb (void *data, const char *hdata_name) +gui_window_hdata_window_scroll_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, "prev_scroll", "next_scroll", @@ -1874,11 +1878,13 @@ gui_window_hdata_window_scroll_cb (void *data, const char *hdata_name) */ struct t_hdata * -gui_window_hdata_window_tree_cb (void *data, const char *hdata_name) +gui_window_hdata_window_tree_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h index 87f957141..cea5c5a37 100644 --- a/src/gui/gui-window.h +++ b/src/gui/gui-window.h @@ -190,11 +190,14 @@ extern void gui_window_search_stop_here (struct t_gui_window *window); extern void gui_window_search_stop (struct t_gui_window *window); extern int gui_window_search_text (struct t_gui_window *window); extern void gui_window_zoom (struct t_gui_window *window); -extern struct t_hdata *gui_window_hdata_window_cb (void *data, +extern struct t_hdata *gui_window_hdata_window_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_window_hdata_window_scroll_cb (void *data, +extern struct t_hdata *gui_window_hdata_window_scroll_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *gui_window_hdata_window_tree_cb (void *data, +extern struct t_hdata *gui_window_hdata_window_tree_cb (const void *pointer, + void *data, const char *hdata_name); extern int gui_window_add_to_infolist (struct t_infolist *infolist, struct t_gui_window *window); diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 40d73e10d..d10fd58f2 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -26,8 +26,7 @@ plugin-config.h plugin-config.c) set(LIB_PLUGINS_SCRIPTS_SRC plugin-script.c plugin-script.h -plugin-script-api.c plugin-script-api.h -plugin-script-callback.c plugin-script-callback.h) +plugin-script-api.c plugin-script-api.h) include_directories(${CMAKE_BINARY_DIR}) add_library(weechat_plugins STATIC ${LIB_PLUGINS_SRC}) diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index aa46965f7..20a29cc19 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -34,8 +34,6 @@ noinst_LTLIBRARIES = lib_weechat_plugins_scripts.la lib_weechat_plugins_scripts_la_SOURCES = plugin-script.c \ plugin-script.h \ - plugin-script-callback.c \ - plugin-script-callback.h \ plugin-script-api.c \ plugin-script-api.h diff --git a/src/plugins/alias/alias-command.c b/src/plugins/alias/alias-command.c index 59975387d..f492faaa5 100644 --- a/src/plugins/alias/alias-command.c +++ b/src/plugins/alias/alias-command.c @@ -76,7 +76,8 @@ alias_command_add (const char *alias_name, const char *command, */ int -alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, +alias_command_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { char *ptr_alias_name; @@ -85,6 +86,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, int alias_found, i; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -287,5 +289,5 @@ alias_command_init () " || add %(alias) %(commands)|%(alias_value)" " || addcompletion %- %(alias) %(commands)|%(alias_value)" " || del %(alias)|%*", - &alias_command_cb, NULL); + &alias_command_cb, NULL, NULL); } diff --git a/src/plugins/alias/alias-completion.c b/src/plugins/alias/alias-completion.c index 42e3a553e..fd90b1c5d 100644 --- a/src/plugins/alias/alias-completion.c +++ b/src/plugins/alias/alias-completion.c @@ -32,13 +32,15 @@ */ int -alias_completion_alias_cb (void *data, const char *completion_item, +alias_completion_alias_cb (const void *pointer, void *data, + const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { struct t_alias *ptr_alias; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -58,7 +60,8 @@ alias_completion_alias_cb (void *data, const char *completion_item, */ int -alias_completion_alias_value_cb (void *data, const char *completion_item, +alias_completion_alias_value_cb (const void *pointer, void *data, + const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { @@ -68,6 +71,7 @@ alias_completion_alias_value_cb (void *data, const char *completion_item, struct t_alias *ptr_alias; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -110,7 +114,7 @@ void alias_completion_init () { weechat_hook_completion ("alias", N_("list of aliases"), - &alias_completion_alias_cb, NULL); + &alias_completion_alias_cb, NULL, NULL); weechat_hook_completion ("alias_value", N_("value of alias"), - &alias_completion_alias_value_cb, NULL); + &alias_completion_alias_value_cb, NULL, NULL); } diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c index 9a2128b39..1ad8780c3 100644 --- a/src/plugins/alias/alias-config.c +++ b/src/plugins/alias/alias-config.c @@ -78,11 +78,13 @@ char *alias_default_completion[][2] = */ void -alias_config_cmd_change_cb (void *data, struct t_config_option *option) +alias_config_cmd_change_cb (const void *pointer, void *data, + struct t_config_option *option) { struct t_config_option *ptr_option_completion; /* make C compiler happy */ + (void) pointer; (void) data; ptr_option_completion = weechat_config_search_option (alias_config_file, @@ -100,12 +102,14 @@ alias_config_cmd_change_cb (void *data, struct t_config_option *option) */ void -alias_config_cmd_delete_cb (void *data, struct t_config_option *option) +alias_config_cmd_delete_cb (const void *pointer, void *data, + struct t_config_option *option) { struct t_config_option *ptr_option_completion; struct t_alias *ptr_alias; /* make C compiler happy */ + (void) pointer; (void) data; ptr_option_completion = weechat_config_search_option (alias_config_file, @@ -125,11 +129,13 @@ alias_config_cmd_delete_cb (void *data, struct t_config_option *option) */ void -alias_config_completion_change_cb (void *data, struct t_config_option *option) +alias_config_completion_change_cb (const void *pointer, void *data, + struct t_config_option *option) { struct t_alias *ptr_alias; /* make C compiler happy */ + (void) pointer; (void) data; ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name")); @@ -145,11 +151,13 @@ alias_config_completion_change_cb (void *data, struct t_config_option *option) */ void -alias_config_completion_delete_cb (void *data, struct t_config_option *option) +alias_config_completion_delete_cb (const void *pointer, void *data, + struct t_config_option *option) { struct t_alias *ptr_alias; /* make C compiler happy */ + (void) pointer; (void) data; ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name")); @@ -164,9 +172,11 @@ alias_config_completion_delete_cb (void *data, struct t_config_option *option) */ int -alias_config_reload (void *data, struct t_config_file *config_file) +alias_config_reload (const void *pointer, void *data, + struct t_config_file *config_file) { /* make C compiler happy */ + (void) pointer; (void) data; weechat_config_section_free_options (alias_config_section_cmd); @@ -181,13 +191,14 @@ alias_config_reload (void *data, struct t_config_file *config_file) */ int -alias_config_cmd_write_default_cb (void *data, +alias_config_cmd_write_default_cb (const void *pointer, void *data, struct t_config_file *config_file, const char *section_name) { int i; /* make C compiler happy */ + (void) pointer; (void) data; if (!weechat_config_write_line (config_file, section_name, NULL)) @@ -214,9 +225,9 @@ alias_config_cmd_new_option (const char *name, const char *command) weechat_config_new_option (alias_config_file, alias_config_section_cmd, name, "string", NULL, NULL, 0, 0, NULL, command, 0, - NULL, NULL, - &alias_config_cmd_change_cb, NULL, - &alias_config_cmd_delete_cb, NULL); + NULL, NULL, NULL, + &alias_config_cmd_change_cb, NULL, NULL, + &alias_config_cmd_delete_cb, NULL, NULL); } /* @@ -224,7 +235,7 @@ alias_config_cmd_new_option (const char *name, const char *command) */ int -alias_config_cmd_create_option_cb (void *data, +alias_config_cmd_create_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) @@ -233,6 +244,7 @@ alias_config_cmd_create_option_cb (void *data, int rc; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -266,13 +278,14 @@ alias_config_cmd_create_option_cb (void *data, */ int -alias_config_completion_write_default_cb (void *data, +alias_config_completion_write_default_cb (const void *pointer, void *data, struct t_config_file *config_file, const char *section_name) { int i; /* make C compiler happy */ + (void) pointer; (void) data; if (!weechat_config_write_line (config_file, section_name, NULL)) @@ -300,9 +313,9 @@ alias_config_completion_new_option (const char *name, const char *completion) alias_config_section_completion, name, "string", NULL, NULL, 0, 0, NULL, completion, 0, - NULL, NULL, - &alias_config_completion_change_cb, NULL, - &alias_config_completion_delete_cb, NULL); + NULL, NULL, NULL, + &alias_config_completion_change_cb, NULL, NULL, + &alias_config_completion_delete_cb, NULL, NULL); } /* @@ -310,7 +323,7 @@ alias_config_completion_new_option (const char *name, const char *completion) */ int -alias_config_completion_create_option_cb (void *data, +alias_config_completion_create_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, @@ -319,6 +332,7 @@ alias_config_completion_create_option_cb (void *data, struct t_alias *ptr_alias; /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -357,18 +371,19 @@ alias_config_init () struct t_config_section *ptr_section; alias_config_file = weechat_config_new (ALIAS_CONFIG_NAME, - &alias_config_reload, NULL); + &alias_config_reload, NULL, NULL); if (!alias_config_file) return 0; /* cmd */ - ptr_section = weechat_config_new_section (alias_config_file, "cmd", - 1, 1, - NULL, NULL, - NULL, NULL, - &alias_config_cmd_write_default_cb, NULL, - &alias_config_cmd_create_option_cb, NULL, - NULL, NULL); + ptr_section = weechat_config_new_section ( + alias_config_file, "cmd", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + &alias_config_cmd_write_default_cb, NULL, NULL, + &alias_config_cmd_create_option_cb, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (alias_config_file); @@ -377,13 +392,14 @@ alias_config_init () alias_config_section_cmd = ptr_section; /* completion */ - ptr_section = weechat_config_new_section (alias_config_file, "completion", - 1, 1, - NULL, NULL, - NULL, NULL, - &alias_config_completion_write_default_cb, NULL, - &alias_config_completion_create_option_cb, NULL, - NULL, NULL); + ptr_section = weechat_config_new_section ( + alias_config_file, "completion", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + &alias_config_completion_write_default_cb, NULL, NULL, + &alias_config_completion_create_option_cb, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (alias_config_file); diff --git a/src/plugins/alias/alias-info.c b/src/plugins/alias/alias-info.c index 600f0c8c2..484c6082b 100644 --- a/src/plugins/alias/alias-info.c +++ b/src/plugins/alias/alias-info.c @@ -30,28 +30,30 @@ */ struct t_infolist * -alias_info_infolist_alias_cb (void *data, const char *infolist_name, - void *pointer, const char *arguments) +alias_info_infolist_alias_cb (const void *pointer, void *data, + const char *infolist_name, + void *obj_pointer, const char *arguments) { struct t_infolist *ptr_infolist; struct t_alias *ptr_alias; /* make C compiler happy */ + (void) pointer; (void) data; (void) infolist_name; (void) arguments; - if (pointer && !alias_valid (pointer)) + if (obj_pointer && !alias_valid (obj_pointer)) return NULL; ptr_infolist = weechat_infolist_new (); if (!ptr_infolist) return NULL; - if (pointer) + if (obj_pointer) { /* build list with only one alias */ - if (!alias_add_to_infolist (ptr_infolist, pointer)) + if (!alias_add_to_infolist (ptr_infolist, obj_pointer)) { weechat_infolist_free (ptr_infolist); return NULL; @@ -90,5 +92,5 @@ alias_info_init () "alias", N_("list of aliases"), N_("alias pointer (optional)"), N_("alias name (wildcard \"*\" is allowed) (optional)"), - &alias_info_infolist_alias_cb, NULL); + &alias_info_infolist_alias_cb, NULL, NULL); } diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c index db02f987c..961748757 100644 --- a/src/plugins/alias/alias.c +++ b/src/plugins/alias/alias.c @@ -337,7 +337,8 @@ alias_run_command (struct t_gui_buffer **buffer, const char *command) */ int -alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, +alias_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { struct t_alias *ptr_alias; @@ -346,9 +347,10 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, int some_args_replaced, length1, length2; /* make C compiler happy */ + (void) data; (void) argv; - ptr_alias = (struct t_alias *)data; + ptr_alias = (struct t_alias *)pointer; if (ptr_alias->running) { @@ -545,7 +547,7 @@ alias_hook_command (struct t_alias *alias) alias->command, NULL, NULL, (str_completion) ? str_completion : alias->completion, - &alias_cb, alias); + &alias_cb, alias, NULL); if (str_priority_name) free (str_priority_name); diff --git a/src/plugins/aspell/weechat-aspell-bar-item.c b/src/plugins/aspell/weechat-aspell-bar-item.c index c723ce782..efb73ae8c 100644 --- a/src/plugins/aspell/weechat-aspell-bar-item.c +++ b/src/plugins/aspell/weechat-aspell-bar-item.c @@ -35,7 +35,8 @@ */ char * -weechat_aspell_bar_item_dict (void *data, struct t_gui_bar_item *item, +weechat_aspell_bar_item_dict (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -43,6 +44,7 @@ weechat_aspell_bar_item_dict (void *data, struct t_gui_bar_item *item, const char *dict_list; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -61,7 +63,8 @@ weechat_aspell_bar_item_dict (void *data, struct t_gui_bar_item *item, */ char * -weechat_aspell_bar_item_suggest (void *data, struct t_gui_bar_item *item, +weechat_aspell_bar_item_suggest (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -71,6 +74,7 @@ weechat_aspell_bar_item_suggest (void *data, struct t_gui_bar_item *item, int i, num_suggestions, length; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -132,6 +136,8 @@ weechat_aspell_bar_item_suggest (void *data, struct t_gui_bar_item *item, void weechat_aspell_bar_item_init () { - weechat_bar_item_new ("aspell_dict", &weechat_aspell_bar_item_dict, NULL); - weechat_bar_item_new ("aspell_suggest", &weechat_aspell_bar_item_suggest, NULL); + weechat_bar_item_new ("aspell_dict", + &weechat_aspell_bar_item_dict, NULL, NULL); + weechat_bar_item_new ("aspell_suggest", + &weechat_aspell_bar_item_suggest, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-command.c b/src/plugins/aspell/weechat-aspell-command.c index 36b06ece7..740f5aac4 100644 --- a/src/plugins/aspell/weechat-aspell-command.c +++ b/src/plugins/aspell/weechat-aspell-command.c @@ -330,7 +330,8 @@ end: */ int -weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer, +weechat_aspell_command_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { char *dicts; @@ -339,6 +340,7 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer, int number; /* make C compiler happy */ + (void) pointer; (void) data; if (argc == 1) @@ -499,5 +501,5 @@ weechat_aspell_command_init () " || setdict %(aspell_dicts)" " || deldict" " || addword", - &weechat_aspell_command_cb, NULL); + &weechat_aspell_command_cb, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-completion.c b/src/plugins/aspell/weechat-aspell-completion.c index c095a0091..30917a012 100644 --- a/src/plugins/aspell/weechat-aspell-completion.c +++ b/src/plugins/aspell/weechat-aspell-completion.c @@ -33,13 +33,15 @@ */ int -weechat_aspell_completion_langs_cb (void *data, const char *completion_item, +weechat_aspell_completion_langs_cb (const void *pointer, void *data, + const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { int i; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -81,7 +83,7 @@ weechat_aspell_completion_enchant_add_dict_cb (const char *lang_tag, */ int -weechat_aspell_completion_dicts_cb (void *data, +weechat_aspell_completion_dicts_cb (const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) @@ -94,6 +96,7 @@ weechat_aspell_completion_dicts_cb (void *data, #endif /* USE_ENCHANT */ /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -129,8 +132,8 @@ weechat_aspell_completion_init () { weechat_hook_completion ("aspell_langs", N_("list of all languages supported by aspell"), - &weechat_aspell_completion_langs_cb, NULL); + &weechat_aspell_completion_langs_cb, NULL, NULL); weechat_hook_completion ("aspell_dicts", N_("list of aspell installed dictionaries"), - &weechat_aspell_completion_dicts_cb, NULL); + &weechat_aspell_completion_dicts_cb, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-config.c b/src/plugins/aspell/weechat-aspell-config.c index ee46731be..b3a1bb11e 100644 --- a/src/plugins/aspell/weechat-aspell-config.c +++ b/src/plugins/aspell/weechat-aspell-config.c @@ -61,13 +61,14 @@ int *weechat_aspell_length_commands_to_check = NULL; */ void -weechat_aspell_config_change_commands (void *data, +weechat_aspell_config_change_commands (const void *pointer, void *data, struct t_config_option *option) { const char *value; int i; /* make C compiler happy */ + (void) pointer; (void) data; if (weechat_aspell_commands_to_check) @@ -106,10 +107,11 @@ weechat_aspell_config_change_commands (void *data, */ void -weechat_aspell_config_change_default_dict (void *data, +weechat_aspell_config_change_default_dict (const void *pointer, void *data, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -123,9 +125,11 @@ weechat_aspell_config_change_default_dict (void *data, */ void -weechat_aspell_config_change_enabled (void *data, struct t_config_option *option) +weechat_aspell_config_change_enabled (const void *pointer, void *data, + struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; aspell_enabled = weechat_config_boolean (option); @@ -140,10 +144,11 @@ weechat_aspell_config_change_enabled (void *data, struct t_config_option *option */ void -weechat_aspell_config_change_suggestions (void *data, +weechat_aspell_config_change_suggestions (const void *pointer, void *data, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -155,10 +160,11 @@ weechat_aspell_config_change_suggestions (void *data, */ void -weechat_aspell_config_dict_change (void *data, +weechat_aspell_config_dict_change (const void *pointer, void *data, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -172,12 +178,13 @@ weechat_aspell_config_dict_change (void *data, */ int -weechat_aspell_config_dict_delete_option (void *data, +weechat_aspell_config_dict_delete_option (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -196,7 +203,7 @@ weechat_aspell_config_dict_delete_option (void *data, */ int -weechat_aspell_config_dict_create_option (void *data, +weechat_aspell_config_dict_create_option (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, @@ -206,6 +213,7 @@ weechat_aspell_config_dict_create_option (void *data, int rc; /* make C compiler happy */ + (void) pointer; (void) data; rc = WEECHAT_CONFIG_OPTION_SET_ERROR; @@ -236,9 +244,9 @@ weechat_aspell_config_dict_create_option (void *data, option_name, "string", _("comma separated list of dictionaries to use on this buffer"), NULL, 0, 0, "", value, 0, - NULL, NULL, - &weechat_aspell_config_dict_change, NULL, - NULL, NULL); + NULL, NULL, NULL, + &weechat_aspell_config_dict_change, NULL, NULL, + NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -269,10 +277,11 @@ weechat_aspell_config_dict_create_option (void *data, */ void -weechat_aspell_config_option_change (void *data, +weechat_aspell_config_option_change (const void *pointer, void *data, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -286,12 +295,13 @@ weechat_aspell_config_option_change (void *data, */ int -weechat_aspell_config_option_delete_option (void *data, +weechat_aspell_config_option_delete_option (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) config_file; (void) section; @@ -310,7 +320,7 @@ weechat_aspell_config_option_delete_option (void *data, */ int -weechat_aspell_config_option_create_option (void *data, +weechat_aspell_config_option_create_option (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, @@ -320,6 +330,7 @@ weechat_aspell_config_option_create_option (void *data, int rc; /* make C compiler happy */ + (void) pointer; (void) data; rc = WEECHAT_CONFIG_OPTION_SET_ERROR; @@ -348,9 +359,9 @@ weechat_aspell_config_option_create_option (void *data, _("option for aspell (for list of available options and " "format, run command \"aspell config\" in a shell)"), NULL, 0, 0, "", value, 0, - NULL, NULL, - &weechat_aspell_config_option_change, NULL, - NULL, NULL); + NULL, NULL, NULL, + &weechat_aspell_config_option_change, NULL, NULL, + NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -395,7 +406,7 @@ weechat_aspell_config_get_dict (const char *name) int weechat_aspell_config_set_dict (const char *name, const char *value) { - return weechat_aspell_config_dict_create_option (NULL, + return weechat_aspell_config_dict_create_option (NULL, NULL, weechat_aspell_config_file, weechat_aspell_config_section_dict, name, @@ -416,16 +427,19 @@ weechat_aspell_config_init () struct t_config_section *ptr_section; weechat_aspell_config_file = weechat_config_new (ASPELL_CONFIG_NAME, - NULL, NULL); + NULL, NULL, NULL); if (!weechat_aspell_config_file) return 0; /* color */ - ptr_section = weechat_config_new_section (weechat_aspell_config_file, "color", - 0, 0, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL); + ptr_section = weechat_config_new_section ( + weechat_aspell_config_file, "color", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (weechat_aspell_config_file); @@ -436,19 +450,24 @@ weechat_aspell_config_init () weechat_aspell_config_file, ptr_section, "misspelled", "color", N_("text color for misspelled words (input bar)"), - NULL, 0, 0, "lightred", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "lightred", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); weechat_aspell_config_color_suggestions = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "suggestions", "color", N_("text color for suggestions on a misspelled word (status bar)"), - NULL, 0, 0, "default", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "default", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* check */ - ptr_section = weechat_config_new_section (weechat_aspell_config_file, "check", - 0, 0, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL); + ptr_section = weechat_config_new_section ( + weechat_aspell_config_file, "check", + 0, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (weechat_aspell_config_file); @@ -463,7 +482,9 @@ weechat_aspell_config_init () NULL, 0, 0, "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query," "quit,topic", NULL, 0, - NULL, NULL, &weechat_aspell_config_change_commands, NULL, NULL, NULL); + NULL, NULL, NULL, + &weechat_aspell_config_change_commands, NULL, NULL, + NULL, NULL, NULL); weechat_aspell_config_check_default_dict = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "default_dict", "string", @@ -471,24 +492,30 @@ weechat_aspell_config_init () "use when buffer has no dictionary defined (leave blank to disable " "aspell on buffers for which you didn't explicitly enabled it)"), NULL, 0, 0, "", NULL, 0, - NULL, NULL, &weechat_aspell_config_change_default_dict, NULL, NULL, NULL); + NULL, NULL, NULL, + &weechat_aspell_config_change_default_dict, NULL, NULL, + NULL, NULL, NULL); weechat_aspell_config_check_during_search = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "during_search", "boolean", N_("check words during text search in buffer"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); weechat_aspell_config_check_enabled = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "enabled", "boolean", N_("enable aspell check for command line"), NULL, 0, 0, "off", NULL, 0, - NULL, NULL, &weechat_aspell_config_change_enabled, NULL, NULL, NULL); + NULL, NULL, NULL, + &weechat_aspell_config_change_enabled, NULL, NULL, + NULL, NULL, NULL); weechat_aspell_config_check_real_time = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "real_time", "boolean", N_("real-time spell checking of words (slower, disabled by default: " "words are checked only if there's delimiter after)"), - NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); weechat_aspell_config_check_suggestions = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "suggestions", "integer", @@ -496,22 +523,26 @@ weechat_aspell_config_init () "for each dictionary set in buffer (-1 = disable suggestions, " "0 = display all possible suggestions in all languages)"), NULL, -1, INT_MAX, "-1", NULL, 0, - NULL, NULL, &weechat_aspell_config_change_suggestions, NULL, NULL, NULL); + NULL, NULL, NULL, + &weechat_aspell_config_change_suggestions, NULL, NULL, + NULL, NULL, NULL); weechat_aspell_config_check_word_min_length = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "word_min_length", "integer", N_("minimum length for a word to be spell checked (use 0 to check all " "words)"), - NULL, 0, INT_MAX, "2", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "2", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* dict */ - ptr_section = weechat_config_new_section (weechat_aspell_config_file, "dict", - 1, 1, - NULL, NULL, - NULL, NULL, - NULL, NULL, - &weechat_aspell_config_dict_create_option, NULL, - &weechat_aspell_config_dict_delete_option, NULL); + ptr_section = weechat_config_new_section ( + weechat_aspell_config_file, "dict", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &weechat_aspell_config_dict_create_option, NULL, NULL, + &weechat_aspell_config_dict_delete_option, NULL, NULL); if (!ptr_section) { weechat_config_free (weechat_aspell_config_file); @@ -521,13 +552,14 @@ weechat_aspell_config_init () weechat_aspell_config_section_dict = ptr_section; /* option */ - ptr_section = weechat_config_new_section (weechat_aspell_config_file, "option", - 1, 1, - NULL, NULL, - NULL, NULL, - NULL, NULL, - &weechat_aspell_config_option_create_option, NULL, - &weechat_aspell_config_option_delete_option, NULL); + ptr_section = weechat_config_new_section ( + weechat_aspell_config_file, "option", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &weechat_aspell_config_option_create_option, NULL, NULL, + &weechat_aspell_config_option_delete_option, NULL, NULL); if (!ptr_section) { weechat_config_free (weechat_aspell_config_file); @@ -551,8 +583,8 @@ weechat_aspell_config_read () weechat_aspell_config_loading = 0; if (rc == WEECHAT_CONFIG_READ_OK) { - weechat_aspell_config_change_commands (NULL, - weechat_aspell_config_check_commands); + weechat_aspell_config_change_commands ( + NULL, NULL, weechat_aspell_config_check_commands); } weechat_aspell_speller_remove_unused (); diff --git a/src/plugins/aspell/weechat-aspell-info.c b/src/plugins/aspell/weechat-aspell-info.c index 33e6eed86..3e298c063 100644 --- a/src/plugins/aspell/weechat-aspell-info.c +++ b/src/plugins/aspell/weechat-aspell-info.c @@ -32,7 +32,8 @@ */ const char * -weechat_aspell_info_info_aspell_dict_cb (void *data, const char *info_name, +weechat_aspell_info_info_aspell_dict_cb (const void *pointer, void *data, + const char *info_name, const char *arguments) { int rc; @@ -41,6 +42,7 @@ weechat_aspell_info_info_aspell_dict_cb (void *data, const char *info_name, const char *buffer_full_name; /* make C compiler happy */ + (void) pointer; (void) data; (void) info_name; @@ -83,5 +85,5 @@ weechat_aspell_info_init () N_("comma-separated list of dictionaries used in buffer"), N_("buffer pointer (\"0x12345678\") or buffer full name " "(\"irc.freenode.#weechat\")"), - &weechat_aspell_info_info_aspell_dict_cb, NULL); + &weechat_aspell_info_info_aspell_dict_cb, NULL, NULL); } diff --git a/src/plugins/aspell/weechat-aspell-speller.c b/src/plugins/aspell/weechat-aspell-speller.c index fdaee28f5..65b236e3a 100644 --- a/src/plugins/aspell/weechat-aspell-speller.c +++ b/src/plugins/aspell/weechat-aspell-speller.c @@ -272,8 +272,7 @@ weechat_aspell_speller_remove_unused () used_spellers = weechat_hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!used_spellers) return; @@ -448,8 +447,7 @@ weechat_aspell_speller_init () weechat_aspell_spellers = weechat_hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + NULL, NULL); if (!weechat_aspell_spellers) return 0; weechat_hashtable_set_pointer (weechat_aspell_spellers, @@ -459,8 +457,7 @@ weechat_aspell_speller_init () weechat_aspell_speller_buffer = weechat_hashtable_new (32, WEECHAT_HASHTABLE_POINTER, WEECHAT_HASHTABLE_POINTER, - NULL, - NULL); + NULL, NULL); if (!weechat_aspell_speller_buffer) { weechat_hashtable_free (weechat_aspell_spellers); diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c index 961d2553d..1513e2f51 100644 --- a/src/plugins/aspell/weechat-aspell.c +++ b/src/plugins/aspell/weechat-aspell.c @@ -604,7 +604,8 @@ weechat_aspell_get_suggestions (struct t_aspell_speller_buffer *speller_buffer, */ char * -weechat_aspell_modifier_cb (void *data, const char *modifier, +weechat_aspell_modifier_cb (const void *pointer, void *data, + const char *modifier, const char *modifier_data, const char *string) { long unsigned int value; @@ -621,6 +622,7 @@ weechat_aspell_modifier_cb (void *data, const char *modifier, int input_pos, current_pos, word_start_pos, word_end_pos, word_end_pos_valid; /* make C compiler happy */ + (void) pointer; (void) data; (void) modifier; @@ -932,10 +934,12 @@ weechat_aspell_modifier_cb (void *data, const char *modifier, */ int -weechat_aspell_buffer_switch_cb (void *data, const char *signal, - const char *type_data, void *signal_data) +weechat_aspell_buffer_switch_cb (const void *pointer, void *data, + const char *signal, const char *type_data, + void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -953,10 +957,12 @@ weechat_aspell_buffer_switch_cb (void *data, const char *signal, */ int -weechat_aspell_window_switch_cb (void *data, const char *signal, +weechat_aspell_window_switch_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -975,10 +981,12 @@ weechat_aspell_window_switch_cb (void *data, const char *signal, */ int -weechat_aspell_buffer_closed_cb (void *data, const char *signal, +weechat_aspell_buffer_closed_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -993,10 +1001,12 @@ weechat_aspell_buffer_closed_cb (void *data, const char *signal, */ int -weechat_aspell_debug_libs_cb (void *data, const char *signal, +weechat_aspell_debug_libs_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -1059,20 +1069,20 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) * (from other plugins) will be called before this one */ weechat_hook_modifier ("500|input_text_display", - &weechat_aspell_modifier_cb, NULL); + &weechat_aspell_modifier_cb, NULL, NULL); weechat_aspell_bar_item_init (); weechat_aspell_info_init (); weechat_hook_signal ("buffer_switch", - &weechat_aspell_buffer_switch_cb, NULL); + &weechat_aspell_buffer_switch_cb, NULL, NULL); weechat_hook_signal ("window_switch", - &weechat_aspell_window_switch_cb, NULL); + &weechat_aspell_window_switch_cb, NULL, NULL); weechat_hook_signal ("buffer_closed", - &weechat_aspell_buffer_closed_cb, NULL); + &weechat_aspell_buffer_closed_cb, NULL, NULL); weechat_hook_signal ("debug_libs", - &weechat_aspell_debug_libs_cb, NULL); + &weechat_aspell_debug_libs_cb, NULL, NULL); return WEECHAT_RC_OK; } diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c index 7e6a50baf..919f900eb 100644 --- a/src/plugins/charset/charset.c +++ b/src/plugins/charset/charset.c @@ -59,9 +59,11 @@ const char *charset_internal = NULL; */ int -charset_config_reload (void *data, struct t_config_file *config_file) +charset_config_reload (const void *pointer, void *data, + struct t_config_file *config_file) { /* make C compiler happy */ + (void) pointer; (void) data; /* free all decode/encode charsets */ @@ -107,10 +109,12 @@ charset_decode_is_allowed (const char *charset) */ int -charset_check_charset_decode_cb (void *data, struct t_config_option *option, +charset_check_charset_decode_cb (const void *pointer, void *data, + struct t_config_option *option, const char *value) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -122,7 +126,8 @@ charset_check_charset_decode_cb (void *data, struct t_config_option *option, */ int -charset_config_create_option (void *data, struct t_config_file *config_file, +charset_config_create_option (const void *pointer, void *data, + struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) { @@ -130,6 +135,7 @@ charset_config_create_option (void *data, struct t_config_file *config_file, int rc; /* make C compiler happy */ + (void) pointer; (void) data; rc = WEECHAT_CONFIG_OPTION_SET_ERROR; @@ -159,8 +165,9 @@ charset_config_create_option (void *data, struct t_config_file *config_file, config_file, section, option_name, "string", NULL, NULL, 0, 0, "", value, 0, - (section == charset_config_section_decode) ? &charset_check_charset_decode_cb : NULL, NULL, - NULL, NULL, NULL, NULL); + (section == charset_config_section_decode) ? &charset_check_charset_decode_cb : NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -195,15 +202,17 @@ charset_config_init () struct t_config_section *ptr_section; charset_config_file = weechat_config_new (CHARSET_CONFIG_NAME, - &charset_config_reload, NULL); + &charset_config_reload, NULL, NULL); if (!charset_config_file) return 0; ptr_section = weechat_config_new_section (charset_config_file, "default", 0, 0, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (charset_config_file); @@ -220,7 +229,9 @@ charset_config_init () && (weechat_strcasecmp (charset_terminal, charset_internal) != 0)) ? charset_terminal : "iso-8859-1", NULL, 0, - &charset_check_charset_decode_cb, NULL, NULL, NULL, NULL, NULL); + &charset_check_charset_decode_cb, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); charset_default_encode = weechat_config_new_option ( charset_config_file, ptr_section, "encode", "string", @@ -228,14 +239,16 @@ charset_config_init () "(if empty, default is UTF-8 because it is the WeeChat internal " "charset)"), NULL, 0, 0, "", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - ptr_section = weechat_config_new_section (charset_config_file, "decode", - 1, 1, - NULL, NULL, NULL, NULL, - NULL, NULL, - &charset_config_create_option, NULL, - NULL, NULL); + ptr_section = weechat_config_new_section ( + charset_config_file, "decode", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &charset_config_create_option, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (charset_config_file); @@ -244,12 +257,14 @@ charset_config_init () charset_config_section_decode = ptr_section; - ptr_section = weechat_config_new_section (charset_config_file, "encode", - 1, 1, - NULL, NULL, NULL, NULL, - NULL, NULL, - &charset_config_create_option, NULL, - NULL, NULL); + ptr_section = weechat_config_new_section ( + charset_config_file, "encode", + 1, 1, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + &charset_config_create_option, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (charset_config_file); @@ -365,12 +380,14 @@ charset_get (struct t_config_section *section, const char *name, */ char * -charset_decode_cb (void *data, const char *modifier, const char *modifier_data, +charset_decode_cb (const void *pointer, void *data, + const char *modifier, const char *modifier_data, const char *string) { const char *charset; /* make C compiler happy */ + (void) pointer; (void) data; (void) modifier; @@ -394,12 +411,14 @@ charset_decode_cb (void *data, const char *modifier, const char *modifier_data, */ char * -charset_encode_cb (void *data, const char *modifier, const char *modifier_data, +charset_encode_cb (const void *pointer, void *data, + const char *modifier, const char *modifier_data, const char *string) { const char *charset; /* make C compiler happy */ + (void) pointer; (void) data; (void) modifier; @@ -426,7 +445,7 @@ void charset_set (struct t_config_section *section, const char *type, const char *name, const char *value) { - if (charset_config_create_option (NULL, + if (charset_config_create_option (NULL, NULL, charset_config_file, section, name, @@ -458,7 +477,8 @@ charset_display_charsets () */ int -charset_command_cb (void *data, struct t_gui_buffer *buffer, int argc, +charset_command_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { struct t_config_section *ptr_section; @@ -467,6 +487,7 @@ charset_command_cb (void *data, struct t_gui_buffer *buffer, int argc, const char *plugin_name, *name, *charset_modifier; /* make C compiler happy */ + (void) pointer; (void) data; if (argc < 2) @@ -594,11 +615,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "charset: new charset for current buffer\n" " reset: reset charsets for current buffer"), "decode|encode|reset", - &charset_command_cb, NULL); + &charset_command_cb, NULL, NULL); /* modifiers hooks */ - weechat_hook_modifier ("charset_decode", &charset_decode_cb, NULL); - weechat_hook_modifier ("charset_encode", &charset_encode_cb, NULL); + weechat_hook_modifier ("charset_decode", &charset_decode_cb, NULL, NULL); + weechat_hook_modifier ("charset_encode", &charset_encode_cb, NULL, NULL); return WEECHAT_RC_OK; } diff --git a/src/plugins/exec/exec-buffer.c b/src/plugins/exec/exec-buffer.c index 1339dbd5b..908d0d044 100644 --- a/src/plugins/exec/exec-buffer.c +++ b/src/plugins/exec/exec-buffer.c @@ -35,13 +35,15 @@ */ int -exec_buffer_input_cb (void *data, struct t_gui_buffer *buffer, +exec_buffer_input_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, const char *input_data) { char **argv, **argv_eol; int argc; /* make C compiler happy */ + (void) pointer; (void) data; /* close buffer */ @@ -70,12 +72,14 @@ exec_buffer_input_cb (void *data, struct t_gui_buffer *buffer, */ int -exec_buffer_close_cb (void *data, struct t_gui_buffer *buffer) +exec_buffer_close_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer) { const char *full_name; struct t_exec_cmd *ptr_exec_cmd; /* make C compiler happy */ + (void) pointer; (void) data; /* kill any command whose output is on this buffer */ @@ -153,8 +157,8 @@ exec_buffer_new (const char *name, int free_content, int clear_buffer, } new_buffer = weechat_buffer_new (name, - &exec_buffer_input_cb, NULL, - &exec_buffer_close_cb, NULL); + &exec_buffer_input_cb, NULL, NULL, + &exec_buffer_close_cb, NULL, NULL); /* failed to create buffer ? then return */ if (!new_buffer) diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c index 9a1e3cc76..91e8cbdcd 100644 --- a/src/plugins/exec/exec-command.c +++ b/src/plugins/exec/exec-command.c @@ -458,8 +458,7 @@ exec_command_run (struct t_gui_buffer *buffer, process_options = weechat_hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!process_options) { exec_free (new_exec_cmd); @@ -570,7 +569,8 @@ exec_command_run (struct t_gui_buffer *buffer, process_options, cmd_options.timeout * 1000, &exec_process_cb, - new_exec_cmd); + new_exec_cmd, + NULL); if (new_exec_cmd->hook) { @@ -605,7 +605,8 @@ exec_command_run (struct t_gui_buffer *buffer, */ int -exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc, +exec_command_exec (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { int i, length, count; @@ -613,6 +614,7 @@ exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc, struct t_exec_cmd *ptr_exec_cmd, *ptr_next_exec_cmd; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -878,5 +880,5 @@ exec_command_init () " || -killall" " || -set %(exec_commands_ids) stdin|stdin_close|signal" " || -del %(exec_commands_ids)|-all %(exec_commands_ids)|%*", - &exec_command_exec, NULL); + &exec_command_exec, NULL, NULL); } diff --git a/src/plugins/exec/exec-completion.c b/src/plugins/exec/exec-completion.c index d243f6692..52475cfdf 100644 --- a/src/plugins/exec/exec-completion.c +++ b/src/plugins/exec/exec-completion.c @@ -32,7 +32,8 @@ */ int -exec_completion_commands_ids_cb (void *data, const char *completion_item, +exec_completion_commands_ids_cb (const void *pointer, void *data, + const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { @@ -40,6 +41,7 @@ exec_completion_commands_ids_cb (void *data, const char *completion_item, char str_number[32]; /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -69,5 +71,5 @@ exec_completion_init () { weechat_hook_completion ("exec_commands_ids", N_("ids (numbers and names) of executed commands"), - &exec_completion_commands_ids_cb, NULL); + &exec_completion_commands_ids_cb, NULL, NULL); } diff --git a/src/plugins/exec/exec-config.c b/src/plugins/exec/exec-config.c index 7ead68550..77c3152c6 100644 --- a/src/plugins/exec/exec-config.c +++ b/src/plugins/exec/exec-config.c @@ -49,10 +49,11 @@ int exec_config_cmd_num_options = 0; */ void -exec_config_change_command_default_options (void *data, +exec_config_change_command_default_options (const void *pointer, void *data, struct t_config_option *option) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -69,9 +70,11 @@ exec_config_change_command_default_options (void *data, */ int -exec_config_reload_cb (void *data, struct t_config_file *config_file) +exec_config_reload_cb (const void *pointer, void *data, + struct t_config_file *config_file) { /* make C compiler happy */ + (void) pointer; (void) data; return weechat_config_reload (config_file); @@ -91,16 +94,18 @@ exec_config_init () struct t_config_section *ptr_section; exec_config_file = weechat_config_new (EXEC_CONFIG_NAME, - &exec_config_reload_cb, NULL); + &exec_config_reload_cb, NULL, NULL); if (!exec_config_file) return 0; /* command */ ptr_section = weechat_config_new_section (exec_config_file, "command", 0, 0, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (exec_config_file); @@ -113,22 +118,26 @@ exec_config_init () N_("default options for command /exec (see /help exec); example: " "\"-nosh -bg\" to run all commands in background (no output), and " "without using the shell"), - NULL, 0, 0, "", NULL, 0, NULL, NULL, - &exec_config_change_command_default_options, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &exec_config_change_command_default_options, NULL, NULL, + NULL, NULL, NULL); exec_config_command_purge_delay = weechat_config_new_option ( exec_config_file, ptr_section, "purge_delay", "integer", N_("delay for purging finished commands (in seconds, 0 = purge " "commands immediately, -1 = never purge)"), NULL, -1, 36000 * 24 * 30, "0", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* color */ ptr_section = weechat_config_new_section (exec_config_file, "color", 0, 0, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL); + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); if (!ptr_section) { weechat_config_free (exec_config_file); @@ -140,13 +149,13 @@ exec_config_init () "flag_running", "color", N_("text color for a running command flag in list of commands"), NULL, 0, 0, "lightgreen", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); exec_config_color_flag_finished = weechat_config_new_option ( exec_config_file, ptr_section, "flag_finished", "color", N_("text color for a finished command flag in list of commands"), NULL, 0, 0, "lightred", NULL, 0, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); return 1; } diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c index 3922a1154..5589fd2b8 100644 --- a/src/plugins/exec/exec.c +++ b/src/plugins/exec/exec.c @@ -175,14 +175,15 @@ exec_add () */ int -exec_timer_delete_cb (void *data, int remaining_calls) +exec_timer_delete_cb (const void *pointer, void *data, int remaining_calls) { struct t_exec_cmd *exec_cmd, *ptr_exec_cmd; /* make C compiler happy */ + (void) data; (void) remaining_calls; - exec_cmd = (struct t_exec_cmd *)data; + exec_cmd = (struct t_exec_cmd *)pointer; if (!exec_cmd) return WEECHAT_RC_OK; @@ -424,8 +425,7 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) hashtable = weechat_hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (hashtable) { weechat_hashtable_set (hashtable, "command", exec_cmd->command); @@ -526,7 +526,7 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) { weechat_hook_timer (1 + (1000 * weechat_config_integer (exec_config_command_purge_delay)), 0, 1, - &exec_timer_delete_cb, exec_cmd); + &exec_timer_delete_cb, exec_cmd, NULL); } } @@ -535,16 +535,17 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) */ int -exec_process_cb (void *data, const char *command, int return_code, - const char *out, const char *err) +exec_process_cb (const void *pointer, void *data, const char *command, + int return_code, const char *out, const char *err) { struct t_exec_cmd *ptr_exec_cmd; struct t_gui_buffer *ptr_buffer; /* make C compiler happy */ + (void) data; (void) command; - ptr_exec_cmd = (struct t_exec_cmd *)data; + ptr_exec_cmd = (struct t_exec_cmd *)pointer; if (!ptr_exec_cmd) return WEECHAT_RC_ERROR; @@ -681,10 +682,12 @@ exec_print_log () */ int -exec_debug_dump_cb (void *data, const char *signal, const char *type_data, +exec_debug_dump_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -725,7 +728,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) exec_config_read (); /* hook some signals */ - weechat_hook_signal ("debug_dump", &exec_debug_dump_cb, NULL); + weechat_hook_signal ("debug_dump", &exec_debug_dump_cb, NULL, NULL); /* hook completions */ exec_completion_init (); diff --git a/src/plugins/exec/exec.h b/src/plugins/exec/exec.h index e54187a73..2adb1435f 100644 --- a/src/plugins/exec/exec.h +++ b/src/plugins/exec/exec.h @@ -80,7 +80,8 @@ extern int exec_cmds_count; extern int exec_search_color (const char *color); extern struct t_exec_cmd *exec_search_by_id (const char *id); extern struct t_exec_cmd *exec_add (); -extern int exec_process_cb (void *data, const char *command, int return_code, +extern int exec_process_cb (const void *pointer, void *data, + const char *command, int return_code, const char *out, const char *err); extern void exec_free (struct t_exec_cmd *exec_cmd); extern void exec_free_all (); diff --git a/src/plugins/fifo/fifo-command.c b/src/plugins/fifo/fifo-command.c index ece6ea646..19ea553a5 100644 --- a/src/plugins/fifo/fifo-command.c +++ b/src/plugins/fifo/fifo-command.c @@ -30,10 +30,12 @@ */ int -fifo_command_fifo (void *data, struct t_gui_buffer *buffer, int argc, +fifo_command_fifo (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -113,5 +115,5 @@ fifo_command_init () "Examples:\n" " /fifo toggle"), "enable|disable|toggle", - &fifo_command_fifo, NULL); + &fifo_command_fifo, NULL, NULL); } diff --git a/src/plugins/fifo/fifo-info.c b/src/plugins/fifo/fifo-info.c index dd709fb9f..8be53ff9c 100644 --- a/src/plugins/fifo/fifo-info.c +++ b/src/plugins/fifo/fifo-info.c @@ -30,10 +30,12 @@ */ const char * -fifo_info_info_fifo_filename_cb (void *data, const char *info_name, +fifo_info_info_fifo_filename_cb (const void *pointer, void *data, + const char *info_name, const char *arguments) { /* make C compiler happy */ + (void) pointer; (void) data; (void) info_name; (void) arguments; @@ -49,5 +51,5 @@ void fifo_info_init () { weechat_hook_info ("fifo_filename", N_("name of FIFO pipe"), NULL, - &fifo_info_info_fifo_filename_cb, NULL); + &fifo_info_info_fifo_filename_cb, NULL, NULL); } diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c index 4331eeafa..e438fc4a1 100644 --- a/src/plugins/fifo/fifo.c +++ b/src/plugins/fifo/fifo.c @@ -55,7 +55,7 @@ char *fifo_filename; char *fifo_unterminated = NULL; -int fifo_read(); +int fifo_fd_cb (); /* @@ -164,7 +164,7 @@ fifo_create () fifo_filename); } fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0, - &fifo_read, NULL); + &fifo_fd_cb, NULL, NULL); } else weechat_printf (NULL, @@ -290,13 +290,14 @@ fifo_exec (const char *text) */ int -fifo_read (void *data, int fd) +fifo_fd_cb (const void *pointer, void *data, int fd) { static char buffer[4096 + 2]; char *buf2, *pos, *ptr_buf, *next_ptr_buf; int num_read; /* make C compiler happy */ + (void) pointer; (void) data; (void) fd; @@ -386,8 +387,10 @@ fifo_read (void *data, int fd) fifo_remove (); } else + { fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0, - &fifo_read, NULL); + &fifo_fd_cb, NULL, NULL); + } } } @@ -399,9 +402,11 @@ fifo_read (void *data, int fd) */ int -fifo_config_cb (void *data, const char *option, const char *value) +fifo_config_cb (const void *pointer, void *data, + const char *option, const char *value) { /* make C compiler happy */ + (void) pointer; (void) data; (void) option; @@ -440,7 +445,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) snprintf (str_option, sizeof (str_option), "plugins.var.fifo.%s", FIFO_OPTION_NAME); - weechat_hook_config (str_option, &fifo_config_cb, NULL); + weechat_hook_config (str_option, &fifo_config_cb, NULL, NULL); fifo_command_init (); fifo_info_init (); diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index 3ac2b766a..3b475d7be 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -28,7 +28,6 @@ #include "../weechat-plugin.h" #include "../plugin-script.h" #include "../plugin-script-api.h" -#include "../plugin-script-callback.h" #include "weechat-guile.h" @@ -773,24 +772,26 @@ weechat_guile_api_list_free (SCM weelist) } int -weechat_guile_api_config_reload_cb (void *data, +weechat_guile_api_config_reload_cb (const void *pointer, void *data, struct t_config_file *config_file) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[2]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(config_file); - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ss", func_argv); if (!rc) @@ -831,29 +832,31 @@ weechat_guile_api_config_new (SCM name, SCM function, SCM data) } int -weechat_guile_api_config_read_cb (void *data, +weechat_guile_api_config_read_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[5]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(config_file); func_argv[2] = API_PTR2STR(section); func_argv[3] = (option_name) ? (char *)option_name : empty_arg; func_argv[4] = (value) ? (char *)value : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sssss", func_argv); if (!rc) @@ -875,26 +878,28 @@ weechat_guile_api_config_read_cb (void *data, } int -weechat_guile_api_config_section_write_cb (void *data, +weechat_guile_api_config_section_write_cb (const void *pointer, void *data, struct t_config_file *config_file, const char *section_name) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(config_file); func_argv[2] = (section_name) ? (char *)section_name : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -914,26 +919,28 @@ weechat_guile_api_config_section_write_cb (void *data, } int -weechat_guile_api_config_section_write_default_cb (void *data, +weechat_guile_api_config_section_write_default_cb (const void *pointer, void *data, struct t_config_file *config_file, const char *section_name) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(config_file); func_argv[2] = (section_name) ? (char *)section_name : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -953,30 +960,32 @@ weechat_guile_api_config_section_write_default_cb (void *data, } int -weechat_guile_api_config_section_create_option_cb (void *data, +weechat_guile_api_config_section_create_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[5]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(config_file); func_argv[2] = API_PTR2STR(section); func_argv[3] = (option_name) ? (char *)option_name : empty_arg; func_argv[4] = (value) ? (char *)value : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sssss", func_argv); if (!rc) @@ -998,28 +1007,30 @@ weechat_guile_api_config_section_create_option_cb (void *data, } int -weechat_guile_api_config_section_delete_option_cb (void *data, +weechat_guile_api_config_section_delete_option_cb (const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[4]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(config_file); func_argv[2] = API_PTR2STR(section); func_argv[3] = API_PTR2STR(option); - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ssss", func_argv); if (!rc) @@ -1080,27 +1091,29 @@ weechat_guile_api_config_new_section (SCM args) || !scm_is_string (function_delete_option) || !scm_is_string (data_delete_option)) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(plugin_script_api_config_new_section (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(config_file)), - API_SCM_TO_STRING(name), - scm_to_int (user_can_add_options), - scm_to_int (user_can_delete_options), - &weechat_guile_api_config_read_cb, - API_SCM_TO_STRING(function_read), - API_SCM_TO_STRING(data_read), - &weechat_guile_api_config_section_write_cb, - API_SCM_TO_STRING(function_write), - API_SCM_TO_STRING(data_write), - &weechat_guile_api_config_section_write_default_cb, - API_SCM_TO_STRING(function_write_default), - API_SCM_TO_STRING(data_write_default), - &weechat_guile_api_config_section_create_option_cb, - API_SCM_TO_STRING(function_create_option), - API_SCM_TO_STRING(data_create_option), - &weechat_guile_api_config_section_delete_option_cb, - API_SCM_TO_STRING(function_delete_option), - API_SCM_TO_STRING(data_delete_option))); + result = API_PTR2STR( + plugin_script_api_config_new_section ( + weechat_guile_plugin, + guile_current_script, + API_STR2PTR(API_SCM_TO_STRING(config_file)), + API_SCM_TO_STRING(name), + scm_to_int (user_can_add_options), + scm_to_int (user_can_delete_options), + &weechat_guile_api_config_read_cb, + API_SCM_TO_STRING(function_read), + API_SCM_TO_STRING(data_read), + &weechat_guile_api_config_section_write_cb, + API_SCM_TO_STRING(function_write), + API_SCM_TO_STRING(data_write), + &weechat_guile_api_config_section_write_default_cb, + API_SCM_TO_STRING(function_write_default), + API_SCM_TO_STRING(data_write_default), + &weechat_guile_api_config_section_create_option_cb, + API_SCM_TO_STRING(function_create_option), + API_SCM_TO_STRING(data_create_option), + &weechat_guile_api_config_section_delete_option_cb, + API_SCM_TO_STRING(function_delete_option), + API_SCM_TO_STRING(data_delete_option))); API_RETURN_STRING_FREE(result); } @@ -1122,26 +1135,28 @@ weechat_guile_api_config_search_section (SCM config_file, SCM section_name) } int -weechat_guile_api_config_option_check_value_cb (void *data, +weechat_guile_api_config_option_check_value_cb (const void *pointer, void *data, struct t_config_option *option, const char *value) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(option); func_argv[2] = (value) ? (char *)value : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -1161,24 +1176,26 @@ weechat_guile_api_config_option_check_value_cb (void *data, } void -weechat_guile_api_config_option_change_cb (void *data, +weechat_guile_api_config_option_change_cb (const void *pointer, void *data, struct t_config_option *option) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[2]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(option); - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ss", func_argv); if (func_argv[1]) @@ -1190,24 +1207,26 @@ weechat_guile_api_config_option_change_cb (void *data, } void -weechat_guile_api_config_option_delete_cb (void *data, +weechat_guile_api_config_option_delete_cb (const void *pointer, void *data, struct t_config_option *option) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[2]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(option); - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ss", func_argv); if (func_argv[1]) @@ -1614,9 +1633,7 @@ weechat_guile_api_config_option_free (SCM option) if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_config_option_free (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(option))); + weechat_config_option_free (API_STR2PTR(API_SCM_TO_STRING(option))); API_RETURN_OK; } @@ -1628,9 +1645,8 @@ weechat_guile_api_config_section_free_options (SCM section) if (!scm_is_string (section)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_config_section_free_options (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(section))); + weechat_config_section_free_options ( + API_STR2PTR(API_SCM_TO_STRING(section))); API_RETURN_OK; } @@ -1642,9 +1658,7 @@ weechat_guile_api_config_section_free (SCM section) if (!scm_is_string (section)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_config_section_free (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(section))); + weechat_config_section_free (API_STR2PTR(API_SCM_TO_STRING(section))); API_RETURN_OK; } @@ -1656,9 +1670,7 @@ weechat_guile_api_config_free (SCM config_file) if (!scm_is_string (config_file)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_config_free (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(config_file))); + weechat_config_free (API_STR2PTR(API_SCM_TO_STRING(config_file))); API_RETURN_OK; } @@ -1889,28 +1901,31 @@ weechat_guile_api_log_print (SCM message) } int -weechat_guile_api_hook_command_cb (void *data, struct t_gui_buffer *buffer, +weechat_guile_api_hook_command_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; /* make C compiler happy */ (void) argv; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -1959,25 +1974,28 @@ weechat_guile_api_hook_command (SCM command, SCM description, SCM args, } int -weechat_guile_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer, +weechat_guile_api_hook_command_run_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, const char *command) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); func_argv[2] = (command) ? (char *)command : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -2018,26 +2036,29 @@ weechat_guile_api_hook_command_run (SCM command, SCM function, SCM data) } int -weechat_guile_api_hook_timer_cb (void *data, int remaining_calls) +weechat_guile_api_hook_timer_cb (const void *pointer, void *data, + int remaining_calls) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[2]; char str_remaining_calls[32], empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { snprintf (str_remaining_calls, sizeof (str_remaining_calls), "%d", remaining_calls); - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = str_remaining_calls; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ss", func_argv); if (!rc) @@ -2080,25 +2101,27 @@ weechat_guile_api_hook_timer (SCM interval, SCM align_second, SCM max_calls, } int -weechat_guile_api_hook_fd_cb (void *data, int fd) +weechat_guile_api_hook_fd_cb (const void *pointer, void *data, int fd) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[2]; char str_fd[32], empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { snprintf (str_fd, sizeof (str_fd), "%d", fd); - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = str_fd; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ss", func_argv); if (!rc) @@ -2142,28 +2165,30 @@ weechat_guile_api_hook_fd (SCM fd, SCM read, SCM write, SCM exception, } int -weechat_guile_api_hook_process_cb (void *data, +weechat_guile_api_hook_process_cb (const void *pointer, void *data, const char *command, int return_code, const char *out, const char *err) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[5]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (command) ? (char *)command : empty_arg; func_argv[2] = &return_code; func_argv[3] = (out) ? (char *)out : empty_arg; func_argv[4] = (err) ? (char *)err : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ssiss", func_argv); if (!rc) @@ -2238,34 +2263,37 @@ weechat_guile_api_hook_process_hashtable (SCM command, SCM options, SCM timeout, } int -weechat_guile_api_hook_connect_cb (void *data, int status, int gnutls_rc, +weechat_guile_api_hook_connect_cb (const void *pointer, void *data, + int status, int gnutls_rc, int sock, const char *error, const char *ip_address) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[6]; char str_status[32], str_gnutls_rc[32], str_sock[32]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { snprintf (str_status, sizeof (str_status), "%d", status); snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = str_status; func_argv[2] = str_gnutls_rc; func_argv[3] = str_sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ssssss", func_argv); if (!rc) @@ -2317,28 +2345,31 @@ weechat_guile_api_hook_connect (SCM proxy, SCM address, SCM port, SCM ipv6, } int -weechat_guile_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, +weechat_guile_api_hook_print_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, time_t date, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, const char *message) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[8]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; static char timebuffer[64]; int *rc, ret; /* make C compiler happy */ (void) tags_count; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date); - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); func_argv[2] = timebuffer; func_argv[3] = weechat_string_build_with_split_string (tags, ","); @@ -2349,9 +2380,9 @@ weechat_guile_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, func_argv[6] = (prefix) ? (char *)prefix : empty_arg; func_argv[7] = (message) ? (char *)message : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ssssiiss", func_argv); if (!rc) @@ -2399,20 +2430,23 @@ weechat_guile_api_hook_print (SCM buffer, SCM tags, SCM message, } int -weechat_guile_api_hook_signal_cb (void *data, const char *signal, +weechat_guile_api_hook_signal_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; static char str_value[64]; int *rc, ret, free_needed; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (signal) ? (char *)signal : empty_arg; free_needed = 0; if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0) @@ -2437,9 +2471,9 @@ weechat_guile_api_hook_signal_cb (void *data, const char *signal, else func_argv[2] = empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -2521,25 +2555,28 @@ weechat_guile_api_hook_signal_send (SCM signal, SCM type_data, } int -weechat_guile_api_hook_hsignal_cb (void *data, const char *signal, +weechat_guile_api_hook_hsignal_cb (const void *pointer, void *data, + const char *signal, struct t_hashtable *hashtable) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (signal) ? (char *)signal : empty_arg; func_argv[2] = hashtable; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ssh", func_argv); if (!rc) @@ -2601,24 +2638,27 @@ weechat_guile_api_hook_hsignal_send (SCM signal, SCM hashtable) } int -weechat_guile_api_hook_config_cb (void *data, const char *option, const char *value) +weechat_guile_api_hook_config_cb (const void *pointer, void *data, + const char *option, const char *value) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (option) ? (char *)option : empty_arg; func_argv[2] = (value) ? (char *)value : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -2657,27 +2697,30 @@ weechat_guile_api_hook_config (SCM option, SCM function, SCM data) } int -weechat_guile_api_hook_completion_cb (void *data, const char *completion_item, +weechat_guile_api_hook_completion_cb (const void *pointer, void *data, + const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[4]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg; func_argv[2] = API_PTR2STR(buffer); func_argv[3] = API_PTR2STR(completion); - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ssss", func_argv); if (!rc) @@ -2755,25 +2798,29 @@ weechat_guile_api_hook_completion_list_add (SCM completion, SCM word, } char * -weechat_guile_api_hook_modifier_cb (void *data, const char *modifier, - const char *modifier_data, const char *string) +weechat_guile_api_hook_modifier_cb (const void *pointer, void *data, + const char *modifier, + const char *modifier_data, + const char *string) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[4]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (modifier) ? (char *)modifier : empty_arg; func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg; func_argv[3] = (string) ? (char *)string : empty_arg; - return (char *)weechat_guile_exec (script_callback->script, + return (char *)weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_STRING, - script_callback->function, + ptr_function, "ssss", func_argv); } @@ -2821,24 +2868,27 @@ weechat_guile_api_hook_modifier_exec (SCM modifier, SCM modifier_data, } const char * -weechat_guile_api_hook_info_cb (void *data, const char *info_name, +weechat_guile_api_hook_info_cb (const void *pointer, void *data, + const char *info_name, const char *arguments) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (info_name) ? (char *)info_name : empty_arg; func_argv[2] = (arguments) ? (char *)arguments : empty_arg; - return (const char *)weechat_guile_exec (script_callback->script, + return (const char *)weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_STRING, - script_callback->function, + ptr_function, "sss", func_argv); } @@ -2871,25 +2921,29 @@ weechat_guile_api_hook_info (SCM info_name, SCM description, } struct t_hashtable * -weechat_guile_api_hook_info_hashtable_cb (void *data, const char *info_name, +weechat_guile_api_hook_info_hashtable_cb (const void *pointer, void *data, + const char *info_name, struct t_hashtable *hashtable) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (info_name) ? (char *)info_name : empty_arg; func_argv[2] = hashtable; - return (struct t_hashtable *)weechat_guile_exec (script_callback->script, - WEECHAT_SCRIPT_EXEC_HASHTABLE, - script_callback->function, - "ssh", func_argv); + return (struct t_hashtable *)weechat_guile_exec ( + script, + WEECHAT_SCRIPT_EXEC_HASHTABLE, + ptr_function, + "ssh", func_argv); } return NULL; @@ -2924,27 +2978,31 @@ weechat_guile_api_hook_info_hashtable (SCM info_name, SCM description, } struct t_infolist * -weechat_guile_api_hook_infolist_cb (void *data, const char *infolist_name, - void *pointer, const char *arguments) +weechat_guile_api_hook_infolist_cb (const void *pointer, void *data, + const char *infolist_name, + void *obj_pointer, const char *arguments) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[4]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; struct t_infolist *result; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg; - func_argv[2] = API_PTR2STR(pointer); + func_argv[2] = API_PTR2STR(obj_pointer); func_argv[3] = (arguments) ? (char *)arguments : empty_arg; - result = (struct t_infolist *)weechat_guile_exec (script_callback->script, - WEECHAT_SCRIPT_EXEC_STRING, - script_callback->function, - "ssss", func_argv); + result = (struct t_infolist *)weechat_guile_exec ( + script, + WEECHAT_SCRIPT_EXEC_STRING, + ptr_function, + "ssss", func_argv); if (func_argv[2]) free (func_argv[2]); @@ -2983,23 +3041,27 @@ weechat_guile_api_hook_infolist (SCM infolist_name, SCM description, } struct t_hashtable * -weechat_guile_api_hook_focus_cb (void *data, struct t_hashtable *info) +weechat_guile_api_hook_focus_cb (const void *pointer, void *data, + struct t_hashtable *info) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[2]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = info; - return (struct t_hashtable *)weechat_guile_exec (script_callback->script, - WEECHAT_SCRIPT_EXEC_HASHTABLE, - script_callback->function, - "sh", func_argv); + return (struct t_hashtable *)weechat_guile_exec ( + script, + WEECHAT_SCRIPT_EXEC_HASHTABLE, + ptr_function, + "sh", func_argv); } return NULL; @@ -3048,9 +3110,7 @@ weechat_guile_api_unhook (SCM hook) if (!scm_is_string (hook)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_unhook (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(hook))); + weechat_unhook (API_STR2PTR(API_SCM_TO_STRING(hook))); API_RETURN_OK; } @@ -3060,31 +3120,34 @@ weechat_guile_api_unhook_all () { API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR); - plugin_script_api_unhook_all (weechat_guile_plugin, guile_current_script); + weechat_unhook_all_plugin (guile_current_script->name); API_RETURN_OK; } int -weechat_guile_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer, +weechat_guile_api_buffer_input_data_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, const char *input_data) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[3]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); func_argv[2] = (input_data) ? (char *)input_data : empty_arg; - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "sss", func_argv); if (!rc) @@ -3104,23 +3167,26 @@ weechat_guile_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer, } int -weechat_guile_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer) +weechat_guile_api_buffer_close_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[2]; char empty_arg[1] = { '\0' }; + const char *ptr_function, *ptr_data; int *rc, ret; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); - rc = (int *) weechat_guile_exec (script_callback->script, + rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, + ptr_function, "ss", func_argv); if (!rc) @@ -3226,9 +3292,7 @@ weechat_guile_api_buffer_close (SCM buffer) if (!scm_is_string (buffer)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_buffer_close (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(buffer))); + weechat_buffer_close (API_STR2PTR(API_SCM_TO_STRING(buffer))); API_RETURN_OK; } @@ -3715,31 +3779,34 @@ weechat_guile_api_bar_item_search (SCM name) } char * -weechat_guile_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item, +weechat_guile_api_bar_item_build_cb (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { - struct t_plugin_script_cb *script_callback; + struct t_plugin_script *script; void *func_argv[5]; char empty_arg[1] = { '\0' }, *ret; + const char *ptr_function, *ptr_data; - script_callback = (struct t_plugin_script_cb *)data; + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); - if (script_callback && script_callback->function && script_callback->function[0]) + if (ptr_function && ptr_function[0]) { - if (strncmp (script_callback->function, "(extra)", 7) == 0) + if (strncmp (ptr_function, "(extra)", 7) == 0) { /* new callback: data, item, window, buffer, extra_info */ - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(item); func_argv[2] = API_PTR2STR(window); func_argv[3] = API_PTR2STR(buffer); func_argv[4] = extra_info; - ret = (char *)weechat_guile_exec (script_callback->script, + ret = (char *)weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_STRING, - script_callback->function + 7, + ptr_function + 7, "ssssh", func_argv); if (func_argv[1]) @@ -3752,13 +3819,13 @@ weechat_guile_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item, else { /* old callback: data, item, window */ - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(item); func_argv[2] = API_PTR2STR(window); - ret = (char *)weechat_guile_exec (script_callback->script, + ret = (char *)weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_STRING, - script_callback->function, + ptr_function, "sss", func_argv); if (func_argv[1]) @@ -3813,9 +3880,7 @@ weechat_guile_api_bar_item_remove (SCM item) if (!scm_is_string (item)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_bar_item_remove (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(item))); + weechat_bar_item_remove (API_STR2PTR(API_SCM_TO_STRING(item))); API_RETURN_OK; } @@ -4587,18 +4652,72 @@ weechat_guile_api_hdata_get_string (SCM hdata, SCM property) API_RETURN_STRING(result); } +int +weechat_guile_api_upgrade_read_cb (const void *pointer, void *data, + struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist) +{ + struct t_plugin_script *script; + void *func_argv[4]; + char empty_arg[1] = { '\0' }, str_object_id[32]; + const char *ptr_function, *ptr_data; + int *rc, ret; + + script = (struct t_plugin_script *)pointer; + plugin_script_get_function_and_data (data, &ptr_function, &ptr_data); + + if (ptr_function && ptr_function[0]) + { + snprintf (str_object_id, sizeof (str_object_id), "%d", object_id); + + func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; + func_argv[1] = API_PTR2STR(upgrade_file); + func_argv[2] = str_object_id; + func_argv[3] = API_PTR2STR(infolist); + + rc = (int *) weechat_guile_exec (script, + WEECHAT_SCRIPT_EXEC_INT, + ptr_function, + "ssss", func_argv); + + if (!rc) + ret = WEECHAT_RC_ERROR; + else + { + ret = *rc; + free (rc); + } + if (func_argv[1]) + free (func_argv[1]); + if (func_argv[3]) + free (func_argv[3]); + + return ret; + } + + return WEECHAT_RC_ERROR; +} + SCM -weechat_guile_api_upgrade_new (SCM filename, SCM write) +weechat_guile_api_upgrade_new (SCM filename, SCM function, SCM data) { char *result; SCM return_value; API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); - if (!scm_is_string (filename) || !scm_is_integer (write)) + if (!scm_is_string (filename) || !scm_is_string (function) + || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_upgrade_new (API_SCM_TO_STRING(filename), - scm_to_int (write))); + result = API_PTR2STR( + plugin_script_api_upgrade_new ( + weechat_guile_plugin, + guile_current_script, + API_SCM_TO_STRING(filename), + &weechat_guile_api_upgrade_read_cb, + API_SCM_TO_STRING(function), + API_SCM_TO_STRING(data))); API_RETURN_STRING_FREE(result); } @@ -4621,67 +4740,16 @@ weechat_guile_api_upgrade_write_object (SCM upgrade_file, SCM object_id, API_RETURN_INT(rc); } -int -weechat_guile_api_upgrade_read_cb (void *data, - struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist) -{ - struct t_plugin_script_cb *script_callback; - void *func_argv[4]; - char empty_arg[1] = { '\0' }, str_object_id[32]; - int *rc, ret; - - script_callback = (struct t_plugin_script_cb *)data; - - if (script_callback && script_callback->function && script_callback->function[0]) - { - snprintf (str_object_id, sizeof (str_object_id), "%d", object_id); - - func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; - func_argv[1] = API_PTR2STR(upgrade_file); - func_argv[2] = str_object_id; - func_argv[3] = API_PTR2STR(infolist); - - rc = (int *) weechat_guile_exec (script_callback->script, - WEECHAT_SCRIPT_EXEC_INT, - script_callback->function, - "ssss", func_argv); - - if (!rc) - ret = WEECHAT_RC_ERROR; - else - { - ret = *rc; - free (rc); - } - if (func_argv[1]) - free (func_argv[1]); - if (func_argv[3]) - free (func_argv[3]); - - return ret; - } - - return WEECHAT_RC_ERROR; -} - SCM -weechat_guile_api_upgrade_read (SCM upgrade_file, SCM function, SCM data) +weechat_guile_api_upgrade_read (SCM upgrade_file) { int rc; API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0)); - if (!scm_is_string (upgrade_file) || !scm_is_string (function) - || !scm_is_string (data)) + if (!scm_is_string (upgrade_file)) API_WRONG_ARGS(API_RETURN_INT(0)); - rc = plugin_script_api_upgrade_read (weechat_guile_plugin, - guile_current_script, - API_STR2PTR(API_SCM_TO_STRING(upgrade_file)), - &weechat_guile_api_upgrade_read_cb, - API_SCM_TO_STRING(function), - API_SCM_TO_STRING(data)); + rc = weechat_upgrade_read (API_STR2PTR(API_SCM_TO_STRING(upgrade_file))); API_RETURN_INT(rc); } @@ -4906,9 +4974,9 @@ weechat_guile_api_module_init (void *data) API_DEF_FUNC(hdata_hashtable, 3); API_DEF_FUNC(hdata_update, 3); API_DEF_FUNC(hdata_get_string, 2); - API_DEF_FUNC(upgrade_new, 2); + API_DEF_FUNC(upgrade_new, 3); API_DEF_FUNC(upgrade_write_object, 3); - API_DEF_FUNC(upgrade_read, 3); + API_DEF_FUNC(upgrade_read, 1); API_DEF_FUNC(upgrade_close, 1); /* interface constants */ diff --git a/src/plugins/guile/weechat-guile-api.h b/src/plugins/guile/weechat-guile-api.h index 91d05b6d2..bb0972677 100644 --- a/src/plugins/guile/weechat-guile-api.h +++ b/src/plugins/guile/weechat-guile-api.h @@ -20,10 +20,12 @@ #ifndef WEECHAT_GUILE_API_H #define WEECHAT_GUILE_API_H 1 -extern int weechat_guile_api_buffer_input_data_cb (void *data, +extern int weechat_guile_api_buffer_input_data_cb (const void *pointer, + void *data, struct t_gui_buffer *buffer, const char *input_data); -extern int weechat_guile_api_buffer_close_cb (void *data, +extern int weechat_guile_api_buffer_close_cb (const void *pointer, + void *data, struct t_gui_buffer *buffer); extern void weechat_guile_api_module_init (void *data); diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c index 85d49e76d..b24cf7203 100644 --- a/src/plugins/guile/weechat-guile.c +++ b/src/plugins/guile/weechat-guile.c @@ -587,13 +587,15 @@ weechat_guile_reload_name (const char *name) */ int -weechat_guile_command_cb (void *data, struct t_gui_buffer *buffer, +weechat_guile_command_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { char *ptr_name, *path_script; SCM value; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -700,11 +702,13 @@ weechat_guile_command_cb (void *data, struct t_gui_buffer *buffer, */ int -weechat_guile_completion_cb (void *data, const char *completion_item, +weechat_guile_completion_cb (const void *pointer, void *data, + const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { /* make C compiler happy */ + (void) pointer; (void) data; (void) completion_item; (void) buffer; @@ -719,9 +723,11 @@ weechat_guile_completion_cb (void *data, const char *completion_item, */ struct t_hdata * -weechat_guile_hdata_cb (void *data, const char *hdata_name) +weechat_guile_hdata_cb (const void *pointer, void *data, + const char *hdata_name) { /* make C compiler happy */ + (void) pointer; (void) data; return plugin_script_hdata_script (weechat_plugin, @@ -734,10 +740,12 @@ weechat_guile_hdata_cb (void *data, const char *hdata_name) */ struct t_infolist * -weechat_guile_infolist_cb (void *data, const char *infolist_name, - void *pointer, const char *arguments) +weechat_guile_infolist_cb (const void *pointer, void *data, + const char *infolist_name, + void *obj_pointer, const char *arguments) { /* make C compiler happy */ + (void) pointer; (void) data; if (!infolist_name || !infolist_name[0]) @@ -746,7 +754,7 @@ weechat_guile_infolist_cb (void *data, const char *infolist_name, if (weechat_strcasecmp (infolist_name, "guile_script") == 0) { return plugin_script_infolist_list_scripts (weechat_guile_plugin, - guile_scripts, pointer, + guile_scripts, obj_pointer, arguments); } @@ -758,10 +766,12 @@ weechat_guile_infolist_cb (void *data, const char *infolist_name, */ int -weechat_guile_signal_debug_dump_cb (void *data, const char *signal, +weechat_guile_signal_debug_dump_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -780,10 +790,12 @@ weechat_guile_signal_debug_dump_cb (void *data, const char *signal, */ int -weechat_guile_signal_debug_libs_cb (void *data, const char *signal, +weechat_guile_signal_debug_libs_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -802,39 +814,21 @@ weechat_guile_signal_debug_libs_cb (void *data, const char *signal, return WEECHAT_RC_OK; } -/* - * Callback called when a buffer is closed. - */ - -int -weechat_guile_signal_buffer_closed_cb (void *data, const char *signal, - const char *type_data, - void *signal_data) -{ - /* make C compiler happy */ - (void) data; - (void) signal; - (void) type_data; - - if (signal_data) - plugin_script_remove_buffer_callbacks (guile_scripts, signal_data); - - return WEECHAT_RC_OK; -} - /* * Timer for executing actions. */ int -weechat_guile_timer_action_cb (void *data, int remaining_calls) +weechat_guile_timer_action_cb (const void *pointer, void *data, + int remaining_calls) { /* make C compiler happy */ + (void) data; (void) remaining_calls; - if (data) + if (pointer) { - if (data == &guile_action_install_list) + if (pointer == &guile_action_install_list) { plugin_script_action_install (weechat_guile_plugin, guile_scripts, @@ -843,7 +837,7 @@ weechat_guile_timer_action_cb (void *data, int remaining_calls) &guile_quiet, &guile_action_install_list); } - else if (data == &guile_action_remove_list) + else if (pointer == &guile_action_remove_list) { plugin_script_action_remove (weechat_guile_plugin, guile_scripts, @@ -851,7 +845,7 @@ weechat_guile_timer_action_cb (void *data, int remaining_calls) &guile_quiet, &guile_action_remove_list); } - else if (data == &guile_action_autoload_list) + else if (pointer == &guile_action_autoload_list) { plugin_script_action_autoload (weechat_guile_plugin, &guile_quiet, @@ -867,11 +861,13 @@ weechat_guile_timer_action_cb (void *data, int remaining_calls) */ int -weechat_guile_signal_script_action_cb (void *data, const char *signal, +weechat_guile_signal_script_action_cb (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0) @@ -882,7 +878,7 @@ weechat_guile_signal_script_action_cb (void *data, const char *signal, (const char *)signal_data); weechat_hook_timer (1, 0, 1, &weechat_guile_timer_action_cb, - &guile_action_install_list); + &guile_action_install_list, NULL); } else if (strcmp (signal, "guile_script_remove") == 0) { @@ -890,7 +886,7 @@ weechat_guile_signal_script_action_cb (void *data, const char *signal, (const char *)signal_data); weechat_hook_timer (1, 0, 1, &weechat_guile_timer_action_cb, - &guile_action_remove_list); + &guile_action_remove_list, NULL); } else if (strcmp (signal, "guile_script_autoload") == 0) { @@ -898,7 +894,7 @@ weechat_guile_signal_script_action_cb (void *data, const char *signal, (const char *)signal_data); weechat_hook_timer (1, 0, 1, &weechat_guile_timer_action_cb, - &guile_action_autoload_list); + &guile_action_autoload_list, NULL); } } @@ -996,7 +992,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) init.callback_infolist = &weechat_guile_infolist_cb; init.callback_signal_debug_dump = &weechat_guile_signal_debug_dump_cb; init.callback_signal_debug_libs = &weechat_guile_signal_debug_libs_cb; - init.callback_signal_buffer_closed = &weechat_guile_signal_buffer_closed_cb; init.callback_signal_script_action = &weechat_guile_signal_script_action_cb; init.callback_load_file = &weechat_guile_load_cb; diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c index 4c8f96e2f..fb599fb02 100644 --- a/src/plugins/irc/irc-bar-item.c +++ b/src/plugins/irc/irc-bar-item.c @@ -38,7 +38,8 @@ */ char * -irc_bar_item_buffer_plugin (void *data, struct t_gui_bar_item *item, +irc_bar_item_buffer_plugin (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -50,6 +51,7 @@ irc_bar_item_buffer_plugin (void *data, struct t_gui_bar_item *item, struct t_irc_channel *channel; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -198,12 +200,14 @@ irc_bar_item_buffer_name_content (struct t_gui_buffer *buffer, int short_name) */ char * -irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, +irc_bar_item_buffer_name (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -218,12 +222,14 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item, */ char * -irc_bar_item_buffer_short_name (void *data, struct t_gui_bar_item *item, +irc_bar_item_buffer_short_name (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -237,7 +243,8 @@ irc_bar_item_buffer_short_name (void *data, struct t_gui_bar_item *item, */ char * -irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item, +irc_bar_item_buffer_modes (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -249,6 +256,7 @@ irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item, struct t_irc_channel *channel; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -297,7 +305,8 @@ irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item, */ char * -irc_bar_item_channel (void *data, struct t_gui_bar_item *item, +irc_bar_item_channel (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { @@ -308,6 +317,7 @@ irc_bar_item_channel (void *data, struct t_gui_bar_item *item, struct t_irc_channel *channel; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -374,7 +384,8 @@ irc_bar_item_channel (void *data, struct t_gui_bar_item *item, */ char * -irc_bar_item_lag (void *data, struct t_gui_bar_item *item, +irc_bar_item_lag (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) { @@ -382,6 +393,7 @@ irc_bar_item_lag (void *data, struct t_gui_bar_item *item, struct t_irc_server *server; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -413,7 +425,8 @@ irc_bar_item_lag (void *data, struct t_gui_bar_item *item, */ char * -irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item, +irc_bar_item_input_prompt (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -425,6 +438,7 @@ irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item, int length; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -494,7 +508,8 @@ irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item, */ char * -irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item, +irc_bar_item_nick_modes (const void *pointer, void *data, + struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info) @@ -504,6 +519,7 @@ irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item, int length; /* make C compiler happy */ + (void) pointer; (void) data; (void) item; (void) window; @@ -533,7 +549,7 @@ irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item, */ struct t_hashtable * -irc_bar_item_focus_buffer_nicklist (void *data, +irc_bar_item_focus_buffer_nicklist (const void *pointer, void *data, struct t_hashtable *info) { long unsigned int value; @@ -555,6 +571,7 @@ irc_bar_item_focus_buffer_nicklist (void *data, IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ + (void) pointer; (void) data; if (ptr_server && ptr_channel) @@ -579,10 +596,12 @@ irc_bar_item_focus_buffer_nicklist (void *data, */ int -irc_bar_item_buffer_switch (void *data, const char *signal, +irc_bar_item_buffer_switch (const void *pointer, void *data, + const char *signal, const char *type_data, void *signal_data) { /* make C compiler happy */ + (void) pointer; (void) data; (void) signal; (void) type_data; @@ -619,16 +638,26 @@ irc_bar_item_update_channel () void irc_bar_item_init () { - weechat_bar_item_new ("buffer_plugin", &irc_bar_item_buffer_plugin, NULL); - weechat_bar_item_new ("buffer_name", &irc_bar_item_buffer_name, NULL); - weechat_bar_item_new ("buffer_short_name", &irc_bar_item_buffer_short_name, NULL); - weechat_bar_item_new ("buffer_modes", &irc_bar_item_buffer_modes, NULL); - weechat_bar_item_new ("irc_channel", &irc_bar_item_channel, NULL); - weechat_bar_item_new ("lag", &irc_bar_item_lag, NULL); - weechat_bar_item_new ("input_prompt", &irc_bar_item_input_prompt, NULL); - weechat_bar_item_new ("irc_nick_modes", &irc_bar_item_nick_modes, NULL); + weechat_bar_item_new ("buffer_plugin", + &irc_bar_item_buffer_plugin, NULL, NULL); + weechat_bar_item_new ("buffer_name", + &irc_bar_item_buffer_name, NULL, NULL); + weechat_bar_item_new ("buffer_short_name", + &irc_bar_item_buffer_short_name, NULL, NULL); + weechat_bar_item_new ("buffer_modes", + &irc_bar_item_buffer_modes, NULL, NULL); + weechat_bar_item_new ("irc_channel", + &irc_bar_item_channel, NULL, NULL); + weechat_bar_item_new ("lag", + &irc_bar_item_lag, NULL, NULL); + weechat_bar_item_new ("input_prompt", + &irc_bar_item_input_prompt, NULL, NULL); + weechat_bar_item_new ("irc_nick_modes", + &irc_bar_item_nick_modes, NULL, NULL); + weechat_hook_focus ("buffer_nicklist", - &irc_bar_item_focus_buffer_nicklist, NULL); + &irc_bar_item_focus_buffer_nicklist, NULL, NULL); + weechat_hook_signal ("buffer_switch", - &irc_bar_item_buffer_switch, NULL); + &irc_bar_item_buffer_switch, NULL, NULL); } diff --git a/src/plugins/irc/irc-buffer.c b/src/plugins/irc/irc-buffer.c index f7df9d267..bee87ed56 100644 --- a/src/plugins/irc/irc-buffer.c +++ b/src/plugins/irc/irc-buffer.c @@ -112,13 +112,15 @@ irc_buffer_build_name (const char *server, const char *channel) */ int -irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer) +irc_buffer_close_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer) { struct t_irc_channel *next_channel; IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ + (void) pointer; (void) data; if (buffer == irc_raw_buffer) @@ -175,15 +177,18 @@ irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer) */ int -irc_buffer_nickcmp_cb (void *data, +irc_buffer_nickcmp_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, const char *nick1, const char *nick2) { struct t_irc_server *server; - if (data) - server = (struct t_irc_server *)data; + /* make C compiler happy */ + (void) data; + + if (pointer) + server = (struct t_irc_server *)pointer; else irc_buffer_get_server_and_channel (buffer, &server, NULL); diff --git a/src/plugins/irc/irc-buffer.h b/src/plugins/irc/irc-buffer.h index b31a5c2bb..c58dfe73e 100644 --- a/src/plugins/irc/irc-buffer.h +++ b/src/plugins/irc/irc-buffer.h @@ -53,11 +53,11 @@ extern void irc_buffer_get_server_and_channel (struct t_gui_buffer *buffer, struct t_irc_channel **channel); extern const char *irc_buffer_build_name (const char *server, const char *channel); -extern int irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer); -extern int irc_buffer_nickcmp_cb (void *data, +extern int irc_buffer_close_cb (const void *pointer, void *data, + struct t_gui_buffer *buffer); +extern int irc_buffer_nickcmp_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, - const char *nick1, - const char *nick2); + const char *nick1, const char *nick2); extern struct t_gui_buffer *irc_buffer_search_server_lowest_number (); extern struct t_gui_buffer *irc_buffer_search_private_lowest_number (struct t_irc_server *server); diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index fe7b92863..20c912360 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -270,8 +270,8 @@ irc_channel_create_buffer (struct t_irc_server *server, weechat_current_buffer (), "number"); ptr_buffer = weechat_buffer_new (buffer_name, - &irc_input_data_cb, NULL, - &irc_buffer_close_cb, NULL); + &irc_input_data_cb, NULL, NULL, + &irc_buffer_close_cb, NULL, NULL); if (!ptr_buffer) return NULL; @@ -351,7 +351,7 @@ irc_channel_create_buffer (struct t_irc_server *server, weechat_buffer_set (ptr_buffer, "nicklist_display_groups", "0"); weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback", &irc_buffer_nickcmp_cb); - weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback_data", + weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback_pointer", server); } @@ -463,8 +463,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type, 32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); new_channel->checking_whox = 0; new_channel->away_message = NULL; new_channel->has_quit_server = 0; @@ -1024,8 +1023,7 @@ irc_channel_join_smart_filtered_add (struct t_irc_channel *channel, 64, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_TIME, - NULL, - NULL); + NULL, NULL); } if (!channel->join_smart_filtered) return; @@ -1224,8 +1222,7 @@ irc_channel_join_smart_filtered_unmask (struct t_irc_channel *channel, hashtable = weechat_hashtable_new (4, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (hashtable) { /* update tags in line (remove tag "irc_smart_filter") */ @@ -1280,15 +1277,17 @@ irc_channel_rejoin (struct t_irc_server *server, struct t_irc_channel *channel) */ int -irc_channel_autorejoin_cb (void *data, int remaining_calls) +irc_channel_autorejoin_cb (const void *pointer, void *data, + int remaining_calls) { struct t_irc_server *ptr_server, *ptr_server_found; struct t_irc_channel *ptr_channel_arg, *ptr_channel; /* make C compiler happy */ + (void) data; (void) remaining_calls; - ptr_channel_arg = (struct t_irc_channel *)data; + ptr_channel_arg = (struct t_irc_channel *)pointer; ptr_server_found = NULL; for (ptr_server = irc_servers; ptr_server; @@ -1435,11 +1434,13 @@ irc_channel_free_all (struct t_irc_server *server) */ struct t_hdata * -irc_channel_hdata_channel_cb (void *data, const char *hdata_name) +irc_channel_hdata_channel_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = weechat_hdata_new (hdata_name, "prev_channel", "next_channel", @@ -1481,11 +1482,13 @@ irc_channel_hdata_channel_cb (void *data, const char *hdata_name) */ struct t_hdata * -irc_channel_hdata_channel_speaking_cb (void *data, const char *hdata_name) +irc_channel_hdata_channel_speaking_cb (const void *pointer, void *data, + const char *hdata_name) { struct t_hdata *hdata; /* make C compiler happy */ + (void) pointer; (void) data; hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick", diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h index 479dbba45..5c8dd6a9e 100644 --- a/src/plugins/irc/irc-channel.h +++ b/src/plugins/irc/irc-channel.h @@ -151,13 +151,16 @@ extern void irc_channel_join_smart_filtered_unmask (struct t_irc_channel *channe const char *nick); extern void irc_channel_rejoin (struct t_irc_server *server, struct t_irc_channel *channel); -extern int irc_channel_autorejoin_cb (void *data, int remaining_calls); +extern int irc_channel_autorejoin_cb (const void *pointer, void *data, + int remaining_calls); extern void irc_channel_display_nick_back_in_pv (struct t_irc_server *server, struct t_irc_nick *nick, const char *nickname); -extern struct t_hdata *irc_channel_hdata_channel_cb (void *data, +extern struct t_hdata *irc_channel_hdata_channel_cb (const void *pointer, + void *data, const char *hdata_name); -extern struct t_hdata *irc_channel_hdata_channel_speaking_cb (void *data, +extern struct t_hdata *irc_channel_hdata_channel_speaking_cb (const void *pointer, + void *data, const char *hdata_name); extern int irc_channel_add_to_infolist (struct t_infolist *infolist, struct t_irc_channel *channel); diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 194a32ac3..5f9c1e52e 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -767,12 +767,14 @@ irc_color_decode_ansi (const char *string, int keep_colors) */ char * -irc_color_modifier_cb (void *data, const char *modifier, - const char *modifier_data, const char *string) +irc_color_modifier_cb (const void *pointer, void *data, + const char *modifier, const char *modifier_data, + const char *string) { int keep_colors; /* make C compiler happy */ + (void) pointer; (void) data; keep_colors = (modifier_data && (strcmp (modifier_data, "1") == 0)) ? 1 : 0; diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index 9425db0ac..4bc9ffb8f 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -106,7 +106,8 @@ struct t_irc_color_ansi_state extern char *irc_color_decode (const char *string, int keep_colors); extern char *irc_color_encode (const char *string, int keep_colors); -extern char *irc_color_modifier_cb (void *data, const char *modifier, +extern char *irc_color_modifier_cb (const void *pointer, void *data, + const char *modifier, const char *modifier_data, const char *string); extern char *irc_color_for_tags (const char *color); diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index d3fa3becf..5fa524513 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -142,8 +142,7 @@ irc_command_mode_nicks (struct t_irc_server *server, nicks_sent = weechat_hashtable_new (128, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, - NULL, - NULL); + NULL, NULL); if (!nicks_sent) return; @@ -241,14 +240,13 @@ irc_command_mode_nicks (struct t_irc_server *server, * the server. */ -int -irc_command_admin (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(admin) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("admin", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -390,9 +388,7 @@ irc_command_exec_all_channels (struct t_irc_server *server, * connected servers. */ -int -irc_command_allchan (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(allchan) { int i, current_server; const char *ptr_exclude_channels, *ptr_command; @@ -400,6 +396,7 @@ irc_command_allchan (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -441,9 +438,7 @@ irc_command_allchan (void *data, struct t_gui_buffer *buffer, int argc, * connected servers. */ -int -irc_command_allpv (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(allpv) { int i, current_server; const char *ptr_exclude_channels, *ptr_command; @@ -451,6 +446,7 @@ irc_command_allpv (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -593,14 +589,13 @@ irc_command_exec_all_servers (const char *exclude_servers, const char *command) * Callback for command "/allserv": executes a command on all connected servers. */ -int -irc_command_allserv (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(allserv) { int i; const char *ptr_exclude_servers, *ptr_command; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -889,13 +884,12 @@ irc_command_away_server (struct t_irc_server *server, const char *arguments, * Callback for command "/away": toggles away status. */ -int -irc_command_away (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(away) { IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; if ((argc >= 2) && (weechat_strcasecmp (argv[1], "-all") == 0)) @@ -928,7 +922,8 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc, */ int -irc_command_run_away (void *data, struct t_gui_buffer *buffer, +irc_command_run_away (const void *pointer, void *data, + struct t_gui_buffer *buffer, const char *command) { int argc; @@ -939,7 +934,7 @@ irc_command_run_away (void *data, struct t_gui_buffer *buffer, if (argv && argv_eol) { - irc_command_away (data, buffer, argc, argv, argv_eol); + irc_command_away (pointer, data, buffer, argc, argv, argv_eol); } if (argv) @@ -993,9 +988,7 @@ irc_command_send_ban (struct t_irc_server *server, * Callback for command "/ban": bans nicks or hosts. */ -int -irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(ban) { char *pos_channel; int pos_args; @@ -1004,6 +997,7 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("ban", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -1080,14 +1074,13 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc, * http://ircv3.net/specs/core/capability-negotiation-3.2.html */ -int -irc_command_cap (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(cap) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("cap", 1); /* make C compiler happy */ + (void) pointer; (void) data; if (argc > 1) @@ -1165,9 +1158,7 @@ irc_command_connect_one_server (struct t_irc_server *server, * Callback for command "/connect": connects to server(s). */ -int -irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(connect) { int i, nb_connect, connect_ok, all_servers, all_opened, switch_address; int no_join, autoconnect; @@ -1176,6 +1167,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -1362,9 +1354,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/ctcp": sends a CTCP message. */ -int -irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(ctcp) { char **targets, *ctcp_type, str_time[512]; const char *ctcp_target, *ctcp_args; @@ -1374,6 +1364,7 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -1474,9 +1465,7 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/cycle": leaves and rejoins a channel. */ -int -irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(cycle) { char *channel_name, *pos_args, *buf; const char *version, *ptr_arg, *msg_part; @@ -1487,6 +1476,7 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("cycle", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -1579,9 +1569,7 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/dcc": DCC control (file or chat). */ -int -irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(dcc) { struct sockaddr_storage addr; socklen_t length; @@ -1594,6 +1582,7 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("dcc", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -1678,14 +1667,13 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc, * nickname(s). */ -int -irc_command_dehalfop (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(dehalfop) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("dehalfop", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -1718,14 +1706,13 @@ irc_command_dehalfop (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/deop": removes operator privileges from nickname(s). */ -int -irc_command_deop (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(deop) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("deop", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -1758,14 +1745,13 @@ irc_command_deop (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/devoice": removes voice from nickname(s). */ -int -irc_command_devoice (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(devoice) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("devoice", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -1798,14 +1784,13 @@ irc_command_devoice (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/die": shutdowns the server. */ -int -irc_command_die (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(die) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("die", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -1900,9 +1885,7 @@ irc_command_disconnect_one_server (struct t_irc_server *server, * Callback for command "/disconnect": disconnects from server(s). */ -int -irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(disconnect) { int disconnect_ok; const char *reason; @@ -1910,6 +1893,7 @@ irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; reason = (argc > 2) ? argv_eol[2] : NULL; @@ -1976,14 +1960,13 @@ irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc, * nickname(s). */ -int -irc_command_halfop (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(halfop) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("halfop", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -2043,9 +2026,7 @@ irc_command_ignore_display (struct t_irc_ignore *ignore) * Callback for command "/ignore": adds or removes ignore. */ -int -irc_command_ignore (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(ignore) { struct t_irc_ignore *ptr_ignore; char *mask, *regex, *regex2, *ptr_regex, *server, *channel, *error; @@ -2053,6 +2034,7 @@ irc_command_ignore (void *data, struct t_gui_buffer *buffer, int argc, long number; /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -2205,14 +2187,13 @@ irc_command_ignore (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/info": gets information describing the server. */ -int -irc_command_info (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(info) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("info", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -2234,9 +2215,7 @@ irc_command_info (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/invite": invites a nick on a channel. */ -int -irc_command_invite (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(invite) { int i, arg_last_nick; char *ptr_channel_name; @@ -2245,6 +2224,7 @@ irc_command_invite (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("invite", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -2299,14 +2279,13 @@ error: * Callback for command "/ison": checks if a nickname is currently on IRC. */ -int -irc_command_ison (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(ison) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("ison", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -2463,9 +2442,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments, * Callback for command "/join": joins a new channel. */ -int -irc_command_join (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(join) { int i, arg_channels, noswitch; const char *ptr_type, *ptr_server_name, *ptr_channel_name; @@ -2473,6 +2450,7 @@ irc_command_join (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ + (void) pointer; (void) data; noswitch = 0; @@ -2589,9 +2567,7 @@ irc_command_kick_channel (struct t_irc_server *server, * Callback for command "/kick": forcibly removes a user from a channel. */ -int -irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(kick) { char *pos_channel, *pos_nick, *pos_comment; @@ -2599,6 +2575,7 @@ irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("kick", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -2637,9 +2614,7 @@ irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc, * bans it. */ -int -irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(kickban) { char *pos_channel, *pos_nick, *nick_only, *pos_comment, *pos, *mask; int length; @@ -2648,6 +2623,7 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("kickban", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -2732,14 +2708,13 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/kill": closes client-server connection. */ -int -irc_command_kill (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(kill) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("kill", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -2763,14 +2738,13 @@ irc_command_kill (void *data, struct t_gui_buffer *buffer, int argc, * server answering the query. */ -int -irc_command_links (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(links) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("links", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -2792,9 +2766,7 @@ irc_command_links (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/list": lists channels and their topic. */ -int -irc_command_list (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(list) { char buf[512], *ptr_channel_name, *ptr_server_name, *ptr_regex; int i, ret; @@ -2803,6 +2775,7 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("list", 1); /* make C compiler happy */ + (void) pointer; (void) data; if (ptr_server->cmd_list_regexp) @@ -2896,14 +2869,13 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc, * network. */ -int -irc_command_lusers (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(lusers) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("lusers", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -2925,14 +2897,13 @@ irc_command_lusers (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/map": shows a graphical map of the IRC network. */ -int -irc_command_map (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(map) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("map", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -2954,14 +2925,13 @@ irc_command_map (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/me": sends a ctcp action to the current channel. */ -int -irc_command_me (void *data, struct t_gui_buffer *buffer, int argc, char **argv, - char **argv_eol) +IRC_COMMAND_CALLBACK(me) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("me", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -3013,14 +2983,13 @@ irc_command_mode_server (struct t_irc_server *server, * Callback for command "/mode": changes mode for channel/nickname. */ -int -irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(mode) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("mode", 1); /* make C compiler happy */ + (void) pointer; (void) data; if (argc > 1) @@ -3070,14 +3039,13 @@ irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/motd": gets the "Message Of The Day". */ -int -irc_command_motd (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(motd) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("motd", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -3099,9 +3067,7 @@ irc_command_motd (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/msg": sends a message to a nick or channel. */ -int -irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(msg) { char **targets, *msg_pwd_hidden, *string; int num_targets, i, j, arg_target, arg_text, is_channel, status_msg; @@ -3111,6 +3077,7 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -3319,14 +3286,13 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/names": lists nicknames on channels. */ -int -irc_command_names (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(names) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("names", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -3376,14 +3342,13 @@ irc_send_nick_server (struct t_irc_server *server, const char *nickname) * Callback for command "/nick": changes nickname. */ -int -irc_command_nick (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(nick) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("nick", 0); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -3409,9 +3374,7 @@ irc_command_nick (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/notice": sends notice message. */ -int -irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(notice) { char *string, hash_key[32], *str_args; int arg_target, arg_text, number, is_channel; @@ -3421,6 +3384,7 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -3495,9 +3459,7 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/notify": adds or removes notify. */ -int -irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(notify) { struct t_irc_notify *ptr_notify; int i, check_away; @@ -3505,6 +3467,7 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; (void) argv_eol; @@ -3682,14 +3645,13 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/op": gives operator privileges to nickname(s). */ -int -irc_command_op (void *data, struct t_gui_buffer *buffer, int argc, char **argv, - char **argv_eol) +IRC_COMMAND_CALLBACK(op) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("op", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -3722,14 +3684,13 @@ irc_command_op (void *data, struct t_gui_buffer *buffer, int argc, char **argv, * Callback for command "/oper": gets oper privileges. */ -int -irc_command_oper (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(oper) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("oper", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -3779,9 +3740,7 @@ irc_command_part_channel (struct t_irc_server *server, const char *channel_name, * Callback for command "/part": leaves a channel or close a private window. */ -int -irc_command_part (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(part) { char *channel_name, *pos_args; @@ -3789,6 +3748,7 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("part", 1); /* make C compiler happy */ + (void) pointer; (void) data; if (argc > 1) @@ -3848,14 +3808,13 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/ping": pings a server. */ -int -irc_command_ping (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(ping) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("ping", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -3871,14 +3830,13 @@ irc_command_ping (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/pong": sends pong answer to a daemon. */ -int -irc_command_pong (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(pong) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("pong", 0); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -3894,9 +3852,7 @@ irc_command_pong (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/query": starts private conversation with a nick. */ -int -irc_command_query (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(query) { char *string, **nicks; int i, arg_nick, arg_text, num_nicks, noswitch; @@ -3904,6 +3860,7 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -4012,9 +3969,7 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/quiet": quiets nicks or hosts. */ -int -irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(quiet) { char *pos_channel; int pos_args; @@ -4023,6 +3978,7 @@ irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("quiet", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -4095,13 +4051,12 @@ irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/quote": sends raw data to server. */ -int -irc_command_quote (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(quote) { IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -4172,15 +4127,14 @@ irc_command_reconnect_one_server (struct t_irc_server *server, * Callback for command "/reconnect": reconnects to server(s). */ -int -irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(reconnect) { int i, nb_reconnect, reconnect_ok, all_servers, switch_address, no_join; IRC_BUFFER_GET_SERVER(buffer); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -4261,14 +4215,13 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/rehash": tells the server to reload its config file. */ -int -irc_command_rehash (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(rehash) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("rehash", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -4290,9 +4243,7 @@ irc_command_rehash (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/remove": remove a user from a channel. */ -int -irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(remove) { const char *ptr_channel_name; char *msg_vars_replaced; @@ -4302,6 +4253,7 @@ irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("remove", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -4353,14 +4305,13 @@ irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/restart": tells the server to restart itself. */ -int -irc_command_restart (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(restart) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("restart", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -4382,14 +4333,13 @@ irc_command_restart (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/sajoin": forces a user to join channel(s). */ -int -irc_command_sajoin (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(sajoin) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("sajoin", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -4405,14 +4355,13 @@ irc_command_sajoin (void *data, struct t_gui_buffer *buffer, int argc, * operator status. */ -int -irc_command_samode (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(samode) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("samode", 1); /* make C compiler happy */ + (void) pointer; (void) data; if (argc > 1) @@ -4465,14 +4414,13 @@ irc_command_samode (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/sanick": forces a user to use another nick. */ -int -irc_command_sanick (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(sanick) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("sanick", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -4487,14 +4435,13 @@ irc_command_sanick (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/sapart": forces a user to leave channel(s). */ -int -irc_command_sapart (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(sapart) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("sapart", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -4509,14 +4456,13 @@ irc_command_sapart (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/saquit": forces a user to quit server with a reason. */ -int -irc_command_saquit (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(saquit) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("saquit", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(3, ""); @@ -4947,9 +4893,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail) * Callback for command "/server": manages IRC servers. */ -int -irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(server) { int i, detailed_list, one_server_found, length, count; struct t_irc_server *ptr_server2, *server_found, *new_server; @@ -4958,6 +4902,7 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, IRC_BUFFER_GET_SERVER_CHANNEL(buffer); /* make C compiler happy */ + (void) pointer; (void) data; (void) buffer; @@ -5313,14 +5258,13 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/service": registers a new service. */ -int -irc_command_service (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(service) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("service", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5337,14 +5281,13 @@ irc_command_service (void *data, struct t_gui_buffer *buffer, int argc, * network. */ -int -irc_command_servlist (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(servlist) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("servlist", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5366,14 +5309,13 @@ irc_command_servlist (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/squery": delivers a message to a service. */ -int -irc_command_squery (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(squery) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("squery", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -5396,14 +5338,13 @@ irc_command_squery (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/squit": disconnects server links. */ -int -irc_command_squit (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(squit) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("squit", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5418,14 +5359,13 @@ irc_command_squit (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/stats": queries statistics about server. */ -int -irc_command_stats (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(stats) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("stats", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5448,14 +5388,13 @@ irc_command_stats (void *data, struct t_gui_buffer *buffer, int argc, * server a message asking them to please join IRC. */ -int -irc_command_summon (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(summon) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("summon", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5471,14 +5410,13 @@ irc_command_summon (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/time": queries local time from server. */ -int -irc_command_time (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(time) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("time", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5500,9 +5438,7 @@ irc_command_time (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/topic": gets/sets topic for a channel. */ -int -irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(topic) { char *channel_name, *new_topic, *new_topic_color; @@ -5510,6 +5446,7 @@ irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("topic", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5578,14 +5515,13 @@ irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/trace": finds the route to specific server. */ -int -irc_command_trace (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(trace) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("trace", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5607,9 +5543,7 @@ irc_command_trace (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/unban": unbans nicks or hosts. */ -int -irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(unban) { char *pos_channel; int pos_args; @@ -5618,6 +5552,7 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("unban", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -5665,9 +5600,7 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/unquiet": unquiets nicks or hosts. */ -int -irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(unquiet) { char *pos_channel; int pos_args; @@ -5676,6 +5609,7 @@ irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("unquiet", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -5734,14 +5668,13 @@ irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc, * nicknames. */ -int -irc_command_userhost (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(userhost) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("userhost", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5757,14 +5690,13 @@ irc_command_userhost (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/users": list of users logged into the server. */ -int -irc_command_users (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(users) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("users", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -5787,14 +5719,13 @@ irc_command_users (void *data, struct t_gui_buffer *buffer, int argc, * (current or specified). */ -int -irc_command_version (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(version) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("version", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -5825,14 +5756,13 @@ irc_command_version (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/voice": gives voice to nickname(s). */ -int -irc_command_voice (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(voice) { IRC_BUFFER_GET_SERVER_CHANNEL(buffer); IRC_COMMAND_CHECK_SERVER("voice", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv_eol; @@ -5865,9 +5795,7 @@ irc_command_voice (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/wallchops": sends a notice to channel ops. */ -int -irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(wallchops) { char *pos_channel; int pos_args; @@ -5878,6 +5806,7 @@ irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("wallchops", 1); /* make C compiler happy */ + (void) pointer; (void) data; WEECHAT_COMMAND_MIN_ARGS(2, ""); @@ -5977,14 +5906,13 @@ irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc, * users who have set the 'w' user mode for themselves. */ -int -irc_command_wallops (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(wallops) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("wallops", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -6001,14 +5929,13 @@ irc_command_wallops (void *data, struct t_gui_buffer *buffer, int argc, * information. */ -int -irc_command_who (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(who) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("who", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -6030,9 +5957,7 @@ irc_command_who (void *data, struct t_gui_buffer *buffer, int argc, * Callback for command "/whois": queries information about user(s). */ -int -irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(whois) { int double_nick; const char *ptr_nick; @@ -6041,6 +5966,7 @@ irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc, IRC_COMMAND_CHECK_SERVER("whois", 1); /* make C compiler happy */ + (void) pointer; (void) data; double_nick = weechat_config_boolean (irc_config_network_whois_double_nick); @@ -6082,14 +6008,13 @@ irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc, * no longer exists. */ -int -irc_command_whowas (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) +IRC_COMMAND_CALLBACK(whowas) { IRC_BUFFER_GET_SERVER(buffer); IRC_COMMAND_CHECK_SERVER("whowas", 1); /* make C compiler happy */ + (void) pointer; (void) data; (void) argv; @@ -6113,7 +6038,7 @@ irc_command_init () N_("find information about the administrator of the server"), N_("[]"), N_("target: server name"), - NULL, &irc_command_admin, NULL); + NULL, &irc_command_admin, NULL, NULL); weechat_hook_command ( "allchan", N_("execute a command on all channels of all connected servers"), @@ -6133,7 +6058,7 @@ irc_command_init () " say 'hello' everywhere but not on #weechat and channels beginning " "with #linux:\n" " /allchan -exclude=#weechat,#linux* msg * hello"), - "-current", &irc_command_allchan, NULL); + "-current", &irc_command_allchan, NULL, NULL); weechat_hook_command ( "allpv", N_("execute a command on all private buffers of all connected servers"), @@ -6156,7 +6081,7 @@ irc_command_init () " /allpv -exclude=foo,bar* msg * hello\n" " close all private buffers:\n" " /allpv close"), - "-current", &irc_command_allpv, NULL); + "-current", &irc_command_allpv, NULL, NULL); weechat_hook_command ( "allserv", N_("execute a command on all connected servers"), @@ -6174,8 +6099,8 @@ irc_command_init () " /allserv away I'm away\n" " do a whois on my nick on all servers:\n" " /allserv whois $nick"), - NULL, &irc_command_allserv, NULL); - weechat_hook_command_run ("/away", &irc_command_run_away, NULL); + NULL, &irc_command_allserv, NULL, NULL); + weechat_hook_command_run ("/away", &irc_command_run_away, NULL, NULL); weechat_hook_command ( "ban", N_("ban nicks or hosts"), @@ -6185,7 +6110,7 @@ irc_command_init () "\n" "Without argument, this command displays the ban list for current " "channel."), - "%(irc_channel_nicks_hosts)", &irc_command_ban, NULL); + "%(irc_channel_nicks_hosts)", &irc_command_ban, NULL, NULL); weechat_hook_command ( "cap", N_("client capability negotiation"), @@ -6216,7 +6141,7 @@ irc_command_init () " || req " IRC_COMMAND_CAP_SUPPORTED_COMPLETION " || ack " IRC_COMMAND_CAP_SUPPORTED_COMPLETION " || end", - &irc_command_cap, NULL); + &irc_command_cap, NULL, NULL); weechat_hook_command ( "connect", N_("connect to IRC server(s)"), @@ -6254,7 +6179,7 @@ irc_command_init () " /connect irc://nick@irc.oftc.net/#channel\n" " /connect -switch"), "%(irc_servers)|-all|-auto|-open|-nojoin|-switch|%*", - &irc_command_connect, NULL); + &irc_command_connect, NULL, NULL); weechat_hook_command ( "ctcp", N_("send a CTCP message (Client-To-Client Protocol)"), @@ -6272,14 +6197,14 @@ irc_command_init () IRC_COMMAND_CTCP_SUPPORTED_COMPLETION " || %(irc_channel)|%(nicks)|* " IRC_COMMAND_CTCP_SUPPORTED_COMPLETION, - &irc_command_ctcp, NULL); + &irc_command_ctcp, NULL, NULL); weechat_hook_command ( "cycle", N_("leave and rejoin a channel"), N_("[[,...]] []"), N_("channel: channel name\n" "message: part message (displayed to other users)"), - "%(irc_msg_part)", &irc_command_cycle, NULL); + "%(irc_msg_part)", &irc_command_cycle, NULL, NULL); weechat_hook_command ( "dcc", N_("start a DCC (file transfer or direct chat)"), @@ -6294,7 +6219,7 @@ irc_command_init () " /dcc send toto /home/foo/bar.txt"), "chat %(nicks)" " || send %(nicks) %(filename)", - &irc_command_dcc, NULL); + &irc_command_dcc, NULL, NULL); weechat_hook_command ( "dehalfop", N_("remove channel half-operator status from nick(s)"), @@ -6302,7 +6227,7 @@ irc_command_init () N_("nick: nick or mask (wildcard \"*\" is allowed)\n" " *: remove channel half-operator status from everybody on channel " "except yourself"), - "%(nicks)", &irc_command_dehalfop, NULL); + "%(nicks)", &irc_command_dehalfop, NULL, NULL); weechat_hook_command ( "deop", N_("remove channel operator status from nick(s)"), @@ -6310,20 +6235,20 @@ irc_command_init () N_("nick: nick or mask (wildcard \"*\" is allowed)\n" " *: remove channel operator status from everybody on channel " "except yourself"), - "%(nicks)|%*", &irc_command_deop, NULL); + "%(nicks)|%*", &irc_command_deop, NULL, NULL); weechat_hook_command ( "devoice", N_("remove voice from nick(s)"), N_(" [...] || * -yes"), N_("nick: nick or mask (wildcard \"*\" is allowed)\n" " *: remove voice from everybody on channel"), - "%(nicks)|%*", &irc_command_devoice, NULL); + "%(nicks)|%*", &irc_command_devoice, NULL, NULL); weechat_hook_command ( "die", N_("shutdown the server"), N_("[]"), N_("target: server name"), - NULL, &irc_command_die, NULL); + NULL, &irc_command_die, NULL, NULL); weechat_hook_command ( "disconnect", N_("disconnect from one or all IRC servers"), @@ -6334,14 +6259,14 @@ irc_command_init () "reconnecting\n" " reason: reason for the \"quit\""), "%(irc_servers)|-all|-pending", - &irc_command_disconnect, NULL); + &irc_command_disconnect, NULL, NULL); weechat_hook_command ( "halfop", N_("give channel half-operator status to nick(s)"), N_(" [...] || * -yes"), N_("nick: nick or mask (wildcard \"*\" is allowed)\n" " *: give channel half-operator status to everybody on channel"), - "%(nicks)", &irc_command_halfop, NULL); + "%(nicks)", &irc_command_halfop, NULL, NULL); weechat_hook_command ( "ignore", N_("ignore nicks/hosts from servers or channels"), @@ -6372,26 +6297,26 @@ irc_command_init () "list" " || add %(irc_channel_nicks_hosts) %(irc_servers) %(irc_channels) %-" " || del -all|%(irc_ignores_numbers) %-", - &irc_command_ignore, NULL); + &irc_command_ignore, NULL, NULL); weechat_hook_command ( "info", N_("get information describing the server"), N_("[]"), N_("target: server name"), - NULL, &irc_command_info, NULL); + NULL, &irc_command_info, NULL, NULL); weechat_hook_command ( "invite", N_("invite a nick on a channel"), N_(" [...] []"), N_(" nick: nick\n" "channel: channel name"), - "%(nicks) %(irc_server_channels)", &irc_command_invite, NULL); + "%(nicks) %(irc_server_channels)", &irc_command_invite, NULL, NULL); weechat_hook_command ( "ison", N_("check if a nick is currently on IRC"), N_(" [...]"), N_("nick: nick"), - "%(nicks)|%*", &irc_command_ison, NULL); + "%(nicks)|%*", &irc_command_ison, NULL, NULL); weechat_hook_command ( "join", N_("join a channel"), @@ -6409,7 +6334,7 @@ irc_command_init () " /join -server freenode #weechat\n" " /join -noswitch #weechat"), "%(irc_channels)|-noswitch|-server|%(irc_servers)|%*", - &irc_command_join, NULL); + &irc_command_join, NULL, NULL); weechat_hook_command ( "kick", N_("kick a user out of a channel"), @@ -6418,7 +6343,7 @@ irc_command_init () " nick: nick\n" " reason: reason (special variables $nick, $channel and $server are " "replaced by their value)"), - "%(nicks) %(irc_msg_kick) %-", &irc_command_kick, NULL); + "%(nicks) %(irc_msg_kick) %-", &irc_command_kick, NULL, NULL); weechat_hook_command ( "kickban", N_("kick a user out of a channel and ban the host"), @@ -6435,14 +6360,14 @@ irc_command_init () " ban \"*!*@host.com\" and then kick \"toto\":\n" " /kickban toto!*@host.com"), "%(irc_channel_nicks_hosts) %(irc_msg_kick) %-", - &irc_command_kickban, NULL); + &irc_command_kickban, NULL, NULL); weechat_hook_command ( "kill", N_("close client-server connection"), N_(" []"), N_(" nick: nick\n" "reason: reason"), - "%(nicks) %-", &irc_command_kill, NULL); + "%(nicks) %-", &irc_command_kill, NULL, NULL); weechat_hook_command ( "links", N_("list all servernames which are known by the server answering the " @@ -6450,7 +6375,7 @@ irc_command_init () N_("[[] ]"), N_(" server: this server should answer the query\n" "server_mask: list of servers must match this mask"), - NULL, &irc_command_links, NULL); + NULL, &irc_command_links, NULL, NULL); weechat_hook_command ( "list", N_("list channels and their topic"), @@ -6470,26 +6395,26 @@ irc_command_init () " list all channels beginning with \"#weechat\" (can be very slow " "on large networks):\n" " /list -re #weechat.*"), - NULL, &irc_command_list, NULL); + NULL, &irc_command_list, NULL, NULL); weechat_hook_command ( "lusers", N_("get statistics about the size of the IRC network"), N_("[ []]"), N_(" mask: servers matching the mask only\n" "target: server for forwarding request"), - NULL, &irc_command_lusers, NULL); + NULL, &irc_command_lusers, NULL, NULL); weechat_hook_command ( "map", N_("show a graphical map of the IRC network"), "", "", - NULL, &irc_command_map, NULL); + NULL, &irc_command_map, NULL, NULL); weechat_hook_command ( "me", N_("send a CTCP action to the current channel"), N_(""), N_("message: message to send"), - NULL, &irc_command_me, NULL); + NULL, &irc_command_me, NULL, NULL); weechat_hook_command ( "mode", N_("change channel or user mode"), @@ -6524,13 +6449,13 @@ irc_command_init () " /mode #weechat +t\n" " become invisible on server:\n" " /mode nick +i"), - "%(irc_channel)|%(irc_server_nick)", &irc_command_mode, NULL); + "%(irc_channel)|%(irc_server_nick)", &irc_command_mode, NULL, NULL); weechat_hook_command ( "motd", N_("get the \"Message Of The Day\""), N_("[]"), N_("target: server name"), - NULL, &irc_command_motd, NULL); + NULL, &irc_command_motd, NULL, NULL); weechat_hook_command ( "msg", N_("send message to a nick or channel"), @@ -6540,13 +6465,13 @@ irc_command_init () " text: text to send"), "-server %(irc_servers) %(nicks)|*" " || %(nicks)|*", - &irc_command_msg, NULL); + &irc_command_msg, NULL, NULL); weechat_hook_command ( "names", N_("list nicks on channels"), N_("[[,...]]"), N_("channel: channel name"), - "%(irc_channels)", &irc_command_names, NULL); + "%(irc_channels)", &irc_command_names, NULL, NULL); weechat_hook_command ( "nick", N_("change current nick"), @@ -6555,7 +6480,7 @@ irc_command_init () "nick: new nick"), "-all %(irc_server_nick)" " || %(irc_server_nick)", - &irc_command_nick, NULL); + &irc_command_nick, NULL, NULL); weechat_hook_command ( "notice", N_("send notice message to user"), @@ -6565,7 +6490,7 @@ irc_command_init () " text: text to send"), "-server %(irc_servers) %(nicks)" " || %(nicks)", - &irc_command_notice, NULL); + &irc_command_notice, NULL, NULL); weechat_hook_command ( "notify", N_("add a notification for presence or away status of nicks on servers"), @@ -6591,42 +6516,42 @@ irc_command_init () " /notify add toto freenode -away"), "add %(irc_channel_nicks) %(irc_servers) -away %-" " || del -all|%(irc_notify_nicks) %(irc_servers) %-", - &irc_command_notify, NULL); + &irc_command_notify, NULL, NULL); weechat_hook_command ( "op", N_("give channel operator status to nick(s)"), N_(" [...] || * -yes"), N_("nick: nick or mask (wildcard \"*\" is allowed)\n" " *: give channel operator status to everybody on channel"), - "%(nicks)|%*", &irc_command_op, NULL); + "%(nicks)|%*", &irc_command_op, NULL, NULL); weechat_hook_command ( "oper", N_("get operator privileges"), N_(" "), N_(" user: user\n" "password: password"), - NULL, &irc_command_oper, NULL); + NULL, &irc_command_oper, NULL, NULL); weechat_hook_command ( "part", N_("leave a channel"), N_("[[,...]] []"), N_("channel: channel name to leave\n" "message: part message (displayed to other users)"), - "%(irc_msg_part)", &irc_command_part, NULL); + "%(irc_msg_part)", &irc_command_part, NULL, NULL); weechat_hook_command ( "ping", N_("send a ping to server"), N_(" []"), N_("server1: server\n" "server2: forward ping to this server"), - NULL, &irc_command_ping, NULL); + NULL, &irc_command_ping, NULL, NULL); weechat_hook_command ( "pong", N_("answer to a ping message"), N_(" []"), N_(" daemon: daemon who has responded to Ping message\n" "daemon2: forward message to this daemon"), - NULL, &irc_command_pong, NULL); + NULL, &irc_command_pong, NULL, NULL); weechat_hook_command ( "query", N_("send a private message to a nick"), @@ -6637,7 +6562,7 @@ irc_command_init () " text: text to send"), "-noswitch|-server %(irc_servers) %(nicks)" " || %(nicks)", - &irc_command_query, NULL); + &irc_command_query, NULL, NULL); weechat_hook_command ( "quiet", N_("quiet nicks or hosts"), @@ -6647,14 +6572,14 @@ irc_command_init () "\n" "Without argument, this command displays the quiet list for " "current channel."), - "%(irc_channel_nicks_hosts)", &irc_command_quiet, NULL); + "%(irc_channel_nicks_hosts)", &irc_command_quiet, NULL, NULL); weechat_hook_command ( "quote", N_("send raw data to server without parsing"), N_("[-server ] "), N_("server: send to this server (internal name)\n" " data: raw data to send"), - "-server %(irc_servers)", &irc_command_quote, NULL); + "-server %(irc_servers)", &irc_command_quote, NULL, NULL); weechat_hook_command ( "reconnect", N_("reconnect to server(s)"), @@ -6666,13 +6591,13 @@ irc_command_init () "server)\n" "-switch: switch to next server address"), "%(irc_servers)|-all|-nojoin|-switch|%*", - &irc_command_reconnect, NULL); + &irc_command_reconnect, NULL, NULL); weechat_hook_command ( "rehash", N_("tell the server to reload its config file"), N_("[