diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/de/autogen/plugin_api/hdata.txt | 659 | ||||
-rw-r--r-- | doc/de/autogen/user/weechat_commands.txt | 3 | ||||
-rw-r--r-- | doc/docgen.pl | 166 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/hdata.txt | 659 | ||||
-rw-r--r-- | doc/en/autogen/user/weechat_commands.txt | 3 | ||||
-rw-r--r-- | doc/en/weechat_plugin_api.en.txt | 910 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/hdata.txt | 659 | ||||
-rw-r--r-- | doc/fr/autogen/user/weechat_commands.txt | 3 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.txt | 925 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/hdata.txt | 659 | ||||
-rw-r--r-- | doc/it/autogen/user/weechat_commands.txt | 3 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.txt | 931 |
12 files changed, 5550 insertions, 30 deletions
diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt new file mode 100644 index 000000000..00b2711d3 --- /dev/null +++ b/doc/de/autogen/plugin_api/hdata.txt @@ -0,0 +1,659 @@ +[width="100%",cols="^1,^2,5,5,5",options="header"] +|======================================== +| Erweiterung | Name | Beschreibung | Variables | Lists + +| irc | irc_channel | irc channel | + 'type' (integer) + + 'name' (string) + + 'topic' (string) + + 'modes' (string) + + 'limit' (integer) + + 'key' (string) + + 'checking_away' (integer) + + 'away_message' (string) + + 'has_quit_server' (integer) + + 'cycle' (integer) + + 'part' (integer) + + 'display_creation_date' (integer) + + 'nick_completion_reset' (integer) + + 'pv_remote_nick_color' (string) + + 'hook_autorejoin' (pointer) + + 'nicks_count' (integer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'nicks_speaking' (pointer) + + 'nicks_speaking_time' (pointer) + + 'last_nick_speaking_time' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'prev_channel' (pointer) + + 'next_channel' (pointer) | + - + +| irc | irc_channel_speaking | irc channel_speaking | + 'nick' (string) + + 'time_last_message' (time) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_ignore | irc ignore | + 'number' (integer) + + 'mask' (string) + + 'regex_mask' (pointer) + + 'server' (string) + + 'channel' (string) + + 'prev_ignore' (pointer) + + 'next_ignore' (pointer) | + 'irc_ignore_list' + + 'last_irc_ignore' + +| irc | irc_nick | irc nick | + 'name' (string) + + 'host' (string) + + 'prefixes' (string) + + 'prefix' (string) + + 'away' (integer) + + 'color' (string) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_notify | irc notify | + 'server' (pointer) + + 'nick' (string) + + 'check_away' (integer) + + 'is_on_server' (integer) + + 'away_message' (string) + + 'ison_received' (integer) + + 'prev_notify' (pointer) + + 'next_notify' (pointer) | + - + +| irc | irc_redirect | irc redirect | + 'server' (pointer) + + 'pattern' (string) + + 'signal' (string) + + 'count' (integer) + + 'current_count' (integer) + + 'string' (string) + + 'timeout' (integer) + + 'command' (string) + + 'start_time' (time) + + 'cmd_start' (pointer) + + 'cmd_stop' (pointer) + + 'cmd_extra' (pointer) + + 'cmd_start_received' (integer) + + 'cmd_stop_received' (integer) + + 'cmd_filter' (pointer) + + 'output' (string) + + 'output_size' (integer) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + - + +| irc | irc_redirect_pattern | pattern for irc redirect | + 'name' (string) + + 'temp_pattern' (integer) + + 'timeout' (integer) + + 'cmd_start' (string) + + 'cmd_stop' (string) + + 'cmd_extra' (string) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + 'irc_redirect_patterns' + + 'last_irc_redirect_pattern' + +| irc | irc_server | irc server | + 'name' (string) + + 'options' (pointer) + + 'temp_server' (integer) + + 'reloading_from_config' (integer) + + 'reloaded_from_config' (integer) + + 'addresses_count' (integer) + + 'addresses_array' (pointer) + + 'ports_array' (pointer) + + 'index_current_address' (integer) + + 'current_address' (string) + + 'current_ip' (string) + + 'current_port' (integer) + + 'sock' (integer) + + 'hook_connect' (pointer) + + 'hook_fd' (pointer) + + 'hook_timer_connection' (pointer) + + 'hook_timer_sasl' (pointer) + + 'is_connected' (integer) + + 'ssl_connected' (integer) + + 'gnutls_sess' (other) + + 'tls_cert' (other) + + 'tls_cert_key' (other) + + 'unterminated_message' (string) + + 'nicks_count' (integer) + + 'nicks_array' (pointer) + + 'nick_first_tried' (integer) + + 'nick' (string) + + 'nick_modes' (string) + + 'isupport' (string) + + 'prefix_modes' (string) + + 'prefix_chars' (string) + + 'reconnect_delay' (integer) + + 'reconnect_start' (time) + + 'command_time' (time) + + 'reconnect_join' (integer) + + 'disable_autojoin' (integer) + + 'is_away' (integer) + + 'away_message' (string) + + 'away_time' (time) + + 'lag' (integer) + + 'lag_check_time' (other) + + 'lag_next_check' (time) + + 'lag_last_refresh' (time) + + 'cmd_list_regexp' (pointer) + + 'last_user_message' (time) + + 'last_away_check' (time) + + 'outqueue' (pointer) + + 'last_outqueue' (pointer) + + 'redirects' (pointer) + + 'last_redirect' (pointer) + + 'notify_list' (pointer) + + 'last_notify' (pointer) + + 'manual_joins' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'channels' (pointer) + + 'last_channel' (pointer) + + 'prev_server' (pointer) + + 'next_server' (pointer) | + 'irc_servers' + + 'last_irc_server' + +| weechat | bar | bar | + 'name' (string) + + 'options' (pointer) + + 'conditions_count' (integer) + + 'conditions_array' (pointer) + + 'items_count' (integer) + + 'items_subcount' (pointer) + + 'items_array' (pointer) + + 'bar_window' (pointer) + + 'bar_refresh_needed' (integer) + + 'prev_bar' (pointer) + + 'next_bar' (pointer) | + 'gui_bars' + + 'last_gui_bar' + +| weechat | bar_item | bar item | + 'plugin' (pointer) + + 'name' (string) + + 'build_callback' (pointer) + + 'build_callback_data' (pointer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + 'gui_bar_items' + + 'last_gui_bar_item' + +| weechat | buffer | buffer | + 'plugin' (pointer) + + 'plugin_name_for_upgrade' (string) + + 'merge_for_upgrade' (pointer) + + 'number' (integer) + + 'layout_number' (integer) + + 'layout_applied' (integer) + + 'name' (string) + + 'short_name' (string) + + 'type' (integer) + + 'notify' (integer) + + 'num_displayed' (integer) + + 'active' (integer) + + 'print_hooks_enabled' (integer) + + 'close_callback' (pointer) + + 'close_callback_data' (pointer) + + 'title' (string) + + 'own_lines' (pointer) + + 'mixed_lines' (pointer) + + 'lines' (pointer) + + 'time_for_each_line' (integer) + + 'chat_refresh_needed' (integer) + + 'nicklist' (integer) + + 'nicklist_case_sensitive' (integer) + + 'nicklist_root' (pointer) + + 'nicklist_max_length' (integer) + + 'nicklist_display_groups' (integer) + + 'nicklist_visible_count' (integer) + + 'input' (integer) + + 'input_callback' (pointer) + + 'input_callback_data' (pointer) + + 'input_get_unknown_commands' (integer) + + 'input_buffer' (string) + + 'input_buffer_alloc' (integer) + + 'input_buffer_size' (integer) + + 'input_buffer_length' (integer) + + 'input_buffer_pos' (integer) + + 'input_buffer_1st_display' (integer) + + 'input_undo_snap' (pointer) + + 'input_undo' (pointer) + + 'last_input_undo' (pointer) + + 'ptr_input_undo' (pointer) + + 'input_undo_count' (integer) + + 'completion' (pointer) + + 'history' (pointer) + + 'last_history' (pointer) + + 'ptr_history' (pointer) + + 'num_history' (integer) + + 'text_search' (integer) + + 'text_search_exact' (integer) + + 'text_search_found' (integer) + + 'text_search_input' (string) + + 'highlight_words' (string) + + 'highlight_tags' (string) + + 'highlight_tags_count' (integer) + + 'highlight_tags_array' (pointer) + + 'hotlist_max_level_nicks' (pointer) + + 'keys' (pointer) + + 'last_key' (pointer) + + 'keys_count' (integer) + + 'local_variables' (pointer) + + 'prev_buffer' (pointer) + + 'next_buffer' (pointer) | + 'gui_buffers' + + 'last_gui_buffer' + +| weechat | completion | completion | + 'buffer' (pointer) + + 'context' (integer) + + 'base_command' (string) + + 'base_command_arg_index' (integer) + + 'base_word' (string) + + 'base_word_pos' (integer) + + 'position' (integer) + + 'args' (string) + + 'direction' (integer) + + 'add_space' (integer) + + 'force_partial_completion' (integer) + + 'completion_list' (pointer) + + 'word_found' (string) + + 'word_found_is_nick' (integer) + + 'position_replace' (integer) + + 'diff_size' (integer) + + 'diff_length' (integer) + + 'partial_completion_list' (pointer) + + 'last_partial_completion' (pointer) | + - + +| weechat | completion_partial | partial completion | + 'word' (string) + + 'count' (integer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + - + +| weechat | config_file | config file | + 'plugin' (pointer) + + 'name' (string) + + 'filename' (string) + + 'file' (pointer) + + 'callback_reload' (pointer) + + 'callback_reload_data' (pointer) + + 'sections' (pointer) + + 'last_section' (pointer) + + 'prev_config' (pointer) + + 'next_config' (pointer) | + 'config_files' + + 'last_config_file' + +| weechat | config_option | config option | + 'config_file' (pointer) + + 'section' (pointer) + + 'name' (string) + + 'type' (integer) + + 'description' (string) + + 'string_values' (pointer) + + 'min' (integer) + + 'max' (integer) + + 'default_value' (pointer) + + 'value' (pointer) + + 'null_value_allowed' (integer) + + 'callback_check_value' (pointer) + + 'callback_check_value_data' (pointer) + + 'callback_change' (pointer) + + 'callback_change_data' (pointer) + + 'callback_delete' (pointer) + + 'callback_delete_data' (pointer) + + 'loaded' (integer) + + 'prev_option' (pointer) + + 'next_option' (pointer) | + - + +| weechat | config_section | config section | + 'config_file' (pointer) + + 'name' (string) + + 'user_can_add_options' (integer) + + 'user_can_delete_options' (integer) + + 'callback_read' (pointer) + + 'callback_read_data' (pointer) + + 'callback_write' (pointer) + + 'callback_write_data' (pointer) + + 'callback_write_default' (pointer) + + 'callback_write_default_data' (pointer) + + 'callback_create_option' (pointer) + + 'callback_create_option_data' (pointer) + + 'callback_delete_option' (pointer) + + 'callback_delete_option_data' (pointer) + + 'options' (pointer) + + 'last_option' (pointer) + + 'prev_section' (pointer) + + 'next_section' (pointer) | + - + +| weechat | filter | filter | + 'enabled' (integer) + + 'name' (string) + + 'buffer_name' (string) + + 'num_buffers' (integer) + + 'buffers' (pointer) + + 'tags' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'regex' (string) + + 'regex_prefix' (pointer) + + 'regex_message' (pointer) + + 'prev_filter' (pointer) + + 'next_filter' (pointer) | + 'gui_filters' + + 'last_gui_filter' + +| weechat | history | history of commands in buffer | + 'text' (string) + + 'next_history' (pointer) + + 'prev_history' (pointer) | + - + +| weechat | hook | hook (variables common to all hook types) | + 'plugin' (pointer) + + 'type' (integer) + + 'deleted' (integer) + + 'running' (integer) + + 'priority' (integer) + + 'callback_data' (pointer) + + 'hook_data' (pointer) + + 'prev_hook' (pointer) + + 'next_hook' (pointer) | + - + +| weechat | hook_command | hook of type "command" | + 'callback' (pointer) + + 'command' (string) + + 'description' (string) + + 'args' (string) + + 'args_description' (string) + + 'completion' (string) + + 'cplt_num_templates' (integer) + + 'cplt_templates' (pointer) + + 'cplt_templates_static' (pointer) + + 'cplt_template_num_args' (pointer) + + 'cplt_template_args' (pointer) + + 'cplt_template_num_args_concat' (integer) + + 'cplt_template_args_concat' (pointer) | + 'last_weechat_hook_command' + + 'weechat_hooks_command' + +| weechat | hook_command_run | hook of type "command_run" | + 'callback' (pointer) + + 'command' (string) | + 'last_weechat_hook_command_run' + + 'weechat_hooks_command_run' + +| weechat | hook_completion | hook of type "completion" | + 'callback' (pointer) + + 'completion_item' (string) + + 'description' (string) | + 'last_weechat_hook_completion' + + 'weechat_hooks_completion' + +| weechat | hook_config | hook of type "config" | + 'callback' (pointer) + + 'option' (string) | + 'last_weechat_hook_config' + + 'weechat_hooks_config' + +| weechat | hook_connect | hook of type "connect" | + 'callback' (pointer) + + 'proxy' (string) + + 'address' (string) + + 'port' (integer) + + 'sock' (integer) + + 'ipv6' (integer) + + 'gnutls_sess' (pointer) + + 'gnutls_cb' (pointer) + + 'gnutls_dhkey_size' (integer) + + 'gnutls_priorities' (string) + + 'local_hostname' (string) + + 'child_read' (integer) + + 'child_write' (integer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'handshake_hook_fd' (pointer) + + 'handshake_hook_timer' (pointer) + + 'handshake_fd_flags' (integer) + + 'handshake_ip_address' (string) | + 'last_weechat_hook_connect' + + 'weechat_hooks_connect' + +| weechat | hook_fd | hook of type "fd" | + 'callback' (pointer) + + 'fd' (integer) + + 'flags' (integer) | + 'last_weechat_hook_fd' + + 'weechat_hooks_fd' + +| weechat | hook_hdata | hook of type "hdata" | + 'callback' (pointer) + + 'hdata_name' (string) + + 'description' (string) | + 'last_weechat_hook_hdata' + + 'weechat_hooks_hdata' + +| weechat | hook_hsignal | hook of type "hsignal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_hsignal' + + 'weechat_hooks_hsignal' + +| weechat | hook_info | hook of type "info" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) | + 'last_weechat_hook_info' + + 'weechat_hooks_info' + +| weechat | hook_info_hashtable | hook of type "info_hashtable" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) + + 'output_description' (string) | + 'last_weechat_hook_info_hashtable' + + 'weechat_hooks_info_hashtable' + +| weechat | hook_infolist | hook of type "infolist" | + 'callback' (pointer) + + 'infolist_name' (string) + + 'description' (string) + + 'pointer_description' (string) + + 'args_description' (string) | + 'last_weechat_hook_infolist' + + 'weechat_hooks_infolist' + +| weechat | hook_modifier | hook of type "modifier" | + 'callback' (pointer) + + 'modifier' (string) | + 'last_weechat_hook_modifier' + + 'weechat_hooks_modifier' + +| weechat | hook_print | hook of type "print" | + 'callback' (pointer) + + 'buffer' (pointer) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'message' (string) + + 'strip_colors' (integer) | + 'last_weechat_hook_print' + + 'weechat_hooks_print' + +| weechat | hook_process | hook of type "process" | + 'callback' (pointer) + + 'command' (string) + + 'timeout' (long) + + 'child_read' (pointer) + + 'child_write' (pointer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'hook_timer' (pointer) + + 'buffer' (pointer) + + 'buffer_size' (pointer) | + 'last_weechat_hook_process' + + 'weechat_hooks_process' + +| weechat | hook_signal | hook of type "signal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_signal' + + 'weechat_hooks_signal' + +| weechat | hook_timer | hook of type "timer" | + 'callback' (pointer) + + 'interval' (long) + + 'align_second' (integer) + + 'remaining_calls' (integer) + + 'last_exec' (other) + + 'next_exec' (other) | + 'last_weechat_hook_timer' + + 'weechat_hooks_timer' + +| weechat | input_undo | undo for input line | + 'data' (string) + + 'pos' (integer) + + 'prev_undo' (pointer) + + 'next_undo' (pointer) | + - + +| weechat | key | key | + 'key' (string) + + 'command' (string) + + 'prev_key' (pointer) + + 'next_key' (pointer) | + 'gui_default_keys' + + 'gui_keys' + + 'last_gui_default_key' + + 'last_gui_key' + +| weechat | line | line | + 'data' (pointer) + + 'prev_line' (pointer) + + 'next_line' (pointer) | + - + +| weechat | line_data | line data | + 'buffer' (pointer) + + 'y' (integer) + + 'date' (time) + + 'date_printed' (time) + + 'str_time' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'displayed' (integer) + + 'highlight' (integer) + + 'refresh_needed' (integer) + + 'prefix' (string) + + 'prefix_length' (integer) + + 'message' (string) | + - + +| weechat | lines | lines | + 'first_line' (pointer) + + 'last_line' (pointer) + + 'last_read_line' (pointer) + + 'lines_count' (integer) + + 'first_line_not_read' (integer) + + 'lines_hidden' (integer) + + 'buffer_max_length' (integer) + + 'prefix_max_length' (integer) | + - + +| weechat | nick | nick in nicklist | + 'group' (pointer) + + 'name' (string) + + 'color' (string) + + 'prefix' (string) + + 'prefix_color' (string) + + 'visible' (integer) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| weechat | nick_group | group in nicklist | + 'name' (string) + + 'color' (string) + + 'visible' (integer) + + 'level' (integer) + + 'parent' (pointer) + + 'childs' (pointer) + + 'last_child' (pointer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'prev_group' (pointer) + + 'next_group' (pointer) | + - + +| weechat | window | window | + 'win_x' (integer) + + 'win_y' (integer) + + 'win_width' (integer) + + 'win_height' (integer) + + 'win_width_pct' (integer) + + 'win_height_pct' (integer) + + 'win_chat_x' (integer) + + 'win_chat_y' (integer) + + 'win_chat_width' (integer) + + 'win_chat_height' (integer) + + 'win_chat_cursor_x' (integer) + + 'win_chat_cursor_y' (integer) + + 'bar_windows' (pointer) + + 'last_bar_window' (pointer) + + 'refresh_needed' (integer) + + 'gui_objects' (pointer) + + 'buffer' (pointer) + + 'layout_plugin_name' (string) + + 'layout_buffer_name' (string) + + 'scroll' (pointer) + + 'ptr_tree' (pointer) + + 'prev_window' (pointer) + + 'next_window' (pointer) | + 'gui_current_window' + + 'gui_windows' + + 'last_gui_window' + +| weechat | window_scroll | scroll info in window | + 'buffer' (pointer) + + 'first_line_displayed' (integer) + + 'start_line' (pointer) + + 'start_line_pos' (integer) + + 'scrolling' (integer) + + 'start_col' (integer) + + 'lines_after' (integer) + + 'reset_allowed' (integer) + + 'prev_scroll' (pointer) + + 'next_scroll' (pointer) | + - + +| weechat | window_tree | tree of windows | + 'parent_node' (pointer) + + 'split_pct' (integer) + + 'split_horizontal' (integer) + + 'child1' (pointer) + + 'child2' (pointer) + + 'window' (pointer) | + 'gui_windows_tree' + +|======================================== diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt index 4e47e76f6..c999e32ba 100644 --- a/doc/de/autogen/user/weechat_commands.txt +++ b/doc/de/autogen/user/weechat_commands.txt @@ -145,7 +145,7 @@ Erweiterung: Name der Erweiterung ('weechat' für interne WeeChat Befehle) /debug list set <plugin> <level> dump [<plugin>] - buffer|color|infolists|memory|term|windows + buffer|color|hdata|infolists|memory|term|windows list: list plugins with debug levels set: set debug level for plugin @@ -154,6 +154,7 @@ Erweiterung: Name der Erweiterung ('weechat' für interne WeeChat Befehle) dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes) buffer: dump buffer content with hexadecimal values in log file color: display infos about current color pairs + hdata: display infos about hdata infolists: display infos about infolists memory: display infos about memory usage term: display infos about terminal diff --git a/doc/docgen.pl b/doc/docgen.pl index 9b9d15658..47627137c 100644 --- a/doc/docgen.pl +++ b/doc/docgen.pl @@ -42,7 +42,7 @@ my $version = "0.1"; # -------------------------------[ config ]------------------------------------ -# default path where doc XML files will be written (should be doc/ in sources +# default path where doc files will be written (should be doc/ in sources # package tree) # path must have subdirectories with languages and autogen directory: # path @@ -53,7 +53,7 @@ my $version = "0.1"; # ... my $default_path = "~/src/weechat/doc"; -# list of locales for which we want to build XML doc files to include +# list of locales for which we want to build doc files to include my @all_locale_list = qw(en_US fr_FR it_IT de_DE); # all commands/options/.. of following plugins will produce a file @@ -101,6 +101,9 @@ my @ignore_infos_hashtable_plugins = (); # infolists to ignore my @ignore_infolists_plugins = (); +# hdata to ignore +my @ignore_hdata_plugins = (); + # completions to ignore my @ignore_completions_plugins = (); my @ignore_completions_items = ("docgen.*", @@ -291,6 +294,78 @@ sub get_infolists return %infolists; } +# get list of hdata hooked by plugins in a hash with 3 indexes: plugin, name, xxx +sub get_hdata +{ + my %hdata; + + # get hdata hooked + my $infolist = weechat::infolist_get("hook", "", "hdata"); + while (weechat::infolist_next($infolist)) + { + my $hdata_name = weechat::infolist_string($infolist, "hdata_name"); + my $plugin = weechat::infolist_string($infolist, "plugin_name"); + $plugin = "weechat" if ($plugin eq ""); + + # check if hdata is ignored or not + my $ignore = 0; + foreach my $mask (@ignore_hdata_plugins) + { + $ignore = 1 if ($plugin =~ /${mask}/); + } + + if ($ignore ne 1) + { + $hdata{$plugin}{$hdata_name}{"description"} = weechat::infolist_string($infolist, "description"); + + my $vars = ""; + my $lists = ""; + my $ptr_hdata = weechat::hdata_get($hdata_name); + if ($ptr_hdata ne "") + { + my $str = weechat::hdata_get_string($ptr_hdata, "var_keys_values"); + my @items = split(/,/, $str); + my %hdata2; + foreach my $item (@items) + { + my ($key, $value) = split(/:/, $item); + my $type = int($value) >> 16; + my $offset = int($value) & 0xFFFF; + my $stroffset = sprintf("%08d", $offset); + $hdata2{$stroffset} = "'".$key."' (".weechat::hdata_get_var_type_string($ptr_hdata, $key).")"; + } + foreach my $offset (sort keys %hdata2) + { + $vars .= " +\n" if ($vars ne ""); + $vars .= " ".$hdata2{$offset}; + } + $hdata{$plugin}{$hdata_name}{"vars"} = "\n".$vars; + + $str = weechat::hdata_get_string($ptr_hdata, "list_keys"); + if ($str ne "") + { + my @items = split(/,/, $str); + @items = sort(@items); + foreach my $item (@items) + { + $lists .= " +\n" if ($lists ne ""); + $lists .= " '".$item."'"; + } + $lists = "\n".$lists; + } + else + { + $lists = "\n -"; + } + $hdata{$plugin}{$hdata_name}{"lists"} = $lists; + } + } + } + weechat::infolist_free($infolist); + + return %hdata; +} + # get list of completions hooked by plugins in a hash with 3 indexes: plugin, item, xxx sub get_completions { @@ -339,7 +414,7 @@ sub escape_table return $str; } -# build XML doc files (command /docgen) +# build doc files (command /docgen) sub docgen { my ($data, $buffer, $args) = ($_[0], $_[1], $_[2]); @@ -352,6 +427,7 @@ sub docgen my %plugin_infos = get_infos(); my %plugin_infos_hashtable = get_infos_hashtable(); my %plugin_infolists = get_infolists(); + my %plugin_hdata = get_hdata(); my %plugin_completions = get_completions(); # get path and replace ~ by home if needed @@ -377,6 +453,8 @@ sub docgen my $num_files_infos_hashtable_updated = 0; my $num_files_infolists = 0; my $num_files_infolists_updated = 0; + my $num_files_hdata = 0; + my $num_files_hdata_updated = 0; my $num_files_completions = 0; my $num_files_completions_updated = 0; @@ -678,6 +756,50 @@ sub docgen weechat::print("", weechat::prefix("error")."docgen error: unable to write file '$filename'"); } + # write hdata hooked + $filename = $dir."plugin_api/hdata.txt"; + if (open(FILE, ">".$filename.".tmp")) + { + print FILE "[width=\"100%\",cols=\"^1,^2,5,5,5\",options=\"header\"]\n"; + print FILE "|========================================\n"; + print FILE "| ".weechat_gettext("Plugin")." | ".weechat_gettext("Name") + ." | ".weechat_gettext("Description")." | ".weechat_gettext("Variables") + ." | ".weechat_gettext("Lists")."\n\n"; + foreach my $plugin (sort keys %plugin_hdata) + { + foreach my $hdata (sort keys %{$plugin_hdata{$plugin}}) + { + my $description = $plugin_hdata{$plugin}{$hdata}{"description"}; + $description = $d->get($description) if ($description ne ""); + my $vars = $plugin_hdata{$plugin}{$hdata}{"vars"}; + my $lists = $plugin_hdata{$plugin}{$hdata}{"lists"}; + print FILE "| ".escape_table($plugin)." | ".escape_table($hdata) + ." | ".escape_table($description)." | ".escape_table($vars) + ." | ".escape_table($lists)."\n\n"; + } + } + print FILE "|========================================\n"; + #weechat::print("", "docgen: file ok: '$filename'"); + my $rc = system("diff ".$filename." ".$filename.".tmp >/dev/null 2>&1"); + if ($rc != 0) + { + system("mv -f ".$filename.".tmp ".$filename); + $num_files_updated++; + $num_files_hdata_updated++; + } + else + { + system("rm ".$filename.".tmp"); + } + $num_files++; + $num_files_hdata++; + close(FILE); + } + else + { + weechat::print("", weechat::prefix("error")."docgen error: unable to write file '$filename'"); + } + # write completions hooked $filename = $dir."plugin_api/completions.txt"; if (open(FILE, ">".$filename.".tmp")) @@ -725,27 +847,31 @@ sub docgen } my $total_files = $num_files_commands + $num_files_options + $num_files_infos + $num_files_infos_hashtable - + $num_files_infolists + $num_files_completions; + + $num_files_infolists + $num_files_hdata + $num_files_completions; my $total_files_updated = $num_files_commands_updated + $num_files_options_updated + $num_files_infos_updated + $num_files_infos_hashtable_updated + $num_files_infolists_updated - + $num_files_completions_updated; - weechat::print("", "docgen: ".$locale.": ".$total_files." files (" - .$num_files_commands." cmd, " - .$num_files_options." opt, " - .$num_files_infos." infos, " - .$num_files_infos." infos (hashtable), " - .$num_files_infolists." infolists, " - .$num_files_completions." complt) -- " - .$total_files_updated." updated (" - .$num_files_commands_updated." cmd, " - .$num_files_options_updated." opt, " - .$num_files_infos_updated." infos, " - .$num_files_infos_hashtable_updated." infos (hashtable), " - .$num_files_infolists_updated." infolists, " - .$num_files_completions_updated." complt)"); + + $num_files_hdata_updated + $num_files_completions_updated; + weechat::print("", + sprintf ("docgen: %s: %3d files (%2d cmd, %2d opt, %2d infos, " + ."%2d infos_hash, %2d infolists, %2d hdata, " + ."%2d complt)", + $locale, $total_files, $num_files_commands, + $num_files_options, $num_files_infos, $num_files_infos, + $num_files_infolists, $num_files_hdata, + $num_files_completions)); + weechat::print("", + sprintf (" %3d updated (%2d cmd, %2d opt, %2d infos, " + ."%2d infos_hash, %2d infolists, %2d hdata, " + ."%2d complt)", + $total_files_updated, $num_files_commands_updated, + $num_files_options_updated, $num_files_infos_updated, + $num_files_infos_updated, $num_files_infolists_updated, + $num_files_hdata_updated, $num_files_completions_updated)); } - weechat::print("", "docgen: total: ".$num_files." files (".$num_files_updated." updated)"); + weechat::print("", + sprintf ("docgen: total: %d files, %d updated", + $num_files, $num_files_updated)); setlocale(LC_MESSAGES, $old_locale); diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt new file mode 100644 index 000000000..e6a8bcc54 --- /dev/null +++ b/doc/en/autogen/plugin_api/hdata.txt @@ -0,0 +1,659 @@ +[width="100%",cols="^1,^2,5,5,5",options="header"] +|======================================== +| Plugin | Name | Description | Variables | Lists + +| irc | irc_channel | irc channel | + 'type' (integer) + + 'name' (string) + + 'topic' (string) + + 'modes' (string) + + 'limit' (integer) + + 'key' (string) + + 'checking_away' (integer) + + 'away_message' (string) + + 'has_quit_server' (integer) + + 'cycle' (integer) + + 'part' (integer) + + 'display_creation_date' (integer) + + 'nick_completion_reset' (integer) + + 'pv_remote_nick_color' (string) + + 'hook_autorejoin' (pointer) + + 'nicks_count' (integer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'nicks_speaking' (pointer) + + 'nicks_speaking_time' (pointer) + + 'last_nick_speaking_time' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'prev_channel' (pointer) + + 'next_channel' (pointer) | + - + +| irc | irc_channel_speaking | irc channel_speaking | + 'nick' (string) + + 'time_last_message' (time) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_ignore | irc ignore | + 'number' (integer) + + 'mask' (string) + + 'regex_mask' (pointer) + + 'server' (string) + + 'channel' (string) + + 'prev_ignore' (pointer) + + 'next_ignore' (pointer) | + 'irc_ignore_list' + + 'last_irc_ignore' + +| irc | irc_nick | irc nick | + 'name' (string) + + 'host' (string) + + 'prefixes' (string) + + 'prefix' (string) + + 'away' (integer) + + 'color' (string) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_notify | irc notify | + 'server' (pointer) + + 'nick' (string) + + 'check_away' (integer) + + 'is_on_server' (integer) + + 'away_message' (string) + + 'ison_received' (integer) + + 'prev_notify' (pointer) + + 'next_notify' (pointer) | + - + +| irc | irc_redirect | irc redirect | + 'server' (pointer) + + 'pattern' (string) + + 'signal' (string) + + 'count' (integer) + + 'current_count' (integer) + + 'string' (string) + + 'timeout' (integer) + + 'command' (string) + + 'start_time' (time) + + 'cmd_start' (pointer) + + 'cmd_stop' (pointer) + + 'cmd_extra' (pointer) + + 'cmd_start_received' (integer) + + 'cmd_stop_received' (integer) + + 'cmd_filter' (pointer) + + 'output' (string) + + 'output_size' (integer) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + - + +| irc | irc_redirect_pattern | pattern for irc redirect | + 'name' (string) + + 'temp_pattern' (integer) + + 'timeout' (integer) + + 'cmd_start' (string) + + 'cmd_stop' (string) + + 'cmd_extra' (string) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + 'irc_redirect_patterns' + + 'last_irc_redirect_pattern' + +| irc | irc_server | irc server | + 'name' (string) + + 'options' (pointer) + + 'temp_server' (integer) + + 'reloading_from_config' (integer) + + 'reloaded_from_config' (integer) + + 'addresses_count' (integer) + + 'addresses_array' (pointer) + + 'ports_array' (pointer) + + 'index_current_address' (integer) + + 'current_address' (string) + + 'current_ip' (string) + + 'current_port' (integer) + + 'sock' (integer) + + 'hook_connect' (pointer) + + 'hook_fd' (pointer) + + 'hook_timer_connection' (pointer) + + 'hook_timer_sasl' (pointer) + + 'is_connected' (integer) + + 'ssl_connected' (integer) + + 'gnutls_sess' (other) + + 'tls_cert' (other) + + 'tls_cert_key' (other) + + 'unterminated_message' (string) + + 'nicks_count' (integer) + + 'nicks_array' (pointer) + + 'nick_first_tried' (integer) + + 'nick' (string) + + 'nick_modes' (string) + + 'isupport' (string) + + 'prefix_modes' (string) + + 'prefix_chars' (string) + + 'reconnect_delay' (integer) + + 'reconnect_start' (time) + + 'command_time' (time) + + 'reconnect_join' (integer) + + 'disable_autojoin' (integer) + + 'is_away' (integer) + + 'away_message' (string) + + 'away_time' (time) + + 'lag' (integer) + + 'lag_check_time' (other) + + 'lag_next_check' (time) + + 'lag_last_refresh' (time) + + 'cmd_list_regexp' (pointer) + + 'last_user_message' (time) + + 'last_away_check' (time) + + 'outqueue' (pointer) + + 'last_outqueue' (pointer) + + 'redirects' (pointer) + + 'last_redirect' (pointer) + + 'notify_list' (pointer) + + 'last_notify' (pointer) + + 'manual_joins' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'channels' (pointer) + + 'last_channel' (pointer) + + 'prev_server' (pointer) + + 'next_server' (pointer) | + 'irc_servers' + + 'last_irc_server' + +| weechat | bar | bar | + 'name' (string) + + 'options' (pointer) + + 'conditions_count' (integer) + + 'conditions_array' (pointer) + + 'items_count' (integer) + + 'items_subcount' (pointer) + + 'items_array' (pointer) + + 'bar_window' (pointer) + + 'bar_refresh_needed' (integer) + + 'prev_bar' (pointer) + + 'next_bar' (pointer) | + 'gui_bars' + + 'last_gui_bar' + +| weechat | bar_item | bar item | + 'plugin' (pointer) + + 'name' (string) + + 'build_callback' (pointer) + + 'build_callback_data' (pointer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + 'gui_bar_items' + + 'last_gui_bar_item' + +| weechat | buffer | buffer | + 'plugin' (pointer) + + 'plugin_name_for_upgrade' (string) + + 'merge_for_upgrade' (pointer) + + 'number' (integer) + + 'layout_number' (integer) + + 'layout_applied' (integer) + + 'name' (string) + + 'short_name' (string) + + 'type' (integer) + + 'notify' (integer) + + 'num_displayed' (integer) + + 'active' (integer) + + 'print_hooks_enabled' (integer) + + 'close_callback' (pointer) + + 'close_callback_data' (pointer) + + 'title' (string) + + 'own_lines' (pointer) + + 'mixed_lines' (pointer) + + 'lines' (pointer) + + 'time_for_each_line' (integer) + + 'chat_refresh_needed' (integer) + + 'nicklist' (integer) + + 'nicklist_case_sensitive' (integer) + + 'nicklist_root' (pointer) + + 'nicklist_max_length' (integer) + + 'nicklist_display_groups' (integer) + + 'nicklist_visible_count' (integer) + + 'input' (integer) + + 'input_callback' (pointer) + + 'input_callback_data' (pointer) + + 'input_get_unknown_commands' (integer) + + 'input_buffer' (string) + + 'input_buffer_alloc' (integer) + + 'input_buffer_size' (integer) + + 'input_buffer_length' (integer) + + 'input_buffer_pos' (integer) + + 'input_buffer_1st_display' (integer) + + 'input_undo_snap' (pointer) + + 'input_undo' (pointer) + + 'last_input_undo' (pointer) + + 'ptr_input_undo' (pointer) + + 'input_undo_count' (integer) + + 'completion' (pointer) + + 'history' (pointer) + + 'last_history' (pointer) + + 'ptr_history' (pointer) + + 'num_history' (integer) + + 'text_search' (integer) + + 'text_search_exact' (integer) + + 'text_search_found' (integer) + + 'text_search_input' (string) + + 'highlight_words' (string) + + 'highlight_tags' (string) + + 'highlight_tags_count' (integer) + + 'highlight_tags_array' (pointer) + + 'hotlist_max_level_nicks' (pointer) + + 'keys' (pointer) + + 'last_key' (pointer) + + 'keys_count' (integer) + + 'local_variables' (pointer) + + 'prev_buffer' (pointer) + + 'next_buffer' (pointer) | + 'gui_buffers' + + 'last_gui_buffer' + +| weechat | completion | completion | + 'buffer' (pointer) + + 'context' (integer) + + 'base_command' (string) + + 'base_command_arg_index' (integer) + + 'base_word' (string) + + 'base_word_pos' (integer) + + 'position' (integer) + + 'args' (string) + + 'direction' (integer) + + 'add_space' (integer) + + 'force_partial_completion' (integer) + + 'completion_list' (pointer) + + 'word_found' (string) + + 'word_found_is_nick' (integer) + + 'position_replace' (integer) + + 'diff_size' (integer) + + 'diff_length' (integer) + + 'partial_completion_list' (pointer) + + 'last_partial_completion' (pointer) | + - + +| weechat | completion_partial | partial completion | + 'word' (string) + + 'count' (integer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + - + +| weechat | config_file | config file | + 'plugin' (pointer) + + 'name' (string) + + 'filename' (string) + + 'file' (pointer) + + 'callback_reload' (pointer) + + 'callback_reload_data' (pointer) + + 'sections' (pointer) + + 'last_section' (pointer) + + 'prev_config' (pointer) + + 'next_config' (pointer) | + 'config_files' + + 'last_config_file' + +| weechat | config_option | config option | + 'config_file' (pointer) + + 'section' (pointer) + + 'name' (string) + + 'type' (integer) + + 'description' (string) + + 'string_values' (pointer) + + 'min' (integer) + + 'max' (integer) + + 'default_value' (pointer) + + 'value' (pointer) + + 'null_value_allowed' (integer) + + 'callback_check_value' (pointer) + + 'callback_check_value_data' (pointer) + + 'callback_change' (pointer) + + 'callback_change_data' (pointer) + + 'callback_delete' (pointer) + + 'callback_delete_data' (pointer) + + 'loaded' (integer) + + 'prev_option' (pointer) + + 'next_option' (pointer) | + - + +| weechat | config_section | config section | + 'config_file' (pointer) + + 'name' (string) + + 'user_can_add_options' (integer) + + 'user_can_delete_options' (integer) + + 'callback_read' (pointer) + + 'callback_read_data' (pointer) + + 'callback_write' (pointer) + + 'callback_write_data' (pointer) + + 'callback_write_default' (pointer) + + 'callback_write_default_data' (pointer) + + 'callback_create_option' (pointer) + + 'callback_create_option_data' (pointer) + + 'callback_delete_option' (pointer) + + 'callback_delete_option_data' (pointer) + + 'options' (pointer) + + 'last_option' (pointer) + + 'prev_section' (pointer) + + 'next_section' (pointer) | + - + +| weechat | filter | filter | + 'enabled' (integer) + + 'name' (string) + + 'buffer_name' (string) + + 'num_buffers' (integer) + + 'buffers' (pointer) + + 'tags' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'regex' (string) + + 'regex_prefix' (pointer) + + 'regex_message' (pointer) + + 'prev_filter' (pointer) + + 'next_filter' (pointer) | + 'gui_filters' + + 'last_gui_filter' + +| weechat | history | history of commands in buffer | + 'text' (string) + + 'next_history' (pointer) + + 'prev_history' (pointer) | + - + +| weechat | hook | hook (variables common to all hook types) | + 'plugin' (pointer) + + 'type' (integer) + + 'deleted' (integer) + + 'running' (integer) + + 'priority' (integer) + + 'callback_data' (pointer) + + 'hook_data' (pointer) + + 'prev_hook' (pointer) + + 'next_hook' (pointer) | + - + +| weechat | hook_command | hook of type "command" | + 'callback' (pointer) + + 'command' (string) + + 'description' (string) + + 'args' (string) + + 'args_description' (string) + + 'completion' (string) + + 'cplt_num_templates' (integer) + + 'cplt_templates' (pointer) + + 'cplt_templates_static' (pointer) + + 'cplt_template_num_args' (pointer) + + 'cplt_template_args' (pointer) + + 'cplt_template_num_args_concat' (integer) + + 'cplt_template_args_concat' (pointer) | + 'last_weechat_hook_command' + + 'weechat_hooks_command' + +| weechat | hook_command_run | hook of type "command_run" | + 'callback' (pointer) + + 'command' (string) | + 'last_weechat_hook_command_run' + + 'weechat_hooks_command_run' + +| weechat | hook_completion | hook of type "completion" | + 'callback' (pointer) + + 'completion_item' (string) + + 'description' (string) | + 'last_weechat_hook_completion' + + 'weechat_hooks_completion' + +| weechat | hook_config | hook of type "config" | + 'callback' (pointer) + + 'option' (string) | + 'last_weechat_hook_config' + + 'weechat_hooks_config' + +| weechat | hook_connect | hook of type "connect" | + 'callback' (pointer) + + 'proxy' (string) + + 'address' (string) + + 'port' (integer) + + 'sock' (integer) + + 'ipv6' (integer) + + 'gnutls_sess' (pointer) + + 'gnutls_cb' (pointer) + + 'gnutls_dhkey_size' (integer) + + 'gnutls_priorities' (string) + + 'local_hostname' (string) + + 'child_read' (integer) + + 'child_write' (integer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'handshake_hook_fd' (pointer) + + 'handshake_hook_timer' (pointer) + + 'handshake_fd_flags' (integer) + + 'handshake_ip_address' (string) | + 'last_weechat_hook_connect' + + 'weechat_hooks_connect' + +| weechat | hook_fd | hook of type "fd" | + 'callback' (pointer) + + 'fd' (integer) + + 'flags' (integer) | + 'last_weechat_hook_fd' + + 'weechat_hooks_fd' + +| weechat | hook_hdata | hook of type "hdata" | + 'callback' (pointer) + + 'hdata_name' (string) + + 'description' (string) | + 'last_weechat_hook_hdata' + + 'weechat_hooks_hdata' + +| weechat | hook_hsignal | hook of type "hsignal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_hsignal' + + 'weechat_hooks_hsignal' + +| weechat | hook_info | hook of type "info" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) | + 'last_weechat_hook_info' + + 'weechat_hooks_info' + +| weechat | hook_info_hashtable | hook of type "info_hashtable" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) + + 'output_description' (string) | + 'last_weechat_hook_info_hashtable' + + 'weechat_hooks_info_hashtable' + +| weechat | hook_infolist | hook of type "infolist" | + 'callback' (pointer) + + 'infolist_name' (string) + + 'description' (string) + + 'pointer_description' (string) + + 'args_description' (string) | + 'last_weechat_hook_infolist' + + 'weechat_hooks_infolist' + +| weechat | hook_modifier | hook of type "modifier" | + 'callback' (pointer) + + 'modifier' (string) | + 'last_weechat_hook_modifier' + + 'weechat_hooks_modifier' + +| weechat | hook_print | hook of type "print" | + 'callback' (pointer) + + 'buffer' (pointer) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'message' (string) + + 'strip_colors' (integer) | + 'last_weechat_hook_print' + + 'weechat_hooks_print' + +| weechat | hook_process | hook of type "process" | + 'callback' (pointer) + + 'command' (string) + + 'timeout' (long) + + 'child_read' (pointer) + + 'child_write' (pointer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'hook_timer' (pointer) + + 'buffer' (pointer) + + 'buffer_size' (pointer) | + 'last_weechat_hook_process' + + 'weechat_hooks_process' + +| weechat | hook_signal | hook of type "signal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_signal' + + 'weechat_hooks_signal' + +| weechat | hook_timer | hook of type "timer" | + 'callback' (pointer) + + 'interval' (long) + + 'align_second' (integer) + + 'remaining_calls' (integer) + + 'last_exec' (other) + + 'next_exec' (other) | + 'last_weechat_hook_timer' + + 'weechat_hooks_timer' + +| weechat | input_undo | undo for input line | + 'data' (string) + + 'pos' (integer) + + 'prev_undo' (pointer) + + 'next_undo' (pointer) | + - + +| weechat | key | key | + 'key' (string) + + 'command' (string) + + 'prev_key' (pointer) + + 'next_key' (pointer) | + 'gui_default_keys' + + 'gui_keys' + + 'last_gui_default_key' + + 'last_gui_key' + +| weechat | line | line | + 'data' (pointer) + + 'prev_line' (pointer) + + 'next_line' (pointer) | + - + +| weechat | line_data | line data | + 'buffer' (pointer) + + 'y' (integer) + + 'date' (time) + + 'date_printed' (time) + + 'str_time' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'displayed' (integer) + + 'highlight' (integer) + + 'refresh_needed' (integer) + + 'prefix' (string) + + 'prefix_length' (integer) + + 'message' (string) | + - + +| weechat | lines | lines | + 'first_line' (pointer) + + 'last_line' (pointer) + + 'last_read_line' (pointer) + + 'lines_count' (integer) + + 'first_line_not_read' (integer) + + 'lines_hidden' (integer) + + 'buffer_max_length' (integer) + + 'prefix_max_length' (integer) | + - + +| weechat | nick | nick in nicklist | + 'group' (pointer) + + 'name' (string) + + 'color' (string) + + 'prefix' (string) + + 'prefix_color' (string) + + 'visible' (integer) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| weechat | nick_group | group in nicklist | + 'name' (string) + + 'color' (string) + + 'visible' (integer) + + 'level' (integer) + + 'parent' (pointer) + + 'childs' (pointer) + + 'last_child' (pointer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'prev_group' (pointer) + + 'next_group' (pointer) | + - + +| weechat | window | window | + 'win_x' (integer) + + 'win_y' (integer) + + 'win_width' (integer) + + 'win_height' (integer) + + 'win_width_pct' (integer) + + 'win_height_pct' (integer) + + 'win_chat_x' (integer) + + 'win_chat_y' (integer) + + 'win_chat_width' (integer) + + 'win_chat_height' (integer) + + 'win_chat_cursor_x' (integer) + + 'win_chat_cursor_y' (integer) + + 'bar_windows' (pointer) + + 'last_bar_window' (pointer) + + 'refresh_needed' (integer) + + 'gui_objects' (pointer) + + 'buffer' (pointer) + + 'layout_plugin_name' (string) + + 'layout_buffer_name' (string) + + 'scroll' (pointer) + + 'ptr_tree' (pointer) + + 'prev_window' (pointer) + + 'next_window' (pointer) | + 'gui_current_window' + + 'gui_windows' + + 'last_gui_window' + +| weechat | window_scroll | scroll info in window | + 'buffer' (pointer) + + 'first_line_displayed' (integer) + + 'start_line' (pointer) + + 'start_line_pos' (integer) + + 'scrolling' (integer) + + 'start_col' (integer) + + 'lines_after' (integer) + + 'reset_allowed' (integer) + + 'prev_scroll' (pointer) + + 'next_scroll' (pointer) | + - + +| weechat | window_tree | tree of windows | + 'parent_node' (pointer) + + 'split_pct' (integer) + + 'split_horizontal' (integer) + + 'child1' (pointer) + + 'child2' (pointer) + + 'window' (pointer) | + 'gui_windows_tree' + +|======================================== diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt index 90a830f37..ce6e4eb5c 100644 --- a/doc/en/autogen/user/weechat_commands.txt +++ b/doc/en/autogen/user/weechat_commands.txt @@ -145,7 +145,7 @@ command: command to execute (a '/' is automatically added if not found at beginn /debug list set <plugin> <level> dump [<plugin>] - buffer|color|infolists|memory|term|windows + buffer|color|hdata|infolists|memory|term|windows list: list plugins with debug levels set: set debug level for plugin @@ -154,6 +154,7 @@ command: command to execute (a '/' is automatically added if not found at beginn dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes) buffer: dump buffer content with hexadecimal values in log file color: display infos about current color pairs + hdata: display infos about hdata infolists: display infos about infolists memory: display infos about memory usage term: display infos about terminal diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index 4631c6581..4000b3920 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -3247,7 +3247,7 @@ Prototype: [source,C] ---------------------------------------- const char *weechat_hashtable_get_string (struct t_hashtable *hashtable, - void *property); + const char *property); ---------------------------------------- Arguments: @@ -6042,7 +6042,7 @@ weechat_hook_modifier ("2000|input_text_display", &modifier_cb, NULL); ---------------------------------------- Following hook types allow priority: command, command_run, signal, hsignal, -config, completion, modifier, info, infolist. +config, completion, modifier, info, info_hashtable, infolist, hdata. weechat_hook_command ^^^^^^^^^^^^^^^^^^^^ @@ -8173,6 +8173,62 @@ hook = weechat.hook_infolist("my_infolist", "Infolist with some data", "my_infolist_cb", "") ---------------------------------------- +weechat_hook_hdata +^^^^^^^^^^^^^^^^^^ + +Hook a hdata: callback will return pointer to hdata asked. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_hdata (const char *hdata_name, + const char *description, + struct t_hdata *(*callback)(void *data, + const char *hdata_name), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'hdata_name': name of hdata + (priority allowed, see note about <<hook_priority,priority>>) +* 'description': description +* 'callback': function called when hdata is asked, arguments and return + value: +** 'void *data': pointer +** 'const char *hdata_name': name of hdata +** return value: hdata asked +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hdata * +my_hdata_cb (void *data, const char *hdata_name) +{ + struct t_hdata *my_hdata; + + /* build hdata */ + /* ... */ + + return my_hdata; +} + +/* add hdata "my_hdata" */ +struct t_hook *my_hdata = weechat_hook_hdata ("my_hdata", + "Hdata for my structure", + &my_hdata_cb, NULL); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + weechat_unhook ^^^^^^^^^^^^^^ @@ -11101,6 +11157,13 @@ weechat_infolist_get Return infolist from WeeChat or a plugin. +[IMPORTANT] +Content of infolist is a duplication of actual data. So if you are asking +infolist with lot of data (like "buffer_lines"), WeeChat will allocate memory +to duplicate all data, and this can take some time. + +Instead of using big infolist, it is preferable to use hdata (but infolist may +have more info than hdata, which is raw data), see <<hdata,hdata>>. + Prototype: [source,C] @@ -11550,6 +11613,849 @@ weechat.infolist_free(infolist) weechat.infolist_free(infolist) ---------------------------------------- +[[hdata]] +Hdata +~~~~~ + +Functions for hdata (raw access to WeeChat or plugins data). + +[IMPORTANT] +Hdata provides read-only access to data. It is *STRICTLY FORBIDDEN* to write +something in memory pointed by hdata variables. + +weechat_hdata_new +^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Create a new hdata. + +[NOTE] +.hdata vs infolist +======================================== +Hdata is a fast way to read WeeChat or plugins data. It is similar to +infolist, but there are some differences: + +* it is faster and uses less memory: direct read of data without duplication +* it may have different info than infolist: it only raw data in structures + (infolist may add some extra data for convenience) +======================================== + +Prototype: + +[source,C] +---------------------------------------- +struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next); +---------------------------------------- + +Arguments: + +* 'hdata_name': name of hdata +* 'var_prev': name of variable in structure which is a pointer to previous + element in list (may be NULL if no such variable is available) +* 'var_next': name of variable in structure which is a pointer to next + element in list (may be NULL if no such variable is available) + +Return value: + +* pointer to new hdata + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +weechat_hdata_new_var +^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Create a new variable in hdata. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'name': variable name +* 'offset': offset of variable in structure +* 'type': variable type, one of: +** WEECHAT_HDATA_INTEGER +** WEECHAT_HDATA_LONG +** WEECHAT_HDATA_STRING +** WEECHAT_HDATA_POINTER +** WEECHAT_HDATA_TIME +** WEECHAT_HDATA_OTHER + +C example: + +[source,C] +---------------------------------------- +struct t_myplugin_list +{ + char *name; + struct t_gui_buffer *buffer; + int count; + struct t_myplugin_list *prev; + struct t_myplugin_list *next; +}; + +/* ... */ + +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING); +weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "count", offsetof (struct t_myplugin_list, count), WEECHAT_HDATA_INTEGER); +weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER); +---------------------------------------- + +The macro "WEECHAT_HDATA_VAR" can be used to shorten code: + +[source,C] +---------------------------------------- +WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING); +WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, count, INTEGER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +weechat_hdata_new_list +^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Create a new list pointer in hdata. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_hdata_new_list (struct t_hdata *hdata, const char *name, void *pointer); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'name': variable name +* 'pointer': list pointer + +C example: + +[source,C] +---------------------------------------- +struct t_myplugin_list +{ + char *name; + struct t_gui_buffer *buffer; + int count; + struct t_myplugin_list *prev; + struct t_myplugin_list *next; +}; + +struct t_myplugin_list *buffers = NULL; +struct t_myplugin_list *last_buffer = NULL; + +/* ... */ + +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING); +weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "count", offsetof (struct t_myplugin_list, count), WEECHAT_HDATA_INTEGER); +weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER); +weechat_hdata_new_list (hdata, "buffers", &buffers); +weechat_hdata_new_list (hdata, "last_buffer", &last_buffer); +---------------------------------------- + +The macro "WEECHAT_HDATA_LIST" can be used to shorten code: + +[source,C] +---------------------------------------- +WEECHAT_HDATA_LIST(buffers); +WEECHAT_HDATA_LIST(last_buffer); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +weechat_hdata_get +^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return hdata for a WeeChat or plugin structure. + +[NOTE] +Hdata does not contain data, it's only a hashtable with position of variables +in structure. That means you will need this hdata and a pointer to a +WeeChat/plugin object to read some data. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hdata *weechat_hdata_get (const char *hdata_name); +---------------------------------------- + +Arguments: + +* 'hdata_name': name of hdata: +include::autogen/plugin_api/hdata.txt[] + +Return value: + +* pointer to hdata, NULL if an error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("irc_server"); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +hdata = weechat.hdata_get(hdata_name) + +# example +hdata = weechat.hdata_get("irc_server") +---------------------------------------- + +weechat_hdata_get_var_offset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return offset of variable in hdata. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_hdata_get_var_offset (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'name': variable name + +Return value: + +* variable offset, 0 if an error occured + +C example: + +[source,C] +---------------------------------------- +int offset = weechat_hdata_get_var_offset (hdata, "name"); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +weechat_hdata_get_var_type +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return type of variable in hdata (as integer). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_hdata_get_var_type (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'name': variable name + +Return value: + +* variable type, -1 if an error occured + +C example: + +[source,C] +---------------------------------------- +int type = weechat_hdata_get_var_type (hdata, "name"); +switch (type) +{ + case WEECHAT_HDATA_INTEGER: + /* ... */ + break; + case WEECHAT_HDATA_LONG: + /* ... */ + break; + case WEECHAT_HDATA_STRING: + /* ... */ + break; + case WEECHAT_HDATA_POINTER: + /* ... */ + break; + case WEECHAT_HDATA_TIME: + /* ... */ + break; + case WEECHAT_HDATA_OTHER: + /* ... */ + break; + default: + /* variable not found */ + break; +} +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +weechat_hdata_get_var_type_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return type of variable in hdata (as string). + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_hdata_get_var_type_string (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'name': variable name + +Return value: + +* variable type, NULL if an error occured + +C example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "type = %s", + weechat_hdata_get_var_type_string (hdata, "name")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +type = weechat.hdata_get_var_type_string(hdata, name) + +# example +weechat.prnt("", "type = %s" % weechat.hdata_get_var_type_string("name")) +---------------------------------------- + +weechat_hdata_get_var +^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return pointer to content of variable in hdata. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_hdata_get_var (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name + +Return value: + +* pointer to content of variable, NULL if an error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +void *pointer = weechat_hdata_get_var (hdata, buffer, "name"); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +weechat_hdata_get_var_at_offset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return pointer to content of variable in hdata, using offset. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_hdata_get_var_at_offset (struct t_hdata *hdata, void *pointer, int offset); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'offset': offset of variable + +Return value: + +* pointer to content of variable, NULL if an error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +int offset = weechat_hdata_get_var_offset (hdata, "name"); +void *pointer = weechat_hdata_get_var_at_offset (hdata, buffer, offset); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +weechat_hdata_get_list +^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return list pointer from hdata. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_hdata_get_list (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'name': list name + +Return value: + +* list pointer, NULL if an error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffers = weechat_hdata_get_list (hdata, "gui_buffers"); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +list = weechat.hdata_get_list(hdata, name) + +# example +hdata = weechat.hdata_get("buffer") +buffers = weechat.hdata_get_list(hdata, "gui_buffers") +---------------------------------------- + +weechat_hdata_move +^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Move pointer to another element in list. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_hdata_move (struct t_hdata *hdata, void *pointer, int count); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to a WeeChat/plugin object +* 'count': number of jump(s) to execute (negative or positive integer, different + from 0) + +Return value: + +* pointer to element reached, NULL if an error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); + +/* move to next buffer, 2 times */ +buffer = weechat_hdata_move (hdata, buffer, 2); + +/* move to previous buffer */ +if (buffer) + buffer = weechat_hdata_move (hdata, buffer, -1); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +pointer = weechat.hdata_move(hdata, pointer, count) + +# example +hdata = weechat_hdata_get("buffer") +buffer = weechat.buffer_search_main() + +# move to next buffer, 2 times +buffer = weechat.hdata_move(hdata, buffer, 2) + +# move to previous buffer +if buffer: + buffer = weechat.hdata_move(hdata, buffer, -1) +---------------------------------------- + +weechat_hdata_integer +^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return value of integer variable in structure using hdata. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_hdata_integer (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "integer") + +Return value: + +* integer value of variable + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "number = %d", weechat_hdata_integer (hdata, buffer, "number")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_integer(hdata, pointer, name) + +# example +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "number = %d" % weechat.hdata_integer(hdata, buffer, "number")) +---------------------------------------- + +weechat_hdata_long +^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return value of long variable in structure using hdata. + +Prototype: + +[source,C] +---------------------------------------- +long weechat_hdata_long (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "long") + +Return value: + +* long value of variable + +C example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "longvar = %ld", weechat_hdata_long (hdata, pointer, "longvar")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_long(hdata, pointer, name) + +# example +weechat.prnt("", "longvar = %ld" % weechat.hdata_long(hdata, pointer, "longvar")) +---------------------------------------- + +weechat_hdata_string +^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return value of string variable in structure using hdata. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_hdata_string (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "string") + +Return value: + +* string value of variable + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "name = %s", weechat_hdata_string (hdata, buffer, "name")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_string(hdata, pointer, name) + +# example +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "name = %s" % weechat.hdata_string(hdata, buffer, "name")) +---------------------------------------- + +weechat_hdata_pointer +^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return value of pointer variable in structure using hdata. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_hdata_pointer (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "pointer") + +Return value: + +* pointer value of variable + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "lines = %lx", weechat_hdata_pointer (hdata, buffer, "lines")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_pointer(hdata, pointer, name) + +# example +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "lines = %lx" % weechat.hdata_pointer(hdata, buffer, "lines")) +---------------------------------------- + +weechat_hdata_time +^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return value of time variable in structure using hdata. + +Prototype: + +[source,C] +---------------------------------------- +time_t weechat_hdata_time (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "time") + +Return value: + +* time value of variable + +C example: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *ptr = weechat_buffer_search_main (); +ptr = weechat_hdata_pointer (hdata, ptr, "lines"); +if (ptr) +{ + hdata = weechat_hdata_get ("lines"); + ptr = weechat_hdata_pointer (hdata, ptr, "first_line"); + if (ptr) + { + hdata = weechat_hdata_get ("line"); + ptr = weechat_hdata_pointer (hdata, ptr, "data"); + if (ptr) + { + hdata = weechat_hdata_get ("line_data"); + time_t date = weechat_hdata_time (hdata, hdata, "date"); + weechat_printf (NULL, "time of last line displayed = %s", ctime (&date)); + } + } +} +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_time(hdata, pointer, name) + +# example +hdata = weechat.hdata_get("buffer") +ptr = weechat.buffer_search_main() +ptr = weechat.hdata_pointer(hdata, ptr, "lines") +if ptr: + hdata = weechat.hdata_get("lines") + ptr = weechat.hdata_pointer(hdata, ptr, "first_line") + if ptr: + hdata = weechat.hdata_get("line") + ptr = weechat.hdata_pointer(hdata, ptr, "data") + if ptr: + hdata = weechat.hdata_get("line_data") + weechat.prnt("", "time of last line displayed = %s" % weechat.hdata_time(hdata, ptr, "date")) +---------------------------------------- + +weechat_hdata_get_string +^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.6._ + +Return string value of a hdata property. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_hdata_get_string (struct t_hdata *hdata, const char *property); +---------------------------------------- + +Arguments: + +* 'hdata': hdata pointer +* 'property': property name: +** 'var_keys': string with list of keys for variables in hdata + (format: "key1,key2,key3") +** 'var_values': string with list of values for variables in hdata + (format: "value1,value2,value3") +** 'var_keys_values': string with list of keys and values for variables in hdata + (format: "key1:value1,key2:value2,key3:value3") +** 'var_prev': name of variable in structure which is a pointer to previous + element in list +** 'var_next': name of variable in structure which is a pointer to next + element in list +** 'list_keys': string with list of keys for lists in hdata + (format: "key1,key2,key3") +** 'list_values': string with list of values for lists in hdata + (format: "value1,value2,value3") +** 'list_keys_values': string with list of keys and values for lists in hdata + (format: "key1:value1,key2:value2,key3:value3") + +Return value: + +* string value of property + +C example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "variables in hdata: %s" weechat_hdata_get_string (hdata, "var_keys")); +weechat_printf (NULL, "lists in hdata: %s" weechat_hdata_get_string (hdata, "list_keys")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_get_string(hdata, property) + +# example +weechat.prnt("", "variables in hdata: %s" % weechat.hdata_get_string(hdata, "var_keys")) +weechat.prnt("", "lists in hdata: %s" % weechat.hdata_get_string(hdata, "list_keys")) +---------------------------------------- + [[upgrade]] Upgrade ~~~~~~~ diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt new file mode 100644 index 000000000..65db2c5a3 --- /dev/null +++ b/doc/fr/autogen/plugin_api/hdata.txt @@ -0,0 +1,659 @@ +[width="100%",cols="^1,^2,5,5,5",options="header"] +|======================================== +| Extension | Nom | Description | Variables | Listes + +| irc | irc_channel | canal irc | + 'type' (integer) + + 'name' (string) + + 'topic' (string) + + 'modes' (string) + + 'limit' (integer) + + 'key' (string) + + 'checking_away' (integer) + + 'away_message' (string) + + 'has_quit_server' (integer) + + 'cycle' (integer) + + 'part' (integer) + + 'display_creation_date' (integer) + + 'nick_completion_reset' (integer) + + 'pv_remote_nick_color' (string) + + 'hook_autorejoin' (pointer) + + 'nicks_count' (integer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'nicks_speaking' (pointer) + + 'nicks_speaking_time' (pointer) + + 'last_nick_speaking_time' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'prev_channel' (pointer) + + 'next_channel' (pointer) | + - + +| irc | irc_channel_speaking | channel_speaking irc | + 'nick' (string) + + 'time_last_message' (time) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_ignore | ignore irc | + 'number' (integer) + + 'mask' (string) + + 'regex_mask' (pointer) + + 'server' (string) + + 'channel' (string) + + 'prev_ignore' (pointer) + + 'next_ignore' (pointer) | + 'irc_ignore_list' + + 'last_irc_ignore' + +| irc | irc_nick | pseudo irc | + 'name' (string) + + 'host' (string) + + 'prefixes' (string) + + 'prefix' (string) + + 'away' (integer) + + 'color' (string) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_notify | notify irc | + 'server' (pointer) + + 'nick' (string) + + 'check_away' (integer) + + 'is_on_server' (integer) + + 'away_message' (string) + + 'ison_received' (integer) + + 'prev_notify' (pointer) + + 'next_notify' (pointer) | + - + +| irc | irc_redirect | redirection irc | + 'server' (pointer) + + 'pattern' (string) + + 'signal' (string) + + 'count' (integer) + + 'current_count' (integer) + + 'string' (string) + + 'timeout' (integer) + + 'command' (string) + + 'start_time' (time) + + 'cmd_start' (pointer) + + 'cmd_stop' (pointer) + + 'cmd_extra' (pointer) + + 'cmd_start_received' (integer) + + 'cmd_stop_received' (integer) + + 'cmd_filter' (pointer) + + 'output' (string) + + 'output_size' (integer) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + - + +| irc | irc_redirect_pattern | modèle pour une redirection irc | + 'name' (string) + + 'temp_pattern' (integer) + + 'timeout' (integer) + + 'cmd_start' (string) + + 'cmd_stop' (string) + + 'cmd_extra' (string) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + 'irc_redirect_patterns' + + 'last_irc_redirect_pattern' + +| irc | irc_server | serveur irc | + 'name' (string) + + 'options' (pointer) + + 'temp_server' (integer) + + 'reloading_from_config' (integer) + + 'reloaded_from_config' (integer) + + 'addresses_count' (integer) + + 'addresses_array' (pointer) + + 'ports_array' (pointer) + + 'index_current_address' (integer) + + 'current_address' (string) + + 'current_ip' (string) + + 'current_port' (integer) + + 'sock' (integer) + + 'hook_connect' (pointer) + + 'hook_fd' (pointer) + + 'hook_timer_connection' (pointer) + + 'hook_timer_sasl' (pointer) + + 'is_connected' (integer) + + 'ssl_connected' (integer) + + 'gnutls_sess' (other) + + 'tls_cert' (other) + + 'tls_cert_key' (other) + + 'unterminated_message' (string) + + 'nicks_count' (integer) + + 'nicks_array' (pointer) + + 'nick_first_tried' (integer) + + 'nick' (string) + + 'nick_modes' (string) + + 'isupport' (string) + + 'prefix_modes' (string) + + 'prefix_chars' (string) + + 'reconnect_delay' (integer) + + 'reconnect_start' (time) + + 'command_time' (time) + + 'reconnect_join' (integer) + + 'disable_autojoin' (integer) + + 'is_away' (integer) + + 'away_message' (string) + + 'away_time' (time) + + 'lag' (integer) + + 'lag_check_time' (other) + + 'lag_next_check' (time) + + 'lag_last_refresh' (time) + + 'cmd_list_regexp' (pointer) + + 'last_user_message' (time) + + 'last_away_check' (time) + + 'outqueue' (pointer) + + 'last_outqueue' (pointer) + + 'redirects' (pointer) + + 'last_redirect' (pointer) + + 'notify_list' (pointer) + + 'last_notify' (pointer) + + 'manual_joins' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'channels' (pointer) + + 'last_channel' (pointer) + + 'prev_server' (pointer) + + 'next_server' (pointer) | + 'irc_servers' + + 'last_irc_server' + +| weechat | bar | barre | + 'name' (string) + + 'options' (pointer) + + 'conditions_count' (integer) + + 'conditions_array' (pointer) + + 'items_count' (integer) + + 'items_subcount' (pointer) + + 'items_array' (pointer) + + 'bar_window' (pointer) + + 'bar_refresh_needed' (integer) + + 'prev_bar' (pointer) + + 'next_bar' (pointer) | + 'gui_bars' + + 'last_gui_bar' + +| weechat | bar_item | objet de barre | + 'plugin' (pointer) + + 'name' (string) + + 'build_callback' (pointer) + + 'build_callback_data' (pointer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + 'gui_bar_items' + + 'last_gui_bar_item' + +| weechat | buffer | tampon | + 'plugin' (pointer) + + 'plugin_name_for_upgrade' (string) + + 'merge_for_upgrade' (pointer) + + 'number' (integer) + + 'layout_number' (integer) + + 'layout_applied' (integer) + + 'name' (string) + + 'short_name' (string) + + 'type' (integer) + + 'notify' (integer) + + 'num_displayed' (integer) + + 'active' (integer) + + 'print_hooks_enabled' (integer) + + 'close_callback' (pointer) + + 'close_callback_data' (pointer) + + 'title' (string) + + 'own_lines' (pointer) + + 'mixed_lines' (pointer) + + 'lines' (pointer) + + 'time_for_each_line' (integer) + + 'chat_refresh_needed' (integer) + + 'nicklist' (integer) + + 'nicklist_case_sensitive' (integer) + + 'nicklist_root' (pointer) + + 'nicklist_max_length' (integer) + + 'nicklist_display_groups' (integer) + + 'nicklist_visible_count' (integer) + + 'input' (integer) + + 'input_callback' (pointer) + + 'input_callback_data' (pointer) + + 'input_get_unknown_commands' (integer) + + 'input_buffer' (string) + + 'input_buffer_alloc' (integer) + + 'input_buffer_size' (integer) + + 'input_buffer_length' (integer) + + 'input_buffer_pos' (integer) + + 'input_buffer_1st_display' (integer) + + 'input_undo_snap' (pointer) + + 'input_undo' (pointer) + + 'last_input_undo' (pointer) + + 'ptr_input_undo' (pointer) + + 'input_undo_count' (integer) + + 'completion' (pointer) + + 'history' (pointer) + + 'last_history' (pointer) + + 'ptr_history' (pointer) + + 'num_history' (integer) + + 'text_search' (integer) + + 'text_search_exact' (integer) + + 'text_search_found' (integer) + + 'text_search_input' (string) + + 'highlight_words' (string) + + 'highlight_tags' (string) + + 'highlight_tags_count' (integer) + + 'highlight_tags_array' (pointer) + + 'hotlist_max_level_nicks' (pointer) + + 'keys' (pointer) + + 'last_key' (pointer) + + 'keys_count' (integer) + + 'local_variables' (pointer) + + 'prev_buffer' (pointer) + + 'next_buffer' (pointer) | + 'gui_buffers' + + 'last_gui_buffer' + +| weechat | completion | complétion | + 'buffer' (pointer) + + 'context' (integer) + + 'base_command' (string) + + 'base_command_arg_index' (integer) + + 'base_word' (string) + + 'base_word_pos' (integer) + + 'position' (integer) + + 'args' (string) + + 'direction' (integer) + + 'add_space' (integer) + + 'force_partial_completion' (integer) + + 'completion_list' (pointer) + + 'word_found' (string) + + 'word_found_is_nick' (integer) + + 'position_replace' (integer) + + 'diff_size' (integer) + + 'diff_length' (integer) + + 'partial_completion_list' (pointer) + + 'last_partial_completion' (pointer) | + - + +| weechat | completion_partial | complétion partielle | + 'word' (string) + + 'count' (integer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + - + +| weechat | config_file | fichier de configuration | + 'plugin' (pointer) + + 'name' (string) + + 'filename' (string) + + 'file' (pointer) + + 'callback_reload' (pointer) + + 'callback_reload_data' (pointer) + + 'sections' (pointer) + + 'last_section' (pointer) + + 'prev_config' (pointer) + + 'next_config' (pointer) | + 'config_files' + + 'last_config_file' + +| weechat | config_option | option de configuration | + 'config_file' (pointer) + + 'section' (pointer) + + 'name' (string) + + 'type' (integer) + + 'description' (string) + + 'string_values' (pointer) + + 'min' (integer) + + 'max' (integer) + + 'default_value' (pointer) + + 'value' (pointer) + + 'null_value_allowed' (integer) + + 'callback_check_value' (pointer) + + 'callback_check_value_data' (pointer) + + 'callback_change' (pointer) + + 'callback_change_data' (pointer) + + 'callback_delete' (pointer) + + 'callback_delete_data' (pointer) + + 'loaded' (integer) + + 'prev_option' (pointer) + + 'next_option' (pointer) | + - + +| weechat | config_section | section de configuration | + 'config_file' (pointer) + + 'name' (string) + + 'user_can_add_options' (integer) + + 'user_can_delete_options' (integer) + + 'callback_read' (pointer) + + 'callback_read_data' (pointer) + + 'callback_write' (pointer) + + 'callback_write_data' (pointer) + + 'callback_write_default' (pointer) + + 'callback_write_default_data' (pointer) + + 'callback_create_option' (pointer) + + 'callback_create_option_data' (pointer) + + 'callback_delete_option' (pointer) + + 'callback_delete_option_data' (pointer) + + 'options' (pointer) + + 'last_option' (pointer) + + 'prev_section' (pointer) + + 'next_section' (pointer) | + - + +| weechat | filter | filtre | + 'enabled' (integer) + + 'name' (string) + + 'buffer_name' (string) + + 'num_buffers' (integer) + + 'buffers' (pointer) + + 'tags' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'regex' (string) + + 'regex_prefix' (pointer) + + 'regex_message' (pointer) + + 'prev_filter' (pointer) + + 'next_filter' (pointer) | + 'gui_filters' + + 'last_gui_filter' + +| weechat | history | historique des commandes dans le tampon | + 'text' (string) + + 'next_history' (pointer) + + 'prev_history' (pointer) | + - + +| weechat | hook | hook (variables communes à tous les types de hooks) | + 'plugin' (pointer) + + 'type' (integer) + + 'deleted' (integer) + + 'running' (integer) + + 'priority' (integer) + + 'callback_data' (pointer) + + 'hook_data' (pointer) + + 'prev_hook' (pointer) + + 'next_hook' (pointer) | + - + +| weechat | hook_command | hook de type "command" | + 'callback' (pointer) + + 'command' (string) + + 'description' (string) + + 'args' (string) + + 'args_description' (string) + + 'completion' (string) + + 'cplt_num_templates' (integer) + + 'cplt_templates' (pointer) + + 'cplt_templates_static' (pointer) + + 'cplt_template_num_args' (pointer) + + 'cplt_template_args' (pointer) + + 'cplt_template_num_args_concat' (integer) + + 'cplt_template_args_concat' (pointer) | + 'last_weechat_hook_command' + + 'weechat_hooks_command' + +| weechat | hook_command_run | hook de type "command_run" | + 'callback' (pointer) + + 'command' (string) | + 'last_weechat_hook_command_run' + + 'weechat_hooks_command_run' + +| weechat | hook_completion | hook de type "completion" | + 'callback' (pointer) + + 'completion_item' (string) + + 'description' (string) | + 'last_weechat_hook_completion' + + 'weechat_hooks_completion' + +| weechat | hook_config | hook de type "config" | + 'callback' (pointer) + + 'option' (string) | + 'last_weechat_hook_config' + + 'weechat_hooks_config' + +| weechat | hook_connect | hook de type "connect" | + 'callback' (pointer) + + 'proxy' (string) + + 'address' (string) + + 'port' (integer) + + 'sock' (integer) + + 'ipv6' (integer) + + 'gnutls_sess' (pointer) + + 'gnutls_cb' (pointer) + + 'gnutls_dhkey_size' (integer) + + 'gnutls_priorities' (string) + + 'local_hostname' (string) + + 'child_read' (integer) + + 'child_write' (integer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'handshake_hook_fd' (pointer) + + 'handshake_hook_timer' (pointer) + + 'handshake_fd_flags' (integer) + + 'handshake_ip_address' (string) | + 'last_weechat_hook_connect' + + 'weechat_hooks_connect' + +| weechat | hook_fd | hook de type "fd" | + 'callback' (pointer) + + 'fd' (integer) + + 'flags' (integer) | + 'last_weechat_hook_fd' + + 'weechat_hooks_fd' + +| weechat | hook_hdata | hook de type "hdata" | + 'callback' (pointer) + + 'hdata_name' (string) + + 'description' (string) | + 'last_weechat_hook_hdata' + + 'weechat_hooks_hdata' + +| weechat | hook_hsignal | hook de type "hsignal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_hsignal' + + 'weechat_hooks_hsignal' + +| weechat | hook_info | hook de type "info" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) | + 'last_weechat_hook_info' + + 'weechat_hooks_info' + +| weechat | hook_info_hashtable | hook de type "info_hashtable" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) + + 'output_description' (string) | + 'last_weechat_hook_info_hashtable' + + 'weechat_hooks_info_hashtable' + +| weechat | hook_infolist | hook de type "infolist" | + 'callback' (pointer) + + 'infolist_name' (string) + + 'description' (string) + + 'pointer_description' (string) + + 'args_description' (string) | + 'last_weechat_hook_infolist' + + 'weechat_hooks_infolist' + +| weechat | hook_modifier | hook de type "modifier" | + 'callback' (pointer) + + 'modifier' (string) | + 'last_weechat_hook_modifier' + + 'weechat_hooks_modifier' + +| weechat | hook_print | hook de type "print" | + 'callback' (pointer) + + 'buffer' (pointer) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'message' (string) + + 'strip_colors' (integer) | + 'last_weechat_hook_print' + + 'weechat_hooks_print' + +| weechat | hook_process | hook de type "process" | + 'callback' (pointer) + + 'command' (string) + + 'timeout' (long) + + 'child_read' (pointer) + + 'child_write' (pointer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'hook_timer' (pointer) + + 'buffer' (pointer) + + 'buffer_size' (pointer) | + 'last_weechat_hook_process' + + 'weechat_hooks_process' + +| weechat | hook_signal | hook de type "signal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_signal' + + 'weechat_hooks_signal' + +| weechat | hook_timer | hook de type "timer" | + 'callback' (pointer) + + 'interval' (long) + + 'align_second' (integer) + + 'remaining_calls' (integer) + + 'last_exec' (other) + + 'next_exec' (other) | + 'last_weechat_hook_timer' + + 'weechat_hooks_timer' + +| weechat | input_undo | undo pour la ligne de commande | + 'data' (string) + + 'pos' (integer) + + 'prev_undo' (pointer) + + 'next_undo' (pointer) | + - + +| weechat | key | touche | + 'key' (string) + + 'command' (string) + + 'prev_key' (pointer) + + 'next_key' (pointer) | + 'gui_default_keys' + + 'gui_keys' + + 'last_gui_default_key' + + 'last_gui_key' + +| weechat | line | ligne | + 'data' (pointer) + + 'prev_line' (pointer) + + 'next_line' (pointer) | + - + +| weechat | line_data | données de la ligne | + 'buffer' (pointer) + + 'y' (integer) + + 'date' (time) + + 'date_printed' (time) + + 'str_time' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'displayed' (integer) + + 'highlight' (integer) + + 'refresh_needed' (integer) + + 'prefix' (string) + + 'prefix_length' (integer) + + 'message' (string) | + - + +| weechat | lines | lignes | + 'first_line' (pointer) + + 'last_line' (pointer) + + 'last_read_line' (pointer) + + 'lines_count' (integer) + + 'first_line_not_read' (integer) + + 'lines_hidden' (integer) + + 'buffer_max_length' (integer) + + 'prefix_max_length' (integer) | + - + +| weechat | nick | pseudo dans la liste de pseudos | + 'group' (pointer) + + 'name' (string) + + 'color' (string) + + 'prefix' (string) + + 'prefix_color' (string) + + 'visible' (integer) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| weechat | nick_group | groupe dans la liste de pseudos | + 'name' (string) + + 'color' (string) + + 'visible' (integer) + + 'level' (integer) + + 'parent' (pointer) + + 'childs' (pointer) + + 'last_child' (pointer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'prev_group' (pointer) + + 'next_group' (pointer) | + - + +| weechat | window | fenêtre | + 'win_x' (integer) + + 'win_y' (integer) + + 'win_width' (integer) + + 'win_height' (integer) + + 'win_width_pct' (integer) + + 'win_height_pct' (integer) + + 'win_chat_x' (integer) + + 'win_chat_y' (integer) + + 'win_chat_width' (integer) + + 'win_chat_height' (integer) + + 'win_chat_cursor_x' (integer) + + 'win_chat_cursor_y' (integer) + + 'bar_windows' (pointer) + + 'last_bar_window' (pointer) + + 'refresh_needed' (integer) + + 'gui_objects' (pointer) + + 'buffer' (pointer) + + 'layout_plugin_name' (string) + + 'layout_buffer_name' (string) + + 'scroll' (pointer) + + 'ptr_tree' (pointer) + + 'prev_window' (pointer) + + 'next_window' (pointer) | + 'gui_current_window' + + 'gui_windows' + + 'last_gui_window' + +| weechat | window_scroll | info de défilement dans la fenêtre | + 'buffer' (pointer) + + 'first_line_displayed' (integer) + + 'start_line' (pointer) + + 'start_line_pos' (integer) + + 'scrolling' (integer) + + 'start_col' (integer) + + 'lines_after' (integer) + + 'reset_allowed' (integer) + + 'prev_scroll' (pointer) + + 'next_scroll' (pointer) | + - + +| weechat | window_tree | arbre des fenêtres | + 'parent_node' (pointer) + + 'split_pct' (integer) + + 'split_horizontal' (integer) + + 'child1' (pointer) + + 'child2' (pointer) + + 'window' (pointer) | + 'gui_windows_tree' + +|======================================== diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt index 8d9a6eb4b..4b648eedb 100644 --- a/doc/fr/autogen/user/weechat_commands.txt +++ b/doc/fr/autogen/user/weechat_commands.txt @@ -145,7 +145,7 @@ extension: nom de l'extension ('weechat' pour une commande interne WeeChat) /debug list set <extension> <niveau> dump [<extension>] - buffer|color|infolists|memory|term|windows + buffer|color|hdata|infolists|memory|term|windows list: lister les extensions avec leur niveau de debug set: définir le niveau de debug pour l'extension @@ -154,6 +154,7 @@ extension: nom de l'extension ("core" pour le coeur de WeeChat) dump: afficher les variables mémoire WeeChat dans le fichier log (les mêmes messages sont affichés lorsque WeeChat plante) buffer: afficher le contenu du tampon en valeurs hexadécimales dans le fichier log color: afficher des infos sur les paires de couleur courantes + hdata: afficher des infos sur les hdata infolists: afficher des infos sur les infolists memory: afficher des infos sur l'utilisation de la mémoire term: afficher des infos sur le terminal diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index 83fa61591..7090c3e0c 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -3279,7 +3279,7 @@ Prototype : [source,C] ---------------------------------------- const char *weechat_hashtable_get_string (struct t_hashtable *hashtable, - void *property); + const char *property); ---------------------------------------- Paramètres : @@ -6109,7 +6109,7 @@ weechat_hook_modifier ("2000|input_text_display", &modifier_cb, NULL); ---------------------------------------- Les types de "hooks" suivants autorisent une priorité : command, command_run, -signal, hsignal, config, completion, modifier, info, infolist. +signal, hsignal, config, completion, modifier, info, info_hashtable, infolist, hdata. weechat_hook_command ^^^^^^^^^^^^^^^^^^^^ @@ -8303,6 +8303,63 @@ hook = weechat.hook_infolist("mon_infolist", "Mon infolist", "my_infolist_cb", "") ---------------------------------------- +weechat_hook_hdata +^^^^^^^^^^^^^^^^^^ + +Accroche un hdata : le "callback" retournera un pointeur vers le hdata demandé. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_hdata (const char *hdata_name, + const char *description, + struct t_hdata *(*callback)(void *data, + const char *hdata_name), + void *callback_data); +---------------------------------------- + +Paramètres : + +* 'hdata_name' : nom du hdata + (priorité autorisée, voir la note sur la <<hook_priority,priorité>>) +* 'description' : description +* 'callback' : fonction appelée quand le hdata est demandé, paramètres et valeur + de retour : +** 'void *data' : pointeur +** 'const char *hdata_name' : nom du hdata +** valeur de retour : hdata demandé +* 'callback_data' : pointeur donné au "callback" lorsqu'il est appelé par + WeeChat + +Valeur de retour : + +* pointeur vers le nouveau "hook", NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata * +my_hdata_cb (void *data, const char *hdata_name) +{ + struct t_hdata *mon_hdata; + + /* construction du hdata */ + /* ... */ + + return mon_hdata; +} + +/* ajouts le hdata "mon_hdata" */ +struct t_hook *my_hdata = weechat_hook_hdata ("mon_hdata", + "Hdata pour ma structure", + &my_hdata_cb, NULL); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_unhook ^^^^^^^^^^^^^^ @@ -11274,6 +11331,15 @@ weechat_infolist_get Retourne une "infolist" de WeeChat ou d'une extension. +[IMPORTANT] +Le contenu d'une infolist est une duplication des données réelles. Donc si vous +demandez une infolist avec beaucoup de données (comme "buffer_lines"), WeeChat +allouera de la mémoire pour dupliquer toutes les données, et cela peut prendre +du temps. + +Au lieu d'utiliser une grosse infolist, il est préférable d'utiliser un hdata +(mais l'infolist peut contenir plus de données que le hdata, qui contient des +données brutes), voir <<hdata,hdata>>. + Prototype : [source,C] @@ -11733,6 +11799,861 @@ weechat.infolist_free(infolist) weechat.infolist_free(infolist) ---------------------------------------- +[[hdata]] +Hdata +~~~~~ + +Fonctions pour les hdata (accès brut aux données de WeeChat ou des extensions). + +[IMPORTANT] +Le "hdata" fournit seulement un accès en lecture seule aux données. Il est +*STRICTEMENT INTERDIT* d'écrire quelque chose dans une zone mémoire pointée par +les variables du hdata. + +weechat_hdata_new +^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Créé un "hdata". + +[NOTE] +.hdata vs infolist +======================================== +Le "hdata" est un moyen rapide de lire des données de WeeChat ou des extensions. +Il est similaire à l'infolist, mais il y a quelques différences : + +* il est plus rapide et utilise moins de mémoire : accès direct aux données sans + duplication +* il peut contenir des informations différentes de l'infolist : il contient les + données brutes des structures (l'infolist peut ajouter des données + supplémentaires pour plus de commodité) +======================================== + +Prototype : + +[source,C] +---------------------------------------- +struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next); +---------------------------------------- + +Paramètres : + +* 'hdata_name' : nom du hdata +* 'var_prev' : nom de la variable dans la structure qui est un pointeur vers + l'élément précédent dans la liste (peut être NULL si une telle variable + n'existe pas) +* 'var_next' : nom de la variable dans la structure qui est un pointeur vers + l'élément suivant dans la liste (peut être NULL si une telle variable + n'existe pas) + +Valeur de retour : + +* pointeur vers le nouveau "hdata" + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hdata_new_var +^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Créé une nouvelle variable dans le hdata. + +Prototype : + +[source,C] +---------------------------------------- +void weechat_hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'name' : nom de la variable +* 'offset' : position (offset) de la variable dans la structure +* 'type' : type de la variable, un parmi ceux-ci : +** WEECHAT_HDATA_INTEGER +** WEECHAT_HDATA_LONG +** WEECHAT_HDATA_STRING +** WEECHAT_HDATA_POINTER +** WEECHAT_HDATA_TIME +** WEECHAT_HDATA_OTHER + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_myplugin_list +{ + char *name; + struct t_gui_buffer *buffer; + int count; + struct t_myplugin_list *prev; + struct t_myplugin_list *next; +}; + +/* ... */ + +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING); +weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "count", offsetof (struct t_myplugin_list, count), WEECHAT_HDATA_INTEGER); +weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER); +---------------------------------------- + +La macro "WEECHAT_HDATA_VAR" peut être utilisée pour raccourcir le code : + +[source,C] +---------------------------------------- +WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING); +WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, count, INTEGER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hdata_new_list +^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Créé un nouveau pointer vers une liste dans le hdata. + +Prototype : + +[source,C] +---------------------------------------- +void weechat_hdata_new_list (struct t_hdata *hdata, const char *name, void *pointer); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'name' : nom de la variable +* 'pointer' : pointeur vers la liste + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_myplugin_list +{ + char *name; + struct t_gui_buffer *buffer; + int count; + struct t_myplugin_list *prev; + struct t_myplugin_list *next; +}; + +struct t_myplugin_list *buffers = NULL; +struct t_myplugin_list *last_buffer = NULL; + +/* ... */ + +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING); +weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "count", offsetof (struct t_myplugin_list, count), WEECHAT_HDATA_INTEGER); +weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER); +weechat_hdata_new_list (hdata, "buffers", &buffers); +weechat_hdata_new_list (hdata, "last_buffer", &last_buffer); +---------------------------------------- + +La macro "WEECHAT_HDATA_LIST" peut être utilisée pour raccourcir le code : + +[source,C] +---------------------------------------- +WEECHAT_HDATA_LIST(buffers); +WEECHAT_HDATA_LIST(last_buffer); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hdata_get +^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne un "hdata" pour une structure de WeeChat ou d'une extension. + +[NOTE] +Le "hdata" ne contient aucune donnée, il s'agit seulement d'une hashtable avec +la position (offset) des variables dans la structure. Cela signifie que vous +aurez besoin de ce hdata et d'un pointeur vers un objet WeeChat ou d'une +extension pour lire des données. + +Prototype : + +[source,C] +---------------------------------------- +struct t_hdata *weechat_hdata_get (const char *hdata_name); +---------------------------------------- + +Paramètres : + +* 'hdata_name' : nom du hdata : +include::autogen/plugin_api/hdata.txt[] + +Valeur de retour : + +* pointeur vers le hdata, NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("irc_server"); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +hdata = weechat.hdata_get(hdata_name) + +# exemple +hdata = weechat.hdata_get("irc_server") +---------------------------------------- + +weechat_hdata_get_var_offset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne la position (offset) de la variable dans le hdata. + +Prototype : + +[source,C] +---------------------------------------- +int weechat_hdata_get_var_offset (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'name' : nom de la variable + +Valeur de retour : + +* position (offset) de la variable, 0 en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +int offset = weechat_hdata_get_var_offset (hdata, "name"); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hdata_get_var_type +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne le type de la variable dans le hdata (sous forme d'entier). + +Prototype : + +[source,C] +---------------------------------------- +int weechat_hdata_get_var_type (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'name' : nom de la variable + +Valeur de retour : + +* type de la variable, -1 en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +int type = weechat_hdata_get_var_type (hdata, "name"); +switch (type) +{ + case WEECHAT_HDATA_INTEGER: + /* ... */ + break; + case WEECHAT_HDATA_LONG: + /* ... */ + break; + case WEECHAT_HDATA_STRING: + /* ... */ + break; + case WEECHAT_HDATA_POINTER: + /* ... */ + break; + case WEECHAT_HDATA_TIME: + /* ... */ + break; + case WEECHAT_HDATA_OTHER: + /* ... */ + break; + default: + /* variable non trouvée */ + break; +} +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hdata_get_var_type_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne le type de la variable dans le hdata (sous forme de chaîne). + +Prototype : + +[source,C] +---------------------------------------- +const char *weechat_hdata_get_var_type_string (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'name' : nom de la variable + +Valeur de retour : + +* type de la variable, NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +weechat_printf (NULL, "type = %s", + weechat_hdata_get_var_type_string (hdata, "name")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +type = weechat.hdata_get_var_type_string(hdata, name) + +# exemple +weechat.prnt("", "type = %s" % weechat.hdata_get_var_type_string("name")) +---------------------------------------- + +weechat_hdata_get_var +^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne un pointeur vers le contenu de la variable dans le hdata. + +Prototype : + +[source,C] +---------------------------------------- +void *weechat_hdata_get_var (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'name' : nom de la variable + +Valeur de retour : + +* pointeur vers le contenu de la variable, NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +void *pointer = weechat_hdata_get_var (hdata, buffer, "name"); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hdata_get_var_at_offset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne un pointeur vers le contenu de la variable dans le hdata, en utilisant +une position (offset). + +Prototype : + +[source,C] +---------------------------------------- +void *weechat_hdata_get_var_at_offset (struct t_hdata *hdata, void *pointer, int offset); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'offset' : position (offset) de la variable + +Valeur de retour : + +* pointeur vers le contenu de la variable, NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +int offset = weechat_hdata_get_var_offset (hdata, "name"); +void *pointer = weechat_hdata_get_var_at_offset (hdata, buffer, offset); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hdata_get_list +^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne un pointeur de liste du hdata. + +Prototype : + +[source,C] +---------------------------------------- +void *weechat_hdata_get_list (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'name' : nom de la liste + +Valeur de retour : + +* pointeur vers la liste, NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffers = weechat_hdata_get_list (hdata, "gui_buffers"); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +list = weechat.hdata_get_list(hdata, name) + +# exemple +hdata = weechat.hdata_get("buffer") +buffers = weechat.hdata_get_list(hdata, "gui_buffers") +---------------------------------------- + +weechat_hdata_move +^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Déplace le pointeur vers un autre élément dans la liste. + +Prototype : + +[source,C] +---------------------------------------- +void *weechat_hdata_move (struct t_hdata *hdata, void *pointer, int count); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'count' : nombre de saut(s) à exécuter (entier négatif ou positif, différent + de 0) + +Valeur de retour : + +* pointeur vers l'élément atteint, NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); + +/* se déplacer au tampon suivant, 2 fois */ +buffer = weechat_hdata_move (hdata, buffer, 2); + +/* se déplacer au tampon précédent */ +if (buffer) + buffer = weechat_hdata_move (hdata, buffer, -1); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +pointer = weechat.hdata_move(hdata, pointer, count) + +# exemple +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() + +# se déplacer au tampon suivant, 2 fois +buffer = weechat.hdata_move(hdata, buffer, 2) + +# se déplacer au tampon précédent +if buffer: + buffer = weechat.hdata_move(hdata, buffer, -1) +---------------------------------------- + +weechat_hdata_integer +^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne la valeur de la variable dans la structure en utilisant le hdata, sous +forme d'entier. + +Prototype : + +[source,C] +---------------------------------------- +int weechat_hdata_integer (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'name' : nom de la variable (doit être de type "integer") + +Valeur de retour : + +* valeur de la variable, sous forme d'entier + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "number = %d", weechat_hdata_integer (hdata, buffer, "number")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_integer(hdata, pointer, name) + +# exemple +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "number = %d" % weechat.hdata_integer(hdata, buffer, "number")) +---------------------------------------- + +weechat_hdata_long +^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne la valeur de la variable dans la structure en utilisant le hdata, sous +forme d'entier long. + +Prototype : + +[source,C] +---------------------------------------- +long weechat_hdata_long (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'name' : nom de la variable (doit être de type "long") + +Valeur de retour : + +* valeur de la variable, sous forme d'entier long + +Exemple en C : + +[source,C] +---------------------------------------- +weechat_printf (NULL, "longvar = %ld", weechat_hdata_long (hdata, pointer, "longvar")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_long(hdata, pointer, name) + +# exemple +weechat.prnt("", "longvar = %ld" % weechat.hdata_long(hdata, pointer, "longvar")) +---------------------------------------- + +weechat_hdata_string +^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne la valeur de la variable dans la structure en utilisant le hdata, sous +forme de chaîne. + +Prototype : + +[source,C] +---------------------------------------- +const char *weechat_hdata_string (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'name' : nom de la variable (doit être de type "string") + +Valeur de retour : + +* valeur de la variable, sous forme de chaîne + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "name = %s", weechat_hdata_string (hdata, buffer, "name")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_string(hdata, pointer, name) + +# exemple +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "name = %s" % weechat.hdata_string(hdata, buffer, "name")) +---------------------------------------- + +weechat_hdata_pointer +^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne la valeur de la variable dans la structure en utilisant le hdata, sous +forme de pointeur. + +Prototype : + +[source,C] +---------------------------------------- +void *weechat_hdata_pointer (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'name' : nom de la variable (doit être de type "pointeur") + +Valeur de retour : + +* valeur de la variable, sous forme de pointeur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "lines = %lx", weechat_hdata_pointer (hdata, buffer, "lines")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_pointer(hdata, pointer, name) + +# exemple +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "lines = %lx" % weechat.hdata_pointer(hdata, buffer, "lines")) +---------------------------------------- + +weechat_hdata_time +^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne la valeur de la variable dans la structure en utilisant le hdata, sous +forme de date/heure. + +Prototype : + +[source,C] +---------------------------------------- +time_t weechat_hdata_time (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'pointer' : pointeur vers un objet WeeChat ou d'une extension +* 'name' : nom de la variable (doit être de type "time") + +Valeur de retour : + +* valeur de la variable, sous forme de date/heure + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *ptr = weechat_buffer_search_main (); +ptr = weechat_hdata_pointer (hdata, ptr, "lines"); +if (ptr) +{ + hdata = weechat_hdata_get ("lines"); + ptr = weechat_hdata_pointer (hdata, ptr, "first_line"); + if (ptr) + { + hdata = weechat_hdata_get ("line"); + ptr = weechat_hdata_pointer (hdata, ptr, "data"); + if (ptr) + { + hdata = weechat_hdata_get ("line_data"); + time_t date = weechat_hdata_time (hdata, hdata, "date"); + weechat_printf (NULL, "heure de la première ligne affichée = %s", ctime (&date)); + } + } +} +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_time(hdata, pointer, name) + +# exemple +hdata = weechat.hdata_get("buffer") +ptr = weechat.buffer_search_main() +ptr = weechat.hdata_pointer(hdata, ptr, "lines") +if ptr: + hdata = weechat.hdata_get("lines") + ptr = weechat.hdata_pointer(hdata, ptr, "first_line") + if ptr: + hdata = weechat.hdata_get("line") + ptr = weechat.hdata_pointer(hdata, ptr, "data") + if ptr: + hdata = weechat.hdata_get("line_data") + weechat.prnt("", "heure de la première ligne affichée = %s" % weechat.hdata_time(hdata, ptr, "date")) +---------------------------------------- + +weechat_hdata_get_string +^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.6._ + +Retourne une valeur pour une propriété d'un hdata sous forme de chaîne. + +Prototype : + +[source,C] +---------------------------------------- +const char *weechat_hdata_get_string (struct t_hdata *hdata, const char *property); +---------------------------------------- + +Paramètres : + +* 'hdata' : pointeur vers le hdata +* 'property' : nom de la propriété : +** 'var_keys' : chaîne avec la liste des clés pour les variables du hdata + (format : "key1,key2,key3") +** 'var_values' : chaîne avec la liste des valeurs pour les variables du hdata + (format : "value1,value2,value3") +** 'var_keys_values' : chaîne avec la liste des clés et valeurs pour les + variables du hdata (format : "key1:value1,key2:value2,key3:value3") +** 'var_prev' : nom de la variable dans la structure qui est un pointeur vers + l'élément précédent dans la liste +** 'var_next' : nom de la variable dans la structure qui est un pointeur vers + l'élément suivant dans la liste +** 'list_keys' : chaîne avec la liste des clés pour les listes du hdata + (format : "key1,key2,key3") +** 'list_values' : chaîne avec la liste des valeurs pour les listes du hdata + (format : "value1,value2,value3") +** 'list_keys_values' : chaîne avec la liste des clés et valeurs pour les listes + du hdata (format : "key1:value1,key2:value2,key3:value3") + +Valeur de retour : + +* valeur de la propriété sous forme de chaîne + +Exemple en C : + +[source,C] +---------------------------------------- +weechat_printf (NULL, "variables dans le hdata: %s" weechat_hdata_get_string (hdata, "var_keys")); +weechat_printf (NULL, "listes dans le hdata: %s" weechat_hdata_get_string (hdata, "list_keys")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +value = weechat.hdata_get_string(hdata, property) + +# exemple +weechat.prnt("", "variables dans le hdata: %s" % weechat.hdata_get_string(hdata, "var_keys")) +weechat.prnt("", "listes dans le hdata: %s" % weechat.hdata_get_string(hdata, "list_keys")) +---------------------------------------- + [[upgrade]] Mise à jour ~~~~~~~~~~~ diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt new file mode 100644 index 000000000..dfe1344d0 --- /dev/null +++ b/doc/it/autogen/plugin_api/hdata.txt @@ -0,0 +1,659 @@ +[width="100%",cols="^1,^2,5,5,5",options="header"] +|======================================== +| Plugin | Nome | Descrizione | Variables | Lists + +| irc | irc_channel | irc channel | + 'type' (integer) + + 'name' (string) + + 'topic' (string) + + 'modes' (string) + + 'limit' (integer) + + 'key' (string) + + 'checking_away' (integer) + + 'away_message' (string) + + 'has_quit_server' (integer) + + 'cycle' (integer) + + 'part' (integer) + + 'display_creation_date' (integer) + + 'nick_completion_reset' (integer) + + 'pv_remote_nick_color' (string) + + 'hook_autorejoin' (pointer) + + 'nicks_count' (integer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'nicks_speaking' (pointer) + + 'nicks_speaking_time' (pointer) + + 'last_nick_speaking_time' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'prev_channel' (pointer) + + 'next_channel' (pointer) | + - + +| irc | irc_channel_speaking | irc channel_speaking | + 'nick' (string) + + 'time_last_message' (time) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_ignore | irc ignore | + 'number' (integer) + + 'mask' (string) + + 'regex_mask' (pointer) + + 'server' (string) + + 'channel' (string) + + 'prev_ignore' (pointer) + + 'next_ignore' (pointer) | + 'irc_ignore_list' + + 'last_irc_ignore' + +| irc | irc_nick | irc nick | + 'name' (string) + + 'host' (string) + + 'prefixes' (string) + + 'prefix' (string) + + 'away' (integer) + + 'color' (string) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| irc | irc_notify | irc notify | + 'server' (pointer) + + 'nick' (string) + + 'check_away' (integer) + + 'is_on_server' (integer) + + 'away_message' (string) + + 'ison_received' (integer) + + 'prev_notify' (pointer) + + 'next_notify' (pointer) | + - + +| irc | irc_redirect | irc redirect | + 'server' (pointer) + + 'pattern' (string) + + 'signal' (string) + + 'count' (integer) + + 'current_count' (integer) + + 'string' (string) + + 'timeout' (integer) + + 'command' (string) + + 'start_time' (time) + + 'cmd_start' (pointer) + + 'cmd_stop' (pointer) + + 'cmd_extra' (pointer) + + 'cmd_start_received' (integer) + + 'cmd_stop_received' (integer) + + 'cmd_filter' (pointer) + + 'output' (string) + + 'output_size' (integer) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + - + +| irc | irc_redirect_pattern | pattern for irc redirect | + 'name' (string) + + 'temp_pattern' (integer) + + 'timeout' (integer) + + 'cmd_start' (string) + + 'cmd_stop' (string) + + 'cmd_extra' (string) + + 'prev_redirect' (pointer) + + 'next_redirect' (pointer) | + 'irc_redirect_patterns' + + 'last_irc_redirect_pattern' + +| irc | irc_server | irc server | + 'name' (string) + + 'options' (pointer) + + 'temp_server' (integer) + + 'reloading_from_config' (integer) + + 'reloaded_from_config' (integer) + + 'addresses_count' (integer) + + 'addresses_array' (pointer) + + 'ports_array' (pointer) + + 'index_current_address' (integer) + + 'current_address' (string) + + 'current_ip' (string) + + 'current_port' (integer) + + 'sock' (integer) + + 'hook_connect' (pointer) + + 'hook_fd' (pointer) + + 'hook_timer_connection' (pointer) + + 'hook_timer_sasl' (pointer) + + 'is_connected' (integer) + + 'ssl_connected' (integer) + + 'gnutls_sess' (other) + + 'tls_cert' (other) + + 'tls_cert_key' (other) + + 'unterminated_message' (string) + + 'nicks_count' (integer) + + 'nicks_array' (pointer) + + 'nick_first_tried' (integer) + + 'nick' (string) + + 'nick_modes' (string) + + 'isupport' (string) + + 'prefix_modes' (string) + + 'prefix_chars' (string) + + 'reconnect_delay' (integer) + + 'reconnect_start' (time) + + 'command_time' (time) + + 'reconnect_join' (integer) + + 'disable_autojoin' (integer) + + 'is_away' (integer) + + 'away_message' (string) + + 'away_time' (time) + + 'lag' (integer) + + 'lag_check_time' (other) + + 'lag_next_check' (time) + + 'lag_last_refresh' (time) + + 'cmd_list_regexp' (pointer) + + 'last_user_message' (time) + + 'last_away_check' (time) + + 'outqueue' (pointer) + + 'last_outqueue' (pointer) + + 'redirects' (pointer) + + 'last_redirect' (pointer) + + 'notify_list' (pointer) + + 'last_notify' (pointer) + + 'manual_joins' (pointer) + + 'buffer' (pointer) + + 'buffer_as_string' (string) + + 'channels' (pointer) + + 'last_channel' (pointer) + + 'prev_server' (pointer) + + 'next_server' (pointer) | + 'irc_servers' + + 'last_irc_server' + +| weechat | bar | bar | + 'name' (string) + + 'options' (pointer) + + 'conditions_count' (integer) + + 'conditions_array' (pointer) + + 'items_count' (integer) + + 'items_subcount' (pointer) + + 'items_array' (pointer) + + 'bar_window' (pointer) + + 'bar_refresh_needed' (integer) + + 'prev_bar' (pointer) + + 'next_bar' (pointer) | + 'gui_bars' + + 'last_gui_bar' + +| weechat | bar_item | bar item | + 'plugin' (pointer) + + 'name' (string) + + 'build_callback' (pointer) + + 'build_callback_data' (pointer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + 'gui_bar_items' + + 'last_gui_bar_item' + +| weechat | buffer | buffer | + 'plugin' (pointer) + + 'plugin_name_for_upgrade' (string) + + 'merge_for_upgrade' (pointer) + + 'number' (integer) + + 'layout_number' (integer) + + 'layout_applied' (integer) + + 'name' (string) + + 'short_name' (string) + + 'type' (integer) + + 'notify' (integer) + + 'num_displayed' (integer) + + 'active' (integer) + + 'print_hooks_enabled' (integer) + + 'close_callback' (pointer) + + 'close_callback_data' (pointer) + + 'title' (string) + + 'own_lines' (pointer) + + 'mixed_lines' (pointer) + + 'lines' (pointer) + + 'time_for_each_line' (integer) + + 'chat_refresh_needed' (integer) + + 'nicklist' (integer) + + 'nicklist_case_sensitive' (integer) + + 'nicklist_root' (pointer) + + 'nicklist_max_length' (integer) + + 'nicklist_display_groups' (integer) + + 'nicklist_visible_count' (integer) + + 'input' (integer) + + 'input_callback' (pointer) + + 'input_callback_data' (pointer) + + 'input_get_unknown_commands' (integer) + + 'input_buffer' (string) + + 'input_buffer_alloc' (integer) + + 'input_buffer_size' (integer) + + 'input_buffer_length' (integer) + + 'input_buffer_pos' (integer) + + 'input_buffer_1st_display' (integer) + + 'input_undo_snap' (pointer) + + 'input_undo' (pointer) + + 'last_input_undo' (pointer) + + 'ptr_input_undo' (pointer) + + 'input_undo_count' (integer) + + 'completion' (pointer) + + 'history' (pointer) + + 'last_history' (pointer) + + 'ptr_history' (pointer) + + 'num_history' (integer) + + 'text_search' (integer) + + 'text_search_exact' (integer) + + 'text_search_found' (integer) + + 'text_search_input' (string) + + 'highlight_words' (string) + + 'highlight_tags' (string) + + 'highlight_tags_count' (integer) + + 'highlight_tags_array' (pointer) + + 'hotlist_max_level_nicks' (pointer) + + 'keys' (pointer) + + 'last_key' (pointer) + + 'keys_count' (integer) + + 'local_variables' (pointer) + + 'prev_buffer' (pointer) + + 'next_buffer' (pointer) | + 'gui_buffers' + + 'last_gui_buffer' + +| weechat | completion | completion | + 'buffer' (pointer) + + 'context' (integer) + + 'base_command' (string) + + 'base_command_arg_index' (integer) + + 'base_word' (string) + + 'base_word_pos' (integer) + + 'position' (integer) + + 'args' (string) + + 'direction' (integer) + + 'add_space' (integer) + + 'force_partial_completion' (integer) + + 'completion_list' (pointer) + + 'word_found' (string) + + 'word_found_is_nick' (integer) + + 'position_replace' (integer) + + 'diff_size' (integer) + + 'diff_length' (integer) + + 'partial_completion_list' (pointer) + + 'last_partial_completion' (pointer) | + - + +| weechat | completion_partial | partial completion | + 'word' (string) + + 'count' (integer) + + 'prev_item' (pointer) + + 'next_item' (pointer) | + - + +| weechat | config_file | config file | + 'plugin' (pointer) + + 'name' (string) + + 'filename' (string) + + 'file' (pointer) + + 'callback_reload' (pointer) + + 'callback_reload_data' (pointer) + + 'sections' (pointer) + + 'last_section' (pointer) + + 'prev_config' (pointer) + + 'next_config' (pointer) | + 'config_files' + + 'last_config_file' + +| weechat | config_option | config option | + 'config_file' (pointer) + + 'section' (pointer) + + 'name' (string) + + 'type' (integer) + + 'description' (string) + + 'string_values' (pointer) + + 'min' (integer) + + 'max' (integer) + + 'default_value' (pointer) + + 'value' (pointer) + + 'null_value_allowed' (integer) + + 'callback_check_value' (pointer) + + 'callback_check_value_data' (pointer) + + 'callback_change' (pointer) + + 'callback_change_data' (pointer) + + 'callback_delete' (pointer) + + 'callback_delete_data' (pointer) + + 'loaded' (integer) + + 'prev_option' (pointer) + + 'next_option' (pointer) | + - + +| weechat | config_section | config section | + 'config_file' (pointer) + + 'name' (string) + + 'user_can_add_options' (integer) + + 'user_can_delete_options' (integer) + + 'callback_read' (pointer) + + 'callback_read_data' (pointer) + + 'callback_write' (pointer) + + 'callback_write_data' (pointer) + + 'callback_write_default' (pointer) + + 'callback_write_default_data' (pointer) + + 'callback_create_option' (pointer) + + 'callback_create_option_data' (pointer) + + 'callback_delete_option' (pointer) + + 'callback_delete_option_data' (pointer) + + 'options' (pointer) + + 'last_option' (pointer) + + 'prev_section' (pointer) + + 'next_section' (pointer) | + - + +| weechat | filter | filter | + 'enabled' (integer) + + 'name' (string) + + 'buffer_name' (string) + + 'num_buffers' (integer) + + 'buffers' (pointer) + + 'tags' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'regex' (string) + + 'regex_prefix' (pointer) + + 'regex_message' (pointer) + + 'prev_filter' (pointer) + + 'next_filter' (pointer) | + 'gui_filters' + + 'last_gui_filter' + +| weechat | history | history of commands in buffer | + 'text' (string) + + 'next_history' (pointer) + + 'prev_history' (pointer) | + - + +| weechat | hook | hook (variables common to all hook types) | + 'plugin' (pointer) + + 'type' (integer) + + 'deleted' (integer) + + 'running' (integer) + + 'priority' (integer) + + 'callback_data' (pointer) + + 'hook_data' (pointer) + + 'prev_hook' (pointer) + + 'next_hook' (pointer) | + - + +| weechat | hook_command | hook of type "command" | + 'callback' (pointer) + + 'command' (string) + + 'description' (string) + + 'args' (string) + + 'args_description' (string) + + 'completion' (string) + + 'cplt_num_templates' (integer) + + 'cplt_templates' (pointer) + + 'cplt_templates_static' (pointer) + + 'cplt_template_num_args' (pointer) + + 'cplt_template_args' (pointer) + + 'cplt_template_num_args_concat' (integer) + + 'cplt_template_args_concat' (pointer) | + 'last_weechat_hook_command' + + 'weechat_hooks_command' + +| weechat | hook_command_run | hook of type "command_run" | + 'callback' (pointer) + + 'command' (string) | + 'last_weechat_hook_command_run' + + 'weechat_hooks_command_run' + +| weechat | hook_completion | hook of type "completion" | + 'callback' (pointer) + + 'completion_item' (string) + + 'description' (string) | + 'last_weechat_hook_completion' + + 'weechat_hooks_completion' + +| weechat | hook_config | hook of type "config" | + 'callback' (pointer) + + 'option' (string) | + 'last_weechat_hook_config' + + 'weechat_hooks_config' + +| weechat | hook_connect | hook of type "connect" | + 'callback' (pointer) + + 'proxy' (string) + + 'address' (string) + + 'port' (integer) + + 'sock' (integer) + + 'ipv6' (integer) + + 'gnutls_sess' (pointer) + + 'gnutls_cb' (pointer) + + 'gnutls_dhkey_size' (integer) + + 'gnutls_priorities' (string) + + 'local_hostname' (string) + + 'child_read' (integer) + + 'child_write' (integer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'handshake_hook_fd' (pointer) + + 'handshake_hook_timer' (pointer) + + 'handshake_fd_flags' (integer) + + 'handshake_ip_address' (string) | + 'last_weechat_hook_connect' + + 'weechat_hooks_connect' + +| weechat | hook_fd | hook of type "fd" | + 'callback' (pointer) + + 'fd' (integer) + + 'flags' (integer) | + 'last_weechat_hook_fd' + + 'weechat_hooks_fd' + +| weechat | hook_hdata | hook of type "hdata" | + 'callback' (pointer) + + 'hdata_name' (string) + + 'description' (string) | + 'last_weechat_hook_hdata' + + 'weechat_hooks_hdata' + +| weechat | hook_hsignal | hook of type "hsignal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_hsignal' + + 'weechat_hooks_hsignal' + +| weechat | hook_info | hook of type "info" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) | + 'last_weechat_hook_info' + + 'weechat_hooks_info' + +| weechat | hook_info_hashtable | hook of type "info_hashtable" | + 'callback' (pointer) + + 'info_name' (string) + + 'description' (string) + + 'args_description' (string) + + 'output_description' (string) | + 'last_weechat_hook_info_hashtable' + + 'weechat_hooks_info_hashtable' + +| weechat | hook_infolist | hook of type "infolist" | + 'callback' (pointer) + + 'infolist_name' (string) + + 'description' (string) + + 'pointer_description' (string) + + 'args_description' (string) | + 'last_weechat_hook_infolist' + + 'weechat_hooks_infolist' + +| weechat | hook_modifier | hook of type "modifier" | + 'callback' (pointer) + + 'modifier' (string) | + 'last_weechat_hook_modifier' + + 'weechat_hooks_modifier' + +| weechat | hook_print | hook of type "print" | + 'callback' (pointer) + + 'buffer' (pointer) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'message' (string) + + 'strip_colors' (integer) | + 'last_weechat_hook_print' + + 'weechat_hooks_print' + +| weechat | hook_process | hook of type "process" | + 'callback' (pointer) + + 'command' (string) + + 'timeout' (long) + + 'child_read' (pointer) + + 'child_write' (pointer) + + 'child_pid' (other) + + 'hook_fd' (pointer) + + 'hook_timer' (pointer) + + 'buffer' (pointer) + + 'buffer_size' (pointer) | + 'last_weechat_hook_process' + + 'weechat_hooks_process' + +| weechat | hook_signal | hook of type "signal" | + 'callback' (pointer) + + 'signal' (string) | + 'last_weechat_hook_signal' + + 'weechat_hooks_signal' + +| weechat | hook_timer | hook of type "timer" | + 'callback' (pointer) + + 'interval' (long) + + 'align_second' (integer) + + 'remaining_calls' (integer) + + 'last_exec' (other) + + 'next_exec' (other) | + 'last_weechat_hook_timer' + + 'weechat_hooks_timer' + +| weechat | input_undo | undo for input line | + 'data' (string) + + 'pos' (integer) + + 'prev_undo' (pointer) + + 'next_undo' (pointer) | + - + +| weechat | key | key | + 'key' (string) + + 'command' (string) + + 'prev_key' (pointer) + + 'next_key' (pointer) | + 'gui_default_keys' + + 'gui_keys' + + 'last_gui_default_key' + + 'last_gui_key' + +| weechat | line | line | + 'data' (pointer) + + 'prev_line' (pointer) + + 'next_line' (pointer) | + - + +| weechat | line_data | line data | + 'buffer' (pointer) + + 'y' (integer) + + 'date' (time) + + 'date_printed' (time) + + 'str_time' (string) + + 'tags_count' (integer) + + 'tags_array' (pointer) + + 'displayed' (integer) + + 'highlight' (integer) + + 'refresh_needed' (integer) + + 'prefix' (string) + + 'prefix_length' (integer) + + 'message' (string) | + - + +| weechat | lines | lines | + 'first_line' (pointer) + + 'last_line' (pointer) + + 'last_read_line' (pointer) + + 'lines_count' (integer) + + 'first_line_not_read' (integer) + + 'lines_hidden' (integer) + + 'buffer_max_length' (integer) + + 'prefix_max_length' (integer) | + - + +| weechat | nick | nick in nicklist | + 'group' (pointer) + + 'name' (string) + + 'color' (string) + + 'prefix' (string) + + 'prefix_color' (string) + + 'visible' (integer) + + 'prev_nick' (pointer) + + 'next_nick' (pointer) | + - + +| weechat | nick_group | group in nicklist | + 'name' (string) + + 'color' (string) + + 'visible' (integer) + + 'level' (integer) + + 'parent' (pointer) + + 'childs' (pointer) + + 'last_child' (pointer) + + 'nicks' (pointer) + + 'last_nick' (pointer) + + 'prev_group' (pointer) + + 'next_group' (pointer) | + - + +| weechat | window | window | + 'win_x' (integer) + + 'win_y' (integer) + + 'win_width' (integer) + + 'win_height' (integer) + + 'win_width_pct' (integer) + + 'win_height_pct' (integer) + + 'win_chat_x' (integer) + + 'win_chat_y' (integer) + + 'win_chat_width' (integer) + + 'win_chat_height' (integer) + + 'win_chat_cursor_x' (integer) + + 'win_chat_cursor_y' (integer) + + 'bar_windows' (pointer) + + 'last_bar_window' (pointer) + + 'refresh_needed' (integer) + + 'gui_objects' (pointer) + + 'buffer' (pointer) + + 'layout_plugin_name' (string) + + 'layout_buffer_name' (string) + + 'scroll' (pointer) + + 'ptr_tree' (pointer) + + 'prev_window' (pointer) + + 'next_window' (pointer) | + 'gui_current_window' + + 'gui_windows' + + 'last_gui_window' + +| weechat | window_scroll | scroll info in window | + 'buffer' (pointer) + + 'first_line_displayed' (integer) + + 'start_line' (pointer) + + 'start_line_pos' (integer) + + 'scrolling' (integer) + + 'start_col' (integer) + + 'lines_after' (integer) + + 'reset_allowed' (integer) + + 'prev_scroll' (pointer) + + 'next_scroll' (pointer) | + - + +| weechat | window_tree | tree of windows | + 'parent_node' (pointer) + + 'split_pct' (integer) + + 'split_horizontal' (integer) + + 'child1' (pointer) + + 'child2' (pointer) + + 'window' (pointer) | + 'gui_windows_tree' + +|======================================== diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt index 3aa85a337..5face207d 100644 --- a/doc/it/autogen/user/weechat_commands.txt +++ b/doc/it/autogen/user/weechat_commands.txt @@ -145,7 +145,7 @@ comando: comando da eseguire (una '/' viene aggiunta automaticamente se non trov /debug list set <plugin> <level> dump [<plugin>] - buffer|color|infolists|memory|term|windows + buffer|color|hdata|infolists|memory|term|windows list: list plugins with debug levels set: set debug level for plugin @@ -154,6 +154,7 @@ comando: comando da eseguire (una '/' viene aggiunta automaticamente se non trov dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes) buffer: dump buffer content with hexadecimal values in log file color: display infos about current color pairs + hdata: display infos about hdata infolists: display infos about infolists memory: display infos about memory usage term: display infos about terminal diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index 3a1d2e078..0abdc74be 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -3237,7 +3237,7 @@ Prototipo: [source,C] ---------------------------------------- const char *weechat_hashtable_get_string (struct t_hashtable *hashtable, - void *property); + const char *property); ---------------------------------------- Argomenti: @@ -6050,7 +6050,8 @@ weechat_hook_modifier ("2000|input_text_display", &modifier_cb, NULL); ---------------------------------------- I tipi di hook che seguono consentono la priorità: command, command_run, -signal, hsignal, config. +signal, hsignal, config, completion, modifier, info, info_hashtable, infolist, +hdata. weechat_hook_command ^^^^^^^^^^^^^^^^^^^^ @@ -8225,6 +8226,63 @@ hook = weechat.hook_infolist("my_infolist", "Infolist with some data", "my_infolist_cb", "") ---------------------------------------- +// TRANSLATION MISSING +weechat_hook_hdata +^^^^^^^^^^^^^^^^^^ + +Hook a hdata: callback will return pointer to hdata asked. + +Prototipo: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_hdata (const char *hdata_name, + const char *description, + struct t_hdata *(*callback)(void *data, + const char *hdata_name), + void *callback_data); +---------------------------------------- + +Argomenti: + +* 'hdata_name': name of hdata + (priority allowed, see note about <<hook_priority,priority>>) +* 'description': description +* 'callback': function called when hdata is asked, arguments and return + value: +** 'void *data': pointer +** 'const char *hdata_name': name of hdata +** return value: hdata asked +* 'callback_data': pointer given to callback when it is called by WeeChat + +Valore restituito: + +* pointer to new hook, NULL if error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata * +my_hdata_cb (void *data, const char *hdata_name) +{ + struct t_hdata *my_hdata; + + /* build hdata */ + /* ... */ + + return my_hdata; +} + +/* add hdata "my_hdata" */ +struct t_hook *my_hdata = weechat_hook_hdata ("my_hdata", + "Hdata for my structure", + &my_hdata_cb, NULL); +---------------------------------------- + +[NOTE] +Questa funzione non è disponibile nelle API per lo scripting. + weechat_unhook ^^^^^^^^^^^^^^ @@ -11190,6 +11248,14 @@ weechat_infolist_get Restituisce una lista info da WeeChat o da un plugin. +[IMPORTANT] +// TRANSLATION MISSING +Content of infolist is a duplication of actual data. So if you are asking +infolist with lot of data (like "buffer_lines"), WeeChat will allocate memory +to duplicate all data, and this can take some time. + +Instead of using big infolist, it is preferable to use hdata (but infolist may +have more info than hdata, which is raw data), see <<hdata,hdata>>. + Prototipo: [source,C] @@ -11650,6 +11716,867 @@ weechat.infolist_free(infolist) weechat.infolist_free(infolist) ---------------------------------------- +[[hdata]] +Hdata +~~~~~ + +// TRANSLATION MISSING +Functions for hdata (raw access to WeeChat or plugins data). + +[IMPORTANT] +Hdata provides read-only access to data. It is *STRICTLY FORBIDDEN* to write +something in memory pointed by hdata variables. + +// TRANSLATION MISSING +weechat_hdata_new +^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Create a new hdata. + +[NOTE] +.hdata vs infolist +======================================== +Hdata is a fast way to read WeeChat or plugins data. It is similar to +infolist, but there are some differences: + +* it is faster and uses less memory: direct read of data without duplication +* it may have different info than infolist: it only raw data in structures + (infolist may add some extra data for convenience) +======================================== + +Prototipo: + +[source,C] +---------------------------------------- +struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next); +---------------------------------------- + +Argomenti: + +* 'hdata_name': name of hdata +* 'var_prev': name of variable in structure which is a pointer to previous + element in list (may be NULL if no such variable is available) +* 'var_next': name of variable in structure which is a pointer to next + element in list (may be NULL if no such variable is available) + +Valore restituito: + +* pointer to new hdata + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hdata_new_var +^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Create a new variable in hdata. + +Prototipo: + +[source,C] +---------------------------------------- +void weechat_hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'name': variable name +* 'offset': offset of variable in structure +* 'type': variable type, one of: +** WEECHAT_HDATA_INTEGER +** WEECHAT_HDATA_LONG +** WEECHAT_HDATA_STRING +** WEECHAT_HDATA_POINTER +** WEECHAT_HDATA_TIME +** WEECHAT_HDATA_OTHER + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_myplugin_list +{ + char *name; + struct t_gui_buffer *buffer; + int count; + struct t_myplugin_list *prev; + struct t_myplugin_list *next; +}; + +/* ... */ + +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING); +weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "count", offsetof (struct t_myplugin_list, count), WEECHAT_HDATA_INTEGER); +weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER); +---------------------------------------- + +The macro "WEECHAT_HDATA_VAR" can be used to shorten code: + +[source,C] +---------------------------------------- +WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING); +WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, count, INTEGER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER); +WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hdata_new_list +^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Create a new list pointer in hdata. + +Prototipo: + +[source,C] +---------------------------------------- +void weechat_hdata_new_list (struct t_hdata *hdata, const char *name, void *pointer); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'name': variable name +* 'pointer': list pointer + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_myplugin_list +{ + char *name; + struct t_gui_buffer *buffer; + int count; + struct t_myplugin_list *prev; + struct t_myplugin_list *next; +}; + +struct t_myplugin_list *buffers = NULL; +struct t_myplugin_list *last_buffer = NULL; + +/* ... */ + +struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next"); +weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING); +weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "count", offsetof (struct t_myplugin_list, count), WEECHAT_HDATA_INTEGER); +weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER); +weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER); +weechat_hdata_new_list (hdata, "buffers", &buffers); +weechat_hdata_new_list (hdata, "last_buffer", &last_buffer); +---------------------------------------- + +The macro "WEECHAT_HDATA_LIST" can be used to shorten code: + +[source,C] +---------------------------------------- +WEECHAT_HDATA_LIST(buffers); +WEECHAT_HDATA_LIST(last_buffer); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hdata_get +^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return hdata for a WeeChat or plugin structure. + +[NOTE] +Hdata does not contain data, it's only a hashtable with position of variables +in structure. That means you will need this hdata and a pointer to a +WeeChat/plugin object to read some data. + +Prototipo: + +[source,C] +---------------------------------------- +struct t_hdata *weechat_hdata_get (const char *hdata_name); +---------------------------------------- + +Argomenti: + +* 'hdata_name': name of hdata: +include::autogen/plugin_api/hdata.txt[] + +Valore restituito: + +* pointer to hdata, NULL if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("irc_server"); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +hdata = weechat.hdata_get(hdata_name) + +# esempio +hdata = weechat.hdata_get("irc_server") +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_get_var_offset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return offset of variable in hdata. + +Prototipo: + +[source,C] +---------------------------------------- +int weechat_hdata_get_var_offset (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'name': variable name + +Valore restituito: + +* variable offset, 0 if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +int offset = weechat_hdata_get_var_offset (hdata, "name"); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hdata_get_var_type +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return type of variable in hdata (as integer). + +Prototipo: + +[source,C] +---------------------------------------- +int weechat_hdata_get_var_type (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'name': variable name + +Valore restituito: + +* variable type, -1 if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +int type = weechat_hdata_get_var_type (hdata, "name"); +switch (type) +{ + case WEECHAT_HDATA_INTEGER: + /* ... */ + break; + case WEECHAT_HDATA_LONG: + /* ... */ + break; + case WEECHAT_HDATA_STRING: + /* ... */ + break; + case WEECHAT_HDATA_POINTER: + /* ... */ + break; + case WEECHAT_HDATA_TIME: + /* ... */ + break; + case WEECHAT_HDATA_OTHER: + /* ... */ + break; + default: + /* variable not found */ + break; +} +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hdata_get_var_type_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return type of variable in hdata (as string). + +Prototipo: + +[source,C] +---------------------------------------- +const char *weechat_hdata_get_var_type_string (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'name': variable name + +Valore restituito: + +* variable type, NULL if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "type = %s", + weechat_hdata_get_var_type_string (hdata, "name")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +type = weechat.hdata_get_var_type_string(hdata, name) + +# esempio +weechat.prnt("", "type = %s" % weechat.hdata_get_var_type_string("name")) +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_get_var +^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return pointer to content of variable in hdata. + +Prototipo: + +[source,C] +---------------------------------------- +void *weechat_hdata_get_var (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name + +Valore restituito: + +* pointer to content of variable, NULL if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +void *pointer = weechat_hdata_get_var (hdata, buffer, "name"); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hdata_get_var_at_offset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return pointer to content of variable in hdata, using offset. + +Prototipo: + +[source,C] +---------------------------------------- +void *weechat_hdata_get_var_at_offset (struct t_hdata *hdata, void *pointer, int offset); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'offset': offset of variable + +Valore restituito: + +* pointer to content of variable, NULL if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +int offset = weechat_hdata_get_var_offset (hdata, "name"); +void *pointer = weechat_hdata_get_var_at_offset (hdata, buffer, offset); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hdata_get_list +^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return list pointer from hdata. + +Prototipo: + +[source,C] +---------------------------------------- +void *weechat_hdata_get_list (struct t_hdata *hdata, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'name': list name + +Valore restituito: + +* list pointer, NULL if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffers = weechat_hdata_get_list (hdata, "gui_buffers"); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +list = weechat.hdata_get_list(hdata, name) + +# esempio +hdata = weechat.hdata_get("buffer") +buffers = weechat.hdata_get_list(hdata, "gui_buffers") +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_move +^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Move pointer to another element in list. + +Prototipo: + +[source,C] +---------------------------------------- +void *weechat_hdata_move (struct t_hdata *hdata, void *pointer, int count); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to a WeeChat/plugin object +* 'count': number of jump(s) to execute (negative or positive integer, different + from 0) + +Valore restituito: + +* pointer to element reached, NULL if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); + +/* move to next buffer, 2 times */ +buffer = weechat_hdata_move (hdata, buffer, 2); + +/* move to previous buffer */ +if (buffer) + buffer = weechat_hdata_move (hdata, buffer, -1); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +pointer = weechat.hdata_move(hdata, pointer, count) + +# esempio +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() + +# move to next buffer, 2 times +buffer = weechat.hdata_move(hdata, buffer, 2) + +# move to previous buffer +if buffer: + buffer = weechat.hdata_move(hdata, buffer, -1) +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_integer +^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return value of integer variable in structure using hdata. + +Prototipo: + +[source,C] +---------------------------------------- +int weechat_hdata_integer (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "integer") + +Valore restituito: + +* integer value of variable + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "number = %d", weechat_hdata_integer (hdata, buffer, "number")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +value = weechat.hdata_integer(hdata, pointer, name) + +# esempio +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "number = %d" % weechat.hdata_integer(hdata, buffer, "number")) +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_long +^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return value of long variable in structure using hdata. + +Prototipo: + +[source,C] +---------------------------------------- +long weechat_hdata_long (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "long") + +Valore restituito: + +* long value of variable + +Esempio in C: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "longvar = %ld", weechat_hdata_long (hdata, pointer, "longvar")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +value = weechat.hdata_long(hdata, pointer, name) + +# esempio +weechat.prnt("", "longvar = %ld" % weechat.hdata_long(hdata, pointer, "longvar")) +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_string +^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return value of string variable in structure using hdata. + +Prototipo: + +[source,C] +---------------------------------------- +const char *weechat_hdata_string (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "string") + +Valore restituito: + +* string value of variable + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "name = %s", weechat_hdata_string (hdata, buffer, "name")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +value = weechat.hdata_string(hdata, pointer, name) + +# esempio +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "name = %s" % weechat.hdata_string(hdata, buffer, "name")) +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_pointer +^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return value of pointer variable in structure using hdata. + +Prototipo: + +[source,C] +---------------------------------------- +void *weechat_hdata_pointer (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "pointer") + +Valore restituito: + +* pointer value of variable + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *buffer = weechat_buffer_search_main (); +weechat_printf (NULL, "lines = %lx", weechat_hdata_pointer (hdata, buffer, "lines")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +value = weechat.hdata_pointer(hdata, pointer, name) + +# esempio +hdata = weechat.hdata_get("buffer") +buffer = weechat.buffer_search_main() +weechat.prnt("", "lines = %lx" % weechat.hdata_pointer(hdata, buffer, "lines")) +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_time +^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return value of time variable in structure using hdata. + +Prototipo: + +[source,C] +---------------------------------------- +time_t weechat_hdata_time (struct t_hdata *hdata, void *pointer, const char *name); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'pointer': pointer to WeeChat/plugin object +* 'name': variable name (must be type "time") + +Valore restituito: + +* time value of variable + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hdata *hdata = weechat_hdata_get ("buffer"); +struct t_gui_buffer *ptr = weechat_buffer_search_main (); +ptr = weechat_hdata_pointer (hdata, ptr, "lines"); +if (ptr) +{ + hdata = weechat_hdata_get ("lines"); + ptr = weechat_hdata_pointer (hdata, ptr, "first_line"); + if (ptr) + { + hdata = weechat_hdata_get ("line"); + ptr = weechat_hdata_pointer (hdata, ptr, "data"); + if (ptr) + { + hdata = weechat_hdata_get ("line_data"); + time_t date = weechat_hdata_time (hdata, hdata, "date"); + weechat_printf (NULL, "time of last line displayed = %s", ctime (&date)); + } + } +} +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +value = weechat.hdata_time(hdata, pointer, name) + +# esempio +hdata = weechat.hdata_get("buffer") +ptr = weechat.buffer_search_main() +ptr = weechat.hdata_pointer(hdata, ptr, "lines") +if ptr: + hdata = weechat.hdata_get("lines") + ptr = weechat.hdata_pointer(hdata, ptr, "first_line") + if ptr: + hdata = weechat.hdata_get("line") + ptr = weechat.hdata_pointer(hdata, ptr, "data") + if ptr: + hdata = weechat.hdata_get("line_data") + weechat.prnt("", "time of last line displayed = %s" % weechat.hdata_time(hdata, ptr, "date")) +---------------------------------------- + +// TRANSLATION MISSING +weechat_hdata_get_string +^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.6._ + +Return string value of a hdata property. + +Prototipo: + +[source,C] +---------------------------------------- +const char *weechat_hdata_get_string (struct t_hdata *hdata, const char *property); +---------------------------------------- + +Argomenti: + +* 'hdata': hdata pointer +* 'property': property name: +** 'var_keys': string with list of keys for variables in hdata + (format: "key1,key2,key3") +** 'var_values': string with list of values for variables in hdata + (format: "value1,value2,value3") +** 'var_keys_values': string with list of keys and values for variables in hdata + (format: "key1:value1,key2:value2,key3:value3") +** 'var_prev': name of variable in structure which is a pointer to previous + element in list +** 'var_next': name of variable in structure which is a pointer to next + element in list +** 'list_keys': string with list of keys for lists in hdata + (format: "key1,key2,key3") +** 'list_values': string with list of values for lists in hdata + (format: "value1,value2,value3") +** 'list_keys_values': string with list of keys and values for lists in hdata + (format: "key1:value1,key2:value2,key3:value3") + +Valore restituito: + +* string value of property + +Esempio in C: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "variables in hdata: %s" weechat_hdata_get_string (hdata, "var_keys")); +weechat_printf (NULL, "lists in hdata: %s" weechat_hdata_get_string (hdata, "list_keys")); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototipo +value = weechat.hdata_get_string(hdata, property) + +# esempio +weechat.prnt("", "variables in hdata: %s" % weechat.hdata_get_string(hdata, "var_keys")) +weechat.prnt("", "lists in hdata: %s" % weechat.hdata_get_string(hdata, "list_keys")) +---------------------------------------- + [[upgrade]] Aggiornamento ~~~~~~~~~~~~~ |