summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-08-27 09:47:46 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-08-27 09:47:46 +0200
commitdf80aa5fc92bd5481fc8099a63dad4093405f2f4 (patch)
tree49388757d0b7d625e8dc25f484792c65d913d594
parente767346a193f0eb53a9324a04a75080d359b1951 (diff)
downloadweechat-df80aa5fc92bd5481fc8099a63dad4093405f2f4.zip
api: allow update for some variables of hdata, add new functions hdata_update and hdata_set
-rw-r--r--ChangeLog4
-rw-r--r--doc/de/autogen/plugin_api/hdata.txt338
-rw-r--r--doc/docgen.py48
-rw-r--r--doc/en/autogen/plugin_api/hdata.txt338
-rw-r--r--doc/en/weechat_plugin_api.en.txt198
-rw-r--r--doc/fr/autogen/plugin_api/hdata.txt338
-rw-r--r--doc/fr/weechat_plugin_api.fr.txt200
-rw-r--r--doc/it/autogen/plugin_api/hdata.txt338
-rw-r--r--doc/it/weechat_plugin_api.it.txt209
-rw-r--r--doc/ja/autogen/plugin_api/hdata.txt338
-rw-r--r--po/cs.po5
-rw-r--r--po/de.po5
-rw-r--r--po/es.po5
-rw-r--r--po/fr.po7
-rw-r--r--po/hu.po5
-rw-r--r--po/it.po5
-rw-r--r--po/ja.po5
-rw-r--r--po/pl.po5
-rw-r--r--po/pt_BR.po5
-rw-r--r--po/ru.po5
-rw-r--r--po/weechat.pot5
-rw-r--r--src/core/wee-config-file.c105
-rw-r--r--src/core/wee-debug.c22
-rw-r--r--src/core/wee-hdata.c749
-rw-r--r--src/core/wee-hdata.h42
-rw-r--r--src/gui/gui-bar-item.c15
-rw-r--r--src/gui/gui-bar-window.c45
-rw-r--r--src/gui/gui-bar.c31
-rw-r--r--src/gui/gui-buffer.c155
-rw-r--r--src/gui/gui-chat.c3
-rw-r--r--src/gui/gui-completion.c52
-rw-r--r--src/gui/gui-filter.c29
-rw-r--r--src/gui/gui-history.c9
-rw-r--r--src/gui/gui-hotlist.c17
-rw-r--r--src/gui/gui-key.c19
-rw-r--r--src/gui/gui-line.c143
-rw-r--r--src/gui/gui-nicklist.c44
-rw-r--r--src/gui/gui-window.c88
-rw-r--r--src/plugins/guile/weechat-guile-api.c33
-rw-r--r--src/plugins/irc/irc-channel.c64
-rw-r--r--src/plugins/irc/irc-ignore.c17
-rw-r--r--src/plugins/irc/irc-nick.c19
-rw-r--r--src/plugins/irc/irc-notify.c19
-rw-r--r--src/plugins/irc/irc-redirect.c62
-rw-r--r--src/plugins/irc/irc-server.c131
-rw-r--r--src/plugins/lua/weechat-lua-api.c36
-rw-r--r--src/plugins/perl/weechat-perl-api.c36
-rw-r--r--src/plugins/plugin-script.c29
-rw-r--r--src/plugins/plugin.c27
-rw-r--r--src/plugins/python/weechat-python-api.c49
-rw-r--r--src/plugins/ruby/weechat-ruby-api.c41
-rw-r--r--src/plugins/script/script-repo.c49
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c38
-rw-r--r--src/plugins/weechat-plugin.h42
54 files changed, 2953 insertions, 1713 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f5579e5f..e00d4bf65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.3.9-dev, 2012-08-25
+v0.3.9-dev, 2012-08-27
Version 0.3.9 (under dev!)
@@ -49,6 +49,8 @@ Version 0.3.9 (under dev!)
* core: escape special chars (`#[\`) in configuration files for name of options
(bug #36584)
* doc: add japanese user's guide (patch #7827)
+* api: allow update for some variables of hdata, add new functions hdata_update
+ and hdata_set
* api: add info "locale" for info_get (locale used to translate messages)
* api: add new function util_version_number
* aspell: add option aspell.check.enabled, add options enable/disable/toggle for
diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt
index b07cafae6..f4e871d9d 100644
--- a/doc/de/autogen/plugin_api/hdata.txt
+++ b/doc/de/autogen/plugin_api/hdata.txt
@@ -1,6 +1,6 @@
-[width="100%",cols="^1,^2,5,5,5",options="header"]
+[width="100%",cols="^1,^2,5,5,5,5",options="header"]
|========================================
-| Erweiterung | Name | Beschreibung | Variablen | Listen
+| Erweiterung | Name | Beschreibung | Variablen | Update allowed | Listen
| guile | guile_script | Liste der Skripten |
'filename' (string) +
@@ -14,8 +14,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'guile_script') +
- 'next_script' (pointer, hdata: 'guile_script') |
+ 'prev_script' (pointer, hdata: "guile_script") +
+ 'next_script' (pointer, hdata: "guile_script") |
+ |
'last_script' +
'scripts'
@@ -36,22 +37,24 @@
'pv_remote_nick_color' (string) +
'hook_autorejoin' (pointer) +
'nicks_count' (integer) +
- 'nicks' (pointer, hdata: 'irc_nick') +
- 'last_nick' (pointer, hdata: 'irc_nick') +
+ 'nicks' (pointer, hdata: "irc_nick") +
+ 'last_nick' (pointer, hdata: "irc_nick") +
'nicks_speaking' (pointer) +
- 'nicks_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'last_nick_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'nicks_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'last_nick_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'prev_channel' (pointer, hdata: 'irc_channel') +
- 'next_channel' (pointer, hdata: 'irc_channel') |
+ 'prev_channel' (pointer, hdata: "irc_channel") +
+ 'next_channel' (pointer, hdata: "irc_channel") |
+ |
-
| irc | irc_channel_speaking | IRC channel_speaking |
'nick' (string) +
'time_last_message' (time) +
- 'prev_nick' (pointer, hdata: 'irc_channel_speaking') +
- 'next_nick' (pointer, hdata: 'irc_channel_speaking') |
+ 'prev_nick' (pointer, hdata: "irc_channel_speaking") +
+ 'next_nick' (pointer, hdata: "irc_channel_speaking") |
+ |
-
| irc | irc_ignore | IRC ignorieren |
@@ -60,8 +63,9 @@
'regex_mask' (pointer) +
'server' (string) +
'channel' (string) +
- 'prev_ignore' (pointer, hdata: 'irc_ignore') +
- 'next_ignore' (pointer, hdata: 'irc_ignore') |
+ 'prev_ignore' (pointer, hdata: "irc_ignore") +
+ 'next_ignore' (pointer, hdata: "irc_ignore") |
+ |
'irc_ignore_list' +
'last_irc_ignore'
@@ -72,23 +76,25 @@
'prefix' (string) +
'away' (integer) +
'color' (string) +
- 'prev_nick' (pointer, hdata: 'irc_nick') +
- 'next_nick' (pointer, hdata: 'irc_nick') |
+ 'prev_nick' (pointer, hdata: "irc_nick") +
+ 'next_nick' (pointer, hdata: "irc_nick") |
+ |
-
| irc | irc_notify | IRC-Benachrichtigungen |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'nick' (string) +
'check_away' (integer) +
'is_on_server' (integer) +
'away_message' (string) +
'ison_received' (integer) +
- 'prev_notify' (pointer, hdata: 'irc_notify') +
- 'next_notify' (pointer, hdata: 'irc_notify') |
+ 'prev_notify' (pointer, hdata: "irc_notify") +
+ 'next_notify' (pointer, hdata: "irc_notify") |
+ |
-
| irc | irc_redirect | IRC Umlenkung |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'pattern' (string) +
'signal' (string) +
'count' (integer) +
@@ -106,8 +112,9 @@
'cmd_filter' (hashtable) +
'output' (string) +
'output_size' (integer) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect') +
- 'next_redirect' (pointer, hdata: 'irc_redirect') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect") +
+ 'next_redirect' (pointer, hdata: "irc_redirect") |
+ |
-
| irc | irc_redirect_pattern | Muster für IRC Umlenkung |
@@ -117,8 +124,9 @@
'cmd_start' (string) +
'cmd_stop' (string) +
'cmd_extra' (string) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect_pattern') +
- 'next_redirect' (pointer, hdata: 'irc_redirect_pattern') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect_pattern") +
+ 'next_redirect' (pointer, hdata: "irc_redirect_pattern") |
+ |
'irc_redirect_patterns' +
'last_irc_redirect_pattern'
@@ -129,17 +137,17 @@
'reloading_from_config' (integer) +
'reloaded_from_config' (integer) +
'addresses_count' (integer) +
- 'addresses_array' (string, array_size: 'addresses_count') +
- 'ports_array' (integer, array_size: 'addresses_count') +
+ 'addresses_array' (string, array_size: "addresses_count") +
+ 'ports_array' (integer, array_size: "addresses_count") +
'index_current_address' (integer) +
'current_address' (string) +
'current_ip' (string) +
'current_port' (integer) +
'sock' (integer) +
- 'hook_connect' (pointer, hdata: 'hook') +
- 'hook_fd' (pointer, hdata: 'hook') +
- 'hook_timer_connection' (pointer, hdata: 'hook') +
- 'hook_timer_sasl' (pointer, hdata: 'hook') +
+ 'hook_connect' (pointer, hdata: "hook") +
+ 'hook_fd' (pointer, hdata: "hook") +
+ 'hook_timer_connection' (pointer, hdata: "hook") +
+ 'hook_timer_sasl' (pointer, hdata: "hook") +
'is_connected' (integer) +
'ssl_connected' (integer) +
'gnutls_sess' (other) +
@@ -147,7 +155,7 @@
'tls_cert_key' (other) +
'unterminated_message' (string) +
'nicks_count' (integer) +
- 'nicks_array' (string, array_size: 'nicks_count') +
+ 'nicks_array' (string, array_size: "nicks_count") +
'nick_first_tried' (integer) +
'nick_alternate_number' (integer) +
'nick' (string) +
@@ -176,17 +184,18 @@
'last_away_check' (time) +
'outqueue' (pointer) +
'last_outqueue' (pointer) +
- 'redirects' (pointer, hdata: 'irc_redirect') +
- 'last_redirect' (pointer, hdata: 'irc_redirect') +
- 'notify_list' (pointer, hdata: 'irc_notify') +
- 'last_notify' (pointer, hdata: 'irc_notify') +
+ 'redirects' (pointer, hdata: "irc_redirect") +
+ 'last_redirect' (pointer, hdata: "irc_redirect") +
+ 'notify_list' (pointer, hdata: "irc_notify") +
+ 'last_notify' (pointer, hdata: "irc_notify") +
'manual_joins' (hashtable) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'channels' (pointer, hdata: 'irc_channel') +
- 'last_channel' (pointer, hdata: 'irc_channel') +
- 'prev_server' (pointer, hdata: 'irc_server') +
- 'next_server' (pointer, hdata: 'irc_server') |
+ 'channels' (pointer, hdata: "irc_channel") +
+ 'last_channel' (pointer, hdata: "irc_channel") +
+ 'prev_server' (pointer, hdata: "irc_server") +
+ 'next_server' (pointer, hdata: "irc_server") |
+ |
'irc_servers' +
'last_irc_server'
@@ -202,8 +211,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'lua_script') +
- 'next_script' (pointer, hdata: 'lua_script') |
+ 'prev_script' (pointer, hdata: "lua_script") +
+ 'next_script' (pointer, hdata: "lua_script") |
+ |
'last_script' +
'scripts'
@@ -219,8 +229,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'perl_script') +
- 'next_script' (pointer, hdata: 'perl_script') |
+ 'prev_script' (pointer, hdata: "perl_script") +
+ 'next_script' (pointer, hdata: "perl_script") |
+ |
'last_script' +
'scripts'
@@ -236,8 +247,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'python_script') +
- 'next_script' (pointer, hdata: 'python_script') |
+ 'prev_script' (pointer, hdata: "python_script") +
+ 'next_script' (pointer, hdata: "python_script") |
+ |
'last_script' +
'scripts'
@@ -253,8 +265,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'ruby_script') +
- 'next_script' (pointer, hdata: 'ruby_script') |
+ 'prev_script' (pointer, hdata: "ruby_script") +
+ 'next_script' (pointer, hdata: "ruby_script") |
+ |
'last_script' +
'scripts'
@@ -280,8 +293,9 @@
'version_loaded' (string) +
'displayed' (integer) +
'install_order' (integer) +
- 'prev_script' (pointer, hdata: 'script_script') +
- 'next_script' (pointer, hdata: 'script_script') |
+ 'prev_script' (pointer, hdata: "script_script") +
+ 'next_script' (pointer, hdata: "script_script") |
+ |
'last_repo_script' +
'repo_scripts'
@@ -297,8 +311,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'tcl_script') +
- 'next_script' (pointer, hdata: 'tcl_script') |
+ 'prev_script' (pointer, hdata: "tcl_script") +
+ 'next_script' (pointer, hdata: "tcl_script") |
+ |
'last_script' +
'scripts'
@@ -306,32 +321,34 @@
'name' (string) +
'options' (pointer) +
'conditions_count' (integer) +
- 'conditions_array' (string, array_size: 'conditions_count') +
+ 'conditions_array' (string, array_size: "conditions_count") +
'items_count' (integer) +
'items_subcount' (pointer) +
'items_array' (pointer) +
'items_prefix' (pointer) +
'items_name' (pointer) +
'items_suffix' (pointer) +
- 'bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_window' (pointer, hdata: "bar_window") +
'bar_refresh_needed' (integer) +
- 'prev_bar' (pointer, hdata: 'bar') +
- 'next_bar' (pointer, hdata: 'bar') |
+ 'prev_bar' (pointer, hdata: "bar") +
+ 'next_bar' (pointer, hdata: "bar") |
+ |
'gui_bars' +
'last_gui_bar'
| weechat | bar_item | Bar-Item |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'build_callback' (pointer) +
'build_callback_data' (pointer) +
- 'prev_item' (pointer, hdata: 'bar_item') +
- 'next_item' (pointer, hdata: 'bar_item') |
+ 'prev_item' (pointer, hdata: "bar_item") +
+ 'next_item' (pointer, hdata: "bar_item") |
+ |
'gui_bar_items' +
'last_gui_bar_item'
| weechat | bar_window | Bar-Fenster |
- 'bar' (pointer, hdata: 'bar') +
+ 'bar' (pointer, hdata: "bar") +
'x' (integer) +
'y' (integer) +
'width' (integer) +
@@ -350,12 +367,13 @@
'coords_count' (integer) +
'coords' (pointer) +
'gui_objects' (pointer) +
- 'prev_bar_window' (pointer, hdata: 'bar_window') +
- 'next_bar_window' (pointer, hdata: 'bar_window') |
+ 'prev_bar_window' (pointer, hdata: "bar_window") +
+ 'next_bar_window' (pointer, hdata: "bar_window") |
+ |
-
| weechat | buffer | Buffer |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'plugin_name_for_upgrade' (string) +
'number' (integer) +
'layout_number' (integer) +
@@ -371,14 +389,14 @@
'close_callback' (pointer) +
'close_callback_data' (pointer) +
'title' (string) +
- 'own_lines' (pointer, hdata: 'lines') +
- 'mixed_lines' (pointer, hdata: 'lines') +
- 'lines' (pointer, hdata: 'lines') +
+ 'own_lines' (pointer, hdata: "lines") +
+ 'mixed_lines' (pointer, hdata: "lines") +
+ 'lines' (pointer, hdata: "lines") +
'time_for_each_line' (integer) +
'chat_refresh_needed' (integer) +
'nicklist' (integer) +
'nicklist_case_sensitive' (integer) +
- 'nicklist_root' (pointer, hdata: 'nick_group') +
+ 'nicklist_root' (pointer, hdata: "nick_group") +
'nicklist_max_length' (integer) +
'nicklist_display_groups' (integer) +
'nicklist_visible_count' (integer) +
@@ -394,15 +412,15 @@
'input_buffer_length' (integer) +
'input_buffer_pos' (integer) +
'input_buffer_1st_display' (integer) +
- 'input_undo_snap' (pointer, hdata: 'input_undo') +
- 'input_undo' (pointer, hdata: 'input_undo') +
- 'last_input_undo' (pointer, hdata: 'input_undo') +
- 'ptr_input_undo' (pointer, hdata: 'input_undo') +
+ 'input_undo_snap' (pointer, hdata: "input_undo") +
+ 'input_undo' (pointer, hdata: "input_undo") +
+ 'last_input_undo' (pointer, hdata: "input_undo") +
+ 'ptr_input_undo' (pointer, hdata: "input_undo") +
'input_undo_count' (integer) +
- 'completion' (pointer, hdata: 'completion') +
- 'history' (pointer, hdata: 'history') +
- 'last_history' (pointer, hdata: 'history') +
- 'ptr_history' (pointer, hdata: 'history') +
+ 'completion' (pointer, hdata: "completion") +
+ 'history' (pointer, hdata: "history") +
+ 'last_history' (pointer, hdata: "history") +
+ 'ptr_history' (pointer, hdata: "history") +
'num_history' (integer) +
'text_search' (integer) +
'text_search_exact' (integer) +
@@ -413,20 +431,21 @@
'highlight_regex_compiled' (pointer) +
'highlight_tags' (string) +
'highlight_tags_count' (integer) +
- 'highlight_tags_array' (string, array_size: 'highlight_tags_count') +
+ 'highlight_tags_array' (string, array_size: "highlight_tags_count") +
'hotlist_max_level_nicks' (hashtable) +
- 'keys' (pointer, hdata: 'key') +
- 'last_key' (pointer, hdata: 'key') +
+ 'keys' (pointer, hdata: "key") +
+ 'last_key' (pointer, hdata: "key") +
'keys_count' (integer) +
'local_variables' (hashtable) +
- 'prev_buffer' (pointer, hdata: 'buffer') +
- 'next_buffer' (pointer, hdata: 'buffer') |
+ 'prev_buffer' (pointer, hdata: "buffer") +
+ 'next_buffer' (pointer, hdata: "buffer") |
+ |
'gui_buffer_last_displayed' +
'gui_buffers' +
'last_gui_buffer'
| weechat | completion | Struktur mit Vervollständigung |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'context' (integer) +
'base_command' (string) +
'base_command_arg_index' (integer) +
@@ -443,38 +462,41 @@
'position_replace' (integer) +
'diff_size' (integer) +
'diff_length' (integer) +
- 'partial_completion_list' (pointer, hdata: 'completion_partial') +
- 'last_partial_completion' (pointer, hdata: 'completion_partial') |
+ 'partial_completion_list' (pointer, hdata: "completion_partial") +
+ 'last_partial_completion' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | completion_partial | Struktur mit teilweise Vervollständigung |
'word' (string) +
'count' (integer) +
- 'prev_item' (pointer, hdata: 'completion_partial') +
- 'next_item' (pointer, hdata: 'completion_partial') |
+ 'prev_item' (pointer, hdata: "completion_partial") +
+ 'next_item' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | config_file | Konfigurationsdatei |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'filename' (string) +
'file' (pointer) +
'callback_reload' (pointer) +
'callback_reload_data' (pointer) +
- 'sections' (pointer, hdata: 'config_section') +
- 'last_section' (pointer, hdata: 'config_section') +
- 'prev_config' (pointer, hdata: 'config_file') +
- 'next_config' (pointer, hdata: 'config_file') |
+ 'sections' (pointer, hdata: "config_section") +
+ 'last_section' (pointer, hdata: "config_section") +
+ 'prev_config' (pointer, hdata: "config_file") +
+ 'next_config' (pointer, hdata: "config_file") |
+ |
'config_files' +
'last_config_file'
| weechat | config_option | Konfigurationsoptionen |
- 'config_file' (pointer, hdata: 'config_file') +
- 'section' (pointer, hdata: 'config_section') +
+ 'config_file' (pointer, hdata: "config_file") +
+ 'section' (pointer, hdata: "config_section") +
'name' (string) +
'type' (integer) +
'description' (string) +
- 'string_values' (string, array_size: '*') +
+ 'string_values' (string, array_size: "*") +
'min' (integer) +
'max' (integer) +
'default_value' (pointer) +
@@ -487,12 +509,13 @@
'callback_delete' (pointer) +
'callback_delete_data' (pointer) +
'loaded' (integer) +
- 'prev_option' (pointer, hdata: 'config_option') +
- 'next_option' (pointer, hdata: 'config_option') |
+ 'prev_option' (pointer, hdata: "config_option") +
+ 'next_option' (pointer, hdata: "config_option") |
+ |
-
| weechat | config_section | Konfigurationssektion |
- 'config_file' (pointer, hdata: 'config_file') +
+ 'config_file' (pointer, hdata: "config_file") +
'name' (string) +
'user_can_add_options' (integer) +
'user_can_delete_options' (integer) +
@@ -506,10 +529,11 @@
'callback_create_option_data' (pointer) +
'callback_delete_option' (pointer) +
'callback_delete_option_data' (pointer) +
- 'options' (pointer, hdata: 'config_option') +
- 'last_option' (pointer, hdata: 'config_option') +
- 'prev_section' (pointer, hdata: 'config_section') +
- 'next_section' (pointer, hdata: 'config_section') |
+ 'options' (pointer, hdata: "config_option") +
+ 'last_option' (pointer, hdata: "config_option") +
+ 'prev_section' (pointer, hdata: "config_section") +
+ 'next_section' (pointer, hdata: "config_section") |
+ |
-
| weechat | filter | Filter |
@@ -520,19 +544,21 @@
'buffers' (pointer) +
'tags' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'regex' (string) +
'regex_prefix' (pointer) +
'regex_message' (pointer) +
- 'prev_filter' (pointer, hdata: 'filter') +
- 'next_filter' (pointer, hdata: 'filter') |
+ 'prev_filter' (pointer, hdata: "filter") +
+ 'next_filter' (pointer, hdata: "filter") |
+ |
'gui_filters' +
'last_gui_filter'
| weechat | history | Verlaufspeicher von Befehlen in einem Buffer |
'text' (string) +
- 'next_history' (pointer, hdata: 'history') +
- 'prev_history' (pointer, hdata: 'history') |
+ 'next_history' (pointer, hdata: "history") +
+ 'prev_history' (pointer, hdata: "history") |
+ |
-
| weechat | hotlist | Hotliste |
@@ -540,17 +566,19 @@
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
- 'count' (integer, array_size: '4') +
- 'prev_hotlist' (pointer, hdata: 'hotlist') +
- 'next_hotlist' (pointer, hdata: 'hotlist') |
+ 'count' (integer, array_size: "4") +
+ 'prev_hotlist' (pointer, hdata: "hotlist") +
+ 'next_hotlist' (pointer, hdata: "hotlist") |
+ |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | Struktur der Rücknahmen für die Befehlszeile |
'data' (string) +
'pos' (integer) +
- 'prev_undo' (pointer, hdata: 'input_undo') +
- 'next_undo' (pointer, hdata: 'input_undo') |
+ 'prev_undo' (pointer, hdata: "input_undo") +
+ 'next_undo' (pointer, hdata: "input_undo") |
+ |
-
| weechat | key | Tastenbelegung (Tastaturkurzbefehl) |
@@ -560,8 +588,9 @@
'area_key' (string) +
'command' (string) +
'score' (integer) +
- 'prev_key' (pointer, hdata: 'key') +
- 'next_key' (pointer, hdata: 'key') |
+ 'prev_key' (pointer, hdata: "key") +
+ 'next_key' (pointer, hdata: "key") |
+ |
'gui_default_keys' +
'gui_default_keys_cursor' +
'gui_default_keys_mouse' +
@@ -580,47 +609,55 @@
'last_gui_key_search'
| weechat | line | Struktur mit einer Zeile |
- 'data' (pointer, hdata: 'line_data') +
- 'prev_line' (pointer, hdata: 'line') +
- 'next_line' (pointer, hdata: 'line') |
+ 'data' (pointer, hdata: "line_data") +
+ 'prev_line' (pointer, hdata: "line") +
+ 'next_line' (pointer, hdata: "line") |
+ |
-
| weechat | line_data | Struktur mit einzeiligen Daten |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'y' (integer) +
'date' (time) +
'date_printed' (time) +
'str_time' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'displayed' (char) +
'highlight' (char) +
'refresh_needed' (char) +
'prefix' (string) +
'prefix_length' (integer) +
'message' (string) |
+ 'date' (time) +
+ 'date_printed' (time) +
+ 'tags_array' (string) +
+ 'prefix' (string) +
+ 'message' (string) |
-
| weechat | lines | Struktur mit Zeilen |
- 'first_line' (pointer, hdata: 'line') +
- 'last_line' (pointer, hdata: 'line') +
- 'last_read_line' (pointer, hdata: 'line') +
+ 'first_line' (pointer, hdata: "line") +
+ 'last_line' (pointer, hdata: "line") +
+ 'last_read_line' (pointer, hdata: "line") +
'lines_count' (integer) +
'first_line_not_read' (integer) +
'lines_hidden' (integer) +
'buffer_max_length' (integer) +
'prefix_max_length' (integer) |
+ |
-
| weechat | nick | Nick in Nickliste |
- 'group' (pointer, hdata: 'nick_group') +
+ 'group' (pointer, hdata: "nick_group") +
'name' (string) +
'color' (string) +
'prefix' (string) +
'prefix_color' (string) +
'visible' (integer) +
- 'prev_nick' (pointer, hdata: 'nick') +
- 'next_nick' (pointer, hdata: 'nick') |
+ 'prev_nick' (pointer, hdata: "nick") +
+ 'next_nick' (pointer, hdata: "nick") |
+ |
-
| weechat | nick_group | Gruppen in Nickliste |
@@ -628,13 +665,14 @@
'color' (string) +
'visible' (integer) +
'level' (integer) +
- 'parent' (pointer, hdata: 'nick_group') +
- 'children' (pointer, hdata: 'nick_group') +
- 'last_child' (pointer, hdata: 'nick_group') +
- 'nicks' (pointer, hdata: 'nick') +
- 'last_nick' (pointer, hdata: 'nick') +
- 'prev_group' (pointer, hdata: 'nick_group') +
- 'next_group' (pointer, hdata: 'nick_group') |
+ 'parent' (pointer, hdata: "nick_group") +
+ 'children' (pointer, hdata: "nick_group") +
+ 'last_child' (pointer, hdata: "nick_group") +
+ 'nicks' (pointer, hdata: "nick") +
+ 'last_nick' (pointer, hdata: "nick") +
+ 'prev_group' (pointer, hdata: "nick_group") +
+ 'next_group' (pointer, hdata: "nick_group") |
+ |
-
| weechat | plugin | Erweiterung |
@@ -647,8 +685,9 @@
'license' (string) +
'charset' (string) +
'debug' (integer) +
- 'prev_plugin' (pointer, hdata: 'plugin') +
- 'next_plugin' (pointer, hdata: 'plugin') |
+ 'prev_plugin' (pointer, hdata: "plugin") +
+ 'next_plugin' (pointer, hdata: "plugin") |
+ |
'last_weechat_plugin' +
'weechat_plugins'
@@ -666,41 +705,44 @@
'win_chat_height' (integer) +
'win_chat_cursor_x' (integer) +
'win_chat_cursor_y' (integer) +
- 'bar_windows' (pointer, hdata: 'bar_window') +
- 'last_bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_windows' (pointer, hdata: "bar_window") +
+ 'last_bar_window' (pointer, hdata: "bar_window") +
'refresh_needed' (integer) +
'gui_objects' (pointer) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'layout_plugin_name' (string) +
'layout_buffer_name' (string) +
- 'scroll' (pointer, hdata: 'window_scroll') +
- 'ptr_tree' (pointer, hdata: 'window_tree') +
- 'prev_window' (pointer, hdata: 'window') +
- 'next_window' (pointer, hdata: 'window') |
+ 'scroll' (pointer, hdata: "window_scroll") +
+ 'ptr_tree' (pointer, hdata: "window_tree") +
+ 'prev_window' (pointer, hdata: "window") +
+ 'next_window' (pointer, hdata: "window") |
+ |
'gui_current_window' +
'gui_windows' +
'last_gui_window'
| weechat | window_scroll | Scroll-Info in Fenstern |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'first_line_displayed' (integer) +
- 'start_line' (pointer, hdata: 'line') +
+ 'start_line' (pointer, hdata: "line") +
'start_line_pos' (integer) +
'scrolling' (integer) +
'start_col' (integer) +
'lines_after' (integer) +
'reset_allowed' (integer) +
- 'prev_scroll' (pointer, hdata: 'window_scroll') +
- 'next_scroll' (pointer, hdata: 'window_scroll') |
+ 'prev_scroll' (pointer, hdata: "window_scroll") +
+ 'next_scroll' (pointer, hdata: "window_scroll") |
+ |
-
| weechat | window_tree | Baumstruktur der Fenster |
- 'parent_node' (pointer, hdata: 'window_tree') +
+ 'parent_node' (pointer, hdata: "window_tree") +
'split_pct' (integer) +
'split_horizontal' (integer) +
- 'child1' (pointer, hdata: 'window_tree') +
- 'child2' (pointer, hdata: 'window_tree') +
- 'window' (pointer, hdata: 'window') |
+ 'child1' (pointer, hdata: "window_tree") +
+ 'child2' (pointer, hdata: "window_tree") +
+ 'window' (pointer, hdata: "window") |
+ |
'gui_windows_tree'
|========================================
diff --git a/doc/docgen.py b/doc/docgen.py
index 43a4365ab..569346a43 100644
--- a/doc/docgen.py
+++ b/doc/docgen.py
@@ -201,6 +201,7 @@ def get_hdata():
plugin = weechat.infolist_string(infolist, 'plugin_name') or 'weechat'
hdata[plugin][hdata_name]['description'] = weechat.infolist_string(infolist, 'description')
variables = ''
+ variables_update = ''
lists = ''
ptr_hdata = weechat.hdata_get(hdata_name)
if ptr_hdata:
@@ -208,26 +209,34 @@ def get_hdata():
string = weechat.hdata_get_string(ptr_hdata, 'var_keys_values')
if string:
for item in string.split(','):
- (key, value) = item.split(':')
- var_type = int(value) >> 16
- var_offset = int(value) & 0xFFFF
+ key = item.split(':')[0]
+ var_offset = weechat.hdata_get_var_offset(ptr_hdata, key)
var_array_size = weechat.hdata_get_var_array_size_string(ptr_hdata, '', key)
if var_array_size:
- var_array_size = ', array_size: \'%s\'' % var_array_size
+ var_array_size = ', array_size: "%s"' % var_array_size
var_hdata = weechat.hdata_get_var_hdata(ptr_hdata, key)
if var_hdata:
- var_hdata = ', hdata: \'%s\'' % var_hdata
+ var_hdata = ', hdata: "%s"' % var_hdata
+ type_string = weechat.hdata_get_var_type_string(ptr_hdata, key)
hdata2.append({'offset': var_offset,
- 'text': '\'%s\' (%s%s%s)' % (key,
- weechat.hdata_get_var_type_string(ptr_hdata, key),
- var_array_size,
- var_hdata)})
+ 'text': '\'%s\' (%s)' % (key, type_string),
+ 'textlong': '\'%s\' (%s%s%s)' % (key, type_string, var_array_size, var_hdata),
+ 'update': weechat.hdata_update(ptr_hdata, '', { '__update_allowed': key })})
hdata2 = sorted(hdata2, key=itemgetter('offset'))
for item in hdata2:
if variables:
variables += ' +\n'
- variables += ' %s' % item['text']
+ variables += ' %s' % item['textlong']
+ if item['update']:
+ if variables_update:
+ variables_update += ' +\n'
+ variables_update += ' %s' % item['text']
+ if weechat.hdata_update(ptr_hdata, '', { '__delete_allowed' : '' }):
+ if variables_update:
+ variables_update += ' +\n'
+ variables_update += ' \'__delete\''
hdata[plugin][hdata_name]['vars'] = '\n%s' % variables
+ hdata[plugin][hdata_name]['vars_update'] = '\n%s' % variables_update
string = weechat.hdata_get_string(ptr_hdata, 'list_keys')
if string:
@@ -480,20 +489,23 @@ def docgen_cmd_cb(data, buffer, args):
filename = '%s/plugin_api/hdata.txt' % directory
tmpfilename = '%s.tmp' % filename
f = open(tmpfilename, 'w')
- f.write('[width="100%",cols="^1,^2,5,5,5",options="header"]\n')
+ f.write('[width="100%",cols="^1,^2,5,5,5,5",options="header"]\n')
f.write('|========================================\n')
- f.write('| %s | %s | %s | %s | %s\n\n' % (_('Plugin'), _('Name'), _('Description'),
- _('Variables'), _('Lists')))
+ f.write('| %s | %s | %s | %s | %s | %s\n\n' % (_('Plugin'), _('Name'), _('Description'),
+ _('Variables'), _('Update allowed'),
+ _('Lists')))
for plugin in sorted(hdata):
for hdata_name in sorted(hdata[plugin]):
description = translate(hdata[plugin][hdata_name]['description'])
variables = hdata[plugin][hdata_name]['vars']
+ variables_update = hdata[plugin][hdata_name]['vars_update']
lists = hdata[plugin][hdata_name]['lists']
- f.write('| %s | %s | %s |%s |%s\n\n' % (escape(plugin),
- escape(hdata_name),
- escape(description),
- escape(variables),
- escape(lists)))
+ f.write('| %s | %s | %s |%s |%s |%s\n\n' % (escape(plugin),
+ escape(hdata_name),
+ escape(description),
+ escape(variables),
+ escape(variables_update),
+ escape(lists)))
f.write('|========================================\n')
f.close()
update_file(filename, tmpfilename, num_files, num_files_updated, 'hdata')
diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt
index 8bbac8e95..e0ac8bcd9 100644
--- a/doc/en/autogen/plugin_api/hdata.txt
+++ b/doc/en/autogen/plugin_api/hdata.txt
@@ -1,6 +1,6 @@
-[width="100%",cols="^1,^2,5,5,5",options="header"]
+[width="100%",cols="^1,^2,5,5,5,5",options="header"]
|========================================
-| Plugin | Name | Description | Variables | Lists
+| Plugin | Name | Description | Variables | Update allowed | Lists
| guile | guile_script | list of scripts |
'filename' (string) +
@@ -14,8 +14,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'guile_script') +
- 'next_script' (pointer, hdata: 'guile_script') |
+ 'prev_script' (pointer, hdata: "guile_script") +
+ 'next_script' (pointer, hdata: "guile_script") |
+ |
'last_script' +
'scripts'
@@ -36,22 +37,24 @@
'pv_remote_nick_color' (string) +
'hook_autorejoin' (pointer) +
'nicks_count' (integer) +
- 'nicks' (pointer, hdata: 'irc_nick') +
- 'last_nick' (pointer, hdata: 'irc_nick') +
+ 'nicks' (pointer, hdata: "irc_nick") +
+ 'last_nick' (pointer, hdata: "irc_nick") +
'nicks_speaking' (pointer) +
- 'nicks_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'last_nick_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'nicks_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'last_nick_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'prev_channel' (pointer, hdata: 'irc_channel') +
- 'next_channel' (pointer, hdata: 'irc_channel') |
+ 'prev_channel' (pointer, hdata: "irc_channel") +
+ 'next_channel' (pointer, hdata: "irc_channel") |
+ |
-
| irc | irc_channel_speaking | irc channel_speaking |
'nick' (string) +
'time_last_message' (time) +
- 'prev_nick' (pointer, hdata: 'irc_channel_speaking') +
- 'next_nick' (pointer, hdata: 'irc_channel_speaking') |
+ 'prev_nick' (pointer, hdata: "irc_channel_speaking") +
+ 'next_nick' (pointer, hdata: "irc_channel_speaking") |
+ |
-
| irc | irc_ignore | irc ignore |
@@ -60,8 +63,9 @@
'regex_mask' (pointer) +
'server' (string) +
'channel' (string) +
- 'prev_ignore' (pointer, hdata: 'irc_ignore') +
- 'next_ignore' (pointer, hdata: 'irc_ignore') |
+ 'prev_ignore' (pointer, hdata: "irc_ignore") +
+ 'next_ignore' (pointer, hdata: "irc_ignore") |
+ |
'irc_ignore_list' +
'last_irc_ignore'
@@ -72,23 +76,25 @@
'prefix' (string) +
'away' (integer) +
'color' (string) +
- 'prev_nick' (pointer, hdata: 'irc_nick') +
- 'next_nick' (pointer, hdata: 'irc_nick') |
+ 'prev_nick' (pointer, hdata: "irc_nick") +
+ 'next_nick' (pointer, hdata: "irc_nick") |
+ |
-
| irc | irc_notify | irc notify |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'nick' (string) +
'check_away' (integer) +
'is_on_server' (integer) +
'away_message' (string) +
'ison_received' (integer) +
- 'prev_notify' (pointer, hdata: 'irc_notify') +
- 'next_notify' (pointer, hdata: 'irc_notify') |
+ 'prev_notify' (pointer, hdata: "irc_notify") +
+ 'next_notify' (pointer, hdata: "irc_notify") |
+ |
-
| irc | irc_redirect | irc redirect |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'pattern' (string) +
'signal' (string) +
'count' (integer) +
@@ -106,8 +112,9 @@
'cmd_filter' (hashtable) +
'output' (string) +
'output_size' (integer) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect') +
- 'next_redirect' (pointer, hdata: 'irc_redirect') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect") +
+ 'next_redirect' (pointer, hdata: "irc_redirect") |
+ |
-
| irc | irc_redirect_pattern | pattern for irc redirect |
@@ -117,8 +124,9 @@
'cmd_start' (string) +
'cmd_stop' (string) +
'cmd_extra' (string) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect_pattern') +
- 'next_redirect' (pointer, hdata: 'irc_redirect_pattern') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect_pattern") +
+ 'next_redirect' (pointer, hdata: "irc_redirect_pattern") |
+ |
'irc_redirect_patterns' +
'last_irc_redirect_pattern'
@@ -129,17 +137,17 @@
'reloading_from_config' (integer) +
'reloaded_from_config' (integer) +
'addresses_count' (integer) +
- 'addresses_array' (string, array_size: 'addresses_count') +
- 'ports_array' (integer, array_size: 'addresses_count') +
+ 'addresses_array' (string, array_size: "addresses_count") +
+ 'ports_array' (integer, array_size: "addresses_count") +
'index_current_address' (integer) +
'current_address' (string) +
'current_ip' (string) +
'current_port' (integer) +
'sock' (integer) +
- 'hook_connect' (pointer, hdata: 'hook') +
- 'hook_fd' (pointer, hdata: 'hook') +
- 'hook_timer_connection' (pointer, hdata: 'hook') +
- 'hook_timer_sasl' (pointer, hdata: 'hook') +
+ 'hook_connect' (pointer, hdata: "hook") +
+ 'hook_fd' (pointer, hdata: "hook") +
+ 'hook_timer_connection' (pointer, hdata: "hook") +
+ 'hook_timer_sasl' (pointer, hdata: "hook") +
'is_connected' (integer) +
'ssl_connected' (integer) +
'gnutls_sess' (other) +
@@ -147,7 +155,7 @@
'tls_cert_key' (other) +
'unterminated_message' (string) +
'nicks_count' (integer) +
- 'nicks_array' (string, array_size: 'nicks_count') +
+ 'nicks_array' (string, array_size: "nicks_count") +
'nick_first_tried' (integer) +
'nick_alternate_number' (integer) +
'nick' (string) +
@@ -176,17 +184,18 @@
'last_away_check' (time) +
'outqueue' (pointer) +
'last_outqueue' (pointer) +
- 'redirects' (pointer, hdata: 'irc_redirect') +
- 'last_redirect' (pointer, hdata: 'irc_redirect') +
- 'notify_list' (pointer, hdata: 'irc_notify') +
- 'last_notify' (pointer, hdata: 'irc_notify') +
+ 'redirects' (pointer, hdata: "irc_redirect") +
+ 'last_redirect' (pointer, hdata: "irc_redirect") +
+ 'notify_list' (pointer, hdata: "irc_notify") +
+ 'last_notify' (pointer, hdata: "irc_notify") +
'manual_joins' (hashtable) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'channels' (pointer, hdata: 'irc_channel') +
- 'last_channel' (pointer, hdata: 'irc_channel') +
- 'prev_server' (pointer, hdata: 'irc_server') +
- 'next_server' (pointer, hdata: 'irc_server') |
+ 'channels' (pointer, hdata: "irc_channel") +
+ 'last_channel' (pointer, hdata: "irc_channel") +
+ 'prev_server' (pointer, hdata: "irc_server") +
+ 'next_server' (pointer, hdata: "irc_server") |
+ |
'irc_servers' +
'last_irc_server'
@@ -202,8 +211,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'lua_script') +
- 'next_script' (pointer, hdata: 'lua_script') |
+ 'prev_script' (pointer, hdata: "lua_script") +
+ 'next_script' (pointer, hdata: "lua_script") |
+ |
'last_script' +
'scripts'
@@ -219,8 +229,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'perl_script') +
- 'next_script' (pointer, hdata: 'perl_script') |
+ 'prev_script' (pointer, hdata: "perl_script") +
+ 'next_script' (pointer, hdata: "perl_script") |
+ |
'last_script' +
'scripts'
@@ -236,8 +247,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'python_script') +
- 'next_script' (pointer, hdata: 'python_script') |
+ 'prev_script' (pointer, hdata: "python_script") +
+ 'next_script' (pointer, hdata: "python_script") |
+ |
'last_script' +
'scripts'
@@ -253,8 +265,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'ruby_script') +
- 'next_script' (pointer, hdata: 'ruby_script') |
+ 'prev_script' (pointer, hdata: "ruby_script") +
+ 'next_script' (pointer, hdata: "ruby_script") |
+ |
'last_script' +
'scripts'
@@ -280,8 +293,9 @@
'version_loaded' (string) +
'displayed' (integer) +
'install_order' (integer) +
- 'prev_script' (pointer, hdata: 'script_script') +
- 'next_script' (pointer, hdata: 'script_script') |
+ 'prev_script' (pointer, hdata: "script_script") +
+ 'next_script' (pointer, hdata: "script_script") |
+ |
'last_repo_script' +
'repo_scripts'
@@ -297,8 +311,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'tcl_script') +
- 'next_script' (pointer, hdata: 'tcl_script') |
+ 'prev_script' (pointer, hdata: "tcl_script") +
+ 'next_script' (pointer, hdata: "tcl_script") |
+ |
'last_script' +
'scripts'
@@ -306,32 +321,34 @@
'name' (string) +
'options' (pointer) +
'conditions_count' (integer) +
- 'conditions_array' (string, array_size: 'conditions_count') +
+ 'conditions_array' (string, array_size: "conditions_count") +
'items_count' (integer) +
'items_subcount' (pointer) +
'items_array' (pointer) +
'items_prefix' (pointer) +
'items_name' (pointer) +
'items_suffix' (pointer) +
- 'bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_window' (pointer, hdata: "bar_window") +
'bar_refresh_needed' (integer) +
- 'prev_bar' (pointer, hdata: 'bar') +
- 'next_bar' (pointer, hdata: 'bar') |
+ 'prev_bar' (pointer, hdata: "bar") +
+ 'next_bar' (pointer, hdata: "bar") |
+ |
'gui_bars' +
'last_gui_bar'
| weechat | bar_item | bar item |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'build_callback' (pointer) +
'build_callback_data' (pointer) +
- 'prev_item' (pointer, hdata: 'bar_item') +
- 'next_item' (pointer, hdata: 'bar_item') |
+ 'prev_item' (pointer, hdata: "bar_item") +
+ 'next_item' (pointer, hdata: "bar_item") |
+ |
'gui_bar_items' +
'last_gui_bar_item'
| weechat | bar_window | bar window |
- 'bar' (pointer, hdata: 'bar') +
+ 'bar' (pointer, hdata: "bar") +
'x' (integer) +
'y' (integer) +
'width' (integer) +
@@ -350,12 +367,13 @@
'coords_count' (integer) +
'coords' (pointer) +
'gui_objects' (pointer) +
- 'prev_bar_window' (pointer, hdata: 'bar_window') +
- 'next_bar_window' (pointer, hdata: 'bar_window') |
+ 'prev_bar_window' (pointer, hdata: "bar_window") +
+ 'next_bar_window' (pointer, hdata: "bar_window") |
+ |
-
| weechat | buffer | buffer |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'plugin_name_for_upgrade' (string) +
'number' (integer) +
'layout_number' (integer) +
@@ -371,14 +389,14 @@
'close_callback' (pointer) +
'close_callback_data' (pointer) +
'title' (string) +
- 'own_lines' (pointer, hdata: 'lines') +
- 'mixed_lines' (pointer, hdata: 'lines') +
- 'lines' (pointer, hdata: 'lines') +
+ 'own_lines' (pointer, hdata: "lines") +
+ 'mixed_lines' (pointer, hdata: "lines") +
+ 'lines' (pointer, hdata: "lines") +
'time_for_each_line' (integer) +
'chat_refresh_needed' (integer) +
'nicklist' (integer) +
'nicklist_case_sensitive' (integer) +
- 'nicklist_root' (pointer, hdata: 'nick_group') +
+ 'nicklist_root' (pointer, hdata: "nick_group") +
'nicklist_max_length' (integer) +
'nicklist_display_groups' (integer) +
'nicklist_visible_count' (integer) +
@@ -394,15 +412,15 @@
'input_buffer_length' (integer) +
'input_buffer_pos' (integer) +
'input_buffer_1st_display' (integer) +
- 'input_undo_snap' (pointer, hdata: 'input_undo') +
- 'input_undo' (pointer, hdata: 'input_undo') +
- 'last_input_undo' (pointer, hdata: 'input_undo') +
- 'ptr_input_undo' (pointer, hdata: 'input_undo') +
+ 'input_undo_snap' (pointer, hdata: "input_undo") +
+ 'input_undo' (pointer, hdata: "input_undo") +
+ 'last_input_undo' (pointer, hdata: "input_undo") +
+ 'ptr_input_undo' (pointer, hdata: "input_undo") +
'input_undo_count' (integer) +
- 'completion' (pointer, hdata: 'completion') +
- 'history' (pointer, hdata: 'history') +
- 'last_history' (pointer, hdata: 'history') +
- 'ptr_history' (pointer, hdata: 'history') +
+ 'completion' (pointer, hdata: "completion") +
+ 'history' (pointer, hdata: "history") +
+ 'last_history' (pointer, hdata: "history") +
+ 'ptr_history' (pointer, hdata: "history") +
'num_history' (integer) +
'text_search' (integer) +
'text_search_exact' (integer) +
@@ -413,20 +431,21 @@
'highlight_regex_compiled' (pointer) +
'highlight_tags' (string) +
'highlight_tags_count' (integer) +
- 'highlight_tags_array' (string, array_size: 'highlight_tags_count') +
+ 'highlight_tags_array' (string, array_size: "highlight_tags_count") +
'hotlist_max_level_nicks' (hashtable) +
- 'keys' (pointer, hdata: 'key') +
- 'last_key' (pointer, hdata: 'key') +
+ 'keys' (pointer, hdata: "key") +
+ 'last_key' (pointer, hdata: "key") +
'keys_count' (integer) +
'local_variables' (hashtable) +
- 'prev_buffer' (pointer, hdata: 'buffer') +
- 'next_buffer' (pointer, hdata: 'buffer') |
+ 'prev_buffer' (pointer, hdata: "buffer") +
+ 'next_buffer' (pointer, hdata: "buffer") |
+ |
'gui_buffer_last_displayed' +
'gui_buffers' +
'last_gui_buffer'
| weechat | completion | structure with completion |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'context' (integer) +
'base_command' (string) +
'base_command_arg_index' (integer) +
@@ -443,38 +462,41 @@
'position_replace' (integer) +
'diff_size' (integer) +
'diff_length' (integer) +
- 'partial_completion_list' (pointer, hdata: 'completion_partial') +
- 'last_partial_completion' (pointer, hdata: 'completion_partial') |
+ 'partial_completion_list' (pointer, hdata: "completion_partial") +
+ 'last_partial_completion' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | completion_partial | structure with partial completion |
'word' (string) +
'count' (integer) +
- 'prev_item' (pointer, hdata: 'completion_partial') +
- 'next_item' (pointer, hdata: 'completion_partial') |
+ 'prev_item' (pointer, hdata: "completion_partial") +
+ 'next_item' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | config_file | config file |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'filename' (string) +
'file' (pointer) +
'callback_reload' (pointer) +
'callback_reload_data' (pointer) +
- 'sections' (pointer, hdata: 'config_section') +
- 'last_section' (pointer, hdata: 'config_section') +
- 'prev_config' (pointer, hdata: 'config_file') +
- 'next_config' (pointer, hdata: 'config_file') |
+ 'sections' (pointer, hdata: "config_section") +
+ 'last_section' (pointer, hdata: "config_section") +
+ 'prev_config' (pointer, hdata: "config_file") +
+ 'next_config' (pointer, hdata: "config_file") |
+ |
'config_files' +
'last_config_file'
| weechat | config_option | config option |
- 'config_file' (pointer, hdata: 'config_file') +
- 'section' (pointer, hdata: 'config_section') +
+ 'config_file' (pointer, hdata: "config_file") +
+ 'section' (pointer, hdata: "config_section") +
'name' (string) +
'type' (integer) +
'description' (string) +
- 'string_values' (string, array_size: '*') +
+ 'string_values' (string, array_size: "*") +
'min' (integer) +
'max' (integer) +
'default_value' (pointer) +
@@ -487,12 +509,13 @@
'callback_delete' (pointer) +
'callback_delete_data' (pointer) +
'loaded' (integer) +
- 'prev_option' (pointer, hdata: 'config_option') +
- 'next_option' (pointer, hdata: 'config_option') |
+ 'prev_option' (pointer, hdata: "config_option") +
+ 'next_option' (pointer, hdata: "config_option") |
+ |
-
| weechat | config_section | config section |
- 'config_file' (pointer, hdata: 'config_file') +
+ 'config_file' (pointer, hdata: "config_file") +
'name' (string) +
'user_can_add_options' (integer) +
'user_can_delete_options' (integer) +
@@ -506,10 +529,11 @@
'callback_create_option_data' (pointer) +
'callback_delete_option' (pointer) +
'callback_delete_option_data' (pointer) +
- 'options' (pointer, hdata: 'config_option') +
- 'last_option' (pointer, hdata: 'config_option') +
- 'prev_section' (pointer, hdata: 'config_section') +
- 'next_section' (pointer, hdata: 'config_section') |
+ 'options' (pointer, hdata: "config_option") +
+ 'last_option' (pointer, hdata: "config_option") +
+ 'prev_section' (pointer, hdata: "config_section") +
+ 'next_section' (pointer, hdata: "config_section") |
+ |
-
| weechat | filter | filter |
@@ -520,19 +544,21 @@
'buffers' (pointer) +
'tags' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'regex' (string) +
'regex_prefix' (pointer) +
'regex_message' (pointer) +
- 'prev_filter' (pointer, hdata: 'filter') +
- 'next_filter' (pointer, hdata: 'filter') |
+ 'prev_filter' (pointer, hdata: "filter") +
+ 'next_filter' (pointer, hdata: "filter") |
+ |
'gui_filters' +
'last_gui_filter'
| weechat | history | history of commands in buffer |
'text' (string) +
- 'next_history' (pointer, hdata: 'history') +
- 'prev_history' (pointer, hdata: 'history') |
+ 'next_history' (pointer, hdata: "history") +
+ 'prev_history' (pointer, hdata: "history") |
+ |
-
| weechat | hotlist | hotlist |
@@ -540,17 +566,19 @@
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
- 'count' (integer, array_size: '4') +
- 'prev_hotlist' (pointer, hdata: 'hotlist') +
- 'next_hotlist' (pointer, hdata: 'hotlist') |
+ 'count' (integer, array_size: "4") +
+ 'prev_hotlist' (pointer, hdata: "hotlist") +
+ 'next_hotlist' (pointer, hdata: "hotlist") |
+ |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | structure with undo for input line |
'data' (string) +
'pos' (integer) +
- 'prev_undo' (pointer, hdata: 'input_undo') +
- 'next_undo' (pointer, hdata: 'input_undo') |
+ 'prev_undo' (pointer, hdata: "input_undo") +
+ 'next_undo' (pointer, hdata: "input_undo") |
+ |
-
| weechat | key | a key (keyboard shortcut) |
@@ -560,8 +588,9 @@
'area_key' (string) +
'command' (string) +
'score' (integer) +
- 'prev_key' (pointer, hdata: 'key') +
- 'next_key' (pointer, hdata: 'key') |
+ 'prev_key' (pointer, hdata: "key") +
+ 'next_key' (pointer, hdata: "key") |
+ |
'gui_default_keys' +
'gui_default_keys_cursor' +
'gui_default_keys_mouse' +
@@ -580,47 +609,55 @@
'last_gui_key_search'
| weechat | line | structure with one line |
- 'data' (pointer, hdata: 'line_data') +
- 'prev_line' (pointer, hdata: 'line') +
- 'next_line' (pointer, hdata: 'line') |
+ 'data' (pointer, hdata: "line_data") +
+ 'prev_line' (pointer, hdata: "line") +
+ 'next_line' (pointer, hdata: "line") |
+ |
-
| weechat | line_data | structure with one line data |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'y' (integer) +
'date' (time) +
'date_printed' (time) +
'str_time' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'displayed' (char) +
'highlight' (char) +
'refresh_needed' (char) +
'prefix' (string) +
'prefix_length' (integer) +
'message' (string) |
+ 'date' (time) +
+ 'date_printed' (time) +
+ 'tags_array' (string) +
+ 'prefix' (string) +
+ 'message' (string) |
-
| weechat | lines | structure with lines |
- 'first_line' (pointer, hdata: 'line') +
- 'last_line' (pointer, hdata: 'line') +
- 'last_read_line' (pointer, hdata: 'line') +
+ 'first_line' (pointer, hdata: "line") +
+ 'last_line' (pointer, hdata: "line") +
+ 'last_read_line' (pointer, hdata: "line") +
'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, hdata: 'nick_group') +
+ 'group' (pointer, hdata: "nick_group") +
'name' (string) +
'color' (string) +
'prefix' (string) +
'prefix_color' (string) +
'visible' (integer) +
- 'prev_nick' (pointer, hdata: 'nick') +
- 'next_nick' (pointer, hdata: 'nick') |
+ 'prev_nick' (pointer, hdata: "nick") +
+ 'next_nick' (pointer, hdata: "nick") |
+ |
-
| weechat | nick_group | group in nicklist |
@@ -628,13 +665,14 @@
'color' (string) +
'visible' (integer) +
'level' (integer) +
- 'parent' (pointer, hdata: 'nick_group') +
- 'children' (pointer, hdata: 'nick_group') +
- 'last_child' (pointer, hdata: 'nick_group') +
- 'nicks' (pointer, hdata: 'nick') +
- 'last_nick' (pointer, hdata: 'nick') +
- 'prev_group' (pointer, hdata: 'nick_group') +
- 'next_group' (pointer, hdata: 'nick_group') |
+ 'parent' (pointer, hdata: "nick_group") +
+ 'children' (pointer, hdata: "nick_group") +
+ 'last_child' (pointer, hdata: "nick_group") +
+ 'nicks' (pointer, hdata: "nick") +
+ 'last_nick' (pointer, hdata: "nick") +
+ 'prev_group' (pointer, hdata: "nick_group") +
+ 'next_group' (pointer, hdata: "nick_group") |
+ |
-
| weechat | plugin | plugin |
@@ -647,8 +685,9 @@
'license' (string) +
'charset' (string) +
'debug' (integer) +
- 'prev_plugin' (pointer, hdata: 'plugin') +
- 'next_plugin' (pointer, hdata: 'plugin') |
+ 'prev_plugin' (pointer, hdata: "plugin") +
+ 'next_plugin' (pointer, hdata: "plugin") |
+ |
'last_weechat_plugin' +
'weechat_plugins'
@@ -666,41 +705,44 @@
'win_chat_height' (integer) +
'win_chat_cursor_x' (integer) +
'win_chat_cursor_y' (integer) +
- 'bar_windows' (pointer, hdata: 'bar_window') +
- 'last_bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_windows' (pointer, hdata: "bar_window") +
+ 'last_bar_window' (pointer, hdata: "bar_window") +
'refresh_needed' (integer) +
'gui_objects' (pointer) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'layout_plugin_name' (string) +
'layout_buffer_name' (string) +
- 'scroll' (pointer, hdata: 'window_scroll') +
- 'ptr_tree' (pointer, hdata: 'window_tree') +
- 'prev_window' (pointer, hdata: 'window') +
- 'next_window' (pointer, hdata: 'window') |
+ 'scroll' (pointer, hdata: "window_scroll") +
+ 'ptr_tree' (pointer, hdata: "window_tree") +
+ 'prev_window' (pointer, hdata: "window") +
+ 'next_window' (pointer, hdata: "window") |
+ |
'gui_current_window' +
'gui_windows' +
'last_gui_window'
| weechat | window_scroll | scroll info in window |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'first_line_displayed' (integer) +
- 'start_line' (pointer, hdata: 'line') +
+ 'start_line' (pointer, hdata: "line") +
'start_line_pos' (integer) +
'scrolling' (integer) +
'start_col' (integer) +
'lines_after' (integer) +
'reset_allowed' (integer) +
- 'prev_scroll' (pointer, hdata: 'window_scroll') +
- 'next_scroll' (pointer, hdata: 'window_scroll') |
+ 'prev_scroll' (pointer, hdata: "window_scroll") +
+ 'next_scroll' (pointer, hdata: "window_scroll") |
+ |
-
| weechat | window_tree | tree of windows |
- 'parent_node' (pointer, hdata: 'window_tree') +
+ 'parent_node' (pointer, hdata: "window_tree") +
'split_pct' (integer) +
'split_horizontal' (integer) +
- 'child1' (pointer, hdata: 'window_tree') +
- 'child2' (pointer, hdata: 'window_tree') +
- 'window' (pointer, hdata: 'window') |
+ 'child1' (pointer, hdata: "window_tree") +
+ 'child2' (pointer, hdata: "window_tree") +
+ 'window' (pointer, hdata: "window") |
+ |
'gui_windows_tree'
|========================================
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt
index 2023eb2d7..572cd3d6e 100644
--- a/doc/en/weechat_plugin_api.en.txt
+++ b/doc/en/weechat_plugin_api.en.txt
@@ -12760,7 +12760,7 @@ something in memory pointed by hdata variables.
weechat_hdata_new
^^^^^^^^^^^^^^^^^
-_New in version 0.3.6._
+_New in version 0.3.6, updated in 0.3.9._
Create a new hdata.
@@ -12779,7 +12779,13 @@ Prototype:
[source,C]
----------------------------------------
-struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next);
+struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next,
+ int delete_allowed,
+ int (*callback_update)(void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable),
+ void *callback_update_data);
----------------------------------------
Arguments:
@@ -12789,6 +12795,17 @@ Arguments:
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)
+* 'delete_allowed': 1 if delete of structure is allowed, otherwise 0
+ (_new in version 0.3.9_)
+* 'callback_update': callback to update data in hdata, can be NULL if no update
+ is allowed (_new in version 0.3.9_), arguments and return value:
+** 'void *data': pointer
+** 'struct t_hdata *hdata': pointer to hdata
+** 'struct t_hashtable *hashtable': hashtable with variables to update
+ (see <<_weechat_hdata_update,weechat_hdata_update>>)
+** return value: number of variables updated
+* 'callback_update_data': pointer given to update callback when it is called by
+ WeeChat (_new in version 0.3.9_)
Return value:
@@ -12798,7 +12815,7 @@ C example:
[source,C]
----------------------------------------
-struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next");
+struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next", 0, &callback_update, NULL);
----------------------------------------
[NOTE]
@@ -12807,7 +12824,7 @@ This function is not available in scripting API.
weechat_hdata_new_var
^^^^^^^^^^^^^^^^^^^^^
-_New in version 0.3.6._
+_New in version 0.3.6, updated in 0.3.9._
Create a new variable in hdata.
@@ -12816,7 +12833,7 @@ Prototype:
[source,C]
----------------------------------------
void weechat_hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type,
- const char *array_size, const char *hdata_name);
+ int update_allowed, const char *array_size, const char *hdata_name);
----------------------------------------
Arguments:
@@ -12833,6 +12850,8 @@ Arguments:
** WEECHAT_HDATA_TIME
** WEECHAT_HDATA_HASHTABLE
** WEECHAT_HDATA_OTHER
+* 'update_allowed': 1 if update of variable is allowed, otherwise 0
+ (_new in version 0.3.9_)
* 'array_size': not NULL only if a variable is an array, and it can be:
(_new in version 0.3.9_)
** name of variable in hdata: this variable will be used as size of array
@@ -12860,26 +12879,26 @@ struct t_myplugin_list
/* ... */
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, NULL, NULL);
-weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER, NULL, NULL);
-weechat_hdata_new_var (hdata, "tags_count", offsetof (struct t_myplugin_list, tags_count), WEECHAT_HDATA_INTEGER, NULL, NULL);
-weechat_hdata_new_var (hdata, "tags_array", offsetof (struct t_myplugin_list, tags_array), WEECHAT_HDATA_STRING, "tags_count", NULL);
-weechat_hdata_new_var (hdata, "string_split", offsetof (struct t_myplugin_list, string_split), WEECHAT_HDATA_STRING, "*", NULL);
-weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER, NULL, "myplugin_list");
-weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER, NULL, "myplugin_list");
+weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "tags_count", offsetof (struct t_myplugin_list, tags_count), WEECHAT_HDATA_INTEGER, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "tags_array", offsetof (struct t_myplugin_list, tags_array), WEECHAT_HDATA_STRING, 0, "tags_count", NULL);
+weechat_hdata_new_var (hdata, "string_split", offsetof (struct t_myplugin_list, string_split), WEECHAT_HDATA_STRING, 0, "*", NULL);
+weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER, 0, NULL, "myplugin_list");
+weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER, 0, NULL, "myplugin_list");
----------------------------------------
The macro "WEECHAT_HDATA_VAR" can be used to shorten code:
[source,C]
----------------------------------------
-WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_count, INTEGER, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_array, STRING, "tags_count", NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, string_split, STRING, "*", NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER, NULL, "myplugin_list");
-WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER, NULL, "myplugin_list");
+WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_count, INTEGER, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_array, STRING, 0, "tags_count", NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, string_split, STRING, 0, "*", NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER, 0, NULL, "myplugin_list");
+WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER, 0, NULL, "myplugin_list");
----------------------------------------
[NOTE]
@@ -13783,18 +13802,15 @@ Script (Python):
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")
+buf = weechat.buffer_search_main()
+ptr = weechat.hdata_pointer(weechat.hdata_get("buffer"), buf, "lines")
if ptr:
- hdata = weechat.hdata_get("lines")
- ptr = weechat.hdata_pointer(hdata, ptr, "first_line")
+ ptr = weechat.hdata_pointer(weechat.hdata_get("lines"), ptr, "first_line")
if ptr:
- hdata = weechat.hdata_get("line")
- ptr = weechat.hdata_pointer(hdata, ptr, "data")
+ ptr = weechat.hdata_pointer(weechat.hdata_get("line"), ptr, "data")
if ptr:
- hdata = weechat.hdata_get("line_data")
- weechat.prnt("", "time of last line displayed = %s" % weechat.hdata_time(hdata, ptr, "date"))
+ date = weechat.hdata_time(weechat.hdata_get("line_data"), ptr, "date")
+ weechat.prnt("", "time of first line displayed = %s" % time.strftime("%F %T", time.localtime(int(date))))
----------------------------------------
weechat_hdata_hashtable
@@ -13849,6 +13865,132 @@ for key in hash:
weechat.prnt("", " %s == %s" % (key, hash[key]))
----------------------------------------
+weechat_hdata_set
+^^^^^^^^^^^^^^^^^
+
+_New in version 0.3.9._
+
+Set new value for variable in a hdata.
+
+[NOTE]
+This function can be called only in an update callback
+(see <<_weechat_hdata_new,weechat_hdata_new>> and
+<<_weechat_hdata_update,weechat_hdata_update>>), if the variable can be updated.
+
+Prototype:
+
+[source,C]
+----------------------------------------
+int weechat_hdata_set (struct t_hdata *hdata, void *pointer, const char *name, const char *value);
+----------------------------------------
+
+Arguments:
+
+* 'hdata': hdata pointer
+* 'pointer': pointer to WeeChat/plugin object
+* 'name': variable name (types allowed: char, integer, long, string, pointer,
+ time)
+* 'value': new value for variable
+
+Return value:
+
+* 1 if ok, 0 if error
+
+C example:
+
+[source,C]
+----------------------------------------
+weechat_hdata_set (hdata, pointer, "message", "test");
+----------------------------------------
+
+[NOTE]
+This function is not available in scripting API.
+
+weechat_hdata_update
+^^^^^^^^^^^^^^^^^^^^
+
+_New in version 0.3.9._
+
+Update data in a hdata.
+
+Prototype:
+
+[source,C]
+----------------------------------------
+int weechat_hdata_update (struct t_hdata *hdata, void *pointer, struct t_hashtable *hashtable);
+----------------------------------------
+
+Arguments:
+
+* 'hdata': hdata pointer
+* 'pointer': pointer to WeeChat/plugin object
+* 'hashtable': variables to update: keys are name of variables, values are new
+ values for variables (keys and values are string), some special keys are
+ allowed:
+** key '__delete_allowed' (with any value): return 1 if delete is allowed for
+ structure, otherwise 0
+** key '__update_allowed', value is name of a variable: return 1 if update is
+ allowed for this variable, otherwise 0
+** key '__delete' (with any value): delete structure (if allowed)
+
+Return value:
+
+* number of variables updated
+
+C example:
+
+[source,C]
+----------------------------------------
+/* subtract one hour on last message displayed in current buffer */
+
+struct t_gui_lines *own_lines;
+struct t_gui_line *line;
+struct t_gui_line_data *line_data;
+struct t_hdata *hdata;
+struct t_hashtable *hashtable;
+char str_date[64];
+
+own_lines = weechat_hdata_pointer (weechat_hdata_get ("buffer"), weechat_current_buffer (), "own_lines");
+if (own_lines)
+{
+ line = weechat_hdata_pointer (weechat_hdata_get ("lines"), own_lines, "last_line");
+ if (line)
+ {
+ line_data = weechat_hdata_pointer (weechat_hdata_get ("line"), line, "data");
+ hdata = weechat_hdata_get ("line_data");
+ hashtable = weechat_hashtable_new (8,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
+ if (hashtable)
+ {
+ snprintf (str_date, sizeof (str_date), "%ld", ((long int)weechat_hdata_time (hdata, line_data, "date")) - 3600);
+ weechat_hashtable_set (hashtable, "date", str_date);
+ weechat_hdata_update (hdata, line_data, hashtable);
+ weechat_hashtable_free (hashtable);
+ }
+ }
+}
+----------------------------------------
+
+Script (Python):
+
+[source,python]
+----------------------------------------
+# prototype
+count = weechat.hdata_update(hdata, pointer, hashtable)
+
+# example: subtract one hour on last message displayed in current buffer
+own_lines = weechat.hdata_pointer(weechat.hdata_get('buffer'), weechat.current_buffer(), 'own_lines')
+if own_lines:
+ line = weechat.hdata_pointer(weechat.hdata_get('lines'), own_lines, 'last_line')
+ if line:
+ line_data = weechat.hdata_pointer(weechat.hdata_get('line'), line, 'data')
+ hdata = weechat.hdata_get('line_data')
+ weechat.hdata_update(hdata, line_data, { 'date': str(weechat.hdata_time(hdata, line_data, 'date') - 3600) })
+----------------------------------------
+
weechat_hdata_get_string
^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt
index 68090727a..e6837bdbb 100644
--- a/doc/fr/autogen/plugin_api/hdata.txt
+++ b/doc/fr/autogen/plugin_api/hdata.txt
@@ -1,6 +1,6 @@
-[width="100%",cols="^1,^2,5,5,5",options="header"]
+[width="100%",cols="^1,^2,5,5,5,5",options="header"]
|========================================
-| Extension | Nom | Description | Variables | Listes
+| Extension | Nom | Description | Variables | Mise à jour autorisée | Listes
| guile | guile_script | liste des scripts |
'filename' (string) +
@@ -14,8 +14,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'guile_script') +
- 'next_script' (pointer, hdata: 'guile_script') |
+ 'prev_script' (pointer, hdata: "guile_script") +
+ 'next_script' (pointer, hdata: "guile_script") |
+ |
'last_script' +
'scripts'
@@ -36,22 +37,24 @@
'pv_remote_nick_color' (string) +
'hook_autorejoin' (pointer) +
'nicks_count' (integer) +
- 'nicks' (pointer, hdata: 'irc_nick') +
- 'last_nick' (pointer, hdata: 'irc_nick') +
+ 'nicks' (pointer, hdata: "irc_nick") +
+ 'last_nick' (pointer, hdata: "irc_nick") +
'nicks_speaking' (pointer) +
- 'nicks_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'last_nick_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'nicks_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'last_nick_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'prev_channel' (pointer, hdata: 'irc_channel') +
- 'next_channel' (pointer, hdata: 'irc_channel') |
+ 'prev_channel' (pointer, hdata: "irc_channel") +
+ 'next_channel' (pointer, hdata: "irc_channel") |
+ |
-
| irc | irc_channel_speaking | channel_speaking irc |
'nick' (string) +
'time_last_message' (time) +
- 'prev_nick' (pointer, hdata: 'irc_channel_speaking') +
- 'next_nick' (pointer, hdata: 'irc_channel_speaking') |
+ 'prev_nick' (pointer, hdata: "irc_channel_speaking") +
+ 'next_nick' (pointer, hdata: "irc_channel_speaking") |
+ |
-
| irc | irc_ignore | ignore irc |
@@ -60,8 +63,9 @@
'regex_mask' (pointer) +
'server' (string) +
'channel' (string) +
- 'prev_ignore' (pointer, hdata: 'irc_ignore') +
- 'next_ignore' (pointer, hdata: 'irc_ignore') |
+ 'prev_ignore' (pointer, hdata: "irc_ignore") +
+ 'next_ignore' (pointer, hdata: "irc_ignore") |
+ |
'irc_ignore_list' +
'last_irc_ignore'
@@ -72,23 +76,25 @@
'prefix' (string) +
'away' (integer) +
'color' (string) +
- 'prev_nick' (pointer, hdata: 'irc_nick') +
- 'next_nick' (pointer, hdata: 'irc_nick') |
+ 'prev_nick' (pointer, hdata: "irc_nick") +
+ 'next_nick' (pointer, hdata: "irc_nick") |
+ |
-
| irc | irc_notify | notify irc |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'nick' (string) +
'check_away' (integer) +
'is_on_server' (integer) +
'away_message' (string) +
'ison_received' (integer) +
- 'prev_notify' (pointer, hdata: 'irc_notify') +
- 'next_notify' (pointer, hdata: 'irc_notify') |
+ 'prev_notify' (pointer, hdata: "irc_notify") +
+ 'next_notify' (pointer, hdata: "irc_notify") |
+ |
-
| irc | irc_redirect | redirection irc |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'pattern' (string) +
'signal' (string) +
'count' (integer) +
@@ -106,8 +112,9 @@
'cmd_filter' (hashtable) +
'output' (string) +
'output_size' (integer) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect') +
- 'next_redirect' (pointer, hdata: 'irc_redirect') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect") +
+ 'next_redirect' (pointer, hdata: "irc_redirect") |
+ |
-
| irc | irc_redirect_pattern | modèle pour une redirection irc |
@@ -117,8 +124,9 @@
'cmd_start' (string) +
'cmd_stop' (string) +
'cmd_extra' (string) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect_pattern') +
- 'next_redirect' (pointer, hdata: 'irc_redirect_pattern') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect_pattern") +
+ 'next_redirect' (pointer, hdata: "irc_redirect_pattern") |
+ |
'irc_redirect_patterns' +
'last_irc_redirect_pattern'
@@ -129,17 +137,17 @@
'reloading_from_config' (integer) +
'reloaded_from_config' (integer) +
'addresses_count' (integer) +
- 'addresses_array' (string, array_size: 'addresses_count') +
- 'ports_array' (integer, array_size: 'addresses_count') +
+ 'addresses_array' (string, array_size: "addresses_count") +
+ 'ports_array' (integer, array_size: "addresses_count") +
'index_current_address' (integer) +
'current_address' (string) +
'current_ip' (string) +
'current_port' (integer) +
'sock' (integer) +
- 'hook_connect' (pointer, hdata: 'hook') +
- 'hook_fd' (pointer, hdata: 'hook') +
- 'hook_timer_connection' (pointer, hdata: 'hook') +
- 'hook_timer_sasl' (pointer, hdata: 'hook') +
+ 'hook_connect' (pointer, hdata: "hook") +
+ 'hook_fd' (pointer, hdata: "hook") +
+ 'hook_timer_connection' (pointer, hdata: "hook") +
+ 'hook_timer_sasl' (pointer, hdata: "hook") +
'is_connected' (integer) +
'ssl_connected' (integer) +
'gnutls_sess' (other) +
@@ -147,7 +155,7 @@
'tls_cert_key' (other) +
'unterminated_message' (string) +
'nicks_count' (integer) +
- 'nicks_array' (string, array_size: 'nicks_count') +
+ 'nicks_array' (string, array_size: "nicks_count") +
'nick_first_tried' (integer) +
'nick_alternate_number' (integer) +
'nick' (string) +
@@ -176,17 +184,18 @@
'last_away_check' (time) +
'outqueue' (pointer) +
'last_outqueue' (pointer) +
- 'redirects' (pointer, hdata: 'irc_redirect') +
- 'last_redirect' (pointer, hdata: 'irc_redirect') +
- 'notify_list' (pointer, hdata: 'irc_notify') +
- 'last_notify' (pointer, hdata: 'irc_notify') +
+ 'redirects' (pointer, hdata: "irc_redirect") +
+ 'last_redirect' (pointer, hdata: "irc_redirect") +
+ 'notify_list' (pointer, hdata: "irc_notify") +
+ 'last_notify' (pointer, hdata: "irc_notify") +
'manual_joins' (hashtable) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'channels' (pointer, hdata: 'irc_channel') +
- 'last_channel' (pointer, hdata: 'irc_channel') +
- 'prev_server' (pointer, hdata: 'irc_server') +
- 'next_server' (pointer, hdata: 'irc_server') |
+ 'channels' (pointer, hdata: "irc_channel") +
+ 'last_channel' (pointer, hdata: "irc_channel") +
+ 'prev_server' (pointer, hdata: "irc_server") +
+ 'next_server' (pointer, hdata: "irc_server") |
+ |
'irc_servers' +
'last_irc_server'
@@ -202,8 +211,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'lua_script') +
- 'next_script' (pointer, hdata: 'lua_script') |
+ 'prev_script' (pointer, hdata: "lua_script") +
+ 'next_script' (pointer, hdata: "lua_script") |
+ |
'last_script' +
'scripts'
@@ -219,8 +229,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'perl_script') +
- 'next_script' (pointer, hdata: 'perl_script') |
+ 'prev_script' (pointer, hdata: "perl_script") +
+ 'next_script' (pointer, hdata: "perl_script") |
+ |
'last_script' +
'scripts'
@@ -236,8 +247,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'python_script') +
- 'next_script' (pointer, hdata: 'python_script') |
+ 'prev_script' (pointer, hdata: "python_script") +
+ 'next_script' (pointer, hdata: "python_script") |
+ |
'last_script' +
'scripts'
@@ -253,8 +265,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'ruby_script') +
- 'next_script' (pointer, hdata: 'ruby_script') |
+ 'prev_script' (pointer, hdata: "ruby_script") +
+ 'next_script' (pointer, hdata: "ruby_script") |
+ |
'last_script' +
'scripts'
@@ -280,8 +293,9 @@
'version_loaded' (string) +
'displayed' (integer) +
'install_order' (integer) +
- 'prev_script' (pointer, hdata: 'script_script') +
- 'next_script' (pointer, hdata: 'script_script') |
+ 'prev_script' (pointer, hdata: "script_script") +
+ 'next_script' (pointer, hdata: "script_script") |
+ |
'last_repo_script' +
'repo_scripts'
@@ -297,8 +311,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'tcl_script') +
- 'next_script' (pointer, hdata: 'tcl_script') |
+ 'prev_script' (pointer, hdata: "tcl_script") +
+ 'next_script' (pointer, hdata: "tcl_script") |
+ |
'last_script' +
'scripts'
@@ -306,32 +321,34 @@
'name' (string) +
'options' (pointer) +
'conditions_count' (integer) +
- 'conditions_array' (string, array_size: 'conditions_count') +
+ 'conditions_array' (string, array_size: "conditions_count") +
'items_count' (integer) +
'items_subcount' (pointer) +
'items_array' (pointer) +
'items_prefix' (pointer) +
'items_name' (pointer) +
'items_suffix' (pointer) +
- 'bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_window' (pointer, hdata: "bar_window") +
'bar_refresh_needed' (integer) +
- 'prev_bar' (pointer, hdata: 'bar') +
- 'next_bar' (pointer, hdata: 'bar') |
+ 'prev_bar' (pointer, hdata: "bar") +
+ 'next_bar' (pointer, hdata: "bar") |
+ |
'gui_bars' +
'last_gui_bar'
| weechat | bar_item | objet de barre |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'build_callback' (pointer) +
'build_callback_data' (pointer) +
- 'prev_item' (pointer, hdata: 'bar_item') +
- 'next_item' (pointer, hdata: 'bar_item') |
+ 'prev_item' (pointer, hdata: "bar_item") +
+ 'next_item' (pointer, hdata: "bar_item") |
+ |
'gui_bar_items' +
'last_gui_bar_item'
| weechat | bar_window | fenêtre de barre |
- 'bar' (pointer, hdata: 'bar') +
+ 'bar' (pointer, hdata: "bar") +
'x' (integer) +
'y' (integer) +
'width' (integer) +
@@ -350,12 +367,13 @@
'coords_count' (integer) +
'coords' (pointer) +
'gui_objects' (pointer) +
- 'prev_bar_window' (pointer, hdata: 'bar_window') +
- 'next_bar_window' (pointer, hdata: 'bar_window') |
+ 'prev_bar_window' (pointer, hdata: "bar_window") +
+ 'next_bar_window' (pointer, hdata: "bar_window") |
+ |
-
| weechat | buffer | tampon |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'plugin_name_for_upgrade' (string) +
'number' (integer) +
'layout_number' (integer) +
@@ -371,14 +389,14 @@
'close_callback' (pointer) +
'close_callback_data' (pointer) +
'title' (string) +
- 'own_lines' (pointer, hdata: 'lines') +
- 'mixed_lines' (pointer, hdata: 'lines') +
- 'lines' (pointer, hdata: 'lines') +
+ 'own_lines' (pointer, hdata: "lines") +
+ 'mixed_lines' (pointer, hdata: "lines") +
+ 'lines' (pointer, hdata: "lines") +
'time_for_each_line' (integer) +
'chat_refresh_needed' (integer) +
'nicklist' (integer) +
'nicklist_case_sensitive' (integer) +
- 'nicklist_root' (pointer, hdata: 'nick_group') +
+ 'nicklist_root' (pointer, hdata: "nick_group") +
'nicklist_max_length' (integer) +
'nicklist_display_groups' (integer) +
'nicklist_visible_count' (integer) +
@@ -394,15 +412,15 @@
'input_buffer_length' (integer) +
'input_buffer_pos' (integer) +
'input_buffer_1st_display' (integer) +
- 'input_undo_snap' (pointer, hdata: 'input_undo') +
- 'input_undo' (pointer, hdata: 'input_undo') +
- 'last_input_undo' (pointer, hdata: 'input_undo') +
- 'ptr_input_undo' (pointer, hdata: 'input_undo') +
+ 'input_undo_snap' (pointer, hdata: "input_undo") +
+ 'input_undo' (pointer, hdata: "input_undo") +
+ 'last_input_undo' (pointer, hdata: "input_undo") +
+ 'ptr_input_undo' (pointer, hdata: "input_undo") +
'input_undo_count' (integer) +
- 'completion' (pointer, hdata: 'completion') +
- 'history' (pointer, hdata: 'history') +
- 'last_history' (pointer, hdata: 'history') +
- 'ptr_history' (pointer, hdata: 'history') +
+ 'completion' (pointer, hdata: "completion") +
+ 'history' (pointer, hdata: "history") +
+ 'last_history' (pointer, hdata: "history") +
+ 'ptr_history' (pointer, hdata: "history") +
'num_history' (integer) +
'text_search' (integer) +
'text_search_exact' (integer) +
@@ -413,20 +431,21 @@
'highlight_regex_compiled' (pointer) +
'highlight_tags' (string) +
'highlight_tags_count' (integer) +
- 'highlight_tags_array' (string, array_size: 'highlight_tags_count') +
+ 'highlight_tags_array' (string, array_size: "highlight_tags_count") +
'hotlist_max_level_nicks' (hashtable) +
- 'keys' (pointer, hdata: 'key') +
- 'last_key' (pointer, hdata: 'key') +
+ 'keys' (pointer, hdata: "key") +
+ 'last_key' (pointer, hdata: "key") +
'keys_count' (integer) +
'local_variables' (hashtable) +
- 'prev_buffer' (pointer, hdata: 'buffer') +
- 'next_buffer' (pointer, hdata: 'buffer') |
+ 'prev_buffer' (pointer, hdata: "buffer") +
+ 'next_buffer' (pointer, hdata: "buffer") |
+ |
'gui_buffer_last_displayed' +
'gui_buffers' +
'last_gui_buffer'
| weechat | completion | structure avec une complétion |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'context' (integer) +
'base_command' (string) +
'base_command_arg_index' (integer) +
@@ -443,38 +462,41 @@
'position_replace' (integer) +
'diff_size' (integer) +
'diff_length' (integer) +
- 'partial_completion_list' (pointer, hdata: 'completion_partial') +
- 'last_partial_completion' (pointer, hdata: 'completion_partial') |
+ 'partial_completion_list' (pointer, hdata: "completion_partial") +
+ 'last_partial_completion' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | completion_partial | structure avec une complétion partielle |
'word' (string) +
'count' (integer) +
- 'prev_item' (pointer, hdata: 'completion_partial') +
- 'next_item' (pointer, hdata: 'completion_partial') |
+ 'prev_item' (pointer, hdata: "completion_partial") +
+ 'next_item' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | config_file | fichier de configuration |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'filename' (string) +
'file' (pointer) +
'callback_reload' (pointer) +
'callback_reload_data' (pointer) +
- 'sections' (pointer, hdata: 'config_section') +
- 'last_section' (pointer, hdata: 'config_section') +
- 'prev_config' (pointer, hdata: 'config_file') +
- 'next_config' (pointer, hdata: 'config_file') |
+ 'sections' (pointer, hdata: "config_section") +
+ 'last_section' (pointer, hdata: "config_section") +
+ 'prev_config' (pointer, hdata: "config_file") +
+ 'next_config' (pointer, hdata: "config_file") |
+ |
'config_files' +
'last_config_file'
| weechat | config_option | option de configuration |
- 'config_file' (pointer, hdata: 'config_file') +
- 'section' (pointer, hdata: 'config_section') +
+ 'config_file' (pointer, hdata: "config_file") +
+ 'section' (pointer, hdata: "config_section") +
'name' (string) +
'type' (integer) +
'description' (string) +
- 'string_values' (string, array_size: '*') +
+ 'string_values' (string, array_size: "*") +
'min' (integer) +
'max' (integer) +
'default_value' (pointer) +
@@ -487,12 +509,13 @@
'callback_delete' (pointer) +
'callback_delete_data' (pointer) +
'loaded' (integer) +
- 'prev_option' (pointer, hdata: 'config_option') +
- 'next_option' (pointer, hdata: 'config_option') |
+ 'prev_option' (pointer, hdata: "config_option") +
+ 'next_option' (pointer, hdata: "config_option") |
+ |
-
| weechat | config_section | section de configuration |
- 'config_file' (pointer, hdata: 'config_file') +
+ 'config_file' (pointer, hdata: "config_file") +
'name' (string) +
'user_can_add_options' (integer) +
'user_can_delete_options' (integer) +
@@ -506,10 +529,11 @@
'callback_create_option_data' (pointer) +
'callback_delete_option' (pointer) +
'callback_delete_option_data' (pointer) +
- 'options' (pointer, hdata: 'config_option') +
- 'last_option' (pointer, hdata: 'config_option') +
- 'prev_section' (pointer, hdata: 'config_section') +
- 'next_section' (pointer, hdata: 'config_section') |
+ 'options' (pointer, hdata: "config_option") +
+ 'last_option' (pointer, hdata: "config_option") +
+ 'prev_section' (pointer, hdata: "config_section") +
+ 'next_section' (pointer, hdata: "config_section") |
+ |
-
| weechat | filter | filtre |
@@ -520,19 +544,21 @@
'buffers' (pointer) +
'tags' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'regex' (string) +
'regex_prefix' (pointer) +
'regex_message' (pointer) +
- 'prev_filter' (pointer, hdata: 'filter') +
- 'next_filter' (pointer, hdata: 'filter') |
+ 'prev_filter' (pointer, hdata: "filter") +
+ 'next_filter' (pointer, hdata: "filter") |
+ |
'gui_filters' +
'last_gui_filter'
| weechat | history | historique des commandes dans le tampon |
'text' (string) +
- 'next_history' (pointer, hdata: 'history') +
- 'prev_history' (pointer, hdata: 'history') |
+ 'next_history' (pointer, hdata: "history") +
+ 'prev_history' (pointer, hdata: "history") |
+ |
-
| weechat | hotlist | hotlist |
@@ -540,17 +566,19 @@
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
- 'count' (integer, array_size: '4') +
- 'prev_hotlist' (pointer, hdata: 'hotlist') +
- 'next_hotlist' (pointer, hdata: 'hotlist') |
+ 'count' (integer, array_size: "4") +
+ 'prev_hotlist' (pointer, hdata: "hotlist") +
+ 'next_hotlist' (pointer, hdata: "hotlist") |
+ |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | structure avec le "undo" pour la ligne de commande |
'data' (string) +
'pos' (integer) +
- 'prev_undo' (pointer, hdata: 'input_undo') +
- 'next_undo' (pointer, hdata: 'input_undo') |
+ 'prev_undo' (pointer, hdata: "input_undo") +
+ 'next_undo' (pointer, hdata: "input_undo") |
+ |
-
| weechat | key | une touche (un raccourci clavier) |
@@ -560,8 +588,9 @@
'area_key' (string) +
'command' (string) +
'score' (integer) +
- 'prev_key' (pointer, hdata: 'key') +
- 'next_key' (pointer, hdata: 'key') |
+ 'prev_key' (pointer, hdata: "key") +
+ 'next_key' (pointer, hdata: "key") |
+ |
'gui_default_keys' +
'gui_default_keys_cursor' +
'gui_default_keys_mouse' +
@@ -580,47 +609,55 @@
'last_gui_key_search'
| weechat | line | structure avec une ligne |
- 'data' (pointer, hdata: 'line_data') +
- 'prev_line' (pointer, hdata: 'line') +
- 'next_line' (pointer, hdata: 'line') |
+ 'data' (pointer, hdata: "line_data") +
+ 'prev_line' (pointer, hdata: "line") +
+ 'next_line' (pointer, hdata: "line") |
+ |
-
| weechat | line_data | structure avec les données d'une ligne |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'y' (integer) +
'date' (time) +
'date_printed' (time) +
'str_time' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'displayed' (char) +
'highlight' (char) +
'refresh_needed' (char) +
'prefix' (string) +
'prefix_length' (integer) +
'message' (string) |
+ 'date' (time) +
+ 'date_printed' (time) +
+ 'tags_array' (string) +
+ 'prefix' (string) +
+ 'message' (string) |
-
| weechat | lines | structure avec des lignes |
- 'first_line' (pointer, hdata: 'line') +
- 'last_line' (pointer, hdata: 'line') +
- 'last_read_line' (pointer, hdata: 'line') +
+ 'first_line' (pointer, hdata: "line") +
+ 'last_line' (pointer, hdata: "line") +
+ 'last_read_line' (pointer, hdata: "line") +
'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, hdata: 'nick_group') +
+ 'group' (pointer, hdata: "nick_group") +
'name' (string) +
'color' (string) +
'prefix' (string) +
'prefix_color' (string) +
'visible' (integer) +
- 'prev_nick' (pointer, hdata: 'nick') +
- 'next_nick' (pointer, hdata: 'nick') |
+ 'prev_nick' (pointer, hdata: "nick") +
+ 'next_nick' (pointer, hdata: "nick") |
+ |
-
| weechat | nick_group | groupe dans la liste de pseudos |
@@ -628,13 +665,14 @@
'color' (string) +
'visible' (integer) +
'level' (integer) +
- 'parent' (pointer, hdata: 'nick_group') +
- 'children' (pointer, hdata: 'nick_group') +
- 'last_child' (pointer, hdata: 'nick_group') +
- 'nicks' (pointer, hdata: 'nick') +
- 'last_nick' (pointer, hdata: 'nick') +
- 'prev_group' (pointer, hdata: 'nick_group') +
- 'next_group' (pointer, hdata: 'nick_group') |
+ 'parent' (pointer, hdata: "nick_group") +
+ 'children' (pointer, hdata: "nick_group") +
+ 'last_child' (pointer, hdata: "nick_group") +
+ 'nicks' (pointer, hdata: "nick") +
+ 'last_nick' (pointer, hdata: "nick") +
+ 'prev_group' (pointer, hdata: "nick_group") +
+ 'next_group' (pointer, hdata: "nick_group") |
+ |
-
| weechat | plugin | extension |
@@ -647,8 +685,9 @@
'license' (string) +
'charset' (string) +
'debug' (integer) +
- 'prev_plugin' (pointer, hdata: 'plugin') +
- 'next_plugin' (pointer, hdata: 'plugin') |
+ 'prev_plugin' (pointer, hdata: "plugin") +
+ 'next_plugin' (pointer, hdata: "plugin") |
+ |
'last_weechat_plugin' +
'weechat_plugins'
@@ -666,41 +705,44 @@
'win_chat_height' (integer) +
'win_chat_cursor_x' (integer) +
'win_chat_cursor_y' (integer) +
- 'bar_windows' (pointer, hdata: 'bar_window') +
- 'last_bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_windows' (pointer, hdata: "bar_window") +
+ 'last_bar_window' (pointer, hdata: "bar_window") +
'refresh_needed' (integer) +
'gui_objects' (pointer) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'layout_plugin_name' (string) +
'layout_buffer_name' (string) +
- 'scroll' (pointer, hdata: 'window_scroll') +
- 'ptr_tree' (pointer, hdata: 'window_tree') +
- 'prev_window' (pointer, hdata: 'window') +
- 'next_window' (pointer, hdata: 'window') |
+ 'scroll' (pointer, hdata: "window_scroll") +
+ 'ptr_tree' (pointer, hdata: "window_tree") +
+ 'prev_window' (pointer, hdata: "window") +
+ 'next_window' (pointer, hdata: "window") |
+ |
'gui_current_window' +
'gui_windows' +
'last_gui_window'
| weechat | window_scroll | info de défilement dans la fenêtre |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'first_line_displayed' (integer) +
- 'start_line' (pointer, hdata: 'line') +
+ 'start_line' (pointer, hdata: "line") +
'start_line_pos' (integer) +
'scrolling' (integer) +
'start_col' (integer) +
'lines_after' (integer) +
'reset_allowed' (integer) +
- 'prev_scroll' (pointer, hdata: 'window_scroll') +
- 'next_scroll' (pointer, hdata: 'window_scroll') |
+ 'prev_scroll' (pointer, hdata: "window_scroll") +
+ 'next_scroll' (pointer, hdata: "window_scroll") |
+ |
-
| weechat | window_tree | arbre des fenêtres |
- 'parent_node' (pointer, hdata: 'window_tree') +
+ 'parent_node' (pointer, hdata: "window_tree") +
'split_pct' (integer) +
'split_horizontal' (integer) +
- 'child1' (pointer, hdata: 'window_tree') +
- 'child2' (pointer, hdata: 'window_tree') +
- 'window' (pointer, hdata: 'window') |
+ 'child1' (pointer, hdata: "window_tree") +
+ 'child2' (pointer, hdata: "window_tree") +
+ 'window' (pointer, hdata: "window") |
+ |
'gui_windows_tree'
|========================================
diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt
index d5e4a699e..fde223645 100644
--- a/doc/fr/weechat_plugin_api.fr.txt
+++ b/doc/fr/weechat_plugin_api.fr.txt
@@ -12975,7 +12975,7 @@ les variables du hdata.
weechat_hdata_new
^^^^^^^^^^^^^^^^^
-_Nouveau dans la version 0.3.6._
+_Nouveau dans la version 0.3.6, mis à jour dans la 0.3.9._
Créé un "hdata".
@@ -12996,7 +12996,13 @@ Prototype :
[source,C]
----------------------------------------
-struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next);
+struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next,
+ int delete_allowed,
+ int (*callback_update)(void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable),
+ void *callback_update_data);
----------------------------------------
Paramètres :
@@ -13008,6 +13014,18 @@ Paramètres :
* '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)
+* 'delete_allowed' : 1 si la suppression de structure est autorisée, sinon 0
+ (_nouveau dans la version 0.3.9_)
+* 'callback_update' : fonction appelée pour mettre à jour des données dans le
+ hdata, peut être NULL si aucune mise à jour n'est autorisée
+ (_nouveau dans la version 0.3.9_), paramètres et valeur de retour :
+** 'void *data' : pointeur
+** 'struct t_hdata *hdata' : pointeur vers le hdata
+** 'struct t_hashtable *hashtable' : hashtable avec les variables à mettre à
+ jour (voir <<_weechat_hdata_update,weechat_hdata_update>>)
+** valeur de retour : nombre de variables mises à jour
+* 'callback_update_data' : pointeur donné au "callback" lorsqu'il est appelé par
+ WeeChat (_nouveau dans la version 0.3.9_)
Valeur de retour :
@@ -13017,7 +13035,7 @@ Exemple en C :
[source,C]
----------------------------------------
-struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next");
+struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next", 0, &callback_update, NULL);
----------------------------------------
[NOTE]
@@ -13035,7 +13053,7 @@ Prototype :
[source,C]
----------------------------------------
void weechat_hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type,
- const char *array_size, const char *hdata_name);
+ int update_allowed, const char *array_size, const char *hdata_name);
----------------------------------------
Paramètres :
@@ -13052,6 +13070,8 @@ Paramètres :
** WEECHAT_HDATA_TIME
** WEECHAT_HDATA_HASHTABLE
** WEECHAT_HDATA_OTHER
+* 'update_allowed' : 1 si la mise à jour de la variable est autorisée, sinon 0
+ (_nouveau dans la version 0.3.9_)
* 'array_size' : non NULL seulement si la variable est un tableau, et peut être :
(_nouveau dans la version 0.3.9_)
** nom d'une variable du hdata : cette variable sera utilisée comme taille de
@@ -13081,26 +13101,26 @@ struct t_myplugin_list
/* ... */
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, NULL, NULL);
-weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER, NULL, NULL);
-weechat_hdata_new_var (hdata, "tags_count", offsetof (struct t_myplugin_list, tags_count), WEECHAT_HDATA_INTEGER, NULL, NULL);
-weechat_hdata_new_var (hdata, "tags_array", offsetof (struct t_myplugin_list, tags_array), WEECHAT_HDATA_STRING, "tags_count", NULL);
-weechat_hdata_new_var (hdata, "string_split", offsetof (struct t_myplugin_list, string_split), WEECHAT_HDATA_STRING, "*", NULL);
-weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER, NULL, "myplugin_list");
-weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER, NULL, "myplugin_list");
+weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "tags_count", offsetof (struct t_myplugin_list, tags_count), WEECHAT_HDATA_INTEGER, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "tags_array", offsetof (struct t_myplugin_list, tags_array), WEECHAT_HDATA_STRING, 0, "tags_count", NULL);
+weechat_hdata_new_var (hdata, "string_split", offsetof (struct t_myplugin_list, string_split), WEECHAT_HDATA_STRING, 0, "*", NULL);
+weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER, 0, NULL, "myplugin_list");
+weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER, 0, NULL, "myplugin_list");
----------------------------------------
La macro "WEECHAT_HDATA_VAR" peut être utilisée pour raccourcir le code :
[source,C]
----------------------------------------
-WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_count, INTEGER, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_array, STRING, "tags_count", NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, string_split, STRING, "*", NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER, NULL, "myplugin_list");
-WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER, NULL, "myplugin_list");
+WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_count, INTEGER, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_array, STRING, 0, "tags_count", NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, string_split, STRING, 0, "*", NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER, 0, NULL, "myplugin_list");
+WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER, 0, NULL, "myplugin_list");
----------------------------------------
[NOTE]
@@ -14020,18 +14040,15 @@ Script (Python) :
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")
+buf = weechat.buffer_search_main()
+ptr = weechat.hdata_pointer(weechat.hdata_get("buffer"), buf, "lines")
if ptr:
- hdata = weechat.hdata_get("lines")
- ptr = weechat.hdata_pointer(hdata, ptr, "first_line")
+ ptr = weechat.hdata_pointer(weechat.hdata_get("lines"), ptr, "first_line")
if ptr:
- hdata = weechat.hdata_get("line")
- ptr = weechat.hdata_pointer(hdata, ptr, "data")
+ ptr = weechat.hdata_pointer(weechat.hdata_get("line"), 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"))
+ date = weechat.hdata_time(weechat.hdata_get("line_data"), ptr, "date")
+ weechat.prnt("", "heure de la première ligne affichée = %s" % time.strftime("%F %T", time.localtime(int(date))))
----------------------------------------
weechat_hdata_hashtable
@@ -14088,6 +14105,135 @@ for key in hash:
weechat.prnt("", " %s == %s" % (key, hash[key]))
----------------------------------------
+weechat_hdata_set
+^^^^^^^^^^^^^^^^^
+
+_Nouveau dans la version 0.3.9._
+
+Définit une nouvelle valeur pour une variable dans un hdata.
+
+[NOTE]
+Cette fonction ne peut être appelée que dans un "callback" de mise à jour
+(voir <<_weechat_hdata_new,weechat_hdata_new>> et
+<<_weechat_hdata_update,weechat_hdata_update>>), si la variable peut être mise à
+jour.
+
+Prototype :
+
+[source,C]
+----------------------------------------
+int weechat_hdata_set (struct t_hdata *hdata, void *pointer, const char *name, const char *value);
+----------------------------------------
+
+Paramètres :
+
+* 'hdata' : pointeur vers le hdata
+* 'pointer' : pointeur vers un objet WeeChat ou d'une extension
+* 'name' : nom de la variable (types autorisés : char, integer, long, string,
+ pointer, time)
+* 'value' : nouvelle valeur pour la variable
+
+Valeur de retour :
+
+* 1 si ok, 0 en cas d'erreur
+
+Exemple en C :
+
+[source,C]
+----------------------------------------
+weechat_hdata_set (hdata, pointer, "message", "test");
+----------------------------------------
+
+[NOTE]
+Cette fonction n'est pas disponible dans l'API script.
+
+weechat_hdata_update
+^^^^^^^^^^^^^^^^^^^^
+
+_Nouveau dans la version 0.3.9._
+
+Met à jour des données dans le hdata.
+
+Prototype :
+
+[source,C]
+----------------------------------------
+int weechat_hdata_update (struct t_hdata *hdata, void *pointer, struct t_hashtable *hashtable);
+----------------------------------------
+
+Paramètres :
+
+* 'hdata' : pointeur vers le hdata
+* 'pointer' : pointeur vers un objet WeeChat ou d'une extension
+* 'hashtable' : variables à mettre à jour : les clés sont les noms des
+ variables, les valeurs sont les nouvelles valeurs pour les variables (clés et
+ valeurs sont des chaînes de caractères), quelqes clés spéciales sont
+ acceptées :
+** clé '__delete_allowed' (avec n'importe quelle valeur) : retourne 1 si la
+ suppression est autorisée pour la structure, sinon 0
+** clé '__update_allowed', la valeur est le nom d'une variable : retourne 1 si
+ la mise à jour est autorisée pour la variable, sinon 0
+** clé '__delete' (avec n'importe quelle valeur) : supprime la structure
+ (si autorisé)
+
+Valeur de retour :
+
+* nombre de variables mises à jour
+
+Exemple en C :
+
+[source,C]
+----------------------------------------
+/* soustrait une heure sur le dernier message affiché dans le tampon courant */
+
+struct t_gui_lines *own_lines;
+struct t_gui_line *line;
+struct t_gui_line_data *line_data;
+struct t_hdata *hdata;
+struct t_hashtable *hashtable;
+char str_date[64];
+
+own_lines = weechat_hdata_pointer (weechat_hdata_get ("buffer"), weechat_current_buffer (), "own_lines");
+if (own_lines)
+{
+ line = weechat_hdata_pointer (weechat_hdata_get ("lines"), own_lines, "last_line");
+ if (line)
+ {
+ line_data = weechat_hdata_pointer (weechat_hdata_get ("line"), line, "data");
+ hdata = weechat_hdata_get ("line_data");
+ hashtable = weechat_hashtable_new (8,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
+ if (hashtable)
+ {
+ snprintf (str_date, sizeof (str_date), "%ld", ((long int)weechat_hdata_time (hdata, line_data, "date")) - 3600);
+ weechat_hashtable_set (hashtable, "date", str_date);
+ weechat_hdata_update (hdata, line_data, hashtable);
+ weechat_hashtable_free (hashtable);
+ }
+ }
+}
+----------------------------------------
+
+Script (Python) :
+
+[source,python]
+----------------------------------------
+# prototype
+count = weechat.hdata_update(hdata, pointer, hashtable)
+
+# exemple : soustrait une heure sur le dernier message affiché dans le tampon courant
+own_lines = weechat.hdata_pointer(weechat.hdata_get('buffer'), weechat.current_buffer(), 'own_lines')
+if own_lines:
+ line = weechat.hdata_pointer(weechat.hdata_get('lines'), own_lines, 'last_line')
+ if line:
+ line_data = weechat.hdata_pointer(weechat.hdata_get('line'), line, 'data')
+ hdata = weechat.hdata_get('line_data')
+ weechat.hdata_update(hdata, line_data, { 'date': str(weechat.hdata_time(hdata, line_data, 'date') - 3600) })
+----------------------------------------
+
weechat_hdata_get_string
^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt
index 3c629d384..4ae2a9476 100644
--- a/doc/it/autogen/plugin_api/hdata.txt
+++ b/doc/it/autogen/plugin_api/hdata.txt
@@ -1,6 +1,6 @@
-[width="100%",cols="^1,^2,5,5,5",options="header"]
+[width="100%",cols="^1,^2,5,5,5,5",options="header"]
|========================================
-| Plugin | Nome | Descrizione | Variabili | Liste
+| Plugin | Nome | Descrizione | Variabili | Update allowed | Liste
| guile | guile_script | elenco degli script |
'filename' (string) +
@@ -14,8 +14,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'guile_script') +
- 'next_script' (pointer, hdata: 'guile_script') |
+ 'prev_script' (pointer, hdata: "guile_script") +
+ 'next_script' (pointer, hdata: "guile_script") |
+ |
'last_script' +
'scripts'
@@ -36,22 +37,24 @@
'pv_remote_nick_color' (string) +
'hook_autorejoin' (pointer) +
'nicks_count' (integer) +
- 'nicks' (pointer, hdata: 'irc_nick') +
- 'last_nick' (pointer, hdata: 'irc_nick') +
+ 'nicks' (pointer, hdata: "irc_nick") +
+ 'last_nick' (pointer, hdata: "irc_nick") +
'nicks_speaking' (pointer) +
- 'nicks_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'last_nick_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'nicks_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'last_nick_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'prev_channel' (pointer, hdata: 'irc_channel') +
- 'next_channel' (pointer, hdata: 'irc_channel') |
+ 'prev_channel' (pointer, hdata: "irc_channel") +
+ 'next_channel' (pointer, hdata: "irc_channel") |
+ |
-
| irc | irc_channel_speaking | channel_speaking irc |
'nick' (string) +
'time_last_message' (time) +
- 'prev_nick' (pointer, hdata: 'irc_channel_speaking') +
- 'next_nick' (pointer, hdata: 'irc_channel_speaking') |
+ 'prev_nick' (pointer, hdata: "irc_channel_speaking") +
+ 'next_nick' (pointer, hdata: "irc_channel_speaking") |
+ |
-
| irc | irc_ignore | ignore irc |
@@ -60,8 +63,9 @@
'regex_mask' (pointer) +
'server' (string) +
'channel' (string) +
- 'prev_ignore' (pointer, hdata: 'irc_ignore') +
- 'next_ignore' (pointer, hdata: 'irc_ignore') |
+ 'prev_ignore' (pointer, hdata: "irc_ignore") +
+ 'next_ignore' (pointer, hdata: "irc_ignore") |
+ |
'irc_ignore_list' +
'last_irc_ignore'
@@ -72,23 +76,25 @@
'prefix' (string) +
'away' (integer) +
'color' (string) +
- 'prev_nick' (pointer, hdata: 'irc_nick') +
- 'next_nick' (pointer, hdata: 'irc_nick') |
+ 'prev_nick' (pointer, hdata: "irc_nick") +
+ 'next_nick' (pointer, hdata: "irc_nick") |
+ |
-
| irc | irc_notify | notify irc |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'nick' (string) +
'check_away' (integer) +
'is_on_server' (integer) +
'away_message' (string) +
'ison_received' (integer) +
- 'prev_notify' (pointer, hdata: 'irc_notify') +
- 'next_notify' (pointer, hdata: 'irc_notify') |
+ 'prev_notify' (pointer, hdata: "irc_notify") +
+ 'next_notify' (pointer, hdata: "irc_notify") |
+ |
-
| irc | irc_redirect | redirezione irc |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'pattern' (string) +
'signal' (string) +
'count' (integer) +
@@ -106,8 +112,9 @@
'cmd_filter' (hashtable) +
'output' (string) +
'output_size' (integer) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect') +
- 'next_redirect' (pointer, hdata: 'irc_redirect') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect") +
+ 'next_redirect' (pointer, hdata: "irc_redirect") |
+ |
-
| irc | irc_redirect_pattern | schema per la redirezione irc |
@@ -117,8 +124,9 @@
'cmd_start' (string) +
'cmd_stop' (string) +
'cmd_extra' (string) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect_pattern') +
- 'next_redirect' (pointer, hdata: 'irc_redirect_pattern') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect_pattern") +
+ 'next_redirect' (pointer, hdata: "irc_redirect_pattern") |
+ |
'irc_redirect_patterns' +
'last_irc_redirect_pattern'
@@ -129,17 +137,17 @@
'reloading_from_config' (integer) +
'reloaded_from_config' (integer) +
'addresses_count' (integer) +
- 'addresses_array' (string, array_size: 'addresses_count') +
- 'ports_array' (integer, array_size: 'addresses_count') +
+ 'addresses_array' (string, array_size: "addresses_count") +
+ 'ports_array' (integer, array_size: "addresses_count") +
'index_current_address' (integer) +
'current_address' (string) +
'current_ip' (string) +
'current_port' (integer) +
'sock' (integer) +
- 'hook_connect' (pointer, hdata: 'hook') +
- 'hook_fd' (pointer, hdata: 'hook') +
- 'hook_timer_connection' (pointer, hdata: 'hook') +
- 'hook_timer_sasl' (pointer, hdata: 'hook') +
+ 'hook_connect' (pointer, hdata: "hook") +
+ 'hook_fd' (pointer, hdata: "hook") +
+ 'hook_timer_connection' (pointer, hdata: "hook") +
+ 'hook_timer_sasl' (pointer, hdata: "hook") +
'is_connected' (integer) +
'ssl_connected' (integer) +
'gnutls_sess' (other) +
@@ -147,7 +155,7 @@
'tls_cert_key' (other) +
'unterminated_message' (string) +
'nicks_count' (integer) +
- 'nicks_array' (string, array_size: 'nicks_count') +
+ 'nicks_array' (string, array_size: "nicks_count") +
'nick_first_tried' (integer) +
'nick_alternate_number' (integer) +
'nick' (string) +
@@ -176,17 +184,18 @@
'last_away_check' (time) +
'outqueue' (pointer) +
'last_outqueue' (pointer) +
- 'redirects' (pointer, hdata: 'irc_redirect') +
- 'last_redirect' (pointer, hdata: 'irc_redirect') +
- 'notify_list' (pointer, hdata: 'irc_notify') +
- 'last_notify' (pointer, hdata: 'irc_notify') +
+ 'redirects' (pointer, hdata: "irc_redirect") +
+ 'last_redirect' (pointer, hdata: "irc_redirect") +
+ 'notify_list' (pointer, hdata: "irc_notify") +
+ 'last_notify' (pointer, hdata: "irc_notify") +
'manual_joins' (hashtable) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'channels' (pointer, hdata: 'irc_channel') +
- 'last_channel' (pointer, hdata: 'irc_channel') +
- 'prev_server' (pointer, hdata: 'irc_server') +
- 'next_server' (pointer, hdata: 'irc_server') |
+ 'channels' (pointer, hdata: "irc_channel") +
+ 'last_channel' (pointer, hdata: "irc_channel") +
+ 'prev_server' (pointer, hdata: "irc_server") +
+ 'next_server' (pointer, hdata: "irc_server") |
+ |
'irc_servers' +
'last_irc_server'
@@ -202,8 +211,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'lua_script') +
- 'next_script' (pointer, hdata: 'lua_script') |
+ 'prev_script' (pointer, hdata: "lua_script") +
+ 'next_script' (pointer, hdata: "lua_script") |
+ |
'last_script' +
'scripts'
@@ -219,8 +229,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'perl_script') +
- 'next_script' (pointer, hdata: 'perl_script') |
+ 'prev_script' (pointer, hdata: "perl_script") +
+ 'next_script' (pointer, hdata: "perl_script") |
+ |
'last_script' +
'scripts'
@@ -236,8 +247,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'python_script') +
- 'next_script' (pointer, hdata: 'python_script') |
+ 'prev_script' (pointer, hdata: "python_script") +
+ 'next_script' (pointer, hdata: "python_script") |
+ |
'last_script' +
'scripts'
@@ -253,8 +265,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'ruby_script') +
- 'next_script' (pointer, hdata: 'ruby_script') |
+ 'prev_script' (pointer, hdata: "ruby_script") +
+ 'next_script' (pointer, hdata: "ruby_script") |
+ |
'last_script' +
'scripts'
@@ -280,8 +293,9 @@
'version_loaded' (string) +
'displayed' (integer) +
'install_order' (integer) +
- 'prev_script' (pointer, hdata: 'script_script') +
- 'next_script' (pointer, hdata: 'script_script') |
+ 'prev_script' (pointer, hdata: "script_script") +
+ 'next_script' (pointer, hdata: "script_script") |
+ |
'last_repo_script' +
'repo_scripts'
@@ -297,8 +311,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'tcl_script') +
- 'next_script' (pointer, hdata: 'tcl_script') |
+ 'prev_script' (pointer, hdata: "tcl_script") +
+ 'next_script' (pointer, hdata: "tcl_script") |
+ |
'last_script' +
'scripts'
@@ -306,32 +321,34 @@
'name' (string) +
'options' (pointer) +
'conditions_count' (integer) +
- 'conditions_array' (string, array_size: 'conditions_count') +
+ 'conditions_array' (string, array_size: "conditions_count") +
'items_count' (integer) +
'items_subcount' (pointer) +
'items_array' (pointer) +
'items_prefix' (pointer) +
'items_name' (pointer) +
'items_suffix' (pointer) +
- 'bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_window' (pointer, hdata: "bar_window") +
'bar_refresh_needed' (integer) +
- 'prev_bar' (pointer, hdata: 'bar') +
- 'next_bar' (pointer, hdata: 'bar') |
+ 'prev_bar' (pointer, hdata: "bar") +
+ 'next_bar' (pointer, hdata: "bar") |
+ |
'gui_bars' +
'last_gui_bar'
| weechat | bar_item | elemento barra |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'build_callback' (pointer) +
'build_callback_data' (pointer) +
- 'prev_item' (pointer, hdata: 'bar_item') +
- 'next_item' (pointer, hdata: 'bar_item') |
+ 'prev_item' (pointer, hdata: "bar_item") +
+ 'next_item' (pointer, hdata: "bar_item") |
+ |
'gui_bar_items' +
'last_gui_bar_item'
| weechat | bar_window | finestra della barra |
- 'bar' (pointer, hdata: 'bar') +
+ 'bar' (pointer, hdata: "bar") +
'x' (integer) +
'y' (integer) +
'width' (integer) +
@@ -350,12 +367,13 @@
'coords_count' (integer) +
'coords' (pointer) +
'gui_objects' (pointer) +
- 'prev_bar_window' (pointer, hdata: 'bar_window') +
- 'next_bar_window' (pointer, hdata: 'bar_window') |
+ 'prev_bar_window' (pointer, hdata: "bar_window") +
+ 'next_bar_window' (pointer, hdata: "bar_window") |
+ |
-
| weechat | buffer | buffer |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'plugin_name_for_upgrade' (string) +
'number' (integer) +
'layout_number' (integer) +
@@ -371,14 +389,14 @@
'close_callback' (pointer) +
'close_callback_data' (pointer) +
'title' (string) +
- 'own_lines' (pointer, hdata: 'lines') +
- 'mixed_lines' (pointer, hdata: 'lines') +
- 'lines' (pointer, hdata: 'lines') +
+ 'own_lines' (pointer, hdata: "lines") +
+ 'mixed_lines' (pointer, hdata: "lines") +
+ 'lines' (pointer, hdata: "lines") +
'time_for_each_line' (integer) +
'chat_refresh_needed' (integer) +
'nicklist' (integer) +
'nicklist_case_sensitive' (integer) +
- 'nicklist_root' (pointer, hdata: 'nick_group') +
+ 'nicklist_root' (pointer, hdata: "nick_group") +
'nicklist_max_length' (integer) +
'nicklist_display_groups' (integer) +
'nicklist_visible_count' (integer) +
@@ -394,15 +412,15 @@
'input_buffer_length' (integer) +
'input_buffer_pos' (integer) +
'input_buffer_1st_display' (integer) +
- 'input_undo_snap' (pointer, hdata: 'input_undo') +
- 'input_undo' (pointer, hdata: 'input_undo') +
- 'last_input_undo' (pointer, hdata: 'input_undo') +
- 'ptr_input_undo' (pointer, hdata: 'input_undo') +
+ 'input_undo_snap' (pointer, hdata: "input_undo") +
+ 'input_undo' (pointer, hdata: "input_undo") +
+ 'last_input_undo' (pointer, hdata: "input_undo") +
+ 'ptr_input_undo' (pointer, hdata: "input_undo") +
'input_undo_count' (integer) +
- 'completion' (pointer, hdata: 'completion') +
- 'history' (pointer, hdata: 'history') +
- 'last_history' (pointer, hdata: 'history') +
- 'ptr_history' (pointer, hdata: 'history') +
+ 'completion' (pointer, hdata: "completion") +
+ 'history' (pointer, hdata: "history") +
+ 'last_history' (pointer, hdata: "history") +
+ 'ptr_history' (pointer, hdata: "history") +
'num_history' (integer) +
'text_search' (integer) +
'text_search_exact' (integer) +
@@ -413,20 +431,21 @@
'highlight_regex_compiled' (pointer) +
'highlight_tags' (string) +
'highlight_tags_count' (integer) +
- 'highlight_tags_array' (string, array_size: 'highlight_tags_count') +
+ 'highlight_tags_array' (string, array_size: "highlight_tags_count") +
'hotlist_max_level_nicks' (hashtable) +
- 'keys' (pointer, hdata: 'key') +
- 'last_key' (pointer, hdata: 'key') +
+ 'keys' (pointer, hdata: "key") +
+ 'last_key' (pointer, hdata: "key") +
'keys_count' (integer) +
'local_variables' (hashtable) +
- 'prev_buffer' (pointer, hdata: 'buffer') +
- 'next_buffer' (pointer, hdata: 'buffer') |
+ 'prev_buffer' (pointer, hdata: "buffer") +
+ 'next_buffer' (pointer, hdata: "buffer") |
+ |
'gui_buffer_last_displayed' +
'gui_buffers' +
'last_gui_buffer'
| weechat | completion | struttura con completamento |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'context' (integer) +
'base_command' (string) +
'base_command_arg_index' (integer) +
@@ -443,38 +462,41 @@
'position_replace' (integer) +
'diff_size' (integer) +
'diff_length' (integer) +
- 'partial_completion_list' (pointer, hdata: 'completion_partial') +
- 'last_partial_completion' (pointer, hdata: 'completion_partial') |
+ 'partial_completion_list' (pointer, hdata: "completion_partial") +
+ 'last_partial_completion' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | completion_partial | struttura con completamento parziale |
'word' (string) +
'count' (integer) +
- 'prev_item' (pointer, hdata: 'completion_partial') +
- 'next_item' (pointer, hdata: 'completion_partial') |
+ 'prev_item' (pointer, hdata: "completion_partial") +
+ 'next_item' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | config_file | file di configurazione |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'filename' (string) +
'file' (pointer) +
'callback_reload' (pointer) +
'callback_reload_data' (pointer) +
- 'sections' (pointer, hdata: 'config_section') +
- 'last_section' (pointer, hdata: 'config_section') +
- 'prev_config' (pointer, hdata: 'config_file') +
- 'next_config' (pointer, hdata: 'config_file') |
+ 'sections' (pointer, hdata: "config_section") +
+ 'last_section' (pointer, hdata: "config_section") +
+ 'prev_config' (pointer, hdata: "config_file") +
+ 'next_config' (pointer, hdata: "config_file") |
+ |
'config_files' +
'last_config_file'
| weechat | config_option | opzione di configurazione |
- 'config_file' (pointer, hdata: 'config_file') +
- 'section' (pointer, hdata: 'config_section') +
+ 'config_file' (pointer, hdata: "config_file") +
+ 'section' (pointer, hdata: "config_section") +
'name' (string) +
'type' (integer) +
'description' (string) +
- 'string_values' (string, array_size: '*') +
+ 'string_values' (string, array_size: "*") +
'min' (integer) +
'max' (integer) +
'default_value' (pointer) +
@@ -487,12 +509,13 @@
'callback_delete' (pointer) +
'callback_delete_data' (pointer) +
'loaded' (integer) +
- 'prev_option' (pointer, hdata: 'config_option') +
- 'next_option' (pointer, hdata: 'config_option') |
+ 'prev_option' (pointer, hdata: "config_option") +
+ 'next_option' (pointer, hdata: "config_option") |
+ |
-
| weechat | config_section | sezione di configurazione |
- 'config_file' (pointer, hdata: 'config_file') +
+ 'config_file' (pointer, hdata: "config_file") +
'name' (string) +
'user_can_add_options' (integer) +
'user_can_delete_options' (integer) +
@@ -506,10 +529,11 @@
'callback_create_option_data' (pointer) +
'callback_delete_option' (pointer) +
'callback_delete_option_data' (pointer) +
- 'options' (pointer, hdata: 'config_option') +
- 'last_option' (pointer, hdata: 'config_option') +
- 'prev_section' (pointer, hdata: 'config_section') +
- 'next_section' (pointer, hdata: 'config_section') |
+ 'options' (pointer, hdata: "config_option") +
+ 'last_option' (pointer, hdata: "config_option") +
+ 'prev_section' (pointer, hdata: "config_section") +
+ 'next_section' (pointer, hdata: "config_section") |
+ |
-
| weechat | filter | filtro |
@@ -520,19 +544,21 @@
'buffers' (pointer) +
'tags' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'regex' (string) +
'regex_prefix' (pointer) +
'regex_message' (pointer) +
- 'prev_filter' (pointer, hdata: 'filter') +
- 'next_filter' (pointer, hdata: 'filter') |
+ 'prev_filter' (pointer, hdata: "filter") +
+ 'next_filter' (pointer, hdata: "filter") |
+ |
'gui_filters' +
'last_gui_filter'
| weechat | history | cronologia dei comandi nel buffer |
'text' (string) +
- 'next_history' (pointer, hdata: 'history') +
- 'prev_history' (pointer, hdata: 'history') |
+ 'next_history' (pointer, hdata: "history") +
+ 'prev_history' (pointer, hdata: "history") |
+ |
-
| weechat | hotlist | hotlist |
@@ -540,17 +566,19 @@
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
- 'count' (integer, array_size: '4') +
- 'prev_hotlist' (pointer, hdata: 'hotlist') +
- 'next_hotlist' (pointer, hdata: 'hotlist') |
+ 'count' (integer, array_size: "4") +
+ 'prev_hotlist' (pointer, hdata: "hotlist") +
+ 'next_hotlist' (pointer, hdata: "hotlist") |
+ |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | struttura con "undo"per la riga di input |
'data' (string) +
'pos' (integer) +
- 'prev_undo' (pointer, hdata: 'input_undo') +
- 'next_undo' (pointer, hdata: 'input_undo') |
+ 'prev_undo' (pointer, hdata: "input_undo") +
+ 'next_undo' (pointer, hdata: "input_undo") |
+ |
-
| weechat | key | un tasto (scorciatoia da tastiera) |
@@ -560,8 +588,9 @@
'area_key' (string) +
'command' (string) +
'score' (integer) +
- 'prev_key' (pointer, hdata: 'key') +
- 'next_key' (pointer, hdata: 'key') |
+ 'prev_key' (pointer, hdata: "key") +
+ 'next_key' (pointer, hdata: "key") |
+ |
'gui_default_keys' +
'gui_default_keys_cursor' +
'gui_default_keys_mouse' +
@@ -580,47 +609,55 @@
'last_gui_key_search'
| weechat | line | struttura con una sola riga |
- 'data' (pointer, hdata: 'line_data') +
- 'prev_line' (pointer, hdata: 'line') +
- 'next_line' (pointer, hdata: 'line') |
+ 'data' (pointer, hdata: "line_data") +
+ 'prev_line' (pointer, hdata: "line") +
+ 'next_line' (pointer, hdata: "line") |
+ |
-
| weechat | line_data | struttura con una riga di dati |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'y' (integer) +
'date' (time) +
'date_printed' (time) +
'str_time' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'displayed' (char) +
'highlight' (char) +
'refresh_needed' (char) +
'prefix' (string) +
'prefix_length' (integer) +
'message' (string) |
+ 'date' (time) +
+ 'date_printed' (time) +
+ 'tags_array' (string) +
+ 'prefix' (string) +
+ 'message' (string) |
-
| weechat | lines | struttura con più righe |
- 'first_line' (pointer, hdata: 'line') +
- 'last_line' (pointer, hdata: 'line') +
- 'last_read_line' (pointer, hdata: 'line') +
+ 'first_line' (pointer, hdata: "line") +
+ 'last_line' (pointer, hdata: "line") +
+ 'last_read_line' (pointer, hdata: "line") +
'lines_count' (integer) +
'first_line_not_read' (integer) +
'lines_hidden' (integer) +
'buffer_max_length' (integer) +
'prefix_max_length' (integer) |
+ |
-
| weechat | nick | nick nella lista nick |
- 'group' (pointer, hdata: 'nick_group') +
+ 'group' (pointer, hdata: "nick_group") +
'name' (string) +
'color' (string) +
'prefix' (string) +
'prefix_color' (string) +
'visible' (integer) +
- 'prev_nick' (pointer, hdata: 'nick') +
- 'next_nick' (pointer, hdata: 'nick') |
+ 'prev_nick' (pointer, hdata: "nick") +
+ 'next_nick' (pointer, hdata: "nick") |
+ |
-
| weechat | nick_group | gruppo nella lista nick |
@@ -628,13 +665,14 @@
'color' (string) +
'visible' (integer) +
'level' (integer) +
- 'parent' (pointer, hdata: 'nick_group') +
- 'children' (pointer, hdata: 'nick_group') +
- 'last_child' (pointer, hdata: 'nick_group') +
- 'nicks' (pointer, hdata: 'nick') +
- 'last_nick' (pointer, hdata: 'nick') +
- 'prev_group' (pointer, hdata: 'nick_group') +
- 'next_group' (pointer, hdata: 'nick_group') |
+ 'parent' (pointer, hdata: "nick_group") +
+ 'children' (pointer, hdata: "nick_group") +
+ 'last_child' (pointer, hdata: "nick_group") +
+ 'nicks' (pointer, hdata: "nick") +
+ 'last_nick' (pointer, hdata: "nick") +
+ 'prev_group' (pointer, hdata: "nick_group") +
+ 'next_group' (pointer, hdata: "nick_group") |
+ |
-
| weechat | plugin | plugin |
@@ -647,8 +685,9 @@
'license' (string) +
'charset' (string) +
'debug' (integer) +
- 'prev_plugin' (pointer, hdata: 'plugin') +
- 'next_plugin' (pointer, hdata: 'plugin') |
+ 'prev_plugin' (pointer, hdata: "plugin") +
+ 'next_plugin' (pointer, hdata: "plugin") |
+ |
'last_weechat_plugin' +
'weechat_plugins'
@@ -666,41 +705,44 @@
'win_chat_height' (integer) +
'win_chat_cursor_x' (integer) +
'win_chat_cursor_y' (integer) +
- 'bar_windows' (pointer, hdata: 'bar_window') +
- 'last_bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_windows' (pointer, hdata: "bar_window") +
+ 'last_bar_window' (pointer, hdata: "bar_window") +
'refresh_needed' (integer) +
'gui_objects' (pointer) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'layout_plugin_name' (string) +
'layout_buffer_name' (string) +
- 'scroll' (pointer, hdata: 'window_scroll') +
- 'ptr_tree' (pointer, hdata: 'window_tree') +
- 'prev_window' (pointer, hdata: 'window') +
- 'next_window' (pointer, hdata: 'window') |
+ 'scroll' (pointer, hdata: "window_scroll") +
+ 'ptr_tree' (pointer, hdata: "window_tree") +
+ 'prev_window' (pointer, hdata: "window") +
+ 'next_window' (pointer, hdata: "window") |
+ |
'gui_current_window' +
'gui_windows' +
'last_gui_window'
| weechat | window_scroll | scorrimento delle info nella finestra |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'first_line_displayed' (integer) +
- 'start_line' (pointer, hdata: 'line') +
+ 'start_line' (pointer, hdata: "line") +
'start_line_pos' (integer) +
'scrolling' (integer) +
'start_col' (integer) +
'lines_after' (integer) +
'reset_allowed' (integer) +
- 'prev_scroll' (pointer, hdata: 'window_scroll') +
- 'next_scroll' (pointer, hdata: 'window_scroll') |
+ 'prev_scroll' (pointer, hdata: "window_scroll") +
+ 'next_scroll' (pointer, hdata: "window_scroll") |
+ |
-
| weechat | window_tree | albero delle finestre |
- 'parent_node' (pointer, hdata: 'window_tree') +
+ 'parent_node' (pointer, hdata: "window_tree") +
'split_pct' (integer) +
'split_horizontal' (integer) +
- 'child1' (pointer, hdata: 'window_tree') +
- 'child2' (pointer, hdata: 'window_tree') +
- 'window' (pointer, hdata: 'window') |
+ 'child1' (pointer, hdata: "window_tree") +
+ 'child2' (pointer, hdata: "window_tree") +
+ 'window' (pointer, hdata: "window") |
+ |
'gui_windows_tree'
|========================================
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt
index 03e54a6ed..a9c582fbf 100644
--- a/doc/it/weechat_plugin_api.it.txt
+++ b/doc/it/weechat_plugin_api.it.txt
@@ -12908,7 +12908,8 @@ scrivere qualcosa in memoria puntato dalle variabili in hdata.
weechat_hdata_new
^^^^^^^^^^^^^^^^^
-_Novità nella versione 0.3.6._
+// TRANSLATION MISSING
+_Novità nella versione 0.3.6, updated in 0.3.9._
Crea un nuovo hdata.
@@ -12928,7 +12929,13 @@ Prototipo:
[source,C]
----------------------------------------
-struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next);
+struct t_hdata *weechat_hdata_new (const char *hdata_name, const char *var_prev, const char *var_next,
+ int delete_allowed,
+ int (*callback_update)(void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable),
+ void *callback_update_data);
----------------------------------------
Argomenti:
@@ -12938,16 +12945,29 @@ Argomenti:
precedente nella lista (può essere NULL se non è disponibile tale variabile)
* 'var_next': nome della variabile nella struttura che è puntatore all'elemento
successivo nella lista (può essere NULL se non è disponibile tale variabile)
+// TRANSLATION MISSING
+* 'delete_allowed': 1 if delete of structure is allowed, otherwise 0
+ (_novità nella versione 0.3.9_)
+// TRANSLATION MISSING
+* 'callback_update': callback to update data in hdata, can be NULL if no update
+ is allowed (_novità nella versione 0.3.9_), arguments and return value:
+** 'void *data': pointer
+** 'struct t_hdata *hdata': pointer to hdata
+** 'struct t_hashtable *hashtable': hashtable with variables to update
+ (see <<_weechat_hdata_update,weechat_hdata_update>>)
+** return value: number of variables updated
+// TRANSLATION MISSING
+* 'callback_update_data': pointer given to update callback when it is called by
+ WeeChat (_novità nella versione 0.3.9_)
Valore restituito:
* puntatore al nuovo hdata
Esempio in C:
-
-[source,C]
+source,C]
----------------------------------------
-struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next");
+struct t_hdata *hdata = weechat_hdata_new ("myplugin_list", "prev", "next", 0, &callback_update, NULL);
----------------------------------------
[NOTE]
@@ -12956,7 +12976,8 @@ Questa funzione non è disponibile nelle API per lo scripting.
weechat_hdata_new_var
^^^^^^^^^^^^^^^^^^^^^
-_Novità nella versione 0.3.6._
+// TRANSLATION MISSING
+_Novità nella versione 0.3.6, updated in 0.3.9_
Crea una nuova variabile in hdata.
@@ -12965,7 +12986,7 @@ Prototipo:
[source,C]
----------------------------------------
void weechat_hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type,
- const char *array_size, const char *hdata_name);
+ int update_allowed, const char *array_size, const char *hdata_name);
----------------------------------------
Argomenti:
@@ -12983,6 +13004,9 @@ Argomenti:
** WEECHAT_HDATA_HASHTABLE
** WEECHAT_HDATA_OTHER
// TRANSLATION MISSING
+* 'update_allowed': 1 if update of variable is allowed, otherwise 0
+ (_novità nella versione 0.3.9_)
+// TRANSLATION MISSING
* 'array_size': not NULL only if a variable is an array, and it can be:
(_novità nella versione 0.3.9_)
** name of variable in hdata: this variable will be used as size of array
@@ -13010,26 +13034,26 @@ struct t_myplugin_list
/* ... */
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, NULL, NULL);
-weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER, NULL, NULL);
-weechat_hdata_new_var (hdata, "tags_count", offsetof (struct t_myplugin_list, tags_count), WEECHAT_HDATA_INTEGER, NULL, NULL);
-weechat_hdata_new_var (hdata, "tags_array", offsetof (struct t_myplugin_list, tags_array), WEECHAT_HDATA_STRING, "tags_count", NULL);
-weechat_hdata_new_var (hdata, "string_split", offsetof (struct t_myplugin_list, string_split), WEECHAT_HDATA_STRING, "*", NULL);
-weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER, NULL, "myplugin_list");
-weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER, NULL, "myplugin_list");
+weechat_hdata_new_var (hdata, "name", offsetof (struct t_myplugin_list, name), WEECHAT_HDATA_STRING, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "buffer", offsetof (struct t_myplugin_list, buffer), WEECHAT_HDATA_POINTER, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "tags_count", offsetof (struct t_myplugin_list, tags_count), WEECHAT_HDATA_INTEGER, 0, NULL, NULL);
+weechat_hdata_new_var (hdata, "tags_array", offsetof (struct t_myplugin_list, tags_array), WEECHAT_HDATA_STRING, 0, "tags_count", NULL);
+weechat_hdata_new_var (hdata, "string_split", offsetof (struct t_myplugin_list, string_split), WEECHAT_HDATA_STRING, 0, "*", NULL);
+weechat_hdata_new_var (hdata, "prev", offsetof (struct t_myplugin_list, prev), WEECHAT_HDATA_POINTER, 0, NULL, "myplugin_list");
+weechat_hdata_new_var (hdata, "next", offsetof (struct t_myplugin_list, next), WEECHAT_HDATA_POINTER, 0, NULL, "myplugin_list");
----------------------------------------
La macro "WEECHAT_HDATA_VAR" può essere usata per accorciare il codice:
[source,C]
----------------------------------------
-WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_count, INTEGER, NULL, NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_array, STRING, "tags_count", NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, string_split, STRING, "*", NULL);
-WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER, NULL, "myplugin_list");
-WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER, NULL, "myplugin_list");
+WEECHAT_HDATA_VAR(struct t_myplugin_list, name, STRING, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, buffer, POINTER, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_count, INTEGER, 0, NULL, NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, tags_array, STRING, 0, "tags_count", NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, string_split, STRING, 0, "*", NULL);
+WEECHAT_HDATA_VAR(struct t_myplugin_list, prev, POINTER, 0, NULL, "myplugin_list");
+WEECHAT_HDATA_VAR(struct t_myplugin_list, next, POINTER, 0, NULL, "myplugin_list");
----------------------------------------
[NOTE]
@@ -13950,18 +13974,15 @@ Script (Python):
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")
+buf = weechat.buffer_search_main()
+ptr = weechat.hdata_pointer(weechat.hdata_get("buffer"), buf, "lines")
if ptr:
- hdata = weechat.hdata_get("lines")
- ptr = weechat.hdata_pointer(hdata, ptr, "first_line")
+ ptr = weechat.hdata_pointer(weechat.hdata_get("lines"), ptr, "first_line")
if ptr:
- hdata = weechat.hdata_get("line")
- ptr = weechat.hdata_pointer(hdata, ptr, "data")
+ ptr = weechat.hdata_pointer(weechat.hdata_get("line"), ptr, "data")
if ptr:
- hdata = weechat.hdata_get("line_data")
- weechat.prnt("", "time of last line displayed = %s" % weechat.hdata_time(hdata, ptr, "date"))
+ date = weechat.hdata_time(weechat.hdata_get("line_data"), ptr, "date")
+ weechat.prnt("", "time of first line displayed = %s" % time.strftime("%F %T", time.localtime(int(date))))
----------------------------------------
weechat_hdata_hashtable
@@ -14019,6 +14040,134 @@ for key in hash:
weechat.prnt("", " %s == %s" % (key, hash[key]))
----------------------------------------
+// TRANSLATION MISSING
+weechat_hdata_set
+^^^^^^^^^^^^^^^^^
+
+_Novità nella versione 0.3.9._
+
+Set new value for variable in a hdata.
+
+[NOTE]
+This function can be called only in an update callback
+(see <<_weechat_hdata_new,weechat_hdata_new>> and
+<<_weechat_hdata_update,weechat_hdata_update>>), if the variable can be updated.
+
+Prototipo:
+
+[source,C]
+----------------------------------------
+int weechat_hdata_set (struct t_hdata *hdata, void *pointer, const char *name, const char *value);
+----------------------------------------
+
+Argomenti:
+
+* 'hdata': hdata pointer
+* 'pointer': pointer to WeeChat/plugin object
+* 'name': variable name (types allowed: char, integer, long, string, pointer,
+ time)
+* 'value': new value for variable
+
+Valore restituito:
+
+* 1 if ok, 0 if error
+
+Esempio in C:
+
+[source,C]
+----------------------------------------
+weechat_hdata_set (hdata, pointer, "message", "test");
+----------------------------------------
+
+[NOTE]
+This function is not available in scripting API.
+
+// TRANSLATION MISSING
+weechat_hdata_update
+^^^^^^^^^^^^^^^^^^^^
+
+_Novità nella versione 0.3.9._
+
+Update data in a hdata.
+
+Prototipo:
+
+[source,C]
+----------------------------------------
+int weechat_hdata_update (struct t_hdata *hdata, void *pointer, struct t_hashtable *hashtable);
+----------------------------------------
+
+Argomenti:
+
+* 'hdata': hdata pointer
+* 'pointer': pointer to WeeChat/plugin object
+* 'hashtable': variables to update: keys are name of variables, values are new
+ values for variables (keys and values are string), some special keys are
+ allowed:
+** key '__delete_allowed' (with any value): return 1 if delete is allowed for
+ structure, otherwise 0
+** key '__update_allowed', value is name of a variable: return 1 if update is
+ allowed for this variable, otherwise 0
+** key '__delete' (with any value): delete structure (if allowed)
+
+Valore restituito:
+
+* number of variables updated
+
+Esempio in C:
+
+[source,C]
+----------------------------------------
+/* subtract one hour on last message displayed in current buffer */
+
+struct t_gui_lines *own_lines;
+struct t_gui_line *line;
+struct t_gui_line_data *line_data;
+struct t_hdata *hdata;
+struct t_hashtable *hashtable;
+char str_date[64];
+
+own_lines = weechat_hdata_pointer (weechat_hdata_get ("buffer"), weechat_current_buffer (), "own_lines");
+if (own_lines)
+{
+ line = weechat_hdata_pointer (weechat_hdata_get ("lines"), own_lines, "last_line");
+ if (line)
+ {
+ line_data = weechat_hdata_pointer (weechat_hdata_get ("line"), line, "data");
+ hdata = weechat_hdata_get ("line_data");
+ hashtable = weechat_hashtable_new (8,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
+ if (hashtable)
+ {
+ snprintf (str_date, sizeof (str_date), "%ld", ((long int)weechat_hdata_time (hdata, line_data, "date")) - 3600);
+ weechat_hashtable_set (hashtable, "date", str_date);
+ weechat_hdata_update (hdata, line_data, hashtable);
+ weechat_hashtable_free (hashtable);
+ }
+ }
+}
+----------------------------------------
+
+Script (Python):
+
+[source,python]
+----------------------------------------
+# prototipo
+count = weechat.hdata_update(hdata, pointer, hashtable)
+
+# example: subtract one hour on last message displayed in current buffer
+own_lines = weechat.hdata_pointer(weechat.hdata_get('buffer'), weechat.current_buffer(), 'own_lines')
+if own_lines:
+ line = weechat.hdata_pointer(weechat.hdata_get('lines'), own_lines, 'last_line')
+ if line:
+ line_data = weechat.hdata_pointer(weechat.hdata_get('line'), line, 'data')
+ hdata = weechat.hdata_get('line_data')
+ weechat.hdata_update(hdata, line_data, { 'date': str(weechat.hdata_time(hdata, line_data, 'date') - 3600) })
+----------------------------------------
+
weechat_hdata_get_string
^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/doc/ja/autogen/plugin_api/hdata.txt b/doc/ja/autogen/plugin_api/hdata.txt
index 8d5da8097..29b4c5a7a 100644
--- a/doc/ja/autogen/plugin_api/hdata.txt
+++ b/doc/ja/autogen/plugin_api/hdata.txt
@@ -1,6 +1,6 @@
-[width="100%",cols="^1,^2,5,5,5",options="header"]
+[width="100%",cols="^1,^2,5,5,5,5",options="header"]
|========================================
-| プラグイン | 名前 | 説明 | 変数 | リスト
+| プラグイン | 名前 | 説明 | 変数 | Update allowed | リスト
| guile | guile_script | スクリプトのリスト |
'filename' (string) +
@@ -14,8 +14,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'guile_script') +
- 'next_script' (pointer, hdata: 'guile_script') |
+ 'prev_script' (pointer, hdata: "guile_script") +
+ 'next_script' (pointer, hdata: "guile_script") |
+ |
'last_script' +
'scripts'
@@ -36,22 +37,24 @@
'pv_remote_nick_color' (string) +
'hook_autorejoin' (pointer) +
'nicks_count' (integer) +
- 'nicks' (pointer, hdata: 'irc_nick') +
- 'last_nick' (pointer, hdata: 'irc_nick') +
+ 'nicks' (pointer, hdata: "irc_nick") +
+ 'last_nick' (pointer, hdata: "irc_nick") +
'nicks_speaking' (pointer) +
- 'nicks_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'last_nick_speaking_time' (pointer, hdata: 'irc_channel_speaking') +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'nicks_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'last_nick_speaking_time' (pointer, hdata: "irc_channel_speaking") +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'prev_channel' (pointer, hdata: 'irc_channel') +
- 'next_channel' (pointer, hdata: 'irc_channel') |
+ 'prev_channel' (pointer, hdata: "irc_channel") +
+ 'next_channel' (pointer, hdata: "irc_channel") |
+ |
-
| irc | irc_channel_speaking | irc 会話中チャンネル |
'nick' (string) +
'time_last_message' (time) +
- 'prev_nick' (pointer, hdata: 'irc_channel_speaking') +
- 'next_nick' (pointer, hdata: 'irc_channel_speaking') |
+ 'prev_nick' (pointer, hdata: "irc_channel_speaking") +
+ 'next_nick' (pointer, hdata: "irc_channel_speaking") |
+ |
-
| irc | irc_ignore | irc 無視 |
@@ -60,8 +63,9 @@
'regex_mask' (pointer) +
'server' (string) +
'channel' (string) +
- 'prev_ignore' (pointer, hdata: 'irc_ignore') +
- 'next_ignore' (pointer, hdata: 'irc_ignore') |
+ 'prev_ignore' (pointer, hdata: "irc_ignore") +
+ 'next_ignore' (pointer, hdata: "irc_ignore") |
+ |
'irc_ignore_list' +
'last_irc_ignore'
@@ -72,23 +76,25 @@
'prefix' (string) +
'away' (integer) +
'color' (string) +
- 'prev_nick' (pointer, hdata: 'irc_nick') +
- 'next_nick' (pointer, hdata: 'irc_nick') |
+ 'prev_nick' (pointer, hdata: "irc_nick") +
+ 'next_nick' (pointer, hdata: "irc_nick") |
+ |
-
| irc | irc_notify | irc 通知 |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'nick' (string) +
'check_away' (integer) +
'is_on_server' (integer) +
'away_message' (string) +
'ison_received' (integer) +
- 'prev_notify' (pointer, hdata: 'irc_notify') +
- 'next_notify' (pointer, hdata: 'irc_notify') |
+ 'prev_notify' (pointer, hdata: "irc_notify") +
+ 'next_notify' (pointer, hdata: "irc_notify") |
+ |
-
| irc | irc_redirect | irc リダイレクト |
- 'server' (pointer, hdata: 'irc_server') +
+ 'server' (pointer, hdata: "irc_server") +
'pattern' (string) +
'signal' (string) +
'count' (integer) +
@@ -106,8 +112,9 @@
'cmd_filter' (hashtable) +
'output' (string) +
'output_size' (integer) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect') +
- 'next_redirect' (pointer, hdata: 'irc_redirect') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect") +
+ 'next_redirect' (pointer, hdata: "irc_redirect") |
+ |
-
| irc | irc_redirect_pattern | irc リダイレクトパターン |
@@ -117,8 +124,9 @@
'cmd_start' (string) +
'cmd_stop' (string) +
'cmd_extra' (string) +
- 'prev_redirect' (pointer, hdata: 'irc_redirect_pattern') +
- 'next_redirect' (pointer, hdata: 'irc_redirect_pattern') |
+ 'prev_redirect' (pointer, hdata: "irc_redirect_pattern") +
+ 'next_redirect' (pointer, hdata: "irc_redirect_pattern") |
+ |
'irc_redirect_patterns' +
'last_irc_redirect_pattern'
@@ -129,17 +137,17 @@
'reloading_from_config' (integer) +
'reloaded_from_config' (integer) +
'addresses_count' (integer) +
- 'addresses_array' (string, array_size: 'addresses_count') +
- 'ports_array' (integer, array_size: 'addresses_count') +
+ 'addresses_array' (string, array_size: "addresses_count") +
+ 'ports_array' (integer, array_size: "addresses_count") +
'index_current_address' (integer) +
'current_address' (string) +
'current_ip' (string) +
'current_port' (integer) +
'sock' (integer) +
- 'hook_connect' (pointer, hdata: 'hook') +
- 'hook_fd' (pointer, hdata: 'hook') +
- 'hook_timer_connection' (pointer, hdata: 'hook') +
- 'hook_timer_sasl' (pointer, hdata: 'hook') +
+ 'hook_connect' (pointer, hdata: "hook") +
+ 'hook_fd' (pointer, hdata: "hook") +
+ 'hook_timer_connection' (pointer, hdata: "hook") +
+ 'hook_timer_sasl' (pointer, hdata: "hook") +
'is_connected' (integer) +
'ssl_connected' (integer) +
'gnutls_sess' (other) +
@@ -147,7 +155,7 @@
'tls_cert_key' (other) +
'unterminated_message' (string) +
'nicks_count' (integer) +
- 'nicks_array' (string, array_size: 'nicks_count') +
+ 'nicks_array' (string, array_size: "nicks_count") +
'nick_first_tried' (integer) +
'nick_alternate_number' (integer) +
'nick' (string) +
@@ -176,17 +184,18 @@
'last_away_check' (time) +
'outqueue' (pointer) +
'last_outqueue' (pointer) +
- 'redirects' (pointer, hdata: 'irc_redirect') +
- 'last_redirect' (pointer, hdata: 'irc_redirect') +
- 'notify_list' (pointer, hdata: 'irc_notify') +
- 'last_notify' (pointer, hdata: 'irc_notify') +
+ 'redirects' (pointer, hdata: "irc_redirect") +
+ 'last_redirect' (pointer, hdata: "irc_redirect") +
+ 'notify_list' (pointer, hdata: "irc_notify") +
+ 'last_notify' (pointer, hdata: "irc_notify") +
'manual_joins' (hashtable) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
- 'channels' (pointer, hdata: 'irc_channel') +
- 'last_channel' (pointer, hdata: 'irc_channel') +
- 'prev_server' (pointer, hdata: 'irc_server') +
- 'next_server' (pointer, hdata: 'irc_server') |
+ 'channels' (pointer, hdata: "irc_channel") +
+ 'last_channel' (pointer, hdata: "irc_channel") +
+ 'prev_server' (pointer, hdata: "irc_server") +
+ 'next_server' (pointer, hdata: "irc_server") |
+ |
'irc_servers' +
'last_irc_server'
@@ -202,8 +211,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'lua_script') +
- 'next_script' (pointer, hdata: 'lua_script') |
+ 'prev_script' (pointer, hdata: "lua_script") +
+ 'next_script' (pointer, hdata: "lua_script") |
+ |
'last_script' +
'scripts'
@@ -219,8 +229,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'perl_script') +
- 'next_script' (pointer, hdata: 'perl_script') |
+ 'prev_script' (pointer, hdata: "perl_script") +
+ 'next_script' (pointer, hdata: "perl_script") |
+ |
'last_script' +
'scripts'
@@ -236,8 +247,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'python_script') +
- 'next_script' (pointer, hdata: 'python_script') |
+ 'prev_script' (pointer, hdata: "python_script") +
+ 'next_script' (pointer, hdata: "python_script") |
+ |
'last_script' +
'scripts'
@@ -253,8 +265,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'ruby_script') +
- 'next_script' (pointer, hdata: 'ruby_script') |
+ 'prev_script' (pointer, hdata: "ruby_script") +
+ 'next_script' (pointer, hdata: "ruby_script") |
+ |
'last_script' +
'scripts'
@@ -280,8 +293,9 @@
'version_loaded' (string) +
'displayed' (integer) +
'install_order' (integer) +
- 'prev_script' (pointer, hdata: 'script_script') +
- 'next_script' (pointer, hdata: 'script_script') |
+ 'prev_script' (pointer, hdata: "script_script") +
+ 'next_script' (pointer, hdata: "script_script") |
+ |
'last_repo_script' +
'repo_scripts'
@@ -297,8 +311,9 @@
'charset' (string) +
'callbacks' (pointer) +
'unloading' (integer) +
- 'prev_script' (pointer, hdata: 'tcl_script') +
- 'next_script' (pointer, hdata: 'tcl_script') |
+ 'prev_script' (pointer, hdata: "tcl_script") +
+ 'next_script' (pointer, hdata: "tcl_script") |
+ |
'last_script' +
'scripts'
@@ -306,32 +321,34 @@
'name' (string) +
'options' (pointer) +
'conditions_count' (integer) +
- 'conditions_array' (string, array_size: 'conditions_count') +
+ 'conditions_array' (string, array_size: "conditions_count") +
'items_count' (integer) +
'items_subcount' (pointer) +
'items_array' (pointer) +
'items_prefix' (pointer) +
'items_name' (pointer) +
'items_suffix' (pointer) +
- 'bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_window' (pointer, hdata: "bar_window") +
'bar_refresh_needed' (integer) +
- 'prev_bar' (pointer, hdata: 'bar') +
- 'next_bar' (pointer, hdata: 'bar') |
+ 'prev_bar' (pointer, hdata: "bar") +
+ 'next_bar' (pointer, hdata: "bar") |
+ |
'gui_bars' +
'last_gui_bar'
| weechat | bar_item | バーアイテム |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'build_callback' (pointer) +
'build_callback_data' (pointer) +
- 'prev_item' (pointer, hdata: 'bar_item') +
- 'next_item' (pointer, hdata: 'bar_item') |
+ 'prev_item' (pointer, hdata: "bar_item") +
+ 'next_item' (pointer, hdata: "bar_item") |
+ |
'gui_bar_items' +
'last_gui_bar_item'
| weechat | bar_window | バーウィンドウ |
- 'bar' (pointer, hdata: 'bar') +
+ 'bar' (pointer, hdata: "bar") +
'x' (integer) +
'y' (integer) +
'width' (integer) +
@@ -350,12 +367,13 @@
'coords_count' (integer) +
'coords' (pointer) +
'gui_objects' (pointer) +
- 'prev_bar_window' (pointer, hdata: 'bar_window') +
- 'next_bar_window' (pointer, hdata: 'bar_window') |
+ 'prev_bar_window' (pointer, hdata: "bar_window") +
+ 'next_bar_window' (pointer, hdata: "bar_window") |
+ |
-
| weechat | buffer | バッファ |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'plugin_name_for_upgrade' (string) +
'number' (integer) +
'layout_number' (integer) +
@@ -371,14 +389,14 @@
'close_callback' (pointer) +
'close_callback_data' (pointer) +
'title' (string) +
- 'own_lines' (pointer, hdata: 'lines') +
- 'mixed_lines' (pointer, hdata: 'lines') +
- 'lines' (pointer, hdata: 'lines') +
+ 'own_lines' (pointer, hdata: "lines") +
+ 'mixed_lines' (pointer, hdata: "lines") +
+ 'lines' (pointer, hdata: "lines") +
'time_for_each_line' (integer) +
'chat_refresh_needed' (integer) +
'nicklist' (integer) +
'nicklist_case_sensitive' (integer) +
- 'nicklist_root' (pointer, hdata: 'nick_group') +
+ 'nicklist_root' (pointer, hdata: "nick_group") +
'nicklist_max_length' (integer) +
'nicklist_display_groups' (integer) +
'nicklist_visible_count' (integer) +
@@ -394,15 +412,15 @@
'input_buffer_length' (integer) +
'input_buffer_pos' (integer) +
'input_buffer_1st_display' (integer) +
- 'input_undo_snap' (pointer, hdata: 'input_undo') +
- 'input_undo' (pointer, hdata: 'input_undo') +
- 'last_input_undo' (pointer, hdata: 'input_undo') +
- 'ptr_input_undo' (pointer, hdata: 'input_undo') +
+ 'input_undo_snap' (pointer, hdata: "input_undo") +
+ 'input_undo' (pointer, hdata: "input_undo") +
+ 'last_input_undo' (pointer, hdata: "input_undo") +
+ 'ptr_input_undo' (pointer, hdata: "input_undo") +
'input_undo_count' (integer) +
- 'completion' (pointer, hdata: 'completion') +
- 'history' (pointer, hdata: 'history') +
- 'last_history' (pointer, hdata: 'history') +
- 'ptr_history' (pointer, hdata: 'history') +
+ 'completion' (pointer, hdata: "completion") +
+ 'history' (pointer, hdata: "history") +
+ 'last_history' (pointer, hdata: "history") +
+ 'ptr_history' (pointer, hdata: "history") +
'num_history' (integer) +
'text_search' (integer) +
'text_search_exact' (integer) +
@@ -413,20 +431,21 @@
'highlight_regex_compiled' (pointer) +
'highlight_tags' (string) +
'highlight_tags_count' (integer) +
- 'highlight_tags_array' (string, array_size: 'highlight_tags_count') +
+ 'highlight_tags_array' (string, array_size: "highlight_tags_count") +
'hotlist_max_level_nicks' (hashtable) +
- 'keys' (pointer, hdata: 'key') +
- 'last_key' (pointer, hdata: 'key') +
+ 'keys' (pointer, hdata: "key") +
+ 'last_key' (pointer, hdata: "key") +
'keys_count' (integer) +
'local_variables' (hashtable) +
- 'prev_buffer' (pointer, hdata: 'buffer') +
- 'next_buffer' (pointer, hdata: 'buffer') |
+ 'prev_buffer' (pointer, hdata: "buffer") +
+ 'next_buffer' (pointer, hdata: "buffer") |
+ |
'gui_buffer_last_displayed' +
'gui_buffers' +
'last_gui_buffer'
| weechat | completion | 補完する構造 |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'context' (integer) +
'base_command' (string) +
'base_command_arg_index' (integer) +
@@ -443,38 +462,41 @@
'position_replace' (integer) +
'diff_size' (integer) +
'diff_length' (integer) +
- 'partial_completion_list' (pointer, hdata: 'completion_partial') +
- 'last_partial_completion' (pointer, hdata: 'completion_partial') |
+ 'partial_completion_list' (pointer, hdata: "completion_partial") +
+ 'last_partial_completion' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | completion_partial | 部分補完する構造 |
'word' (string) +
'count' (integer) +
- 'prev_item' (pointer, hdata: 'completion_partial') +
- 'next_item' (pointer, hdata: 'completion_partial') |
+ 'prev_item' (pointer, hdata: "completion_partial") +
+ 'next_item' (pointer, hdata: "completion_partial") |
+ |
-
| weechat | config_file | 設定ファイル |
- 'plugin' (pointer, hdata: 'plugin') +
+ 'plugin' (pointer, hdata: "plugin") +
'name' (string) +
'filename' (string) +
'file' (pointer) +
'callback_reload' (pointer) +
'callback_reload_data' (pointer) +
- 'sections' (pointer, hdata: 'config_section') +
- 'last_section' (pointer, hdata: 'config_section') +
- 'prev_config' (pointer, hdata: 'config_file') +
- 'next_config' (pointer, hdata: 'config_file') |
+ 'sections' (pointer, hdata: "config_section") +
+ 'last_section' (pointer, hdata: "config_section") +
+ 'prev_config' (pointer, hdata: "config_file") +
+ 'next_config' (pointer, hdata: "config_file") |
+ |
'config_files' +
'last_config_file'
| weechat | config_option | 設定オプション |
- 'config_file' (pointer, hdata: 'config_file') +
- 'section' (pointer, hdata: 'config_section') +
+ 'config_file' (pointer, hdata: "config_file") +
+ 'section' (pointer, hdata: "config_section") +
'name' (string) +
'type' (integer) +
'description' (string) +
- 'string_values' (string, array_size: '*') +
+ 'string_values' (string, array_size: "*") +
'min' (integer) +
'max' (integer) +
'default_value' (pointer) +
@@ -487,12 +509,13 @@
'callback_delete' (pointer) +
'callback_delete_data' (pointer) +
'loaded' (integer) +
- 'prev_option' (pointer, hdata: 'config_option') +
- 'next_option' (pointer, hdata: 'config_option') |
+ 'prev_option' (pointer, hdata: "config_option") +
+ 'next_option' (pointer, hdata: "config_option") |
+ |
-
| weechat | config_section | 設定セクション |
- 'config_file' (pointer, hdata: 'config_file') +
+ 'config_file' (pointer, hdata: "config_file") +
'name' (string) +
'user_can_add_options' (integer) +
'user_can_delete_options' (integer) +
@@ -506,10 +529,11 @@
'callback_create_option_data' (pointer) +
'callback_delete_option' (pointer) +
'callback_delete_option_data' (pointer) +
- 'options' (pointer, hdata: 'config_option') +
- 'last_option' (pointer, hdata: 'config_option') +
- 'prev_section' (pointer, hdata: 'config_section') +
- 'next_section' (pointer, hdata: 'config_section') |
+ 'options' (pointer, hdata: "config_option") +
+ 'last_option' (pointer, hdata: "config_option") +
+ 'prev_section' (pointer, hdata: "config_section") +
+ 'next_section' (pointer, hdata: "config_section") |
+ |
-
| weechat | filter | フィルタ |
@@ -520,19 +544,21 @@
'buffers' (pointer) +
'tags' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'regex' (string) +
'regex_prefix' (pointer) +
'regex_message' (pointer) +
- 'prev_filter' (pointer, hdata: 'filter') +
- 'next_filter' (pointer, hdata: 'filter') |
+ 'prev_filter' (pointer, hdata: "filter") +
+ 'next_filter' (pointer, hdata: "filter") |
+ |
'gui_filters' +
'last_gui_filter'
| weechat | history | バッファのコマンド履歴 |
'text' (string) +
- 'next_history' (pointer, hdata: 'history') +
- 'prev_history' (pointer, hdata: 'history') |
+ 'next_history' (pointer, hdata: "history") +
+ 'prev_history' (pointer, hdata: "history") |
+ |
-
| weechat | hotlist | ホットリスト |
@@ -540,17 +566,19 @@
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
- 'count' (integer, array_size: '4') +
- 'prev_hotlist' (pointer, hdata: 'hotlist') +
- 'next_hotlist' (pointer, hdata: 'hotlist') |
+ 'count' (integer, array_size: "4") +
+ 'prev_hotlist' (pointer, hdata: "hotlist") +
+ 'next_hotlist' (pointer, hdata: "hotlist") |
+ |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | 入力行をアンドゥする構造 |
'data' (string) +
'pos' (integer) +
- 'prev_undo' (pointer, hdata: 'input_undo') +
- 'next_undo' (pointer, hdata: 'input_undo') |
+ 'prev_undo' (pointer, hdata: "input_undo") +
+ 'next_undo' (pointer, hdata: "input_undo") |
+ |
-
| weechat | key | キー (キーボードショートカット) |
@@ -560,8 +588,9 @@
'area_key' (string) +
'command' (string) +
'score' (integer) +
- 'prev_key' (pointer, hdata: 'key') +
- 'next_key' (pointer, hdata: 'key') |
+ 'prev_key' (pointer, hdata: "key") +
+ 'next_key' (pointer, hdata: "key") |
+ |
'gui_default_keys' +
'gui_default_keys_cursor' +
'gui_default_keys_mouse' +
@@ -580,47 +609,55 @@
'last_gui_key_search'
| weechat | line | 1 行の構造 |
- 'data' (pointer, hdata: 'line_data') +
- 'prev_line' (pointer, hdata: 'line') +
- 'next_line' (pointer, hdata: 'line') |
+ 'data' (pointer, hdata: "line_data") +
+ 'prev_line' (pointer, hdata: "line") +
+ 'next_line' (pointer, hdata: "line") |
+ |
-
| weechat | line_data | 1 行データ構造 |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'y' (integer) +
'date' (time) +
'date_printed' (time) +
'str_time' (string) +
'tags_count' (integer) +
- 'tags_array' (string, array_size: 'tags_count') +
+ 'tags_array' (string, array_size: "tags_count") +
'displayed' (char) +
'highlight' (char) +
'refresh_needed' (char) +
'prefix' (string) +
'prefix_length' (integer) +
'message' (string) |
+ 'date' (time) +
+ 'date_printed' (time) +
+ 'tags_array' (string) +
+ 'prefix' (string) +
+ 'message' (string) |
-
| weechat | lines | 行を持つ構造 |
- 'first_line' (pointer, hdata: 'line') +
- 'last_line' (pointer, hdata: 'line') +
- 'last_read_line' (pointer, hdata: 'line') +
+ 'first_line' (pointer, hdata: "line") +
+ 'last_line' (pointer, hdata: "line") +
+ 'last_read_line' (pointer, hdata: "line") +
'lines_count' (integer) +
'first_line_not_read' (integer) +
'lines_hidden' (integer) +
'buffer_max_length' (integer) +
'prefix_max_length' (integer) |
+ |
-
| weechat | nick | ニックネームリストにあるニックネーム |
- 'group' (pointer, hdata: 'nick_group') +
+ 'group' (pointer, hdata: "nick_group") +
'name' (string) +
'color' (string) +
'prefix' (string) +
'prefix_color' (string) +
'visible' (integer) +
- 'prev_nick' (pointer, hdata: 'nick') +
- 'next_nick' (pointer, hdata: 'nick') |
+ 'prev_nick' (pointer, hdata: "nick") +
+ 'next_nick' (pointer, hdata: "nick") |
+ |
-
| weechat | nick_group | ニックネームリストにあるグループ |
@@ -628,13 +665,14 @@
'color' (string) +
'visible' (integer) +
'level' (integer) +
- 'parent' (pointer, hdata: 'nick_group') +
- 'children' (pointer, hdata: 'nick_group') +
- 'last_child' (pointer, hdata: 'nick_group') +
- 'nicks' (pointer, hdata: 'nick') +
- 'last_nick' (pointer, hdata: 'nick') +
- 'prev_group' (pointer, hdata: 'nick_group') +
- 'next_group' (pointer, hdata: 'nick_group') |
+ 'parent' (pointer, hdata: "nick_group") +
+ 'children' (pointer, hdata: "nick_group") +
+ 'last_child' (pointer, hdata: "nick_group") +
+ 'nicks' (pointer, hdata: "nick") +
+ 'last_nick' (pointer, hdata: "nick") +
+ 'prev_group' (pointer, hdata: "nick_group") +
+ 'next_group' (pointer, hdata: "nick_group") |
+ |
-
| weechat | plugin | プラグイン |
@@ -647,8 +685,9 @@
'license' (string) +
'charset' (string) +
'debug' (integer) +
- 'prev_plugin' (pointer, hdata: 'plugin') +
- 'next_plugin' (pointer, hdata: 'plugin') |
+ 'prev_plugin' (pointer, hdata: "plugin") +
+ 'next_plugin' (pointer, hdata: "plugin") |
+ |
'last_weechat_plugin' +
'weechat_plugins'
@@ -666,41 +705,44 @@
'win_chat_height' (integer) +
'win_chat_cursor_x' (integer) +
'win_chat_cursor_y' (integer) +
- 'bar_windows' (pointer, hdata: 'bar_window') +
- 'last_bar_window' (pointer, hdata: 'bar_window') +
+ 'bar_windows' (pointer, hdata: "bar_window") +
+ 'last_bar_window' (pointer, hdata: "bar_window") +
'refresh_needed' (integer) +
'gui_objects' (pointer) +
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'layout_plugin_name' (string) +
'layout_buffer_name' (string) +
- 'scroll' (pointer, hdata: 'window_scroll') +
- 'ptr_tree' (pointer, hdata: 'window_tree') +
- 'prev_window' (pointer, hdata: 'window') +
- 'next_window' (pointer, hdata: 'window') |
+ 'scroll' (pointer, hdata: "window_scroll") +
+ 'ptr_tree' (pointer, hdata: "window_tree") +
+ 'prev_window' (pointer, hdata: "window") +
+ 'next_window' (pointer, hdata: "window") |
+ |
'gui_current_window' +
'gui_windows' +
'last_gui_window'
| weechat | window_scroll | ウィンドウ内のスクロール情報 |
- 'buffer' (pointer, hdata: 'buffer') +
+ 'buffer' (pointer, hdata: "buffer") +
'first_line_displayed' (integer) +
- 'start_line' (pointer, hdata: 'line') +
+ 'start_line' (pointer, hdata: "line") +
'start_line_pos' (integer) +
'scrolling' (integer) +
'start_col' (integer) +
'lines_after' (integer) +
'reset_allowed' (integer) +
- 'prev_scroll' (pointer, hdata: 'window_scroll') +
- 'next_scroll' (pointer, hdata: 'window_scroll') |
+ 'prev_scroll' (pointer, hdata: "window_scroll") +
+ 'next_scroll' (pointer, hdata: "window_scroll") |
+ |
-
| weechat | window_tree | ウィンドウツリー |
- 'parent_node' (pointer, hdata: 'window_tree') +
+ 'parent_node' (pointer, hdata: "window_tree") +
'split_pct' (integer) +
'split_horizontal' (integer) +
- 'child1' (pointer, hdata: 'window_tree') +
- 'child2' (pointer, hdata: 'window_tree') +
- 'window' (pointer, hdata: 'window') |
+ 'child1' (pointer, hdata: "window_tree") +
+ 'child2' (pointer, hdata: "window_tree") +
+ 'window' (pointer, hdata: "window") |
+ |
'gui_windows_tree'
|========================================
diff --git a/po/cs.po b/po/cs.po
index dae88da0c..eaf3429a7 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8993,6 +8993,9 @@ msgstr "Ukazatel"
msgid "Variables"
msgstr ""
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr ""
diff --git a/po/de.po b/po/de.po
index 6fdf4c43a..5dcd29042 100644
--- a/po/de.po
+++ b/po/de.po
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -9575,6 +9575,9 @@ msgstr "Pointer"
msgid "Variables"
msgstr "Variablen"
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr "Listen"
diff --git a/po/es.po b/po/es.po
index e5dfdcf26..e608756f3 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9277,6 +9277,9 @@ msgstr "Puntero"
msgid "Variables"
msgstr "Variables"
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr "Listas"
diff --git a/po/fr.po b/po/fr.po
index 9044c7fa7..14b36f687 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
-"PO-Revision-Date: 2012-08-23 22:02+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
+"PO-Revision-Date: 2012-08-25 16:14+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -9432,6 +9432,9 @@ msgstr "Pointeur"
msgid "Variables"
msgstr "Variables"
+msgid "Update allowed"
+msgstr "Mise à jour autorisée"
+
msgid "Lists"
msgstr "Listes"
diff --git a/po/hu.po b/po/hu.po
index c43f34305..050dadc36 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8488,6 +8488,9 @@ msgstr "perc"
msgid "Variables"
msgstr ""
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr ""
diff --git a/po/it.po b/po/it.po
index 84b6406f8..2b6f5ba36 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9254,6 +9254,9 @@ msgstr "Puntatore"
msgid "Variables"
msgstr "Variabili"
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr "Liste"
diff --git a/po/ja.po b/po/ja.po
index 54b0882cf..357d41187 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@@ -9047,6 +9047,9 @@ msgstr "ポインタ"
msgid "Variables"
msgstr "変数"
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr "リスト"
diff --git a/po/pl.po b/po/pl.po
index cd0ed475e..fcbb6e193 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9186,6 +9186,9 @@ msgstr "Wskaźnik"
msgid "Variables"
msgstr "Zmienne"
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr "Listy"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 734c3cdb0..a32f44449 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8630,6 +8630,9 @@ msgstr "Ponteiro"
msgid "Variables"
msgstr "Variáveis"
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr "Listas"
diff --git a/po/ru.po b/po/ru.po
index 76c0981a3..5d191a33c 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8507,6 +8507,9 @@ msgstr "минута"
msgid "Variables"
msgstr ""
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 4f75ed5b4..836ba2c1b 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-08-23 22:01+0200\n"
+"POT-Creation-Date: 2012-08-25 19:27+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -7479,6 +7479,9 @@ msgstr ""
msgid "Variables"
msgstr ""
+msgid "Update allowed"
+msgstr ""
+
msgid "Lists"
msgstr ""
diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c
index 646d85485..db34d95ee 100644
--- a/src/core/wee-config-file.c
+++ b/src/core/wee-config-file.c
@@ -2606,19 +2606,20 @@ config_file_hdata_config_file_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_config", "next_config");
+ hdata = hdata_new (NULL, hdata_name, "prev_config", "next_config",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_config_file, plugin, POINTER, NULL, "plugin");
- HDATA_VAR(struct t_config_file, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_config_file, filename, STRING, NULL, NULL);
- HDATA_VAR(struct t_config_file, file, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_file, callback_reload, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_file, callback_reload_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_file, sections, POINTER, NULL, "config_section");
- HDATA_VAR(struct t_config_file, last_section, POINTER, NULL, "config_section");
- HDATA_VAR(struct t_config_file, prev_config, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_config_file, next_config, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_config_file, plugin, POINTER, 0, NULL, "plugin");
+ HDATA_VAR(struct t_config_file, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_file, filename, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_file, file, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_file, callback_reload, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_file, callback_reload_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_file, sections, POINTER, 0, NULL, "config_section");
+ HDATA_VAR(struct t_config_file, last_section, POINTER, 0, NULL, "config_section");
+ HDATA_VAR(struct t_config_file, prev_config, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_config_file, next_config, POINTER, 0, NULL, hdata_name);
HDATA_LIST(config_files);
HDATA_LIST(last_config_file);
}
@@ -2637,27 +2638,28 @@ config_file_hdata_config_section_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_section", "next_section");
+ hdata = hdata_new (NULL, hdata_name, "prev_section", "next_section",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_config_section, config_file, POINTER, NULL, "config_file");
- HDATA_VAR(struct t_config_section, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_config_section, user_can_add_options, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_config_section, user_can_delete_options, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_read, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_read_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_write, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_write_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_write_default, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_write_default_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_create_option, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_create_option_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_delete_option, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, callback_delete_option_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_section, options, POINTER, NULL, "config_option");
- HDATA_VAR(struct t_config_section, last_option, POINTER, NULL, "config_option");
- HDATA_VAR(struct t_config_section, prev_section, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_config_section, next_section, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_config_section, config_file, POINTER, 0, NULL, "config_file");
+ HDATA_VAR(struct t_config_section, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, user_can_add_options, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, user_can_delete_options, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_read, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_read_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_write, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_write_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_write_default, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_write_default_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_create_option, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_create_option_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_delete_option, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_delete_option_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, options, POINTER, 0, NULL, "config_option");
+ HDATA_VAR(struct t_config_section, last_option, POINTER, 0, NULL, "config_option");
+ HDATA_VAR(struct t_config_section, prev_section, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_config_section, next_section, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
@@ -2674,29 +2676,30 @@ config_file_hdata_config_option_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_option", "next_option");
+ hdata = hdata_new (NULL, hdata_name, "prev_option", "next_option",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_config_option, config_file, POINTER, NULL, "config_file");
- HDATA_VAR(struct t_config_option, section, POINTER, NULL, "config_section");
- HDATA_VAR(struct t_config_option, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_config_option, type, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_config_option, description, STRING, NULL, NULL);
- HDATA_VAR(struct t_config_option, string_values, STRING, "*", NULL);
- HDATA_VAR(struct t_config_option, min, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_config_option, max, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_config_option, default_value, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, value, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, null_value_allowed, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_config_option, callback_check_value, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, callback_check_value_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, callback_change, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, callback_change_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, callback_delete, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, callback_delete_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_config_option, loaded, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_config_option, prev_option, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_config_option, next_option, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_config_option, config_file, POINTER, 0, NULL, "config_file");
+ HDATA_VAR(struct t_config_option, section, POINTER, 0, NULL, "config_section");
+ HDATA_VAR(struct t_config_option, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, type, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, description, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, string_values, STRING, 0, "*", NULL);
+ HDATA_VAR(struct t_config_option, min, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, max, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, default_value, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, value, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, null_value_allowed, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_check_value, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_check_value_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_change, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_change_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_delete, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_delete_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, loaded, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, prev_option, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_config_option, next_option, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c
index b013431bb..3066a08c7 100644
--- a/src/core/wee-debug.c
+++ b/src/core/wee-debug.c
@@ -310,15 +310,16 @@ debug_hdata_hash_var_map_cb (void *data,
const void *key, const void *value)
{
struct t_weelist *list;
+ struct t_hdata_var *var;
char str_offset[16];
/* make C compiler happy */
(void) hashtable;
list = (struct t_weelist *)data;
+ var = (struct t_hdata_var *)value;
- snprintf (str_offset, sizeof (str_offset),
- "%12d", (*((int *)value)) & 0xFFFF);
+ snprintf (str_offset, sizeof (str_offset), "%12d", var->offset);
weelist_add (list, str_offset, WEECHAT_LIST_POS_SORT, (void *)key);
}
@@ -350,9 +351,9 @@ debug_hdata_map_cb (void *data, struct t_hashtable *hashtable,
const void *key, const void *value)
{
struct t_hdata *ptr_hdata;
+ struct t_hdata_var *ptr_var;
struct t_weelist *list;
struct t_weelist_item *ptr_item;
- void *ptr_value;
/* make C compiler happy */
(void) data;
@@ -379,14 +380,19 @@ debug_hdata_map_cb (void *data, struct t_hashtable *hashtable,
for (ptr_item = list->items; ptr_item;
ptr_item = ptr_item->next_item)
{
- ptr_value = hashtable_get (ptr_hdata->hash_var, ptr_item->user_data);
- if (ptr_value)
+ ptr_var = hashtable_get (ptr_hdata->hash_var, ptr_item->user_data);
+ if (ptr_var)
{
gui_chat_printf (NULL,
- " %04d -> %s (%s)",
- (*((int *)ptr_value)) & 0xFFFF,
+ " %04d -> %s (%s%s%s%s%s%s)",
+ ptr_var->offset,
(char *)ptr_item->user_data,
- hdata_type_string[(*((int *)ptr_value)) >> 16]);
+ hdata_type_string[(int)ptr_var->type],
+ (ptr_var->update_allowed) ? ", R/W" : "",
+ (ptr_var->array_size) ? ", array size: " : "",
+ (ptr_var->array_size) ? ptr_var->array_size : "",
+ (ptr_var->hdata_name) ? ", hdata: " : "",
+ (ptr_var->hdata_name) ? ptr_var->hdata_name : "");
}
}
weelist_free (list);
diff --git a/src/core/wee-hdata.c b/src/core/wee-hdata.c
index 3ed13b526..827573cc5 100644
--- a/src/core/wee-hdata.c
+++ b/src/core/wee-hdata.c
@@ -44,12 +44,43 @@ char *hdata_type_string[8] =
/*
+ * hdata_free_var: free a hdata variable
+ */
+
+void
+hdata_free_var (struct t_hashtable *hashtable,
+ const void *key, void *value)
+{
+ struct t_hdata_var *var;
+
+ /* make C compiler happy */
+ (void) hashtable;
+ (void) key;
+
+ var = (struct t_hdata_var *)value;
+ if (var)
+ {
+ if (var->array_size)
+ free (var->array_size);
+ if (var->hdata_name)
+ free (var->hdata_name);
+ free (var);
+ }
+}
+
+/*
* hdata_new: create a new hdata
*/
struct t_hdata *
hdata_new (struct t_weechat_plugin *plugin, const char *hdata_name,
- const char *var_prev, const char *var_next)
+ const char *var_prev, const char *var_next,
+ int delete_allowed,
+ int (*callback_update)(void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable),
+ void *callback_update_data)
{
struct t_hdata *new_hdata;
@@ -62,27 +93,24 @@ hdata_new (struct t_weechat_plugin *plugin, const char *hdata_name,
new_hdata->plugin = plugin;
new_hdata->var_prev = (var_prev) ? strdup (var_prev) : NULL;
new_hdata->var_next = (var_next) ? strdup (var_next) : NULL;
- new_hdata->hash_var = hashtable_new (8,
+ new_hdata->hash_var = hashtable_new (16,
WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_INTEGER,
+ WEECHAT_HASHTABLE_POINTER,
NULL,
NULL);
- new_hdata->hash_var_array_size = hashtable_new (8,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
- new_hdata->hash_var_hdata = hashtable_new (8,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
- new_hdata->hash_list = hashtable_new (8,
+ hashtable_set_pointer (new_hdata->hash_var,
+ "callback_free_value",
+ &hdata_free_var);
+ new_hdata->hash_list = hashtable_new (16,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
NULL,
NULL);
hashtable_set (weechat_hdata, hdata_name, new_hdata);
+ new_hdata->delete_allowed = delete_allowed;
+ new_hdata->callback_update = callback_update;
+ new_hdata->callback_update_data = callback_update_data;
+ new_hdata->update_pending = 0;
}
return new_hdata;
@@ -94,18 +122,23 @@ hdata_new (struct t_weechat_plugin *plugin, const char *hdata_name,
void
hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type,
- const char *array_size, const char *hdata_name)
+ int update_allowed, const char *array_size,
+ const char *hdata_name)
{
- int value;
+ struct t_hdata_var *var;
+
+ if (!hdata || !name)
+ return;
- if (hdata && name)
+ var = malloc (sizeof (*var));
+ if (var)
{
- value = (type << 16) | (offset & 0xFFFF);
- hashtable_set (hdata->hash_var, name, &value);
- if (array_size && array_size[0])
- hashtable_set (hdata->hash_var_array_size, name, array_size);
- if (hdata_name && hdata_name[0])
- hashtable_set (hdata->hash_var_hdata, name, hdata_name);
+ var->offset = offset;
+ var->type = type;
+ var->update_allowed = update_allowed;
+ var->array_size = (array_size && array_size[0]) ? strdup (array_size) : NULL;
+ var->hdata_name = (hdata_name && hdata_name[0]) ? strdup (hdata_name) : NULL;
+ hashtable_set (hdata->hash_var, name, var);
}
}
@@ -116,8 +149,10 @@ hdata_new_var (struct t_hdata *hdata, const char *name, int offset, int type,
void
hdata_new_list (struct t_hdata *hdata, const char *name, void *pointer)
{
- if (hdata && name)
- hashtable_set (hdata->hash_list, name, pointer);
+ if (!hdata || !name)
+ return;
+
+ hashtable_set (hdata->hash_list, name, pointer);
}
/*
@@ -127,14 +162,14 @@ hdata_new_list (struct t_hdata *hdata, const char *name, void *pointer)
int
hdata_get_var_offset (struct t_hdata *hdata, const char *name)
{
- int *ptr_value;
+ struct t_hdata_var *var;
- if (hdata && name)
- {
- ptr_value = hashtable_get (hdata->hash_var, name);
- if (ptr_value)
- return (*ptr_value) & 0xFFFF;
- }
+ if (!hdata || !name)
+ return -1;
+
+ var = hashtable_get (hdata->hash_var, name);
+ if (var)
+ return var->offset;
return -1;
}
@@ -146,14 +181,14 @@ hdata_get_var_offset (struct t_hdata *hdata, const char *name)
int
hdata_get_var_type (struct t_hdata *hdata, const char *name)
{
- int *ptr_value;
+ struct t_hdata_var *var;
- if (hdata && name)
- {
- ptr_value = hashtable_get (hdata->hash_var, name);
- if (ptr_value)
- return (*ptr_value) >> 16;
- }
+ if (!hdata || !name)
+ return -1;
+
+ var = hashtable_get (hdata->hash_var, name);
+ if (var)
+ return var->type;
return -1;
}
@@ -165,14 +200,14 @@ hdata_get_var_type (struct t_hdata *hdata, const char *name)
const char *
hdata_get_var_type_string (struct t_hdata *hdata, const char *name)
{
- int *ptr_value;
+ struct t_hdata_var *var;
- if (hdata && name)
- {
- ptr_value = hashtable_get (hdata->hash_var, name);
- if (ptr_value)
- return hdata_type_string[(*ptr_value) >> 16];
- }
+ if (!hdata || !name)
+ return NULL;
+
+ var = hashtable_get (hdata->hash_var, name);
+ if (var)
+ return hdata_type_string[(int)var->type];
return NULL;
}
@@ -188,87 +223,87 @@ int
hdata_get_var_array_size (struct t_hdata *hdata, void *pointer,
const char *name)
{
+ struct t_hdata_var *var;
const char *ptr_size;
char *error;
long value;
- int i, type, offset;
+ int i, offset;
void *ptr_value;
- if (hdata && name)
+ if (!hdata || !name)
+ return -1;
+
+ var = hashtable_get (hdata->hash_var, name);
+ if (!var)
+ return -1;
+
+ ptr_size = var->array_size;
+ if (!ptr_size)
+ return -1;
+
+ if (strcmp (ptr_size, "*") == 0)
{
- ptr_size = hashtable_get (hdata->hash_var_array_size, name);
- if (ptr_size)
+ /*
+ * automatic size: look for NULL in array
+ * (this automatic size is possible only with pointers, so with
+ * types: string, pointer, hashtable)
+ */
+ if ((var->type == WEECHAT_HDATA_STRING)
+ || (var->type == WEECHAT_HDATA_POINTER)
+ || (var->type == WEECHAT_HDATA_HASHTABLE))
{
- if (strcmp (ptr_size, "*") == 0)
+ if (!(*((void **)(pointer + var->offset))))
+ return 0;
+ i = 0;
+ while (1)
{
- /*
- * automatic size: look for NULL in array
- * (this automatic size is possible only with pointers, so with
- * types: string, pointer, hashtable)
- */
- type = hdata_get_var_type (hdata, name);
- if ((type == WEECHAT_HDATA_STRING)
- || (type == WEECHAT_HDATA_POINTER)
- || (type == WEECHAT_HDATA_HASHTABLE))
+ ptr_value = NULL;
+ switch (var->type)
{
- offset = hdata_get_var_offset (hdata, name);
- if (offset >= 0)
- {
- if (!(*((void **)(pointer + offset))))
- return 0;
- i = 0;
- while (1)
- {
- ptr_value = NULL;
- switch (type)
- {
- case WEECHAT_HDATA_STRING:
- ptr_value = (*((char ***)(pointer + offset)))[i];
- break;
- case WEECHAT_HDATA_POINTER:
- ptr_value = (*((void ***)(pointer + offset)))[i];
- break;
- case WEECHAT_HDATA_HASHTABLE:
- ptr_value = (*((struct t_hashtable ***)(pointer + offset)))[i];
- break;
- }
- if (!ptr_value)
- break;
- i++;
- }
- return i;
- }
+ case WEECHAT_HDATA_STRING:
+ ptr_value = (*((char ***)(pointer + var->offset)))[i];
+ break;
+ case WEECHAT_HDATA_POINTER:
+ ptr_value = (*((void ***)(pointer + var->offset)))[i];
+ break;
+ case WEECHAT_HDATA_HASHTABLE:
+ ptr_value = (*((struct t_hashtable ***)(pointer + var->offset)))[i];
+ break;
}
+ if (!ptr_value)
+ break;
+ i++;
}
- else
+ return i;
+ }
+ }
+ else
+ {
+ /* fixed size: the size can be a name of variable or integer */
+ offset = hdata_get_var_offset (hdata, ptr_size);
+ if (offset >= 0)
+ {
+ /* size is the name of a variable in hdata, read it */
+ switch (hdata_get_var_type (hdata, ptr_size))
{
- /* fixed size: the size can be a name of variable or integer */
- if (hdata_get_var_offset (hdata, ptr_size) >= 0)
- {
- /* size is the name of a variable in hdata, read it */
- offset = hdata_get_var_offset (hdata, ptr_size);
- switch (hdata_get_var_type (hdata, ptr_size))
- {
- case WEECHAT_HDATA_CHAR:
- return (int)(*((char *)(pointer + offset)));
- case WEECHAT_HDATA_INTEGER:
- return *((int *)(pointer + offset));
- case WEECHAT_HDATA_LONG:
- return (int)(*((long *)(pointer + offset)));
- default:
- break;
- }
- }
- else
- {
- /* check if the size is a valid integer */
- error = NULL;
- value = strtol (ptr_size, &error, 10);
- if (error && !error[0])
- return (int)value;
- }
+ case WEECHAT_HDATA_CHAR:
+ return (int)(*((char *)(pointer + offset)));
+ case WEECHAT_HDATA_INTEGER:
+ return *((int *)(pointer + offset));
+ case WEECHAT_HDATA_LONG:
+ return (int)(*((long *)(pointer + offset)));
+ default:
+ break;
}
}
+ else
+ {
+ /* check if the size is a valid integer */
+ error = NULL;
+ value = strtol (ptr_size, &error, 10);
+ if (error && !error[0])
+ return (int)value;
+ }
}
return -1;
@@ -282,11 +317,17 @@ const char *
hdata_get_var_array_size_string (struct t_hdata *hdata, void *pointer,
const char *name)
{
+ struct t_hdata_var *var;
+
/* make C compiler happy */
(void) pointer;
- if (hdata && name)
- return (const char *)hashtable_get (hdata->hash_var_array_size, name);
+ if (!hdata || !name)
+ return NULL;
+
+ var = hashtable_get (hdata->hash_var, name);
+ if (var)
+ return (const char *)var->array_size;
return NULL;
}
@@ -299,8 +340,14 @@ hdata_get_var_array_size_string (struct t_hdata *hdata, void *pointer,
const char *
hdata_get_var_hdata (struct t_hdata *hdata, const char *name)
{
- if (hdata && name)
- return (const char *)hashtable_get (hdata->hash_var_hdata, name);
+ struct t_hdata_var *var;
+
+ if (!hdata || !name)
+ return NULL;
+
+ var = hashtable_get (hdata->hash_var, name);
+ if (var)
+ return (const char *)var->hdata_name;
return NULL;
}
@@ -314,12 +361,12 @@ hdata_get_var (struct t_hdata *hdata, void *pointer, const char *name)
{
int offset;
- if (hdata && pointer)
- {
- offset = hdata_get_var_offset (hdata, name);
- if (offset >= 0)
- return pointer + offset;
- }
+ if (!hdata || !pointer)
+ return NULL;
+
+ offset = hdata_get_var_offset (hdata, name);
+ if (offset >= 0)
+ return pointer + offset;
return NULL;
}
@@ -332,10 +379,10 @@ hdata_get_var (struct t_hdata *hdata, void *pointer, const char *name)
void *
hdata_get_var_at_offset (struct t_hdata *hdata, void *pointer, int offset)
{
- if (hdata && pointer)
- return pointer + offset;
+ if (!hdata || !pointer)
+ return NULL;
- return NULL;
+ return pointer + offset;
}
/*
@@ -347,12 +394,12 @@ hdata_get_list (struct t_hdata *hdata, const char *name)
{
void *ptr_value;
- if (hdata && name)
- {
- ptr_value = hashtable_get (hdata->hash_list, name);
- if (ptr_value)
- return *((void **)ptr_value);
- }
+ if (!hdata || !name)
+ return NULL;
+
+ ptr_value = hashtable_get (hdata->hash_list, name);
+ if (ptr_value)
+ return *((void **)ptr_value);
return NULL;
}
@@ -368,17 +415,17 @@ hdata_check_pointer (struct t_hdata *hdata, void *list, void *pointer)
{
void *ptr_current;
- if (hdata && list && pointer)
+ if (!hdata || !list || !pointer)
+ return 0;
+
+ if (pointer == list)
+ return 1;
+ ptr_current = list;
+ while (ptr_current)
{
- if (pointer == list)
+ ptr_current = hdata_move (hdata, ptr_current, 1);
+ if (ptr_current && (ptr_current == pointer))
return 1;
- ptr_current = list;
- while (ptr_current)
- {
- ptr_current = hdata_move (hdata, ptr_current, 1);
- if (ptr_current && (ptr_current == pointer))
- return 1;
- }
}
return 0;
@@ -394,17 +441,17 @@ hdata_move (struct t_hdata *hdata, void *pointer, int count)
char *ptr_var;
int i, abs_count;
- if (hdata && pointer && (count != 0))
- {
- ptr_var = (count < 0) ? hdata->var_prev : hdata->var_next;
- abs_count = abs(count);
+ if (!hdata || !pointer || (count == 0))
+ return NULL;
- for (i = 0; i < abs_count; i++)
- {
- pointer = hdata_pointer (hdata, pointer, ptr_var);
- if (pointer)
- return pointer;
- }
+ ptr_var = (count < 0) ? hdata->var_prev : hdata->var_next;
+ abs_count = abs(count);
+
+ for (i = 0; i < abs_count; i++)
+ {
+ pointer = hdata_pointer (hdata, pointer, ptr_var);
+ if (pointer)
+ return pointer;
}
return NULL;
@@ -459,23 +506,24 @@ hdata_get_index_and_name (const char *name, int *index, const char **ptr_name)
char
hdata_char (struct t_hdata *hdata, void *pointer, const char *name)
{
- int offset, index;
+ int index;
const char *ptr_name;
+ struct t_hdata_var *var;
+
+ if (!hdata || !pointer || !name)
+ return '\0';
- if (hdata && pointer && name)
+ hdata_get_index_and_name (name, &index, &ptr_name);
+ var = hashtable_get (hdata->hash_var, ptr_name);
+ if (var && (var->offset >= 0))
{
- hdata_get_index_and_name (name, &index, &ptr_name);
- offset = hdata_get_var_offset (hdata, ptr_name);
- if (offset >= 0)
+ if (var->array_size)
{
- if (hdata_get_var_array_size_string (hdata, pointer, ptr_name))
- {
- if (*((void **)(pointer + offset)))
- return (*((char **)(pointer + offset)))[index];
- }
- else
- return *((char *)(pointer + offset));
+ if (*((void **)(pointer + var->offset)))
+ return (*((char **)(pointer + var->offset)))[index];
}
+ else
+ return *((char *)(pointer + var->offset));
}
return '\0';
@@ -488,23 +536,24 @@ hdata_char (struct t_hdata *hdata, void *pointer, const char *name)
int
hdata_integer (struct t_hdata *hdata, void *pointer, const char *name)
{
- int offset, index;
+ int index;
const char *ptr_name;
+ struct t_hdata_var *var;
+
+ if (!hdata || !pointer || !name)
+ return 0;
- if (hdata && pointer && name)
+ hdata_get_index_and_name (name, &index, &ptr_name);
+ var = hashtable_get (hdata->hash_var, ptr_name);
+ if (var && (var->offset >= 0))
{
- hdata_get_index_and_name (name, &index, &ptr_name);
- offset = hdata_get_var_offset (hdata, ptr_name);
- if (offset >= 0)
+ if (var->array_size)
{
- if (hdata_get_var_array_size_string (hdata, pointer, ptr_name))
- {
- if (*((void **)(pointer + offset)))
- return ((int *)(pointer + offset))[index];
- }
- else
- return *((int *)(pointer + offset));
+ if (*((void **)(pointer + var->offset)))
+ return ((int *)(pointer + var->offset))[index];
}
+ else
+ return *((int *)(pointer + var->offset));
}
return 0;
@@ -517,23 +566,24 @@ hdata_integer (struct t_hdata *hdata, void *pointer, const char *name)
long
hdata_long (struct t_hdata *hdata, void *pointer, const char *name)
{
- int offset, index;
+ int index;
const char *ptr_name;
+ struct t_hdata_var *var;
- if (hdata && pointer && name)
+ if (!hdata || !pointer || !name)
+ return 0;
+
+ hdata_get_index_and_name (name, &index, &ptr_name);
+ var = hashtable_get (hdata->hash_var, ptr_name);
+ if (var && (var->offset >= 0))
{
- hdata_get_index_and_name (name, &index, &ptr_name);
- offset = hdata_get_var_offset (hdata, ptr_name);
- if (offset >= 0)
+ if (var->array_size)
{
- if (hdata_get_var_array_size_string (hdata, pointer, ptr_name))
- {
- if (*((void **)(pointer + offset)))
- return ((long *)(pointer + offset))[index];
- }
- else
- return *((long *)(pointer + offset));
+ if (*((void **)(pointer + var->offset)))
+ return ((long *)(pointer + var->offset))[index];
}
+ else
+ return *((long *)(pointer + var->offset));
}
return 0;
@@ -546,23 +596,24 @@ hdata_long (struct t_hdata *hdata, void *pointer, const char *name)
const char *
hdata_string (struct t_hdata *hdata, void *pointer, const char *name)
{
- int offset, index;
+ int index;
const char *ptr_name;
+ struct t_hdata_var *var;
+
+ if (!hdata || !pointer || !name)
+ return NULL;
- if (hdata && pointer && name)
+ hdata_get_index_and_name (name, &index, &ptr_name);
+ var = hashtable_get (hdata->hash_var, ptr_name);
+ if (var && (var->offset >= 0))
{
- hdata_get_index_and_name (name, &index, &ptr_name);
- offset = hdata_get_var_offset (hdata, ptr_name);
- if (offset >= 0)
+ if (var->array_size)
{
- if (hdata_get_var_array_size_string (hdata, pointer, ptr_name))
- {
- if (*((void **)(pointer + offset)))
- return (*((char ***)(pointer + offset)))[index];
- }
- else
- return *((char **)(pointer + offset));
+ if (*((void **)(pointer + var->offset)))
+ return (*((char ***)(pointer + var->offset)))[index];
}
+ else
+ return *((char **)(pointer + var->offset));
}
return NULL;
@@ -575,23 +626,24 @@ hdata_string (struct t_hdata *hdata, void *pointer, const char *name)
void *
hdata_pointer (struct t_hdata *hdata, void *pointer, const char *name)
{
- int offset, index;
+ int index;
const char *ptr_name;
+ struct t_hdata_var *var;
+
+ if (!hdata || !pointer || !name)
+ return NULL;
- if (hdata && pointer && name)
+ hdata_get_index_and_name (name, &index, &ptr_name);
+ var = hashtable_get (hdata->hash_var, ptr_name);
+ if (var && (var->offset >= 0))
{
- hdata_get_index_and_name (name, &index, &ptr_name);
- offset = hdata_get_var_offset (hdata, ptr_name);
- if (offset >= 0)
+ if (var->array_size)
{
- if (hdata_get_var_array_size_string (hdata, pointer, ptr_name))
- {
- if (*((void **)(pointer + offset)))
- return (*((void ***)(pointer + offset)))[index];
- }
- else
- return *((void **)(pointer + offset));
+ if (*((void **)(pointer + var->offset)))
+ return (*((void ***)(pointer + var->offset)))[index];
}
+ else
+ return *((void **)(pointer + var->offset));
}
return NULL;
@@ -604,23 +656,24 @@ hdata_pointer (struct t_hdata *hdata, void *pointer, const char *name)
time_t
hdata_time (struct t_hdata *hdata, void *pointer, const char *name)
{
- int offset, index;
+ int index;
const char *ptr_name;
+ struct t_hdata_var *var;
- if (hdata && pointer && name)
+ if (!hdata || !pointer || !name)
+ return 0;
+
+ hdata_get_index_and_name (name, &index, &ptr_name);
+ var = hashtable_get (hdata->hash_var, ptr_name);
+ if (var && (var->offset >= 0))
{
- hdata_get_index_and_name (name, &index, &ptr_name);
- offset = hdata_get_var_offset (hdata, ptr_name);
- if (offset >= 0)
+ if (var->array_size)
{
- if (hdata_get_var_array_size_string (hdata, pointer, ptr_name))
- {
- if (*((void **)(pointer + offset)))
- return ((time_t *)(pointer + offset))[index];
- }
- else
- return *((time_t *)(pointer + offset));
+ if (*((void **)(pointer + var->offset)))
+ return ((time_t *)(pointer + var->offset))[index];
}
+ else
+ return *((time_t *)(pointer + var->offset));
}
return 0;
@@ -633,28 +686,164 @@ hdata_time (struct t_hdata *hdata, void *pointer, const char *name)
struct t_hashtable *
hdata_hashtable (struct t_hdata *hdata, void *pointer, const char *name)
{
- int offset, index;
+ int index;
const char *ptr_name;
+ struct t_hdata_var *var;
+
+ if (!hdata || !pointer || !name)
+ return NULL;
- if (hdata && pointer && name)
+ hdata_get_index_and_name (name, &index, &ptr_name);
+ var = hashtable_get (hdata->hash_var, ptr_name);
+ if (var && (var->offset >= 0))
{
- hdata_get_index_and_name (name, &index, &ptr_name);
- offset = hdata_get_var_offset (hdata, ptr_name);
- if (offset >= 0)
+ if (var->array_size)
{
- if (hdata_get_var_array_size_string (hdata, pointer, ptr_name))
- {
- if (*((void **)(pointer + offset)))
- return (*((struct t_hashtable ***)(pointer + offset)))[index];
- }
- else
- return *((struct t_hashtable **)(pointer + offset));
+ if (*((void **)(pointer + var->offset)))
+ return (*((struct t_hashtable ***)(pointer + var->offset)))[index];
}
+ else
+ return *((struct t_hashtable **)(pointer + var->offset));
}
return NULL;
}
+/* hdata_set: set value for a variable in hdata
+ * WARNING: this is dangerous, and only some variables can be set
+ * by this function (this depends on hdata, see API doc
+ * for more info) and this function can be called *ONLY*
+ * in an "update" callback (in hdata).
+ * Return 1 if ok (value set), 0 if error (or not allowed)
+ */
+
+int
+hdata_set (struct t_hdata *hdata, void *pointer, const char *name,
+ const char *value)
+{
+ struct t_hdata_var *var;
+ char **ptr_string, *error;
+ long number;
+ long unsigned int ptr;
+ int rc;
+
+ if (!hdata->update_pending)
+ return 0;
+
+ var = hashtable_get (hdata->hash_var, name);
+ if (!var)
+ return 0;
+
+ if (!var->update_allowed)
+ return 0;
+
+ switch (var->type)
+ {
+ case WEECHAT_HDATA_OTHER:
+ break;
+ case WEECHAT_HDATA_CHAR:
+ *((char *)(pointer + var->offset)) = (value) ? value[0] : '\0';
+ return 1;
+ break;
+ case WEECHAT_HDATA_INTEGER:
+ error = NULL;
+ number = strtol (value, &error, 10);
+ if (error && !error[0])
+ {
+ *((int *)(pointer + var->offset)) = (int)number;
+ return 1;
+ }
+ break;
+ case WEECHAT_HDATA_LONG:
+ error = NULL;
+ number = strtol (value, &error, 10);
+ if (error && !error[0])
+ {
+ *((long *)(pointer + var->offset)) = number;
+ return 1;
+ }
+ break;
+ case WEECHAT_HDATA_STRING:
+ ptr_string = (char **)(pointer + var->offset);
+ if (*ptr_string)
+ free (*ptr_string);
+ *ptr_string = (value) ? strdup (value) : NULL;
+ return 1;
+ break;
+ case WEECHAT_HDATA_POINTER:
+ rc = sscanf (value, "%lx", &ptr);
+ if ((rc != EOF) && (rc != 0))
+ {
+ *((void **)(pointer + var->offset)) = (void *)ptr;
+ return 1;
+ }
+ break;
+ case WEECHAT_HDATA_TIME:
+ error = NULL;
+ number = strtol (value, &error, 10);
+ if (error && !error[0])
+ {
+ *((time_t *)(pointer + var->offset)) = (time_t)number;
+ return 1;
+ }
+ break;
+ case WEECHAT_HDATA_HASHTABLE:
+ break;
+ }
+ return 0;
+}
+
+/*
+ * hdata_update: update some data in hdata
+ * The hashtable contains keys with new values.
+ * A special key "__delete" can be used to delete the whole
+ * structure at pointer (if allowed for this hdata).
+ * WARNING: this is dangerous, and only some data can be updated
+ * by this function (this depends on hdata, see API doc
+ * for more info)
+ * Return number of variables updated or 0 if nothing has been
+ * updated. In case of deletion, return 1 if ok, 0 if error.
+ */
+
+int
+hdata_update (struct t_hdata *hdata, void *pointer,
+ struct t_hashtable *hashtable)
+{
+ const char *value;
+ struct t_hdata_var *var;
+ int rc;
+
+ if (!hdata || !hashtable || !hdata->callback_update)
+ return 0;
+
+ /* check if delete of structure is allowed */
+ if (hashtable_has_key (hashtable, "__delete_allowed"))
+ return (int)hdata->delete_allowed;
+
+ /* check if update of variable is allowed */
+ value = hashtable_get (hashtable, "__update_allowed");
+ if (value)
+ {
+ if (!hdata->callback_update)
+ return 0;
+ var = hashtable_get (hdata->hash_var, value);
+ if (!var)
+ return 0;
+ return (var->update_allowed) ? 1 : 0;
+ }
+
+ if (!pointer)
+ return 0;
+
+ /* update data */
+ hdata->update_pending = 1;
+ rc = (hdata->callback_update) (hdata->callback_update_data,
+ hdata, pointer, hashtable);
+ hdata->update_pending = 0;
+
+ return rc;
+}
+
/*
* hdata_get_string: get a hdata property as string
*/
@@ -662,37 +851,25 @@ hdata_hashtable (struct t_hdata *hdata, void *pointer, const char *name)
const char *
hdata_get_string (struct t_hdata *hdata, const char *property)
{
- if (hdata && property)
- {
- if (string_strcasecmp (property, "var_keys") == 0)
- return hashtable_get_string (hdata->hash_var, "keys");
- else if (string_strcasecmp (property, "var_values") == 0)
- return hashtable_get_string (hdata->hash_var, "values");
- else if (string_strcasecmp (property, "var_keys_values") == 0)
- return hashtable_get_string (hdata->hash_var, "keys_values");
- else if (string_strcasecmp (property, "var_prev") == 0)
- return hdata->var_prev;
- else if (string_strcasecmp (property, "var_next") == 0)
- return hdata->var_next;
- else if (string_strcasecmp (property, "var_array_size_keys") == 0)
- return hashtable_get_string (hdata->hash_var_array_size, "keys");
- else if (string_strcasecmp (property, "var_array_size_values") == 0)
- return hashtable_get_string (hdata->hash_var_array_size, "values");
- else if (string_strcasecmp (property, "var_array_size_keys_values") == 0)
- return hashtable_get_string (hdata->hash_var_array_size, "keys_values");
- else if (string_strcasecmp (property, "var_hdata_keys") == 0)
- return hashtable_get_string (hdata->hash_var_hdata, "keys");
- else if (string_strcasecmp (property, "var_hdata_values") == 0)
- return hashtable_get_string (hdata->hash_var_hdata, "values");
- else if (string_strcasecmp (property, "var_hdata_keys_values") == 0)
- return hashtable_get_string (hdata->hash_var_hdata, "keys_values");
- else if (string_strcasecmp (property, "list_keys") == 0)
- return hashtable_get_string (hdata->hash_list, "keys");
- else if (string_strcasecmp (property, "list_values") == 0)
- return hashtable_get_string (hdata->hash_list, "values");
- else if (string_strcasecmp (property, "list_keys_values") == 0)
- return hashtable_get_string (hdata->hash_list, "keys_values");
- }
+ if (!hdata || !property)
+ return NULL;
+
+ if (string_strcasecmp (property, "var_keys") == 0)
+ return hashtable_get_string (hdata->hash_var, "keys");
+ else if (string_strcasecmp (property, "var_values") == 0)
+ return hashtable_get_string (hdata->hash_var, "values");
+ else if (string_strcasecmp (property, "var_keys_values") == 0)
+ return hashtable_get_string (hdata->hash_var, "keys_values");
+ else if (string_strcasecmp (property, "var_prev") == 0)
+ return hdata->var_prev;
+ else if (string_strcasecmp (property, "var_next") == 0)
+ return hdata->var_next;
+ else if (string_strcasecmp (property, "list_keys") == 0)
+ return hashtable_get_string (hdata->hash_list, "keys");
+ else if (string_strcasecmp (property, "list_values") == 0)
+ return hashtable_get_string (hdata->hash_list, "values");
+ else if (string_strcasecmp (property, "list_keys_values") == 0)
+ return hashtable_get_string (hdata->hash_list, "keys_values");
return NULL;
}
@@ -710,10 +887,6 @@ hdata_free (struct t_hdata *hdata)
free (hdata->var_prev);
if (hdata->var_next)
free (hdata->var_next);
- if (hdata->hash_var_array_size)
- hashtable_free (hdata->hash_var_array_size);
- if (hdata->hash_var_hdata)
- hashtable_free (hdata->hash_var_hdata);
if (hdata->hash_list)
hashtable_free (hdata->hash_list);
@@ -779,6 +952,31 @@ hdata_free_all ()
}
/*
+ * hdata_print_log_var_map_cb: function called for each variable in hdata
+ */
+
+void
+hdata_print_log_var_map_cb (void *data, struct t_hashtable *hashtable,
+ const void *key, const void *value)
+{
+ struct t_hdata_var *var;
+
+ /* make C compiler happy */
+ (void) data;
+ (void) hashtable;
+
+ var = (struct t_hdata_var *)value;
+
+ log_printf ("");
+ log_printf (" [hdata var '%s']", (const char *)key);
+ log_printf (" offset . . . . . . . . : %d", var->offset);
+ log_printf (" type . . . . . . . . . : %d ('%s')", var->type, hdata_type_string[(int)var->type]);
+ log_printf (" update_allowed . . . . : %d", (int)var->update_allowed);
+ log_printf (" array_size . . . . . . : '%s'", var->array_size);
+ log_printf (" hdata_name . . . . . . : '%s'", var->hdata_name);
+}
+
+/*
* hdata_print_log_map_cb: function called for each hdata in memory
*/
@@ -802,15 +1000,14 @@ hdata_print_log_map_cb (void *data, struct t_hashtable *hashtable,
log_printf (" hash_var . . . . . . . : 0x%lx (hashtable: '%s')",
ptr_hdata->hash_var,
hashtable_get_string (ptr_hdata->hash_var, "keys_values"));
- log_printf (" hash_var_array_size. . : 0x%lx (hashtable: '%s')",
- ptr_hdata->hash_var_array_size,
- hashtable_get_string (ptr_hdata->hash_var_array_size, "keys_values"));
- log_printf (" hash_var_hdata . . . . : 0x%lx (hashtable: '%s')",
- ptr_hdata->hash_var_hdata,
- hashtable_get_string (ptr_hdata->hash_var_hdata, "keys_values"));
log_printf (" hash_list. . . . . . . : 0x%lx (hashtable: '%s')",
ptr_hdata->hash_list,
hashtable_get_string (ptr_hdata->hash_list, "keys_values"));
+ log_printf (" delete_allowed . . . . : %d", (int)ptr_hdata->delete_allowed);
+ log_printf (" callback_update. . . . : 0x%lx", ptr_hdata->callback_update);
+ log_printf (" callback_update_data . : 0x%lx", ptr_hdata->callback_update_data);
+ log_printf (" update_pending . . . . : %d", (int)ptr_hdata->update_pending);
+ hashtable_map (ptr_hdata->hash_var, &hdata_print_log_var_map_cb, NULL);
}
/*
diff --git a/src/core/wee-hdata.h b/src/core/wee-hdata.h
index 0eacf669e..3139af4ef 100644
--- a/src/core/wee-hdata.h
+++ b/src/core/wee-hdata.h
@@ -20,11 +20,22 @@
#ifndef __WEECHAT_HDATA_H
#define __WEECHAT_HDATA_H 1
-#define HDATA_VAR(__struct, __name, __type, __array_size, __hdata_name) \
+#define HDATA_VAR(__struct, __name, __type, __update_allowed, \
+ __array_size, __hdata_name) \
hdata_new_var (hdata, #__name, offsetof (__struct, __name), \
- WEECHAT_HDATA_##__type, __array_size, __hdata_name)
+ WEECHAT_HDATA_##__type, __update_allowed, \
+ __array_size, __hdata_name)
#define HDATA_LIST(__name) hdata_new_list (hdata, #__name, &(__name));
+struct t_hdata_var
+{
+ int offset; /* offset */
+ char type; /* type */
+ char update_allowed; /* update allowed? */
+ char *array_size; /* array size */
+ char *hdata_name; /* hdata name */
+};
+
struct t_hdata
{
struct t_weechat_plugin *plugin; /* plugin which created this hdata */
@@ -34,10 +45,19 @@ struct t_hdata
char *var_next; /* name of var with pointer to */
/* next element in list */
struct t_hashtable *hash_var; /* hash with type & offset of vars */
- struct t_hashtable *hash_var_array_size; /* array size */
- struct t_hashtable *hash_var_hdata; /* hashtable with hdata names */
struct t_hashtable *hash_list; /* hashtable with pointers on lists */
/* (used to search objects) */
+
+ char delete_allowed; /* delete allowed? */
+ int (*callback_update) /* update callback */
+ (void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable);
+ void *callback_update_data; /* data sent to update callback */
+
+ /* internal vars */
+ char update_pending; /* update pending: hdata_set allowed */
};
extern struct t_hashtable *weechat_hdata;
@@ -46,9 +66,15 @@ extern char *hdata_type_string[];
extern struct t_hdata *hdata_new (struct t_weechat_plugin *plugin,
const char *hdata_name, const char *var_prev,
- const char *var_next);
+ const char *var_next,
+ int delete_allowed,
+ int (*callback_update)(void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable),
+ void *callback_update_data);
extern void hdata_new_var (struct t_hdata *hdata, const char *name, int offset,
- int type, const char *array_size,
+ int type, int update_allowed, const char *array_size,
const char *hdata_name);
extern void hdata_new_list (struct t_hdata *hdata, const char *name,
void *pointer);
@@ -85,6 +111,10 @@ extern time_t hdata_time (struct t_hdata *hdata, void *pointer,
const char *name);
extern struct t_hashtable *hdata_hashtable (struct t_hdata *hdata,
void *pointer, const char *name);
+extern int hdata_set (struct t_hdata *hdata, void *pointer, const char *name,
+ const char *value);
+extern int hdata_update (struct t_hdata *hdata, void *pointer,
+ struct t_hashtable *hashtable);
extern const char *hdata_get_string (struct t_hdata *hdata,
const char *property);
extern void hdata_free_all_plugin (struct t_weechat_plugin *plugin);
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index 58668c33c..fade60939 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -1852,15 +1852,16 @@ gui_bar_item_hdata_bar_item_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item");
+ hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_bar_item, plugin, POINTER, NULL, "plugin");
- HDATA_VAR(struct t_gui_bar_item, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_item, build_callback, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_item, build_callback_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_item, prev_item, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_bar_item, next_item, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_bar_item, plugin, POINTER, 0, NULL, "plugin");
+ HDATA_VAR(struct t_gui_bar_item, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_item, build_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_item, build_callback_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_item, prev_item, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_bar_item, next_item, POINTER, 0, NULL, hdata_name);
HDATA_LIST(gui_bar_items);
HDATA_LIST(last_gui_bar_item);
}
diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c
index a6479d7c9..66ac6f6e5 100644
--- a/src/gui/gui-bar-window.c
+++ b/src/gui/gui-bar-window.c
@@ -1404,30 +1404,31 @@ gui_bar_window_hdata_bar_window_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_bar_window", "next_bar_window");
+ hdata = hdata_new (NULL, hdata_name, "prev_bar_window", "next_bar_window",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_bar_window, bar, POINTER, NULL, "bar");
- HDATA_VAR(struct t_gui_bar_window, x, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, y, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, width, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, height, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, scroll_x, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, scroll_y, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, cursor_x, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, cursor_y, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, current_size, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, items_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, items_subcount, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, items_content, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, items_num_lines, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, items_refresh_needed, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, screen_col_size, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, coords_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, coords, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, gui_objects, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar_window, prev_bar_window, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_bar_window, next_bar_window, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_bar_window, bar, POINTER, 0, NULL, "bar");
+ HDATA_VAR(struct t_gui_bar_window, x, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, y, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, width, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, height, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, scroll_x, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, scroll_y, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, cursor_x, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, cursor_y, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, current_size, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, items_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, items_subcount, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, items_content, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, items_num_lines, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, items_refresh_needed, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, screen_col_size, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, coords_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, coords, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, gui_objects, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_window, prev_bar_window, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_bar_window, next_bar_window, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c
index 2c7718f8e..31ec7f677 100644
--- a/src/gui/gui-bar.c
+++ b/src/gui/gui-bar.c
@@ -2243,23 +2243,24 @@ gui_bar_hdata_bar_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_bar", "next_bar");
+ hdata = hdata_new (NULL, hdata_name, "prev_bar", "next_bar",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_bar, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, options, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, conditions_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, conditions_array, STRING, "conditions_count", NULL);
- HDATA_VAR(struct t_gui_bar, items_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, items_subcount, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, items_array, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, items_prefix, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, items_name, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, items_suffix, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, bar_window, POINTER, NULL, "bar_window");
- HDATA_VAR(struct t_gui_bar, bar_refresh_needed, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_bar, prev_bar, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_bar, next_bar, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_bar, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, options, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, conditions_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, conditions_array, STRING, 0, "conditions_count", NULL);
+ HDATA_VAR(struct t_gui_bar, items_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, items_subcount, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, items_array, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, items_prefix, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, items_name, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, items_suffix, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, bar_window, POINTER, 0, NULL, "bar_window");
+ HDATA_VAR(struct t_gui_bar, bar_refresh_needed, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar, prev_bar, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_bar, next_bar, POINTER, 0, NULL, hdata_name);
HDATA_LIST(gui_bars);
HDATA_LIST(last_gui_bar);
}
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 168649c4b..509846628 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -3125,75 +3125,76 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer");
+ hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_buffer, plugin, POINTER, NULL, "plugin");
- HDATA_VAR(struct t_gui_buffer, plugin_name_for_upgrade, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, number, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, layout_number, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, layout_number_merge_order, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, full_name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, short_name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, type, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, notify, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, num_displayed, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, active, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, print_hooks_enabled, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, close_callback, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, close_callback_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, title, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, own_lines, POINTER, NULL, "lines");
- HDATA_VAR(struct t_gui_buffer, mixed_lines, POINTER, NULL, "lines");
- HDATA_VAR(struct t_gui_buffer, lines, POINTER, NULL, "lines");
- HDATA_VAR(struct t_gui_buffer, time_for_each_line, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, chat_refresh_needed, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, nicklist, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, nicklist_case_sensitive, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, nicklist_root, POINTER, NULL, "nick_group");
- HDATA_VAR(struct t_gui_buffer, nicklist_max_length, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, nicklist_display_groups, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, nicklist_visible_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, nickcmp_callback, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, nickcmp_callback_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_callback, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_callback_data, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_get_unknown_commands, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_buffer, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_buffer_alloc, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_buffer_size, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_buffer_length, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_buffer_pos, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_buffer_1st_display, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, input_undo_snap, POINTER, NULL, "input_undo");
- HDATA_VAR(struct t_gui_buffer, input_undo, POINTER, NULL, "input_undo");
- HDATA_VAR(struct t_gui_buffer, last_input_undo, POINTER, NULL, "input_undo");
- HDATA_VAR(struct t_gui_buffer, ptr_input_undo, POINTER, NULL, "input_undo");
- HDATA_VAR(struct t_gui_buffer, input_undo_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, completion, POINTER, NULL, "completion");
- HDATA_VAR(struct t_gui_buffer, history, POINTER, NULL, "history");
- HDATA_VAR(struct t_gui_buffer, last_history, POINTER, NULL, "history");
- HDATA_VAR(struct t_gui_buffer, ptr_history, POINTER, NULL, "history");
- HDATA_VAR(struct t_gui_buffer, num_history, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, text_search, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, text_search_exact, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, text_search_found, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, text_search_input, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, highlight_words, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, highlight_regex, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, highlight_regex_compiled, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, highlight_tags, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, highlight_tags_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, highlight_tags_array, STRING, "highlight_tags_count", NULL);
- HDATA_VAR(struct t_gui_buffer, hotlist_max_level_nicks, HASHTABLE, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, keys, POINTER, NULL, "key");
- HDATA_VAR(struct t_gui_buffer, last_key, POINTER, NULL, "key");
- HDATA_VAR(struct t_gui_buffer, keys_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, local_variables, HASHTABLE, NULL, NULL);
- HDATA_VAR(struct t_gui_buffer, prev_buffer, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_buffer, next_buffer, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_buffer, plugin, POINTER, 0, NULL, "plugin");
+ HDATA_VAR(struct t_gui_buffer, plugin_name_for_upgrade, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, number, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, layout_number, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, layout_number_merge_order, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, full_name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, short_name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, type, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, notify, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, num_displayed, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, active, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, print_hooks_enabled, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, close_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, close_callback_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, title, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, own_lines, POINTER, 0, NULL, "lines");
+ HDATA_VAR(struct t_gui_buffer, mixed_lines, POINTER, 0, NULL, "lines");
+ HDATA_VAR(struct t_gui_buffer, lines, POINTER, 0, NULL, "lines");
+ HDATA_VAR(struct t_gui_buffer, time_for_each_line, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, chat_refresh_needed, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nicklist, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nicklist_case_sensitive, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nicklist_root, POINTER, 0, NULL, "nick_group");
+ HDATA_VAR(struct t_gui_buffer, nicklist_max_length, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nicklist_display_groups, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nicklist_visible_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nickcmp_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nickcmp_callback_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_callback_data, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_get_unknown_commands, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_buffer, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_buffer_alloc, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_buffer_size, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_buffer_length, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_buffer_pos, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_buffer_1st_display, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_undo_snap, POINTER, 0, NULL, "input_undo");
+ HDATA_VAR(struct t_gui_buffer, input_undo, POINTER, 0, NULL, "input_undo");
+ HDATA_VAR(struct t_gui_buffer, last_input_undo, POINTER, 0, NULL, "input_undo");
+ HDATA_VAR(struct t_gui_buffer, ptr_input_undo, POINTER, 0, NULL, "input_undo");
+ HDATA_VAR(struct t_gui_buffer, input_undo_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, completion, POINTER, 0, NULL, "completion");
+ HDATA_VAR(struct t_gui_buffer, history, POINTER, 0, NULL, "history");
+ HDATA_VAR(struct t_gui_buffer, last_history, POINTER, 0, NULL, "history");
+ HDATA_VAR(struct t_gui_buffer, ptr_history, POINTER, 0, NULL, "history");
+ HDATA_VAR(struct t_gui_buffer, num_history, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, text_search, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, text_search_exact, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, text_search_found, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, text_search_input, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, highlight_words, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, highlight_regex, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, highlight_regex_compiled, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, highlight_tags, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, highlight_tags_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, highlight_tags_array, STRING, 0, "highlight_tags_count", NULL);
+ HDATA_VAR(struct t_gui_buffer, hotlist_max_level_nicks, HASHTABLE, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, keys, POINTER, 0, NULL, "key");
+ HDATA_VAR(struct t_gui_buffer, last_key, POINTER, 0, NULL, "key");
+ HDATA_VAR(struct t_gui_buffer, keys_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, local_variables, HASHTABLE, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, prev_buffer, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_buffer, next_buffer, POINTER, 0, NULL, hdata_name);
HDATA_LIST(gui_buffers);
HDATA_LIST(last_gui_buffer);
HDATA_LIST(gui_buffer_last_displayed);
@@ -3213,13 +3214,14 @@ gui_buffer_hdata_input_undo_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_undo", "next_undo");
+ hdata = hdata_new (NULL, hdata_name, "prev_undo", "next_undo",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_input_undo, data, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_input_undo, pos, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_input_undo, prev_undo, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_input_undo, next_undo, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_input_undo, data, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_input_undo, pos, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_input_undo, prev_undo, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_input_undo, next_undo, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
@@ -3236,12 +3238,13 @@ gui_buffer_hdata_buffer_visited_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer");
+ hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_buffer_visited, buffer, POINTER, NULL, "buffer");
- HDATA_VAR(struct t_gui_buffer_visited, prev_buffer, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_buffer_visited, next_buffer, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_buffer_visited, buffer, POINTER, 0, NULL, "buffer");
+ HDATA_VAR(struct t_gui_buffer_visited, prev_buffer, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_buffer_visited, next_buffer, POINTER, 0, NULL, hdata_name);
HDATA_LIST(gui_buffers_visited);
HDATA_LIST(last_gui_buffer_visited);
}
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c
index 6c6b1eeee..410a5b684 100644
--- a/src/gui/gui-chat.c
+++ b/src/gui/gui-chat.c
@@ -339,6 +339,9 @@ gui_chat_get_time_string (time_t date)
int i, time_first_digit, time_last_digit, last_color;
struct tm *local_time;
+ if (date == 0)
+ return NULL;
+
if (!CONFIG_STRING(config_look_buffer_time_format)
|| !CONFIG_STRING(config_look_buffer_time_format)[0])
return NULL;
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index 9b7ef2fe2..74581da13 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -1214,28 +1214,29 @@ gui_completion_hdata_completion_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, NULL, NULL);
+ hdata = hdata_new (NULL, hdata_name, NULL, NULL,
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_completion, buffer, POINTER, NULL, "buffer");
- HDATA_VAR(struct t_gui_completion, context, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, base_command, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, base_command_arg_index, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, base_word, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, base_word_pos, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, position, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, args, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, direction, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, add_space, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, force_partial_completion, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, completion_list, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, word_found, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, word_found_is_nick, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, position_replace, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, diff_size, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, diff_length, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion, partial_completion_list, POINTER, NULL, "completion_partial");
- HDATA_VAR(struct t_gui_completion, last_partial_completion, POINTER, NULL, "completion_partial");
+ HDATA_VAR(struct t_gui_completion, buffer, POINTER, 0, NULL, "buffer");
+ HDATA_VAR(struct t_gui_completion, context, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, base_command, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, base_command_arg_index, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, base_word, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, base_word_pos, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, position, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, args, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, direction, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, add_space, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, force_partial_completion, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, completion_list, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, word_found, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, word_found_is_nick, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, position_replace, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, diff_size, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, diff_length, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion, partial_completion_list, POINTER, 0, NULL, "completion_partial");
+ HDATA_VAR(struct t_gui_completion, last_partial_completion, POINTER, 0, NULL, "completion_partial");
}
return hdata;
}
@@ -1253,13 +1254,14 @@ gui_completion_hdata_completion_partial_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item");
+ hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_completion_partial, word, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_completion_partial, count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_completion_partial, prev_item, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_completion_partial, next_item, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_completion_partial, word, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion_partial, count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_completion_partial, prev_item, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_completion_partial, next_item, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c
index 6f4ea13f8..8df37a261 100644
--- a/src/gui/gui-filter.c
+++ b/src/gui/gui-filter.c
@@ -449,22 +449,23 @@ gui_filter_hdata_filter_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_filter", "next_filter");
+ hdata = hdata_new (NULL, hdata_name, "prev_filter", "next_filter",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_filter, enabled, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, buffer_name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, num_buffers, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, buffers, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, tags, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, tags_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, tags_array, STRING, "tags_count", NULL);
- HDATA_VAR(struct t_gui_filter, regex, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, regex_prefix, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, regex_message, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_filter, prev_filter, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_filter, next_filter, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_filter, enabled, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, buffer_name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, num_buffers, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, buffers, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, tags, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, tags_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, tags_array, STRING, 0, "tags_count", NULL);
+ HDATA_VAR(struct t_gui_filter, regex, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, regex_prefix, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, regex_message, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_filter, prev_filter, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_filter, next_filter, POINTER, 0, NULL, hdata_name);
HDATA_LIST(gui_filters);
HDATA_LIST(last_gui_filter);
}
diff --git a/src/gui/gui-history.c b/src/gui/gui-history.c
index e122e9f08..c9071ccee 100644
--- a/src/gui/gui-history.c
+++ b/src/gui/gui-history.c
@@ -227,12 +227,13 @@ gui_history_hdata_history_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_history", "next_history");
+ hdata = hdata_new (NULL, hdata_name, "prev_history", "next_history",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_history, text, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_history, prev_history, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_history, next_history, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_history, text, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_history, prev_history, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_history, next_history, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c
index d7e6bf06a..7ebc9750e 100644
--- a/src/gui/gui-hotlist.c
+++ b/src/gui/gui-hotlist.c
@@ -474,16 +474,17 @@ gui_hotlist_hdata_hotlist_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_hotlist", "next_hotlist");
+ hdata = hdata_new (NULL, hdata_name, "prev_hotlist", "next_hotlist",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_hotlist, priority, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_hotlist, creation_time.tv_sec, TIME, NULL, NULL);
- HDATA_VAR(struct t_gui_hotlist, creation_time.tv_usec, LONG, NULL, NULL);
- HDATA_VAR(struct t_gui_hotlist, buffer, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_hotlist, count, INTEGER, GUI_HOTLIST_NUM_PRIORITIES_STR, NULL);
- HDATA_VAR(struct t_gui_hotlist, prev_hotlist, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_hotlist, next_hotlist, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_hotlist, priority, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_hotlist, creation_time.tv_sec, TIME, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_hotlist, creation_time.tv_usec, LONG, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_hotlist, buffer, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_hotlist, count, INTEGER, 0, GUI_HOTLIST_NUM_PRIORITIES_STR, NULL);
+ HDATA_VAR(struct t_gui_hotlist, prev_hotlist, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_hotlist, next_hotlist, POINTER, 0, NULL, hdata_name);
HDATA_LIST(gui_hotlist);
HDATA_LIST(last_gui_hotlist);
}
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index 81abbd565..492e0d9e4 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -1715,17 +1715,18 @@ gui_key_hdata_key_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_key", "next_key");
+ hdata = hdata_new (NULL, hdata_name, "prev_key", "next_key",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_key, key, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_key, area_type, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_key, area_name, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_key, area_key, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_key, command, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_key, score, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_key, prev_key, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_key, next_key, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_key, key, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_key, area_type, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_key, area_name, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_key, area_key, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_key, command, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_key, score, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_key, prev_key, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_key, next_key, POINTER, 0, NULL, hdata_name);
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
snprintf (str_list, sizeof (str_list),
diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c
index 9e86b891a..81a736728 100644
--- a/src/gui/gui-line.c
+++ b/src/gui/gui-line.c
@@ -1012,8 +1012,7 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
new_line->data->y = -1;
new_line->data->date = date;
new_line->data->date_printed = date_printed;
- new_line->data->str_time = (date == 0) ?
- NULL : gui_chat_get_time_string (date);
+ new_line->data->str_time = gui_chat_get_time_string (date);
if (tags)
{
new_line->data->tags_array = string_split (tags, ",", 0, 0,
@@ -1355,17 +1354,17 @@ gui_line_hdata_lines_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, NULL, NULL);
+ hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_lines, first_line, POINTER, NULL, "line");
- HDATA_VAR(struct t_gui_lines, last_line, POINTER, NULL, "line");
- HDATA_VAR(struct t_gui_lines, last_read_line, POINTER, NULL, "line");
- HDATA_VAR(struct t_gui_lines, lines_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_lines, first_line_not_read, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_lines, lines_hidden, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_lines, buffer_max_length, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_lines, prefix_max_length, INTEGER, NULL, NULL);
+ HDATA_VAR(struct t_gui_lines, first_line, POINTER, 0, NULL, "line");
+ HDATA_VAR(struct t_gui_lines, last_line, POINTER, 0, NULL, "line");
+ HDATA_VAR(struct t_gui_lines, last_read_line, POINTER, 0, NULL, "line");
+ HDATA_VAR(struct t_gui_lines, lines_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_lines, first_line_not_read, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_lines, lines_hidden, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_lines, buffer_max_length, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_lines, prefix_max_length, INTEGER, 0, NULL, NULL);
}
return hdata;
}
@@ -1382,17 +1381,102 @@ gui_line_hdata_line_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_line", "next_line");
+ hdata = hdata_new (NULL, hdata_name, "prev_line", "next_line",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_line, data, POINTER, NULL, "line_data");
- HDATA_VAR(struct t_gui_line, prev_line, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_line, next_line, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_line, data, POINTER, 0, NULL, "line_data");
+ HDATA_VAR(struct t_gui_line, prev_line, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_line, next_line, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
/*
+ * gui_line_hdata_line_data_update_cb: callback for updating data of a line
+ */
+
+int
+gui_line_hdata_line_data_update_cb (void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable)
+{
+ const char *value;
+ struct t_gui_line_data *line_data;
+ int rc;
+
+ /* make C compiler happy */
+ (void) data;
+
+ line_data = (struct t_gui_line_data *)pointer;
+
+ rc = 0;
+
+ if (hashtable_has_key (hashtable, "date"))
+ {
+ value = hashtable_get (hashtable, "date");
+ if (value)
+ {
+ hdata_set (hdata, pointer, "date", value);
+ if (line_data->str_time)
+ free (line_data->str_time);
+ line_data->str_time = gui_chat_get_time_string (line_data->date);
+ rc++;
+ }
+ }
+
+ if (hashtable_has_key (hashtable, "date_printed"))
+ {
+ value = hashtable_get (hashtable, "date_printed");
+ if (value)
+ {
+ hdata_set (hdata, pointer, "date_printed", value);
+ rc++;
+ }
+ }
+
+ if (hashtable_has_key (hashtable, "tags_array"))
+ {
+ value = hashtable_get (hashtable, "tags_array");
+ if (line_data->tags_array)
+ string_free_split (line_data->tags_array);
+ if (value)
+ {
+ line_data->tags_array = string_split (value, ",", 0, 0,
+ &line_data->tags_count);
+ }
+ else
+ {
+ line_data->tags_count = 0;
+ line_data->tags_array = NULL;
+ }
+ rc++;
+ }
+
+ if (hashtable_has_key (hashtable, "prefix"))
+ {
+ value = hashtable_get (hashtable, "prefix");
+ hdata_set (hdata, pointer, "prefix", value);
+ line_data->prefix_length = (line_data->prefix) ?
+ gui_chat_strlen_screen (line_data->prefix) : 0;
+ gui_line_compute_prefix_max_length (line_data->buffer->lines);
+ rc++;
+ }
+
+ if (hashtable_has_key (hashtable, "message"))
+ {
+ value = hashtable_get (hashtable, "message");
+ hdata_set (hdata, pointer, "message", value);
+ rc++;
+ }
+
+ gui_buffer_ask_chat_refresh (line_data->buffer, 1);
+
+ return rc;
+}
+
+/*
* gui_line_hdata_line_data_cb: return hdata for line data
*/
@@ -1404,22 +1488,23 @@ gui_line_hdata_line_data_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, NULL, NULL);
+ hdata = hdata_new (NULL, hdata_name, NULL, NULL,
+ 0, &gui_line_hdata_line_data_update_cb, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_line_data, buffer, POINTER, NULL, "buffer");
- HDATA_VAR(struct t_gui_line_data, y, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, date, TIME, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, date_printed, TIME, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, str_time, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, tags_count, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, tags_array, STRING, "tags_count", NULL);
- HDATA_VAR(struct t_gui_line_data, displayed, CHAR, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, highlight, CHAR, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, refresh_needed, CHAR, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, prefix, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, prefix_length, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_line_data, message, STRING, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, buffer, POINTER, 0, NULL, "buffer");
+ HDATA_VAR(struct t_gui_line_data, y, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, date, TIME, 1, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, date_printed, TIME, 1, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, str_time, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, tags_count, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, tags_array, STRING, 1, "tags_count", NULL);
+ HDATA_VAR(struct t_gui_line_data, displayed, CHAR, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, highlight, CHAR, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, refresh_needed, CHAR, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, prefix, STRING, 1, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, prefix_length, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_line_data, message, STRING, 1, NULL, NULL);
}
return hdata;
}
diff --git a/src/gui/gui-nicklist.c b/src/gui/gui-nicklist.c
index 879573b0c..d160aae02 100644
--- a/src/gui/gui-nicklist.c
+++ b/src/gui/gui-nicklist.c
@@ -971,20 +971,21 @@ gui_nicklist_hdata_nick_group_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_group", "next_group");
+ hdata = hdata_new (NULL, hdata_name, "prev_group", "next_group",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_nick_group, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_nick_group, color, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_nick_group, visible, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_nick_group, level, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_nick_group, parent, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_nick_group, children, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_nick_group, last_child, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_nick_group, nicks, POINTER, NULL, "nick");
- HDATA_VAR(struct t_gui_nick_group, last_nick, POINTER, NULL, "nick");
- HDATA_VAR(struct t_gui_nick_group, prev_group, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_nick_group, next_group, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_nick_group, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick_group, color, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick_group, visible, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick_group, level, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick_group, parent, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_nick_group, children, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_nick_group, last_child, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_nick_group, nicks, POINTER, 0, NULL, "nick");
+ HDATA_VAR(struct t_gui_nick_group, last_nick, POINTER, 0, NULL, "nick");
+ HDATA_VAR(struct t_gui_nick_group, prev_group, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_nick_group, next_group, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
@@ -1001,17 +1002,18 @@ gui_nicklist_hdata_nick_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_nick", "next_nick");
+ hdata = hdata_new (NULL, hdata_name, "prev_nick", "next_nick",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_nick, group, POINTER, NULL, "nick_group");
- HDATA_VAR(struct t_gui_nick, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_nick, color, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_nick, prefix, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_nick, prefix_color, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_nick, visible, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_nick, prev_nick, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_nick, next_nick, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_nick, group, POINTER, 0, NULL, "nick_group");
+ HDATA_VAR(struct t_gui_nick, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick, color, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick, prefix, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick, prefix_color, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick, visible, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_nick, prev_nick, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_nick, next_nick, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index a1cb23c3d..d763ce6e2 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -1609,33 +1609,34 @@ gui_window_hdata_window_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_window", "next_window");
+ hdata = hdata_new (NULL, hdata_name, "prev_window", "next_window",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_window, number, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_x, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_y, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_width, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_height, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_width_pct, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_height_pct, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_chat_x, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_chat_y, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_chat_width, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_chat_height, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_chat_cursor_x, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, win_chat_cursor_y, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, bar_windows, POINTER, NULL, "bar_window");
- HDATA_VAR(struct t_gui_window, last_bar_window, POINTER, NULL, "bar_window");
- HDATA_VAR(struct t_gui_window, refresh_needed, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, gui_objects, POINTER, NULL, NULL);
- HDATA_VAR(struct t_gui_window, buffer, POINTER, NULL, "buffer");
- HDATA_VAR(struct t_gui_window, layout_plugin_name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_window, layout_buffer_name, STRING, NULL, NULL);
- HDATA_VAR(struct t_gui_window, scroll, POINTER, NULL, "window_scroll");
- HDATA_VAR(struct t_gui_window, ptr_tree, POINTER, NULL, "window_tree");
- HDATA_VAR(struct t_gui_window, prev_window, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_window, next_window, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_window, number, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_x, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_y, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_width, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_height, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_width_pct, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_height_pct, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_chat_x, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_chat_y, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_chat_width, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_chat_height, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_chat_cursor_x, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, win_chat_cursor_y, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, bar_windows, POINTER, 0, NULL, "bar_window");
+ HDATA_VAR(struct t_gui_window, last_bar_window, POINTER, 0, NULL, "bar_window");
+ HDATA_VAR(struct t_gui_window, refresh_needed, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, gui_objects, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, buffer, POINTER, 0, NULL, "buffer");
+ HDATA_VAR(struct t_gui_window, layout_plugin_name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, layout_buffer_name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window, scroll, POINTER, 0, NULL, "window_scroll");
+ HDATA_VAR(struct t_gui_window, ptr_tree, POINTER, 0, NULL, "window_tree");
+ HDATA_VAR(struct t_gui_window, prev_window, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_window, next_window, POINTER, 0, NULL, hdata_name);
HDATA_LIST(gui_windows);
HDATA_LIST(last_gui_window);
HDATA_LIST(gui_current_window);
@@ -1655,19 +1656,20 @@ gui_window_hdata_window_scroll_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_scroll", "next_scroll");
+ hdata = hdata_new (NULL, hdata_name, "prev_scroll", "next_scroll",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_window_scroll, buffer, POINTER, NULL, "buffer");
- HDATA_VAR(struct t_gui_window_scroll, first_line_displayed, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_scroll, start_line, POINTER, NULL, "line");
- HDATA_VAR(struct t_gui_window_scroll, start_line_pos, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_scroll, scrolling, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_scroll, start_col, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_scroll, lines_after, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_scroll, reset_allowed, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_scroll, prev_scroll, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_window_scroll, next_scroll, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_window_scroll, buffer, POINTER, 0, NULL, "buffer");
+ HDATA_VAR(struct t_gui_window_scroll, first_line_displayed, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_scroll, start_line, POINTER, 0, NULL, "line");
+ HDATA_VAR(struct t_gui_window_scroll, start_line_pos, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_scroll, scrolling, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_scroll, start_col, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_scroll, lines_after, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_scroll, reset_allowed, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_scroll, prev_scroll, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_window_scroll, next_scroll, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
@@ -1684,15 +1686,15 @@ gui_window_hdata_window_tree_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, NULL, NULL);
+ hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_gui_window_tree, parent_node, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_window_tree, split_pct, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_tree, split_horizontal, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_gui_window_tree, child1, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_window_tree, child2, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_gui_window_tree, window, POINTER, NULL, "window");
+ HDATA_VAR(struct t_gui_window_tree, parent_node, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_window_tree, split_pct, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_tree, split_horizontal, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_window_tree, child1, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_window_tree, child2, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_gui_window_tree, window, POINTER, 0, NULL, "window");
HDATA_LIST(gui_windows_tree);
}
return hdata;
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c
index 5033e785c..071b3a0ff 100644
--- a/src/plugins/guile/weechat-guile-api.c
+++ b/src/plugins/guile/weechat-guile-api.c
@@ -5102,7 +5102,6 @@ weechat_guile_api_hdata_time (SCM hdata, SCM pointer, SCM name)
{
char timebuffer[64], *result;
time_t time;
- struct tm *date_tmp;
SCM return_value;
API_FUNC(1, "hdata_time", API_RETURN_EMPTY);
@@ -5113,9 +5112,7 @@ weechat_guile_api_hdata_time (SCM hdata, SCM pointer, SCM name)
time = weechat_hdata_time (API_STR2PTR(scm_i_string_chars (hdata)),
API_STR2PTR(scm_i_string_chars (pointer)),
scm_i_string_chars (name));
- date_tmp = localtime (&time);
- if (date_tmp)
- strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp);
+ snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)time);
result = strdup (timebuffer);
API_RETURN_STRING_FREE(result);
@@ -5145,6 +5142,33 @@ weechat_guile_api_hdata_hashtable (SCM hdata, SCM pointer, SCM name)
}
/*
+ * weechat_guile_api_hdata_update: update data in a hdata
+ */
+
+SCM
+weechat_guile_api_hdata_update (SCM hdata, SCM pointer, SCM hashtable)
+{
+ struct t_hashtable *c_hashtable;
+ int value;
+
+ API_FUNC(1, "hdata_update", API_RETURN_INT(0));
+ if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_list_p (hashtable))
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ c_hashtable = weechat_guile_alist_to_hashtable (hashtable,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
+
+ value = weechat_hdata_update (API_STR2PTR(scm_i_string_chars (hdata)),
+ API_STR2PTR(scm_i_string_chars (pointer)),
+ c_hashtable);
+
+ if (c_hashtable)
+ weechat_hashtable_free (c_hashtable);
+
+ API_RETURN_INT(value);
+}
+
+/*
* weechat_guile_api_hdata_get_string: get hdata property as string
*/
@@ -5494,6 +5518,7 @@ weechat_guile_api_module_init (void *data)
API_DEF_FUNC(hdata_pointer, 3);
API_DEF_FUNC(hdata_time, 3);
API_DEF_FUNC(hdata_hashtable, 3);
+ API_DEF_FUNC(hdata_update, 3);
API_DEF_FUNC(hdata_get_string, 2);
API_DEF_FUNC(upgrade_new, 2);
API_DEF_FUNC(upgrade_write_object, 3);
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index c1547e12c..638b92ac7 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -876,34 +876,35 @@ irc_channel_hdata_channel_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_channel", "next_channel");
+ hdata = weechat_hdata_new (hdata_name, "prev_channel", "next_channel",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_channel, type, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, name, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, topic, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, modes, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, limit, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, key, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, names_received, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, checking_away, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, away_message, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, has_quit_server, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, cycle, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, part, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, nick_completion_reset, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, pv_remote_nick_color, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, hook_autorejoin, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, nicks_count, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, nicks, POINTER, NULL, "irc_nick");
- WEECHAT_HDATA_VAR(struct t_irc_channel, last_nick, POINTER, NULL, "irc_nick");
- WEECHAT_HDATA_VAR(struct t_irc_channel, nicks_speaking, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, nicks_speaking_time, POINTER, NULL, "irc_channel_speaking");
- WEECHAT_HDATA_VAR(struct t_irc_channel, last_nick_speaking_time, POINTER, NULL, "irc_channel_speaking");
- WEECHAT_HDATA_VAR(struct t_irc_channel, buffer, POINTER, NULL, "buffer");
- WEECHAT_HDATA_VAR(struct t_irc_channel, buffer_as_string, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel, prev_channel, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_channel, next_channel, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, type, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, name, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, topic, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, modes, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, limit, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, key, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, names_received, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, checking_away, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, away_message, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, has_quit_server, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, cycle, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, part, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, nick_completion_reset, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, pv_remote_nick_color, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, hook_autorejoin, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, nicks_count, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, nicks, POINTER, 0, NULL, "irc_nick");
+ WEECHAT_HDATA_VAR(struct t_irc_channel, last_nick, POINTER, 0, NULL, "irc_nick");
+ WEECHAT_HDATA_VAR(struct t_irc_channel, nicks_speaking, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, nicks_speaking_time, POINTER, 0, NULL, "irc_channel_speaking");
+ WEECHAT_HDATA_VAR(struct t_irc_channel, last_nick_speaking_time, POINTER, 0, NULL, "irc_channel_speaking");
+ WEECHAT_HDATA_VAR(struct t_irc_channel, buffer, POINTER, 0, NULL, "buffer");
+ WEECHAT_HDATA_VAR(struct t_irc_channel, buffer_as_string, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, prev_channel, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_channel, next_channel, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
@@ -920,13 +921,14 @@ irc_channel_hdata_channel_speaking_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick");
+ hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, nick, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, time_last_message, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, prev_nick, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, next_nick, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, nick, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, time_last_message, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, prev_nick, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, next_nick, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/plugins/irc/irc-ignore.c b/src/plugins/irc/irc-ignore.c
index fa756fa50..7748f7d05 100644
--- a/src/plugins/irc/irc-ignore.c
+++ b/src/plugins/irc/irc-ignore.c
@@ -318,16 +318,17 @@ irc_ignore_hdata_ignore_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_ignore", "next_ignore");
+ hdata = weechat_hdata_new (hdata_name, "prev_ignore", "next_ignore",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_ignore, number, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_ignore, mask, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_ignore, regex_mask, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_ignore, server, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_ignore, channel, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_ignore, prev_ignore, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_ignore, next_ignore, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_ignore, number, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_ignore, mask, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_ignore, regex_mask, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_ignore, server, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_ignore, channel, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_ignore, prev_ignore, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_ignore, next_ignore, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(irc_ignore_list);
WEECHAT_HDATA_LIST(last_irc_ignore);
}
diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c
index 00b7bb24e..0ceddf3ba 100644
--- a/src/plugins/irc/irc-nick.c
+++ b/src/plugins/irc/irc-nick.c
@@ -1031,17 +1031,18 @@ irc_nick_hdata_nick_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick");
+ hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_nick, name, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_nick, host, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_nick, prefixes, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_nick, prefix, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_nick, away, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_nick, color, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_nick, prev_nick, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_nick, next_nick, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, name, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, host, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, prefixes, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, prefix, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, away, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, color, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, prev_nick, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_nick, next_nick, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c
index 442add9d4..546e707b4 100644
--- a/src/plugins/irc/irc-notify.c
+++ b/src/plugins/irc/irc-notify.c
@@ -963,17 +963,18 @@ irc_notify_hdata_notify_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_notify", "next_notify");
+ hdata = weechat_hdata_new (hdata_name, "prev_notify", "next_notify",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_notify, server, POINTER, NULL, "irc_server");
- WEECHAT_HDATA_VAR(struct t_irc_notify, nick, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_notify, check_away, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_notify, is_on_server, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_notify, away_message, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_notify, ison_received, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_notify, prev_notify, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_notify, next_notify, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_notify, server, POINTER, 0, NULL, "irc_server");
+ WEECHAT_HDATA_VAR(struct t_irc_notify, nick, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_notify, check_away, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_notify, is_on_server, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_notify, away_message, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_notify, ison_received, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_notify, prev_notify, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_notify, next_notify, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c
index 2bad81e0b..4c0341cc6 100644
--- a/src/plugins/irc/irc-redirect.c
+++ b/src/plugins/irc/irc-redirect.c
@@ -975,17 +975,18 @@ irc_redirect_hdata_redirect_pattern_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect");
+ hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, name, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, temp_pattern, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, timeout, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, cmd_start, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, cmd_stop, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, cmd_extra, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, prev_redirect, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, next_redirect, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, name, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, temp_pattern, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, timeout, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, cmd_start, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, cmd_stop, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, cmd_extra, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, prev_redirect, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, next_redirect, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(irc_redirect_patterns);
WEECHAT_HDATA_LIST(last_irc_redirect_pattern);
}
@@ -1004,29 +1005,30 @@ irc_redirect_hdata_redirect_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect");
+ hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_redirect, server, POINTER, NULL, "irc_server");
- WEECHAT_HDATA_VAR(struct t_irc_redirect, pattern, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, signal, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, count, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, current_count, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, string, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, timeout, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, command, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, assigned_to_command, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, start_time, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_start, HASHTABLE, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_stop, HASHTABLE, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_extra, HASHTABLE, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_start_received, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_stop_received, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_filter, HASHTABLE, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, output, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, output_size, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, prev_redirect, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_redirect, next_redirect, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, server, POINTER, 0, NULL, "irc_server");
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, pattern, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, signal, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, count, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, current_count, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, string, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, timeout, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, command, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, assigned_to_command, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, start_time, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_start, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_stop, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_extra, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_start_received, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_stop_received, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_filter, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, output, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, output_size, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, prev_redirect, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_redirect, next_redirect, POINTER, 0, NULL, hdata_name);
}
return hdata;
}
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 0873be623..e6a8fc179 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -4367,75 +4367,76 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_server", "next_server");
+ hdata = weechat_hdata_new (hdata_name, "prev_server", "next_server",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_irc_server, name, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, options, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, temp_server, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, reloading_from_config, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, reloaded_from_config, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, addresses_count, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, addresses_array, STRING, "addresses_count", NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, ports_array, INTEGER, "addresses_count", NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, index_current_address, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, current_address, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, current_ip, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, current_port, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, sock, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, hook_connect, POINTER, NULL, "hook");
- WEECHAT_HDATA_VAR(struct t_irc_server, hook_fd, POINTER, NULL, "hook");
- WEECHAT_HDATA_VAR(struct t_irc_server, hook_timer_connection, POINTER, NULL, "hook");
- WEECHAT_HDATA_VAR(struct t_irc_server, hook_timer_sasl, POINTER, NULL, "hook");
- WEECHAT_HDATA_VAR(struct t_irc_server, is_connected, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, ssl_connected, INTEGER, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, name, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, options, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, temp_server, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, reloading_from_config, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, reloaded_from_config, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, addresses_count, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, addresses_array, STRING, 0, "addresses_count", NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, ports_array, INTEGER, 0, "addresses_count", NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, index_current_address, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, current_address, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, current_ip, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, current_port, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, sock, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, hook_connect, POINTER, 0, NULL, "hook");
+ WEECHAT_HDATA_VAR(struct t_irc_server, hook_fd, POINTER, 0, NULL, "hook");
+ WEECHAT_HDATA_VAR(struct t_irc_server, hook_timer_connection, POINTER, 0, NULL, "hook");
+ WEECHAT_HDATA_VAR(struct t_irc_server, hook_timer_sasl, POINTER, 0, NULL, "hook");
+ WEECHAT_HDATA_VAR(struct t_irc_server, is_connected, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, ssl_connected, INTEGER, 0, NULL, NULL);
#ifdef HAVE_GNUTLS
- WEECHAT_HDATA_VAR(struct t_irc_server, gnutls_sess, OTHER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, tls_cert, OTHER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, tls_cert_key, OTHER, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, gnutls_sess, OTHER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, tls_cert, OTHER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, tls_cert_key, OTHER, 0, NULL, NULL);
#endif
- WEECHAT_HDATA_VAR(struct t_irc_server, unterminated_message, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, nicks_count, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, nicks_array, STRING, "nicks_count", NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, nick_first_tried, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, nick_alternate_number, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, nick, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, nick_modes, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, isupport, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, prefix_modes, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, prefix_chars, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, nick_max_length, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, casemapping, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, chantypes, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, chanmodes, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_delay, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_start, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, command_time, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_join, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, disable_autojoin, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, is_away, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, away_message, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, away_time, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, lag, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, lag_check_time, OTHER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, lag_next_check, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, lag_last_refresh, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, cmd_list_regexp, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, last_user_message, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, last_away_check, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, outqueue, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, last_outqueue, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, redirects, POINTER, NULL, "irc_redirect");
- WEECHAT_HDATA_VAR(struct t_irc_server, last_redirect, POINTER, NULL, "irc_redirect");
- WEECHAT_HDATA_VAR(struct t_irc_server, notify_list, POINTER, NULL, "irc_notify");
- WEECHAT_HDATA_VAR(struct t_irc_server, last_notify, POINTER, NULL, "irc_notify");
- WEECHAT_HDATA_VAR(struct t_irc_server, manual_joins, HASHTABLE, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, buffer, POINTER, NULL, "buffer");
- WEECHAT_HDATA_VAR(struct t_irc_server, buffer_as_string, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, channels, POINTER, NULL, "irc_channel");
- WEECHAT_HDATA_VAR(struct t_irc_server, last_channel, POINTER, NULL, "irc_channel");
- WEECHAT_HDATA_VAR(struct t_irc_server, prev_server, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_irc_server, next_server, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_server, unterminated_message, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, nicks_count, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, nicks_array, STRING, 0, "nicks_count", NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, nick_first_tried, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, nick_alternate_number, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, nick, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, nick_modes, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, isupport, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, prefix_modes, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, prefix_chars, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, nick_max_length, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, casemapping, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, chantypes, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, chanmodes, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_delay, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_start, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, command_time, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, reconnect_join, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, disable_autojoin, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, is_away, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, away_message, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, away_time, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, lag, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, lag_check_time, OTHER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, lag_next_check, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, lag_last_refresh, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, cmd_list_regexp, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, last_user_message, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, last_away_check, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, outqueue, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, last_outqueue, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, redirects, POINTER, 0, NULL, "irc_redirect");
+ WEECHAT_HDATA_VAR(struct t_irc_server, last_redirect, POINTER, 0, NULL, "irc_redirect");
+ WEECHAT_HDATA_VAR(struct t_irc_server, notify_list, POINTER, 0, NULL, "irc_notify");
+ WEECHAT_HDATA_VAR(struct t_irc_server, last_notify, POINTER, 0, NULL, "irc_notify");
+ WEECHAT_HDATA_VAR(struct t_irc_server, manual_joins, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, buffer, POINTER, 0, NULL, "buffer");
+ WEECHAT_HDATA_VAR(struct t_irc_server, buffer_as_string, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, channels, POINTER, 0, NULL, "irc_channel");
+ WEECHAT_HDATA_VAR(struct t_irc_server, last_channel, POINTER, 0, NULL, "irc_channel");
+ WEECHAT_HDATA_VAR(struct t_irc_server, prev_server, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_irc_server, next_server, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(irc_servers);
WEECHAT_HDATA_LIST(last_irc_server);
}
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index 70aeb8fe9..618cc3cd3 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -5627,7 +5627,6 @@ weechat_lua_api_hdata_time (lua_State *L)
{
const char *hdata, *pointer, *name;
time_t time;
- struct tm *date_tmp;
char timebuffer[64], *result;
API_FUNC(1, "hdata_time", API_RETURN_EMPTY);
@@ -5642,9 +5641,7 @@ weechat_lua_api_hdata_time (lua_State *L)
time = weechat_hdata_time (API_STR2PTR(hdata),
API_STR2PTR(pointer),
name);
- date_tmp = localtime (&time);
- if (date_tmp)
- strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp);
+ snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)time);
result = strdup (timebuffer);
API_RETURN_STRING_FREE(result);
@@ -5677,6 +5674,36 @@ weechat_lua_api_hdata_hashtable (lua_State *L)
}
/*
+ * weechat_lua_api_hdata_update: update data in a hdata
+ */
+
+static int
+weechat_lua_api_hdata_update (lua_State *L)
+{
+ const char *hdata, *pointer;
+ struct t_hashtable *hashtable;
+ int value;
+
+ API_FUNC(1, "hdata_update", API_RETURN_INT(0));
+ if (lua_gettop (lua_current_interpreter) < 3)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ hdata = lua_tostring (lua_current_interpreter, -3);
+ pointer = lua_tostring (lua_current_interpreter, -2);
+ hashtable = weechat_lua_tohashtable (lua_current_interpreter, -1,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
+
+ value = weechat_hdata_update (API_STR2PTR(hdata),
+ API_STR2PTR(pointer),
+ hashtable);
+
+ if (hashtable)
+ weechat_hashtable_free (hashtable);
+
+ API_RETURN_INT(value);
+}
+
+/*
* weechat_lua_api_hdata_get_string: get hdata property as string
*/
@@ -6419,6 +6446,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(hdata_pointer),
API_DEF_FUNC(hdata_time),
API_DEF_FUNC(hdata_hashtable),
+ API_DEF_FUNC(hdata_update),
API_DEF_FUNC(hdata_get_string),
API_DEF_FUNC(upgrade_new),
API_DEF_FUNC(upgrade_write_object),
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c
index cb79f3fbf..c0e05ac8e 100644
--- a/src/plugins/perl/weechat-perl-api.c
+++ b/src/plugins/perl/weechat-perl-api.c
@@ -5358,7 +5358,6 @@ XS (XS_weechat_api_hdata_pointer)
XS (XS_weechat_api_hdata_time)
{
time_t time;
- struct tm *date_tmp;
char timebuffer[64], *result, *hdata, *pointer, *name;
dXSARGS;
@@ -5374,9 +5373,7 @@ XS (XS_weechat_api_hdata_time)
time = weechat_hdata_time (API_STR2PTR(hdata),
API_STR2PTR(pointer),
name);
- date_tmp = localtime (&time);
- if (date_tmp)
- strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp);
+ snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)time);
result = strdup (timebuffer);
API_RETURN_STRING_FREE(result);
@@ -5410,6 +5407,36 @@ XS (XS_weechat_api_hdata_hashtable)
}
/*
+ * weechat::hdata_update: update data in a hdata
+ */
+
+XS (XS_weechat_api_hdata_update)
+{
+ char *hdata, *pointer;
+ struct t_hashtable *hashtable;
+ int value;
+ dXSARGS;
+
+ API_FUNC(1, "hdata_update", API_RETURN_INT(0));
+ if (items < 3)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ hdata = SvPV_nolen (ST (0));
+ pointer = SvPV_nolen (ST (1));
+ hashtable = weechat_perl_hash_to_hashtable (ST (2),
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
+
+ value = weechat_hdata_update (API_STR2PTR(hdata),
+ API_STR2PTR(pointer),
+ hashtable);
+
+ if (hashtable)
+ weechat_hashtable_free (hashtable);
+
+ API_RETURN_INT(value);
+}
+
+/*
* weechat::hdata_get_string: get hdata property as string
*/
@@ -5763,6 +5790,7 @@ weechat_perl_api_init (pTHX)
API_DEF_FUNC(hdata_pointer);
API_DEF_FUNC(hdata_time);
API_DEF_FUNC(hdata_hashtable);
+ API_DEF_FUNC(hdata_update);
API_DEF_FUNC(hdata_get_string);
API_DEF_FUNC(upgrade_new);
API_DEF_FUNC(upgrade_write_object);
diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c
index 3d29ed062..b1df0f49d 100644
--- a/src/plugins/plugin-script.c
+++ b/src/plugins/plugin-script.c
@@ -1202,22 +1202,23 @@ plugin_script_hdata_script (struct t_weechat_plugin *weechat_plugin,
{
struct t_hdata *hdata;
- hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script");
+ hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_plugin_script, filename, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, interpreter, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, name, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, author, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, version, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, license, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, description, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, shutdown_func, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, charset, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, callbacks, POINTER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, unloading, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, prev_script, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_plugin_script, next_script, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, filename, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, interpreter, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, name, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, author, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, version, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, license, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, description, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, shutdown_func, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, charset, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, callbacks, POINTER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, unloading, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, prev_script, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_plugin_script, next_script, POINTER, 0, NULL, hdata_name);
weechat_hdata_new_list (hdata, "scripts", scripts);
weechat_hdata_new_list (hdata, "last_script", last_script);
}
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 8fa3f1e87..64ce41b6d 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -756,6 +756,8 @@ plugin_load (const char *filename, int argc, char **argv)
new_plugin->hdata_pointer = &hdata_pointer;
new_plugin->hdata_time = &hdata_time;
new_plugin->hdata_hashtable = &hdata_hashtable;
+ new_plugin->hdata_set = &hdata_set;
+ new_plugin->hdata_update = &hdata_update;
new_plugin->hdata_get_string = &hdata_get_string;
new_plugin->upgrade_new = &upgrade_file_new;
@@ -1211,20 +1213,21 @@ plugin_hdata_plugin_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = hdata_new (NULL, hdata_name, "prev_plugin", "next_plugin");
+ hdata = hdata_new (NULL, hdata_name, "prev_plugin", "next_plugin",
+ 0, NULL, NULL);
if (hdata)
{
- HDATA_VAR(struct t_weechat_plugin, filename, STRING, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, handle, POINTER, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, name, STRING, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, description, STRING, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, author, STRING, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, version, STRING, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, license, STRING, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, charset, STRING, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, debug, INTEGER, NULL, NULL);
- HDATA_VAR(struct t_weechat_plugin, prev_plugin, POINTER, NULL, hdata_name);
- HDATA_VAR(struct t_weechat_plugin, next_plugin, POINTER, NULL, hdata_name);
+ HDATA_VAR(struct t_weechat_plugin, filename, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, handle, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, name, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, description, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, author, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, version, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, license, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, charset, STRING, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, debug, INTEGER, 0, NULL, NULL);
+ HDATA_VAR(struct t_weechat_plugin, prev_plugin, POINTER, 0, NULL, hdata_name);
+ HDATA_VAR(struct t_weechat_plugin, next_plugin, POINTER, 0, NULL, hdata_name);
HDATA_LIST(weechat_plugins);
HDATA_LIST(last_weechat_plugin);
}
diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c
index ddb6ef9ca..291d2b4e6 100644
--- a/src/plugins/python/weechat-python-api.c
+++ b/src/plugins/python/weechat-python-api.c
@@ -388,7 +388,7 @@ weechat_python_api_string_remove_color (PyObject *self, PyObject *args)
char *string, *replacement, *result;
PyObject *return_value;
- API_FUNC(1, "string_remove_color2", API_RETURN_EMPTY);
+ API_FUNC(1, "string_remove_color", API_RETURN_EMPTY);
string = NULL;
replacement = NULL;
if (!PyArg_ParseTuple (args, "ss", &string, &replacement))
@@ -2075,6 +2075,7 @@ weechat_python_api_key_bind (PyObject *self, PyObject *args)
API_FUNC(1, "key_bind", API_RETURN_INT(0));
context = NULL;
+ dict = NULL;
if (!PyArg_ParseTuple (args, "sO", &context, &dict))
API_WRONG_ARGS(API_RETURN_INT(0));
@@ -2641,6 +2642,7 @@ weechat_python_api_hook_process_hashtable (PyObject *self, PyObject *args)
API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY);
command = NULL;
+ dict = NULL;
options = NULL;
timeout = 0;
function = NULL;
@@ -3066,6 +3068,7 @@ weechat_python_api_hook_hsignal_send (PyObject *self, PyObject *args)
API_FUNC(1, "hook_hsignal_send", API_RETURN_ERROR);
signal = NULL;
+ dict = NULL;
if (!PyArg_ParseTuple (args, "sO", &signal, &dict))
API_WRONG_ARGS(API_RETURN_ERROR);
@@ -4829,6 +4832,7 @@ weechat_python_api_info_get_hashtable (PyObject *self, PyObject *args)
API_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY);
info_name = NULL;
+ dict = NULL;
if (!PyArg_ParseTuple (args, "sO", &info_name, &dict))
API_WRONG_ARGS(API_RETURN_EMPTY);
hashtable = weechat_python_dict_to_hashtable (dict,
@@ -5543,10 +5547,8 @@ weechat_python_api_hdata_pointer (PyObject *self, PyObject *args)
static PyObject *
weechat_python_api_hdata_time (PyObject *self, PyObject *args)
{
- char *hdata, *pointer, *name, timebuffer[64], *result;
+ char *hdata, *pointer, *name;
time_t time;
- struct tm *date_tmp;
- PyObject *return_value;
API_FUNC(1, "hdata_time", API_RETURN_EMPTY);
hdata = NULL;
@@ -5555,16 +5557,11 @@ weechat_python_api_hdata_time (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "sss", &hdata, &pointer, &name))
API_WRONG_ARGS(API_RETURN_EMPTY);
- timebuffer[0] = '\0';
time = weechat_hdata_time (API_STR2PTR(hdata),
API_STR2PTR(pointer),
name);
- date_tmp = localtime (&time);
- if (date_tmp)
- strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp);
- result = strdup (timebuffer);
- API_RETURN_STRING_FREE(result);
+ API_RETURN_LONG(time);
}
/*
@@ -5594,6 +5591,37 @@ weechat_python_api_hdata_hashtable (PyObject *self, PyObject *args)
}
/*
+ * weechat_python_api_hdata_update: updata data in a hdata
+ */
+
+static PyObject *
+weechat_python_api_hdata_update (PyObject *self, PyObject *args)
+{
+ char *hdata, *pointer;
+ struct t_hashtable *hashtable;
+ PyObject *dict;
+ int value;
+
+ API_FUNC(1, "hdata_update", API_RETURN_INT(0));
+ hdata = NULL;
+ pointer = NULL;
+ dict = NULL;
+ if (!PyArg_ParseTuple (args, "ssO", &hdata, &pointer, &dict))
+ API_WRONG_ARGS(API_RETURN_INT(0));
+ hashtable = weechat_python_dict_to_hashtable (dict,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
+
+ value = weechat_hdata_update (API_STR2PTR(hdata),
+ API_STR2PTR(pointer),
+ hashtable);
+
+ if (hashtable)
+ weechat_hashtable_free (hashtable);
+
+ API_RETURN_INT(value);
+}
+
+/*
* weechat_python_api_hdata_get_string: get hdata property as string
*/
@@ -5939,6 +5967,7 @@ PyMethodDef weechat_python_funcs[] =
API_DEF_FUNC(hdata_pointer),
API_DEF_FUNC(hdata_time),
API_DEF_FUNC(hdata_hashtable),
+ API_DEF_FUNC(hdata_update),
API_DEF_FUNC(hdata_get_string),
API_DEF_FUNC(upgrade_new),
API_DEF_FUNC(upgrade_write_object),
diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c
index 17eb4f79e..6d5978e10 100644
--- a/src/plugins/ruby/weechat-ruby-api.c
+++ b/src/plugins/ruby/weechat-ruby-api.c
@@ -6382,7 +6382,6 @@ weechat_ruby_api_hdata_time (VALUE class, VALUE hdata, VALUE pointer,
{
char *c_hdata, *c_pointer, *c_name, timebuffer[64], *result;
time_t time;
- struct tm *date_tmp;
VALUE return_value;
API_FUNC(1, "hdata_time", API_RETURN_EMPTY);
@@ -6401,9 +6400,7 @@ weechat_ruby_api_hdata_time (VALUE class, VALUE hdata, VALUE pointer,
time = weechat_hdata_time (API_STR2PTR(c_hdata),
API_STR2PTR(c_pointer),
c_name);
- date_tmp = localtime (&time);
- if (date_tmp)
- strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp);
+ snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)time);
result = strdup (timebuffer);
API_RETURN_STRING_FREE(result);
@@ -6442,6 +6439,41 @@ weechat_ruby_api_hdata_hashtable (VALUE class, VALUE hdata, VALUE pointer,
}
/*
+ * weechat_ruby_api_hdata_update: update data in a hdata
+ */
+
+static VALUE
+weechat_ruby_api_hdata_update (VALUE class, VALUE hdata, VALUE pointer,
+ VALUE hashtable)
+{
+ char *c_hdata, *c_pointer;
+ struct t_hashtable *c_hashtable;
+ int value;
+
+ API_FUNC(1, "hdata_update", API_RETURN_INT(0));
+ if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (hashtable))
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ Check_Type (hdata, T_STRING);
+ Check_Type (pointer, T_STRING);
+ Check_Type (hashtable, T_HASH);
+
+ c_hdata = StringValuePtr (hdata);
+ c_pointer = StringValuePtr (pointer);
+ c_hashtable = weechat_ruby_hash_to_hashtable (hashtable,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
+
+ value = weechat_hdata_update (API_STR2PTR(c_hdata),
+ API_STR2PTR(c_pointer),
+ c_hashtable);
+
+ if (c_hashtable)
+ weechat_hashtable_free (c_hashtable);
+
+ API_RETURN_INT(value);
+}
+
+/*
* weechat_ruby_api_hdata_get_string: get hdata property as string
*/
@@ -6859,6 +6891,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
API_DEF_FUNC(hdata_pointer, 3);
API_DEF_FUNC(hdata_time, 3);
API_DEF_FUNC(hdata_hashtable, 3);
+ API_DEF_FUNC(hdata_update, 3);
API_DEF_FUNC(hdata_get_string, 2);
API_DEF_FUNC(upgrade_new, 2);
API_DEF_FUNC(upgrade_write_object, 3);
diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c
index 5b3fc08fb..2afa13611 100644
--- a/src/plugins/script/script-repo.c
+++ b/src/plugins/script/script-repo.c
@@ -1318,32 +1318,33 @@ script_repo_hdata_script_cb (void *data, const char *hdata_name)
/* make C compiler happy */
(void) data;
- hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script");
+ hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script",
+ 0, NULL, NULL);
if (hdata)
{
- WEECHAT_HDATA_VAR(struct t_repo_script, name, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, name_with_extension, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, language, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, author, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, mail, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, version, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, license, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, description, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, tags, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, requirements, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, min_weechat, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, max_weechat, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, md5sum, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, url, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, popularity, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, date_added, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, date_updated, TIME, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, status, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, version_loaded, STRING, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, displayed, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, install_order, INTEGER, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_repo_script, prev_script, POINTER, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_repo_script, next_script, POINTER, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_repo_script, name, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, name_with_extension, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, language, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, author, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, mail, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, version, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, license, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, description, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, tags, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, requirements, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, min_weechat, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, max_weechat, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, md5sum, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, url, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, popularity, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, date_added, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, date_updated, TIME, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, status, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, version_loaded, STRING, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, displayed, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, install_order, INTEGER, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_repo_script, prev_script, POINTER, 0, NULL, hdata_name);
+ WEECHAT_HDATA_VAR(struct t_repo_script, next_script, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(repo_scripts);
WEECHAT_HDATA_LIST(last_repo_script);
}
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 6b05eb87d..1ea448691 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -6103,7 +6103,6 @@ weechat_tcl_api_hdata_time (ClientData clientData, Tcl_Interp *interp,
{
Tcl_Obj *objp;
time_t time;
- struct tm *date_tmp;
char timebuffer[64], *result, *hdata, *pointer, *name;
int i;
@@ -6119,9 +6118,7 @@ weechat_tcl_api_hdata_time (ClientData clientData, Tcl_Interp *interp,
time = weechat_hdata_time (API_STR2PTR(hdata),
API_STR2PTR(pointer),
name);
- date_tmp = localtime (&time);
- if (date_tmp)
- strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp);
+ snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)time);
result = strdup (timebuffer);
API_RETURN_STRING_FREE(result);
@@ -6158,6 +6155,38 @@ weechat_tcl_api_hdata_hashtable (ClientData clientData, Tcl_Interp *interp,
}
/*
+ * weechat_tcl_api_hdata_update: update data in a hdata
+ */
+
+static int
+weechat_tcl_api_hdata_update (ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[])
+{
+ Tcl_Obj *objp;
+ char *hdata, *pointer;
+ struct t_hashtable *hashtable;
+ int i, value;
+
+ API_FUNC(1, "hdata_update", API_RETURN_INT(0));
+ if (objc < 4)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ hdata = Tcl_GetStringFromObj (objv[1], &i);
+ pointer = Tcl_GetStringFromObj (objv[2], &i);
+ hashtable = weechat_tcl_dict_to_hashtable (interp, objv[3],
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
+
+ value = weechat_hdata_update (API_STR2PTR(hdata),
+ API_STR2PTR(pointer),
+ hashtable);
+
+ if (hashtable)
+ weechat_hashtable_free (hashtable);
+
+ API_RETURN_INT(value);
+}
+
+/*
* weechat_tcl_api_hdata_get_string: get hdata property as string
*/
@@ -6624,6 +6653,7 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
API_DEF_FUNC(hdata_pointer);
API_DEF_FUNC(hdata_time);
API_DEF_FUNC(hdata_hashtable);
+ API_DEF_FUNC(hdata_update);
API_DEF_FUNC(hdata_get_string);
API_DEF_FUNC(upgrade_new);
API_DEF_FUNC(upgrade_write_object);
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index b5f14851b..08ed8cd40 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -46,7 +46,7 @@ struct timeval;
*/
/* API version (used to check that plugin has same API and can be loaded) */
-#define WEECHAT_PLUGIN_API_VERSION "20120804-01"
+#define WEECHAT_PLUGIN_API_VERSION "20120827-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -833,9 +833,15 @@ struct t_weechat_plugin
/* hdata */
struct t_hdata *(*hdata_new) (struct t_weechat_plugin *plugin,
const char *hdata_name, const char *var_prev,
- const char *var_next);
+ const char *var_next,
+ int delete_allowed,
+ int (*callback_update)(void *data,
+ struct t_hdata *hdata,
+ void *pointer,
+ struct t_hashtable *hashtable),
+ void *callback_update_data);
void (*hdata_new_var) (struct t_hdata *hdata, const char *name, int offset,
- int type, const char *array_size,
+ int type, int update_allowed, const char *array_size,
const char *hdata_name);
void (*hdata_new_list) (struct t_hdata *hdata, const char *name,
void *pointer);
@@ -874,6 +880,10 @@ struct t_weechat_plugin
const char *name);
struct t_hashtable *(*hdata_hashtable) (struct t_hdata *hdata,
void *pointer, const char *name);
+ int (*hdata_set) (struct t_hdata *hdata, void *pointer, const char *name,
+ const char *value);
+ int (*hdata_update) (struct t_hdata *hdata, void *pointer,
+ struct t_hashtable *hashtable);
const char *(*hdata_get_string) (struct t_hdata *hdata,
const char *property);
@@ -1598,18 +1608,24 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
weechat_plugin->infolist_free(__list)
/* hdata */
-#define weechat_hdata_new(__hdata_name, __var_prev, __var_next) \
+#define weechat_hdata_new(__hdata_name, __var_prev, __var_next, \
+ __delete_allowed, __callback_update, \
+ __callback_update_data) \
weechat_plugin->hdata_new(weechat_plugin, __hdata_name, __var_prev, \
- __var_next)
+ __var_next, __delete_allowed, \
+ __callback_update, \
+ __callback_update_data)
#define weechat_hdata_new_var(__hdata, __name, __offset, __type, \
- __array_size, __hdata_name) \
+ __update_allowed, __array_size, \
+ __hdata_name) \
weechat_plugin->hdata_new_var(__hdata, __name, __offset, __type, \
- __array_size, __hdata_name)
-#define WEECHAT_HDATA_VAR(__struct, __name, __type, __array_size, \
- __hdata_name) \
+ __update_allowed, __array_size, \
+ __hdata_name)
+#define WEECHAT_HDATA_VAR(__struct, __name, __type, __update_allowed, \
+ __array_size, __hdata_name) \
weechat_hdata_new_var (hdata, #__name, offsetof (__struct, __name), \
- WEECHAT_HDATA_##__type, __array_size, \
- __hdata_name)
+ WEECHAT_HDATA_##__type, __update_allowed, \
+ __array_size, __hdata_name)
#define weechat_hdata_new_list(__hdata, __name, __pointer) \
weechat_plugin->hdata_new_list(__hdata, __name, __pointer)
#define WEECHAT_HDATA_LIST(__name) \
@@ -1656,6 +1672,10 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
weechat_plugin->hdata_time(__hdata, __pointer, __name)
#define weechat_hdata_hashtable(__hdata, __pointer, __name) \
weechat_plugin->hdata_hashtable(__hdata, __pointer, __name)
+#define weechat_hdata_set(__hdata, __pointer, __name, __value) \
+ weechat_plugin->hdata_set(__hdata, __pointer, __name, __value)
+#define weechat_hdata_update(__hdata, __pointer, __hashtable) \
+ weechat_plugin->hdata_update(__hdata, __pointer, __hashtable)
#define weechat_hdata_get_string(__hdata, __property) \
weechat_plugin->hdata_get_string(__hdata, __property)