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
v2.8-utf8proc
Sébastien Helleu 2016-03-21 18:11:21 +01:00
parent 6d764b64c5
commit cf6aca1619
207 changed files with 9596 additions and 7472 deletions

View File

@ -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)

View File

@ -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"

View File

@ -2,21 +2,6 @@
// This file is auto-generated by script docgen.py.
// DO NOT EDIT BY HAND!
//
* [[hdata_guile_callback]]<<hdata_guile_callback,'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]]<<hdata_guile_script,'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]]<<hdata_javascript_callback,'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]]<<hdata_javascript_script,'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]]<<hdata_lua_callback,'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]]<<hdata_lua_script,'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]]<<hdata_perl_callback,'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]]<<hdata_perl_script,'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]]<<hdata_python_callback,'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]]<<hdata_python_script,'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]]<<hdata_ruby_callback,'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]]<<hdata_ruby_script,'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]]<<hdata_tcl_callback,'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]]<<hdata_tcl_script,'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")

View File

@ -2,21 +2,6 @@
// This file is auto-generated by script docgen.py.
// DO NOT EDIT BY HAND!
//
* [[hdata_guile_callback]]<<hdata_guile_callback,'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]]<<hdata_guile_script,'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]]<<hdata_javascript_callback,'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]]<<hdata_javascript_script,'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]]<<hdata_lua_callback,'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]]<<hdata_lua_script,'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]]<<hdata_perl_callback,'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]]<<hdata_perl_script,'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]]<<hdata_python_callback,'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]]<<hdata_python_script,'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]]<<hdata_ruby_callback,'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]]<<hdata_ruby_script,'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]]<<hdata_tcl_callback,'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]]<<hdata_tcl_script,'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")

View File

@ -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

View File

@ -2,21 +2,6 @@
// This file is auto-generated by script docgen.py.
// DO NOT EDIT BY HAND!
//
* [[hdata_guile_callback]]<<hdata_guile_callback,'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]]<<hdata_guile_script,'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]]<<hdata_javascript_callback,'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]]<<hdata_javascript_script,'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]]<<hdata_lua_callback,'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]]<<hdata_lua_script,'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]]<<hdata_perl_callback,'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]]<<hdata_perl_script,'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]]<<hdata_python_callback,'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]]<<hdata_python_script,'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]]<<hdata_ruby_callback,'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]]<<hdata_ruby_script,'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]]<<hdata_tcl_callback,'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]]<<hdata_tcl_script,'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")

View File

@ -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

View File

@ -2,21 +2,6 @@
// This file is auto-generated by script docgen.py.
// DO NOT EDIT BY HAND!
//
* [[hdata_guile_callback]]<<hdata_guile_callback,'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]]<<hdata_guile_script,'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]]<<hdata_javascript_callback,'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]]<<hdata_javascript_script,'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]]<<hdata_lua_callback,'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]]<<hdata_lua_script,'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]]<<hdata_perl_callback,'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]]<<hdata_perl_script,'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]]<<hdata_python_callback,'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]]<<hdata_python_script,'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]]<<hdata_ruby_callback,'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]]<<hdata_ruby_script,'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]]<<hdata_tcl_callback,'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]]<<hdata_tcl_script,'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")

View File

@ -2,21 +2,6 @@
// This file is auto-generated by script docgen.py.
// DO NOT EDIT BY HAND!
//
* [[hdata_guile_callback]]<<hdata_guile_callback,'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]]<<hdata_guile_script,'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]]<<hdata_javascript_callback,'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]]<<hdata_javascript_script,'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]]<<hdata_lua_callback,'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]]<<hdata_lua_script,'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]]<<hdata_perl_callback,'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]]<<hdata_perl_script,'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]]<<hdata_python_callback,'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]]<<hdata_python_script,'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]]<<hdata_ruby_callback,'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]]<<hdata_ruby_script,'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]]<<hdata_tcl_callback,'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]]<<hdata_tcl_script,'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")

View File

@ -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 の主要関数

View File

@ -2,21 +2,6 @@
// This file is auto-generated by script docgen.py.
// DO NOT EDIT BY HAND!
//
* [[hdata_guile_callback]]<<hdata_guile_callback,'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]]<<hdata_guile_script,'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]]<<hdata_javascript_callback,'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]]<<hdata_javascript_script,'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]]<<hdata_lua_callback,'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]]<<hdata_lua_script,'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]]<<hdata_perl_callback,'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]]<<hdata_perl_script,'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]]<<hdata_python_callback,'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]]<<hdata_python_script,'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]]<<hdata_ruby_callback,'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]]<<hdata_ruby_script,'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]]<<hdata_tcl_callback,'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]]<<hdata_tcl_script,'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")

View File

@ -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

View File

@ -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

View File

@ -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);
}
/*

View File

@ -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,

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}
}
}

View File

@ -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);

File diff suppressed because it is too large Load Diff

View File

@ -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);
}
/*

View File

@ -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;

View File

@ -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,

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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",

View File

@ -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 ();

View File

@ -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)

View File

@ -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);
}

View File

@ -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 */

View File

@ -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);

View File

@ -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);
}
}
}

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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);
}
/*

View File

@ -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);
}
}
}

View File

@ -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 ();

View File

@ -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);

View File

@ -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);

View File

@ -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",

View File

@ -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);

View File

@ -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",

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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 ();

View File

@ -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)
{

View File

@ -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",

View File

@ -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);

View File

@ -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",

View File

@ -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);

View File

@ -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;

View File

@ -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",

View File

@ -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);

View File

@ -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",

View File

@ -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);

View File

@ -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",

View File

@ -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);

View File

@ -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",

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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",

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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})

View File

@ -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

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 ();

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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)

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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 ();

View File

@ -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 ();

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 ();

File diff suppressed because it is too large Load Diff

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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",

Some files were not shown because too many files have changed in this diff Show More