From cf6aca1619c32422a43fa3d82e0674f6b7b49fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 21 Mar 2016 18:11:21 +0100 Subject: 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 --- doc/it/autogen/plugin_api/hdata.asciidoc | 125 ++++--------------------------- 1 file changed, 13 insertions(+), 112 deletions(-) (limited to 'doc/it/autogen') diff --git a/doc/it/autogen/plugin_api/hdata.asciidoc b/doc/it/autogen/plugin_api/hdata.asciidoc index c49a21e7d..05366191f 100644 --- a/doc/it/autogen/plugin_api/hdata.asciidoc +++ b/doc/it/autogen/plugin_api/hdata.asciidoc @@ -2,21 +2,6 @@ // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // -* [[hdata_guile_callback]]<>: callback di uno script -** plugin: guile -** variables: -*** 'script' (pointer, hdata: "guile_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "guile_callback") -*** 'next_callback' (pointer, hdata: "guile_callback") * [[hdata_guile_script]]<>: elenco degli script ** plugin: guile ** variables: @@ -29,7 +14,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "guile_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "guile_script") *** 'next_script' (pointer, hdata: "guile_script") @@ -229,21 +213,6 @@ ** lists: *** 'irc_servers' *** 'last_irc_server' -* [[hdata_javascript_callback]]<>: callback di uno script -** plugin: javascript -** variables: -*** 'script' (pointer, hdata: "javascript_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "javascript_callback") -*** 'next_callback' (pointer, hdata: "javascript_callback") * [[hdata_javascript_script]]<>: elenco degli script ** plugin: javascript ** variables: @@ -256,28 +225,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "javascript_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "javascript_script") *** 'next_script' (pointer, hdata: "javascript_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_lua_callback]]<>: callback di uno script -** plugin: lua -** variables: -*** 'script' (pointer, hdata: "lua_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "lua_callback") -*** 'next_callback' (pointer, hdata: "lua_callback") * [[hdata_lua_script]]<>: elenco degli script ** plugin: lua ** variables: @@ -290,28 +243,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "lua_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "lua_script") *** 'next_script' (pointer, hdata: "lua_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_perl_callback]]<>: callback di uno script -** plugin: perl -** variables: -*** 'script' (pointer, hdata: "perl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "perl_callback") -*** 'next_callback' (pointer, hdata: "perl_callback") * [[hdata_perl_script]]<>: elenco degli script ** plugin: perl ** variables: @@ -324,28 +261,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "perl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "perl_script") *** 'next_script' (pointer, hdata: "perl_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_python_callback]]<>: callback di uno script -** plugin: python -** variables: -*** 'script' (pointer, hdata: "python_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "python_callback") -*** 'next_callback' (pointer, hdata: "python_callback") * [[hdata_python_script]]<>: elenco degli script ** plugin: python ** variables: @@ -358,28 +279,12 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "python_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "python_script") *** 'next_script' (pointer, hdata: "python_script") ** lists: *** 'last_script' *** 'scripts' -* [[hdata_ruby_callback]]<>: callback di uno script -** plugin: ruby -** variables: -*** 'script' (pointer, hdata: "ruby_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "ruby_callback") -*** 'next_callback' (pointer, hdata: "ruby_callback") * [[hdata_ruby_script]]<>: elenco degli script ** plugin: ruby ** variables: @@ -392,7 +297,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "ruby_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "ruby_script") *** 'next_script' (pointer, hdata: "ruby_script") @@ -428,21 +332,6 @@ ** lists: *** 'last_script_repo' *** 'scripts_repo' -* [[hdata_tcl_callback]]<>: callback di uno script -** plugin: tcl -** variables: -*** 'script' (pointer, hdata: "tcl_script") -*** 'function' (string) -*** 'data' (string) -*** 'config_file' (pointer, hdata: "config_file") -*** 'config_section' (pointer, hdata: "config_section") -*** 'config_option' (pointer, hdata: "config_option") -*** 'hook' (pointer) -*** 'buffer' (pointer, hdata: "buffer") -*** 'bar_item' (pointer, hdata: "bar_item") -*** 'upgrade_file' (pointer) -*** 'prev_callback' (pointer, hdata: "tcl_callback") -*** 'next_callback' (pointer, hdata: "tcl_callback") * [[hdata_tcl_script]]<>: elenco degli script ** plugin: tcl ** variables: @@ -455,7 +344,6 @@ *** 'description' (string) *** 'shutdown_func' (string) *** 'charset' (string) -*** 'callbacks' (pointer, hdata: "tcl_callback") *** 'unloading' (integer) *** 'prev_script' (pointer, hdata: "tcl_script") *** 'next_script' (pointer, hdata: "tcl_script") @@ -487,6 +375,7 @@ *** 'plugin' (pointer, hdata: "plugin") *** 'name' (string) *** 'build_callback' (pointer) +*** 'build_callback_pointer' (pointer) *** 'build_callback_data' (pointer) *** 'prev_item' (pointer, hdata: "bar_item") *** 'next_item' (pointer, hdata: "bar_item") @@ -540,6 +429,7 @@ *** 'clear' (integer) *** 'filter' (integer) *** 'close_callback' (pointer) +*** 'close_callback_pointer' (pointer) *** 'close_callback_data' (pointer) *** 'closing' (integer) *** 'title' (string) @@ -558,9 +448,11 @@ *** 'nicklist_nicks_count' (integer) *** 'nicklist_visible_count' (integer) *** 'nickcmp_callback' (pointer) +*** 'nickcmp_callback_pointer' (pointer) *** 'nickcmp_callback_data' (pointer) *** 'input' (integer) *** 'input_callback' (pointer) +*** 'input_callback_pointer' (pointer) *** 'input_callback_data' (pointer) *** 'input_get_unknown_commands' (integer) *** 'input_buffer' (string) @@ -644,6 +536,7 @@ *** 'filename' (string) *** 'file' (pointer) *** 'callback_reload' (pointer) +*** 'callback_reload_pointer' (pointer) *** 'callback_reload_data' (pointer) *** 'sections' (pointer, hdata: "config_section") *** 'last_section' (pointer, hdata: "config_section") @@ -668,10 +561,13 @@ *** 'value' (pointer) *** 'null_value_allowed' (integer) *** 'callback_check_value' (pointer) +*** 'callback_check_value_pointer' (pointer) *** 'callback_check_value_data' (pointer) *** 'callback_change' (pointer) +*** 'callback_change_pointer' (pointer) *** 'callback_change_data' (pointer) *** 'callback_delete' (pointer) +*** 'callback_delete_pointer' (pointer) *** 'callback_delete_data' (pointer) *** 'loaded' (integer) *** 'prev_option' (pointer, hdata: "config_option") @@ -684,14 +580,19 @@ *** 'user_can_add_options' (integer) *** 'user_can_delete_options' (integer) *** 'callback_read' (pointer) +*** 'callback_read_pointer' (pointer) *** 'callback_read_data' (pointer) *** 'callback_write' (pointer) +*** 'callback_write_pointer' (pointer) *** 'callback_write_data' (pointer) *** 'callback_write_default' (pointer) +*** 'callback_write_default_pointer' (pointer) *** 'callback_write_default_data' (pointer) *** 'callback_create_option' (pointer) +*** 'callback_create_option_pointer' (pointer) *** 'callback_create_option_data' (pointer) *** 'callback_delete_option' (pointer) +*** 'callback_delete_option_pointer' (pointer) *** 'callback_delete_option_data' (pointer) *** 'options' (pointer, hdata: "config_option") *** 'last_option' (pointer, hdata: "config_option") -- cgit v1.2.3