diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-08-27 15:59:06 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-08-27 15:59:06 +0200 |
commit | 712623547f7e6fffc1bda625399ac54de87b6e2d (patch) | |
tree | 7353e6aec83c944eaa7b8af24694015b13f7715f /doc | |
parent | bb42984f5d6101ddc750700768ed3faf27f31021 (diff) | |
download | weechat-712623547f7e6fffc1bda625399ac54de87b6e2d.zip |
Add new functions in plugin API (hashtable_get_string, hook_info_hashtable, info_get_hashtable), add IRC info_hashtable "irc_parse_message"
Note: tcl >= 8.5 is now required (for tcl plugin).
Diffstat (limited to 'doc')
-rw-r--r-- | doc/de/autogen/plugin_api/infos_hashtable.txt | 7 | ||||
-rw-r--r-- | doc/de/weechat_scripting.de.txt | 4 | ||||
-rw-r--r-- | doc/de/weechat_user.de.txt | 4 | ||||
-rw-r--r-- | doc/docgen.pl | 97 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/infos_hashtable.txt | 7 | ||||
-rw-r--r-- | doc/en/weechat_plugin_api.en.txt | 383 | ||||
-rw-r--r-- | doc/en/weechat_scripting.en.txt | 4 | ||||
-rw-r--r-- | doc/en/weechat_user.en.txt | 4 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/infos_hashtable.txt | 7 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.txt | 389 | ||||
-rw-r--r-- | doc/fr/weechat_scripting.fr.txt | 4 | ||||
-rw-r--r-- | doc/fr/weechat_user.fr.txt | 4 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/infos_hashtable.txt | 7 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.txt | 447 | ||||
-rw-r--r-- | doc/it/weechat_scripting.it.txt | 4 | ||||
-rw-r--r-- | doc/it/weechat_user.it.txt | 4 |
16 files changed, 1343 insertions, 33 deletions
diff --git a/doc/de/autogen/plugin_api/infos_hashtable.txt b/doc/de/autogen/plugin_api/infos_hashtable.txt new file mode 100644 index 000000000..7e89db725 --- /dev/null +++ b/doc/de/autogen/plugin_api/infos_hashtable.txt @@ -0,0 +1,7 @@ +[width="100%",cols="^1,^2,6,6,6",options="header"] +|======================================== +| Erweiterung | Name | Beschreibung | Hashtable (input) | Hashtable (output) + +| irc | irc_parse_message | parse an IRC message | "message": IRC message | "nick": nick, "host": host, "command": command, "channel": channel, "arguments": arguments (includes channel) + +|======================================== diff --git a/doc/de/weechat_scripting.de.txt b/doc/de/weechat_scripting.de.txt index 0ac0428ca..daa73ee8a 100644 --- a/doc/de/weechat_scripting.de.txt +++ b/doc/de/weechat_scripting.de.txt @@ -279,7 +279,7 @@ Liste der Skript API Funktionen: hook_command, hook_command_run, hook_timer, hook_fd, hook_process, hook_connect, hook_print, hook_signal, hook_signal_send, hook_config, hook_completion, hook_completion_list_add, hook_modifier, hook_modifier_exec, - hook_info, hook_infolist, unhook, unhook_all + hook_info, hook_info_hashtable, hook_infolist, unhook, unhook_all | Buffer | buffer_new, current_buffer, buffer_search, buffer_search_main, buffer_clear, buffer_close, buffer_merge, buffer_unmerge, buffer_get_integer, @@ -298,7 +298,7 @@ Liste der Skript API Funktionen: | Befehle | command | Informationen | - info_get + info_get, info_get_hashtable | Infolisten | infolist_new, infolist_new_item, infolist_new_var_integer, infolist_new_var_string, infolist_new_var_pointer, infolist_new_var_time, + diff --git a/doc/de/weechat_user.de.txt b/doc/de/weechat_user.de.txt index 9ec51b603..f72fb46e9 100644 --- a/doc/de/weechat_user.de.txt +++ b/doc/de/weechat_user.de.txt @@ -98,7 +98,7 @@ welche Pakete optional genutzt werden können. | python-dev | nein | python Erweiterung | ruby1.8-dev | nein | ruby Erweiterung | liblua5.1-0-dev | nein | lua Erweiterung -| tcl-dev | nein | tcl Erweiterung +| tcl-dev (>= 8.5) | nein | tcl Erweiterung | asciidoc (>= 8.2) | nein | erstellt Dokumentation (HTML Dateien) | source-highlight | nein | Syntax highlight für Quelltext in HTML Dokumentation |======================================== @@ -515,7 +515,7 @@ Tastenbefehle für die Befehlszeile // TRANSLATION MISSING | Ctrl + R | Sucht nach einem Text in der Protokolldatei (zweimaliges Drücken: sucht nach exaktem Text), - next/previous occurences can be found with up and down arrows + + next/previous occurrences can be found with up and down arrows + `/input search_text` | Ctrl + T | diff --git a/doc/docgen.pl b/doc/docgen.pl index 951c4a67b..d138b8e4b 100644 --- a/doc/docgen.pl +++ b/doc/docgen.pl @@ -93,6 +93,9 @@ my @ignore_options = ("aspell\\.dict\\..*", # infos to ignore my @ignore_infos_plugins = (); +# infos (hashtable) to ignore +my @ignore_infos_hashtable_plugins = (); + # infolists to ignore my @ignore_infolists_plugins = (); @@ -204,7 +207,7 @@ sub get_infos my $plugin = weechat::infolist_string($infolist, "plugin_name"); $plugin = "weechat" if ($plugin eq ""); - # check if infolist is ignored or not + # check if info is ignored or not my $ignore = 0; foreach my $mask (@ignore_infos_plugins) { @@ -222,6 +225,38 @@ sub get_infos return %infos; } +# get list of infos (hashtable) hooked by plugins in a hash with 3 indexes: plugin, name, xxx +sub get_infos_hashtable +{ + my %infos_hashtable; + + # get infos hooked + my $infolist = weechat::infolist_get("hook", "", "info_hashtable"); + while (weechat::infolist_next($infolist)) + { + my $info_name = weechat::infolist_string($infolist, "info_name"); + my $plugin = weechat::infolist_string($infolist, "plugin_name"); + $plugin = "weechat" if ($plugin eq ""); + + # check if info_hashtable is ignored or not + my $ignore = 0; + foreach my $mask (@ignore_infos_hashtable_plugins) + { + $ignore = 1 if ($plugin =~ /${mask}/); + } + + if ($ignore ne 1) + { + $infos_hashtable{$plugin}{$info_name}{"description"} = weechat::infolist_string($infolist, "description"); + $infos_hashtable{$plugin}{$info_name}{"args_description"} = weechat::infolist_string($infolist, "args_description"); + $infos_hashtable{$plugin}{$info_name}{"output_description"} = weechat::infolist_string($infolist, "output_description"); + } + } + weechat::infolist_free($infolist); + + return %infos_hashtable; +} + # get list of infolists hooked by plugins in a hash with 3 indexes: plugin, name, xxx sub get_infolists { @@ -313,6 +348,7 @@ sub docgen my %plugin_commands = get_commands(); my %plugin_options = get_options(); my %plugin_infos = get_infos(); + my %plugin_infos_hashtable = get_infos_hashtable(); my %plugin_infolists = get_infolists(); my %plugin_completions = get_completions(); @@ -335,6 +371,8 @@ sub docgen my $num_files_options_updated = 0; my $num_files_infos = 0; my $num_files_infos_updated = 0; + my $num_files_infos_hashtable = 0; + my $num_files_infos_hashtable_updated = 0; my $num_files_infolists = 0; my $num_files_infolists_updated = 0; my $num_files_completions = 0; @@ -529,6 +567,55 @@ sub docgen weechat::print("", weechat::prefix("error")."docgen error: unable to write file '$filename'"); } + # write infos (hashtable) hooked + $filename = $dir."plugin_api/infos_hashtable.txt"; + if (open(FILE, ">".$filename.".tmp")) + { + print FILE "[width=\"100%\",cols=\"^1,^2,6,6,6\",options=\"header\"]\n"; + print FILE "|========================================\n"; + print FILE "| ".weechat_gettext("Plugin")." | ".weechat_gettext("Name") + ." | ".weechat_gettext("Description")." | ".weechat_gettext("Hashtable (input)") + ." | ".weechat_gettext("Hashtable (output)")."\n\n"; + foreach my $plugin (sort keys %plugin_infos_hashtable) + { + foreach my $info (sort keys %{$plugin_infos_hashtable{$plugin}}) + { + my $description = $plugin_infos_hashtable{$plugin}{$info}{"description"}; + $description = $d->get($description) if ($description ne ""); + my $args_description = $plugin_infos_hashtable{$plugin}{$info}{"args_description"}; + $args_description = $d->get($args_description) if ($args_description ne ""); + $args_description = "-" if ($args_description eq ""); + my $output_description = $plugin_infos_hashtable{$plugin}{$info}{"output_description"}; + $output_description = $d->get($output_description) if ($output_description ne ""); + $output_description = "-" if ($output_description eq ""); + + print FILE "| ".escape_table($plugin)." | ".escape_table($info) + ." | ".escape_table($description)." | ".escape_table($args_description) + ." | ".escape_table($output_description)."\n\n"; + } + } + print FILE "|========================================\n"; + #weechat::print("", "docgen: file ok: '$filename'"); + my $rc = system("diff ".$filename." ".$filename.".tmp >/dev/null 2>&1"); + if ($rc != 0) + { + system("mv -f ".$filename.".tmp ".$filename); + $num_files_updated++; + $num_files_infos_hashtable_updated++; + } + else + { + system("rm ".$filename.".tmp"); + } + $num_files++; + $num_files_infos_hashtable++; + close(FILE); + } + else + { + weechat::print("", weechat::prefix("error")."docgen error: unable to write file '$filename'"); + } + # write infolists hooked $filename = $dir."plugin_api/infolists.txt"; if (open(FILE, ">".$filename.".tmp")) @@ -624,20 +711,24 @@ sub docgen weechat::print("", weechat::prefix("error")."docgen error: directory '$dir' does not exist"); } my $total_files = $num_files_commands + $num_files_options - + $num_files_infos + $num_files_infolists + $num_files_completions; + + $num_files_infos + $num_files_infos_hashtable + + $num_files_infolists + $num_files_completions; my $total_files_updated = $num_files_commands_updated + $num_files_options_updated + $num_files_infos_updated - + $num_files_infolists_updated + $num_files_completions_updated; + + $num_files_infos_hashtable_updated + $num_files_infolists_updated + + $num_files_completions_updated; weechat::print("", "docgen: ".$locale.": ".$total_files." files (" .$num_files_commands." cmd, " .$num_files_options." opt, " .$num_files_infos." infos, " + .$num_files_infos." infos (hashtable), " .$num_files_infolists." infolists, " .$num_files_completions." complt) -- " .$total_files_updated." updated (" .$num_files_commands_updated." cmd, " .$num_files_options_updated." opt, " .$num_files_infos_updated." infos, " + .$num_files_infos_hashtable_updated." infos (hashtable), " .$num_files_infolists_updated." infolists, " .$num_files_completions_updated." complt)"); } diff --git a/doc/en/autogen/plugin_api/infos_hashtable.txt b/doc/en/autogen/plugin_api/infos_hashtable.txt new file mode 100644 index 000000000..c5c1dcfb4 --- /dev/null +++ b/doc/en/autogen/plugin_api/infos_hashtable.txt @@ -0,0 +1,7 @@ +[width="100%",cols="^1,^2,6,6,6",options="header"] +|======================================== +| Plugin | Name | Description | Hashtable (input) | Hashtable (output) + +| irc | irc_parse_message | parse an IRC message | "message": IRC message | "nick": nick, "host": host, "command": command, "channel": channel, "arguments": arguments (includes channel) + +|======================================== diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index 9e80d7c4e..f96100103 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -505,6 +505,9 @@ char *str = weechat_strndup ("abcdef", 3); /* result: "abc" */ free (str); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_tolower ^^^^^^^^^^^^^^^^^^^^^^ @@ -529,6 +532,9 @@ char *str = "AbCdé"; weechat_string_tolower (str); /* str is now: "abcdé" */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_toupper ^^^^^^^^^^^^^^^^^^^^^^ @@ -553,6 +559,9 @@ char *str = "AbCdé"; weechat_string_tolower (str); /* str is now: "ABCDé" */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_strcasecmp ^^^^^^^^^^^^^^^^^^ @@ -584,6 +593,9 @@ C example: int diff = weechat_strcasecmp ("aaa", "CCC"); /* == -2 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_strncasecmp ^^^^^^^^^^^^^^^^^^^ @@ -616,6 +628,9 @@ C example: int diff = weechat_strncasecmp ("aabb", "aacc", 2); /* == 0 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_strcmp_ignore_chars ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -652,6 +667,9 @@ C example: int diff = weechat_strcmp_ignore_chars ("a-b", "--a-e", "-", 1); /* == -3 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_strcasestr ^^^^^^^^^^^^^^^^^^ @@ -680,6 +698,9 @@ C example: char *pos = weechat_strcasestr ("aBcDeF", "de"); /* result: pointer to "DeF" */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_match ^^^^^^^^^^^^^^^^^^^^ @@ -730,7 +751,7 @@ match4 = weechat.string_match("abcdef", "*de*", 0) # 1 weechat_string_replace ^^^^^^^^^^^^^^^^^^^^^^ -Replace all occurences of a string by another string. +Replace all occurrences of a string by another string. Prototype: @@ -760,6 +781,9 @@ char *str = weechat_string_replace ("test", "s", "x"); /* result: "text" */ free (str); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_expand_home ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -794,6 +818,9 @@ char *str = weechat_string_expand_home ("~/file.txt"); free (str); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_remove_quotes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -827,6 +854,9 @@ char *str = weechat_string_remove_quotes (string, " 'I can't' ", "'"); free (str); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_strip ^^^^^^^^^^^^^^^^^^^^ @@ -860,6 +890,9 @@ char *str = weechat_string_strip (".abc -", 0, 1, "- ."); /* result: ".abc" */ free (str); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_has_highlight ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -995,6 +1028,9 @@ argv = weechat_string_split ("abc de fghi", " ", 1, 0, &argc); weechat_string_free_split (argv); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_free_split ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1023,6 +1059,9 @@ argv = weechat_string_split (string, " ", 0, 0, &argc); weechat_string_free_split (argv); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_build_with_split_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1059,6 +1098,9 @@ char *str = weechat_string_build_with_split_string (argv, ";"); free (str); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_split_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1093,6 +1135,9 @@ char **argv = weechat_string_split_command ("/command1 arg;/command2", ';'); weechat_free_split_command (argv); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_free_split_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1119,6 +1164,9 @@ char **argv = weechat_string_split_command ("/command1 arg;/command2", ';'); weechat_free_split_command (argv); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_format_size ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1163,6 +1211,9 @@ char *str = weechat_string_format_size (2097152); /* str == "2 MB" */ free (str); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_remove_color ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1243,6 +1294,9 @@ weechat_string_encode_base64 (string, strlen (string), result); /* result == "YWJjZGVmZ2g=" */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_decode_base64 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1277,6 +1331,9 @@ length = weechat_string_decode_base64 (string, result); /* length == 8, result == "abcdefgh" */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_string_is_command_char ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1400,6 +1457,9 @@ if (weechat_utf8_has_8bits (string)) } ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_is_valid ^^^^^^^^^^^^^^^^^^^^^ @@ -1437,6 +1497,9 @@ else } ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_normalize ^^^^^^^^^^^^^^^^^^^^^^ @@ -1461,6 +1524,9 @@ C example: weechat_utf8_normalize (string, '?'); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_prev_char ^^^^^^^^^^^^^^^^^^^^^^ @@ -1490,6 +1556,9 @@ C example: char *prev_char = weechat_utf8_prev_char (string, ptr_in_string); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_next_char ^^^^^^^^^^^^^^^^^^^^^^ @@ -1517,6 +1586,9 @@ C example: char *next_char = weechat_utf8_next_char (string); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_char_int ^^^^^^^^^^^^^^^^^^^^^ @@ -1544,6 +1616,9 @@ C example: int char_int = weechat_utf8_char_int ("être"); /* "ê" as integer */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_char_size ^^^^^^^^^^^^^^^^^^^^^^ @@ -1571,6 +1646,9 @@ C example: int char_size = weechat_utf8_char_size ("être"); /* == 2 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_strlen ^^^^^^^^^^^^^^^^^^^ @@ -1598,6 +1676,9 @@ C example: int length = weechat_utf8_strlen ("chêne"); /* == 5 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_strnlen ^^^^^^^^^^^^^^^^^^^^ @@ -1626,6 +1707,9 @@ C example: int length = weechat_utf8_strnlen ("chêne", 4); /* == 3 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_strlen_screen ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1653,6 +1737,9 @@ C example: int length_on_screen = weechat_utf8_strlen_screen ("é"); /* == 1 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_charcmp ^^^^^^^^^^^^^^^^^^^^ @@ -1684,6 +1771,9 @@ C example: int diff = weechat_utf8_charcmp ("aaa", "ccc"); /* == -2 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_charcasecmp ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1715,6 +1805,9 @@ C example: int diff = weechat_utf8_charcasecmp ("aaa", "CCC"); /* == -2 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_char_size_screen ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1742,6 +1835,9 @@ C example: int length_on_screen = weechat_utf8_char_size_screen ("é"); /* == 1 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_add_offset ^^^^^^^^^^^^^^^^^^^^^^^ @@ -1771,6 +1867,9 @@ char *str = "chêne"; char *str2 = weechat_utf8_add_offset (str, 3); /* points to "ne" */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_real_pos ^^^^^^^^^^^^^^^^^^^^^ @@ -1799,6 +1898,9 @@ C example: int pos = weechat_utf8_real_pos ("chêne", 3); /* == 4 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_pos ^^^^^^^^^^^^^^^^ @@ -1827,6 +1929,9 @@ C example: int pos = weechat_utf8_pos ("chêne", 4); /* == 3 */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_utf8_strndup ^^^^^^^^^^^^^^^^^^^^ @@ -1857,6 +1962,9 @@ char *string = weechat_utf8_strndup ("chêne", 3); /* returns "chê" */ free (string); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + [[directories]] Directories ~~~~~~~~~~~ @@ -2026,6 +2134,9 @@ void callback (void *data, const char *filename) weechat_exec_on_files ("/tmp", 0, NULL, &callback); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_file_get_content ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2059,6 +2170,9 @@ content = weechat_file_get_content ("/tmp/test.txt"); free (content); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + [[util]] Util ~~~~ @@ -2098,6 +2212,9 @@ if (weechat_util_timeval_cmp (&tv1, &tv2) > 0) } ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_util_timeval_diff ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2126,6 +2243,9 @@ C example: long diff = weechat_util_timeval_diff (&tv1, &tv2); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_util_timeval_add ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2150,6 +2270,9 @@ C example: weechat_util_timeval_add (&tv, 2000); /* add 2 seconds */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_util_get_time_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2177,6 +2300,9 @@ weechat_printf (NULL, "date: %s", weechat_util_get_time_string (&date)); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + [[sorted_lists]] Sorted lists ~~~~~~~~~~~~ @@ -2742,6 +2868,9 @@ struct t_hashtable *hashtable = weechat_hashtable_new (8, NULL); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_set_with_size ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2780,6 +2909,9 @@ weechat_hashtable_set_with_size (hashtable, "my_key", 0, my_buffer, sizeof (my_buffer_struct)); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_set ^^^^^^^^^^^^^^^^^^^^^ @@ -2812,6 +2944,9 @@ C example: weechat_hashtable_set (hashtable, "my_key", "my_value"); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_get ^^^^^^^^^^^^^^^^^^^^^ @@ -2842,6 +2977,9 @@ C example: void *value = weechat_hashtable_get (hashtable, "my_key"); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_map ^^^^^^^^^^^^^^^^^^^^^ @@ -2884,6 +3022,9 @@ map_cb (void *data, struct t_hashtable *hashtable, weechat_hashtable_map (hashtable, &map_cb, NULL); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_get_integer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2917,6 +3058,55 @@ C example: int items_count = weechat_hashtable_get_integer (hashtable, "items_count"); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + +weechat_hashtable_get_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.4._ + +Return string value of a hashtable property. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_hashtable_get_string (struct t_hashtable *hashtable, + void *property); +---------------------------------------- + +Arguments: + +* 'hashtable': hashtable pointer +* 'property': property name: +** 'type_keys': type for keys: +*** 'integer': integer +*** 'string': string +*** 'pointer': pointer +*** 'buffer': buffer +*** 'time': time +** 'type_values': type for values: +*** 'integer': integer +*** 'string': string +*** 'pointer': pointer +*** 'buffer': buffer +*** 'time': time + +Return value: + +* string value of property + +C example: + +[source,C] +---------------------------------------- +const char *type_keys = weechat_hashtable_get_string (hashtable, "type_keys"); +---------------------------------------- + +[NOTE] +This function is not available in scripting API. + weechat_hashtable_add_to_infolist ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2960,6 +3150,9 @@ weechat_hashtable_add_to_infolist (hashtable, infolist_item, "testhash"); */ ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_remove ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2986,6 +3179,9 @@ C example: weechat_hashtable_remove (hashtable, "my_key"); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_remove_all ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3011,6 +3207,9 @@ C example: weechat_hashtable_remove_all (hashtable); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_hashtable_free ^^^^^^^^^^^^^^^^^^^^^^ @@ -3036,6 +3235,9 @@ C example: weechat_hashtable_free (hashtable); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + [[configuration_files]] Configuration files ~~~~~~~~~~~~~~~~~~~ @@ -3665,6 +3867,9 @@ else } ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_config_search_with_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3712,6 +3917,9 @@ else } ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_config_string_to_boolean ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -4084,6 +4292,9 @@ C example: char *description = weechat_config_option_get_pointer (option, "description"); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_config_option_is_null ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -5349,6 +5560,9 @@ C example: weechat_printf_date (NULL, time (NULL) - 120, "Hello, 2 minutes ago"); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_printf_tags ^^^^^^^^^^^^^^^^^^^ @@ -5376,6 +5590,9 @@ weechat_printf_tags (NULL, "notify_message", "Message with a tag 'notify_message'"); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_printf_date_tags ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -6870,7 +7087,7 @@ weechat.hook_modifier_exec("my_modifier", my_data, my_string) weechat_hook_info ^^^^^^^^^^^^^^^^^ -Hook an information. +Hook an information (callback takes and returns a string). Prototype: @@ -6934,6 +7151,82 @@ hook = weechat.hook_info("my_info", "Some info", "Info about arguments", "my_info_cb", "") ---------------------------------------- +weechat_hook_info_hashtable +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.4._ + +Hook an information (callback takes and returns a hashtable). + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_info_hashtable (const char *info_name, + const char *description, + const char *args_description, + const char *output_description, + struct t_hashtable *(*callback)(void *data, + const char *info_name, + struct t_hashtable *hashtable), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'info_name': name of info + (priority allowed, see note about <<hook_priority,priority>>) +* 'description': description +* 'args_description': description of expected hashtable (optional, can be NULL) +* 'output_description': description of hashtable returned by callback + (optional, can be NULL) +* 'callback': function called when info is asked, arguments: +** 'void *data': pointer +** 'const char *info_name': name of info +** 'struct t_hashtable *hashtable': hashtable, depending on info +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hashtable * +my_info_hashtable_cb (void *data, const char *info_name, struct t_hashtable *hashtable) +{ + /* ... */ + return pointer_to_new_hashtable; +} + +/* add info "my_info_hashtable" */ +struct t_hook *my_info_hook = weechat_hook_info_hashtable ("my_info_hashtable", + "Some info", + "Info about input hashtable", + "Info about output hashtable", + &my_info_hashtable_cb, NULL); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +hook = weechat.hook_info_hashtable(info_name, description, args_description, + output_description, callback, callback_data) + +# example +def my_info_hashtable_cb(data, info_name, hashtable): + return { "test_key": "test_value" } + +hook = weechat.hook_info_hashtable("my_info_hashtable", "Some info", + "Info about input hashtable", + "Info about output hashtable", + "my_info_hashtable_cb", "") +---------------------------------------- + weechat_hook_infolist ^^^^^^^^^^^^^^^^^^^^^ @@ -7800,6 +8093,9 @@ my_close_cb (void *data, struct t_gui_buffer *buffer) weechat_buffer_set_pointer (my_buffer, "close_callback", &my_close_cb); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_buffer_string_replace_local_var ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8903,6 +9199,9 @@ else } ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_network_connect_to ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8953,6 +9252,9 @@ else } ---------------------------------------- +[NOTE] +This function is not available in scripting API. + [[infos]] Infos ~~~~~ @@ -8962,7 +9264,7 @@ Functions to get infos. weechat_info_get ^^^^^^^^^^^^^^^^ -Return info from WeeChat or a plugin. +Return info, as string, from WeeChat or a plugin. Prototype: @@ -9006,6 +9308,75 @@ weechat.prnt("", "Current WeeChat version is: %s (compiled on %s)" weechat.prnt("", "WeeChat home is: %s" % weechat.info_get("weechat_dir", "")) ---------------------------------------- +weechat_info_get_hashtable +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_New in version 0.3.4._ + +Return info, as hashtable, from WeeChat or a plugin. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hashtable *weechat_info_get_hashtable (const char *info_name, + struct t_hashtable *hashtable); +---------------------------------------- + +Arguments: + +* 'info_name': name of info to read: +include::autogen/plugin_api/infos_hashtable.txt[] +* 'hashtable': hashtable with arguments (depends on info asked) (optional, NULL + if no argument is needed) + +Return value: + +* hashtable with info asked, NULL if an error occured + +C example: + +[source,C] +---------------------------------------- +struct t_hashtable *hashtable_in, *hashtable_out; + +hashtable_in = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +if (hashtable_in) +{ + weechat_hashtable_set (hashtable_in, "message", + ":nick!user@host PRIVMSG #weechat :message here"); + hashtable_out = weechat_info_get_hashtable ("irc_parse_message", + hashtable_in); + /* + * now hashtable_out has following keys/values: + * "nick" : "nick" + * "host" : "nick!user@host" + * "command" : "PRIVMSG" + * "channel" : "#weechat" + * "arguments": "#weechat :message here" + */ + weechat_hashtable_free (hashtable_in); + weechat_hashtable_free (hashtable_out); +} +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +dict = weechat.info_get_hashtable(info_name, dict_in) + +# example +dict_in = { "message": ":nick!user@host PRIVMSG #weechat :message here" } +weechat.prnt("", "message parsed: %s" + % weechat.info_get_hashtable("irc_parse_message", dict_in)) +---------------------------------------- + [[infolists]] Infolists ~~~~~~~~~ @@ -9266,6 +9637,9 @@ struct t_infolist_var *var = weechat_infolist_new_variable_buffer (item, sizeof (buffer)); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_infolist_new_var_time ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9687,6 +10061,9 @@ weechat_printf (NULL, "buffer = 0x%lx, size = %d", pointer, size); ---------------------------------------- +[NOTE] +This function is not available in scripting API. + weechat_infolist_time ^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/en/weechat_scripting.en.txt b/doc/en/weechat_scripting.en.txt index 94ca235de..2f46e3d8c 100644 --- a/doc/en/weechat_scripting.en.txt +++ b/doc/en/weechat_scripting.en.txt @@ -272,7 +272,7 @@ List of functions in script API: hook_command, hook_command_run, hook_timer, hook_fd, hook_process, hook_connect, hook_print, hook_signal, hook_signal_send, hook_config, hook_completion, hook_completion_list_add, hook_modifier, hook_modifier_exec, - hook_info, hook_infolist, unhook, unhook_all + hook_info, hook_info_hashtable, hook_infolist, unhook, unhook_all | buffers | buffer_new, current_buffer, buffer_search, buffer_search_main, buffer_clear, buffer_close, buffer_merge, buffer_unmerge, buffer_get_integer, @@ -291,7 +291,7 @@ List of functions in script API: | commands | command | infos | - info_get + info_get, info_get_hashtable | infolists | infolist_new, infolist_new_item, infolist_new_var_integer, infolist_new_var_string, infolist_new_var_pointer, infolist_new_var_time, + diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index 80655eb9b..61f3f94cc 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -98,7 +98,7 @@ compile WeeChat. | python-dev | no | python plugin | ruby1.8-dev | no | ruby plugin | liblua5.1-0-dev | no | lua plugin -| tcl-dev | no | tcl plugin +| tcl-dev (>= 8.5) | no | tcl plugin | asciidoc (>= 8.2) | no | build documentation (HTML files) | source-highlight | no | syntax highlight for sources in HTML documentation |======================================== @@ -515,7 +515,7 @@ Keys for command line | Ctrl + R | Search for text in buffer history (two times: search exact text), - next/previous occurences can be found with up and down arrows + + next/previous occurrences can be found with up and down arrows + `/input search_text` | Ctrl + T | diff --git a/doc/fr/autogen/plugin_api/infos_hashtable.txt b/doc/fr/autogen/plugin_api/infos_hashtable.txt new file mode 100644 index 000000000..ce3471b6e --- /dev/null +++ b/doc/fr/autogen/plugin_api/infos_hashtable.txt @@ -0,0 +1,7 @@ +[width="100%",cols="^1,^2,6,6,6",options="header"] +|======================================== +| Extension | Nom | Description | Hashtable (entrée) | Hashtable (sortie) + +| irc | irc_parse_message | analyse un message IRC | "message": message IRC | "nick": pseudo, "host": nom d'hôte, "command": commande, "channel": canal, "arguments": paramètres (inclut le canal) + +|======================================== diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index e37799c82..924ecb84c 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -512,6 +512,9 @@ char *str = weechat_strndup ("abcdef", 3); /* résultat : "abc" */ free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_tolower ^^^^^^^^^^^^^^^^^^^^^^ @@ -536,6 +539,9 @@ char *str = "AbCdé"; weechat_string_tolower (str); /* str vaut maintenant : "abcdé" */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_toupper ^^^^^^^^^^^^^^^^^^^^^^ @@ -560,6 +566,9 @@ char *str = "AbCdé"; weechat_string_tolower (str); /* str vaut maintenant : "ABCDé" */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_strcasecmp ^^^^^^^^^^^^^^^^^^ @@ -591,6 +600,9 @@ Exemple en C : int diff = weechat_strcasecmp ("aaa", "CCC"); /* == -2 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_strncasecmp ^^^^^^^^^^^^^^^^^^^ @@ -624,6 +636,9 @@ Exemple en C : int diff = weechat_strncasecmp ("aabb", "aacc", 2); /* == 0 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_strcmp_ignore_chars ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -660,6 +675,9 @@ Exemple en C : int diff = weechat_strcmp_ignore_chars ("a-b", "--a-e", "-", 1); /* == -3 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_strcasestr ^^^^^^^^^^^^^^^^^^ @@ -688,6 +706,9 @@ Exemple en C : char *pos = weechat_strcasestr ("aBcDeF", "de"); /* résultat : pointeur vers "DeF" */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_match ^^^^^^^^^^^^^^^^^^^^ @@ -738,7 +759,7 @@ match4 = weechat.string_match("abcdef", "*de*", 0) # 1 weechat_string_replace ^^^^^^^^^^^^^^^^^^^^^^ -Remplace toutes les occurences d'une chaîne par une autre chaîne. +Remplace toutes les occurrences d'une chaîne par une autre chaîne. Prototype : @@ -768,6 +789,9 @@ char *str = weechat_string_replace ("test, test", "s", "x"); /* résultat : "tex free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_expand_home ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -802,6 +826,9 @@ char *str = weechat_string_expand_home ("~/fichier.txt"); free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_remove_quotes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -835,6 +862,9 @@ char *str = weechat_string_remove_quotes (string, " 'aujourd'hui' ", "'"); free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_strip ^^^^^^^^^^^^^^^^^^^^ @@ -869,6 +899,9 @@ char *str = weechat_string_strip (".abc -", 0, 1, "- ."); /* résultat : ".abc" free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_has_highlight ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1008,6 +1041,9 @@ argv = weechat_string_split ("abc de fghi", " ", 1, 0, &argc); weechat_string_free_split (argv); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_free_split ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1036,6 +1072,9 @@ argv = weechat_string_split (string, " ", 0, 0, &argc); weechat_string_free_split (argv); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_build_with_split_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1073,6 +1112,9 @@ char *str = weechat_string_build_with_split_string (argv, ";"); free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_split_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1107,6 +1149,9 @@ char **argv = weechat_string_split_command ("/commande1 arg;/commande2", ';'); weechat_free_split_command (argv); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_free_split_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1133,6 +1178,9 @@ char **argv = weechat_string_split_command ("/commande1 arg;/commande2", ';'); weechat_free_split_command (argv); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_format_size ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1177,6 +1225,9 @@ char *str = weechat_string_format_size (2097152); /* str == "2 Mo" */ free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_remove_color ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1258,6 +1309,9 @@ weechat_string_encode_base64 (string, strlen (string), result); /* result == "YWJjZGVmZ2g=" */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_decode_base64 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1292,6 +1346,9 @@ length = weechat_string_decode_base64 (string, result); /* length == 8, result == "abcdefgh" */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_string_is_command_char ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1417,6 +1474,9 @@ if (weechat_utf8_has_8bits (string)) } ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_is_valid ^^^^^^^^^^^^^^^^^^^^^ @@ -1454,6 +1514,9 @@ else } ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_normalize ^^^^^^^^^^^^^^^^^^^^^^ @@ -1479,6 +1542,9 @@ Exemple en C : weechat_utf8_normalize (string, '?'); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_prev_char ^^^^^^^^^^^^^^^^^^^^^^ @@ -1509,6 +1575,9 @@ Exemple en C : char *prev_char = weechat_utf8_prev_char (string, ptr_in_string); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_next_char ^^^^^^^^^^^^^^^^^^^^^^ @@ -1537,6 +1606,9 @@ Exemple en C : char *next_char = weechat_utf8_next_char (string); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_char_int ^^^^^^^^^^^^^^^^^^^^^ @@ -1564,6 +1636,9 @@ Exemple en C : int char_int = weechat_utf8_char_int ("être"); /* "ê" comme entier */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_char_size ^^^^^^^^^^^^^^^^^^^^^^ @@ -1591,6 +1666,9 @@ Exemple en C : int char_size = weechat_utf8_char_size ("être"); /* == 2 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_strlen ^^^^^^^^^^^^^^^^^^^ @@ -1618,6 +1696,9 @@ Exemple en C : int length = weechat_utf8_strlen ("chêne"); /* == 5 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_strnlen ^^^^^^^^^^^^^^^^^^^^ @@ -1647,6 +1728,9 @@ Exemple en C : int length = weechat_utf8_strnlen ("chêne", 4); /* == 3 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_strlen_screen ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1675,6 +1759,9 @@ Exemple en C : int length_on_screen = weechat_utf8_strlen_screen ("é"); /* == 1 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_charcmp ^^^^^^^^^^^^^^^^^^^^ @@ -1706,6 +1793,9 @@ Exemple en C : int diff = weechat_utf8_charcmp ("aaa", "ccc"); /* == -2 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_charcasecmp ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1737,6 +1827,9 @@ Exemple en C : int diff = weechat_utf8_charcasecmp ("aaa", "CCC"); /* == -2 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_char_size_screen ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1765,6 +1858,9 @@ Exemple en C : int length_on_screen = weechat_utf8_char_size_screen ("é"); /* == 1 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_add_offset ^^^^^^^^^^^^^^^^^^^^^^^ @@ -1795,6 +1891,9 @@ char *str = "chêne"; char *str2 = weechat_utf8_add_offset (str, 3); /* pointe vers "ne" */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_real_pos ^^^^^^^^^^^^^^^^^^^^^ @@ -1823,6 +1922,9 @@ Exemple en C : int pos = weechat_utf8_real_pos ("chêne", 3); /* == 4 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_pos ^^^^^^^^^^^^^^^^ @@ -1851,6 +1953,9 @@ Exemple en C : int pos = weechat_utf8_pos ("chêne", 4); /* == 3 */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_utf8_strndup ^^^^^^^^^^^^^^^^^^^^ @@ -1881,6 +1986,9 @@ char *string = weechat_utf8_strndup ("chêne", 3); /* retourne "chê" */ free (str); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + [[directories]] Répertoires ~~~~~~~~~~~ @@ -2051,6 +2159,9 @@ void callback (void *data, const char *filename) weechat_exec_on_files ("/tmp", 0, NULL, &callback); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_file_get_content ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2085,6 +2196,9 @@ contenu = weechat_file_get_content ("/tmp/test.txt"); free (contenu); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + [[util]] Util ~~~~ @@ -2124,6 +2238,9 @@ if (weechat_util_timeval_cmp (&tv1, &tv2) > 0) } ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_util_timeval_diff ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2152,6 +2269,9 @@ Exemple en C : long diff = weechat_util_timeval_diff (&tv1, &tv2); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_util_timeval_add ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2176,6 +2296,9 @@ Exemple en C : weechat_util_timeval_add (&tv, 2000); /* ajoute 2 secondes */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_util_get_time_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2203,6 +2326,9 @@ weechat_printf (NULL, "date: %s", weechat_util_get_time_string (&date)); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + [[sorted_lists]] Listes triées ~~~~~~~~~~~~~ @@ -2772,6 +2898,9 @@ struct t_hashtable *hashtable = weechat_hashtable_new (8, NULL); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_set_with_size ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2811,6 +2940,9 @@ weechat_hashtable_set_with_size (hashtable, "ma_cle", 0, my_buffer, sizeof (my_buffer_struct)); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_set ^^^^^^^^^^^^^^^^^^^^^ @@ -2843,6 +2975,9 @@ Exemple en C : weechat_hashtable_set (hashtable, "ma_cle", "ma_valeur"); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_get ^^^^^^^^^^^^^^^^^^^^^ @@ -2873,6 +3008,9 @@ Exemple en C : void *value = weechat_hashtable_get (hashtable, "ma_cle"); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_map ^^^^^^^^^^^^^^^^^^^^^ @@ -2915,6 +3053,9 @@ map_cb (void *data, struct t_hashtable *hashtable, weechat_hashtable_map (hashtable, &map_cb, NULL); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_get_integer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2939,7 +3080,7 @@ Paramètres : Valeur en retour : -* valeur entière de l'option +* valeur de la propriété sous forme d'entier Exemple en C : @@ -2948,6 +3089,55 @@ Exemple en C : int items_count = weechat_hashtable_get_integer (hashtable, "items_count"); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + +weechat_hashtable_get_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.4._ + +Retourne une valeur pour une propriété d'une hashtable sous forme de chaîne. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_hashtable_get_string (struct t_hashtable *hashtable, + void *property); +---------------------------------------- + +Arguments: + +* 'hashtable' : pointeur vers la hashtable +* 'property' : nom de la propriété : +** 'type_keys' : type pour les clés : +*** 'integer' : entier +*** 'string' : chaîne +*** 'pointer' : pointeur +*** 'buffer' : buffer +*** 'time' : heure +** 'type_values': type pour les valeurs : +*** 'integer' : entier +*** 'string' : chaîne +*** 'pointer' : pointeur +*** 'buffer' : buffer +*** 'time' : heure + +Valeur en retour : + +* valeur de la propriété sous forme de chaîne + +Exemple en C : + +[source,C] +---------------------------------------- +const char *type_keys = weechat_hashtable_get_string (hashtable, "type_keys"); +---------------------------------------- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_add_to_infolist ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2991,6 +3181,9 @@ weechat_hashtable_add_to_infolist (hashtable, infolist_item, "testhash"); */ ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_remove ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3017,6 +3210,9 @@ Exemple en C : weechat_hashtable_remove (hashtable, "ma_cle"); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_remove_all ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3042,6 +3238,9 @@ Exemple en C : weechat_hashtable_remove_all (hashtable); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_hashtable_free ^^^^^^^^^^^^^^^^^^^^^^ @@ -3067,6 +3266,9 @@ Exemple en C : weechat_hashtable_free (hashtable); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + [[configuration_files]] Fichiers de configuration ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -3708,6 +3910,9 @@ else } ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_config_search_with_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3756,6 +3961,9 @@ else } ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_config_string_to_boolean ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -4134,6 +4342,9 @@ Exemple en C : char *description = weechat_config_option_get_pointer (option, "description"); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_config_option_is_null ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -4917,6 +5128,8 @@ Exemple en C : weechat_config_section_free (section); ---------------------------------------- +Script (Python) : + [source,python] ---------------------------------------- # prototype @@ -5408,6 +5621,9 @@ Exemple en C : weechat_printf_date (NULL, time (NULL) - 120, "Bonjour, il y a 2 minutes"); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_printf_tags ^^^^^^^^^^^^^^^^^^^ @@ -5436,6 +5652,9 @@ weechat_printf_tags (NULL, "notify_message", "Message avec une étiquette 'notify_message'"); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_printf_date_tags ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -6964,7 +7183,7 @@ weechat.hook_modifier_exec("mon_modifier", mes_donnees, ma_chaine) weechat_hook_info ^^^^^^^^^^^^^^^^^ -Accroche une information. +Accroche une information (le "callback" prend et retourne une chaîne). Prototype : @@ -7031,6 +7250,84 @@ hook = weechat.hook_info("mon_info", "Une information", "Info sur les paramètre "my_info_cb", "") ---------------------------------------- +weechat_hook_info_hashtable +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.4._ + +Accroche une information (le "callback" prend et retourne une hashtable). + +Prototype : + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_info_hashtable (const char *info_name, + const char *description, + const char *args_description, + const char *output_description, + struct t_hashtable *(*callback)(void *data, + const char *info_name, + struct t_hashtable *hashtable), + void *callback_data); +---------------------------------------- + +Paramètres : + +* 'info_name' : nom de l'information + (priorité autorisée, voir la note sur la <<hook_priority,priorité>>) +* 'description' : description +* 'args_description' : description de la hashtable attendue + (optionnel, peut être NULL) +* 'output_description' : description de la hashtable retournée par le "callback" + (optionnel, peut être NULL) +* 'callback' : fonction appelée quand l'information est demandée, paramètres : +** 'void *data' : pointeur +** 'const char *info_name': nom de l'information +** 'struct t_hashtable *hashtable' : hashtable, dépendant de l'information +* 'callback_data' : pointeur donné au "callback" lorsqu'il est appelé par + WeeChat + +Valeur de retour : + +* pointeur vers le nouveau "hook", NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hashtable * +my_info_hashtable_cb (void *data, const char *info_name, struct t_hashtable *hashtable) +{ + /* ... */ + return pointer_vers_nouvelle_hashtable; +} + +/* ajoute l'information "mon_info_hashtable" */ +struct t_hook *my_info_hook = weechat_hook_info_hashtable ("mon_info_hashtable", + "Une information", + "Info sur la hashtable en entrée", + "Info sur la hashtable en sortie", + &my_info_hashtable_cb, NULL); +---------------------------------------- + +Script (Python) : + +[source,python] +---------------------------------------- +# prototype +hook = weechat.hook_info_hashtable(info_name, description, args_description, + output_description, callback, callback_data) + +# exemple +def my_info_hashtable_cb(data, info_name, hashtable): + return { "test_cle": "test_valeur" } + +hook = weechat.hook_info_hashtable("mon_info_hashtable", "Une information", + "Info sur la hashtable en entrée", + "Info sur la hashtable en sortie", + "my_info_hashtable_cb", "") +---------------------------------------- + weechat_hook_infolist ^^^^^^^^^^^^^^^^^^^^^ @@ -7915,6 +8212,9 @@ my_close_cb (void *data, struct t_gui_buffer *buffer) weechat_buffer_set_pointer (mon_tampon, "close_callback", &my_close_cb); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_buffer_string_replace_local_var ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9039,6 +9339,9 @@ else } ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_network_connect_to ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9089,6 +9392,9 @@ else } ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + [[infos]] Infos ~~~~~ @@ -9098,7 +9404,7 @@ Fonctions pour obtenir des informations. weechat_info_get ^^^^^^^^^^^^^^^^ -Retourne une information de WeeChat ou d'une extension. +Retourne une information, sous forme de chaîne, de WeeChat ou d'une extension. Prototype : @@ -9142,6 +9448,75 @@ weechat.prnt("", "La version de WeeChat est : %s (compilée le %s)" weechat.prnt("", "Le répertoire de WeeChat est : %s" % weechat.info_get("weechat_dir", "")) ---------------------------------------- +weechat_info_get_hashtable +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Nouveau dans la version 0.3.4._ + +Retourne une information, sous forme de hashtable, de WeeChat ou d'une extension. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hashtable *weechat_info_get_hashtable (const char *info_name, + struct t_hashtable *hashtable); +---------------------------------------- + +Paramètres : + +* 'info_name' : nom de l'information à lire : +include::autogen/plugin_api/infos_hashtable.txt[] +* 'hashtable' : hashtable avec les paramètres (dépendant de l'information + demandée) (optionnel, NULL si aucun paramètre n'est nécessaire) + +Valeur de retour : + +* hashtable avec l'information demandée, NULL en cas d'erreur + +Exemple en C : + +[source,C] +---------------------------------------- +struct t_hashtable *hashtable_in, *hashtable_out; + +hashtable_in = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +if (hashtable_in) +{ + weechat_hashtable_set (hashtable_in, "message", + ":nick!user@host PRIVMSG #weechat :message ici"); + hashtable_out = weechat_info_get_hashtable ("irc_parse_message", + hashtable_in); + /* + * maintenant hashtable_out a les clés/valeurs suivantes : + * "nick" : "nick" + * "host" : "nick!user@host" + * "command" : "PRIVMSG" + * "channel" : "#weechat" + * "arguments": "#weechat :message ici" + */ + weechat_hashtable_free (hashtable_in); + weechat_hashtable_free (hashtable_out); +} +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +dict = weechat.info_get_hashtable(info_name, dict_in) + +# example +dict_in = { "message": ":nick!user@host PRIVMSG #weechat :message ici" } +weechat.prnt("", "message analysé: %s" + % weechat.info_get_hashtable("irc_parse_message", dict_in)) +---------------------------------------- + [[infolists]] Infolists ~~~~~~~~~ @@ -9404,6 +9779,9 @@ struct t_infolist_var *var = weechat_infolist_new_var_buffer (item, sizeof (buffer)); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_infolist_new_var_time ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9834,6 +10212,9 @@ weechat_printf (NULL, "buffer = 0x%lx, taille = %d", pointer, size); ---------------------------------------- +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + weechat_infolist_time ^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/fr/weechat_scripting.fr.txt b/doc/fr/weechat_scripting.fr.txt index 45fa4dc6b..354adf91e 100644 --- a/doc/fr/weechat_scripting.fr.txt +++ b/doc/fr/weechat_scripting.fr.txt @@ -281,7 +281,7 @@ Liste des fonctions de l'API script : hook_command, hook_command_run, hook_timer, hook_fd, hook_process, hook_connect, hook_print, hook_signal, hook_signal_send, hook_config, hook_completion, hook_completion_list_add, hook_modifier, hook_modifier_exec, - hook_info, hook_infolist, unhook, unhook_all + hook_info, hook_info_hashtable, hook_infolist, unhook, unhook_all | tampons | buffer_new, current_buffer, buffer_search, buffer_search_main, buffer_clear, buffer_close, buffer_merge, buffer_unmerge, buffer_get_integer, @@ -300,7 +300,7 @@ Liste des fonctions de l'API script : | commandes | command | infos | - info_get + info_get, info_get_hashtable | infolists | infolist_new, infolist_new_item, infolist_new_var_integer, infolist_new_var_string, infolist_new_var_pointer, infolist_new_var_time, + diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt index 59bea103f..46001e1ab 100644 --- a/doc/fr/weechat_user.fr.txt +++ b/doc/fr/weechat_user.fr.txt @@ -100,7 +100,7 @@ compiler WeeChat. | python-dev | non | extension python | ruby1.8-dev | non | extension ruby | liblua5.1-0-dev | non | extension lua -| tcl-dev | non | extension tcl +| tcl-dev (>= 8.5) | non | extension tcl | asciidoc (>= 8.2) | non | construction de la documentation (fichiers HTML) | source-highlight | non | coloration des sources dans la documentation HTML |======================================== @@ -526,7 +526,7 @@ Touches pour la ligne de commande | Ctrl + R | Chercher du texte dans l'historique du tampon (deux appuis successifs pour - rechercher du texte exact), les occurences suivantes/précédentes peuvent être + rechercher du texte exact), les occurrences suivantes/précédentes peuvent être trouvées avec les flèches haut et bas + `/input search_text` diff --git a/doc/it/autogen/plugin_api/infos_hashtable.txt b/doc/it/autogen/plugin_api/infos_hashtable.txt new file mode 100644 index 000000000..0eb5c42cd --- /dev/null +++ b/doc/it/autogen/plugin_api/infos_hashtable.txt @@ -0,0 +1,7 @@ +[width="100%",cols="^1,^2,6,6,6",options="header"] +|======================================== +| Plugin | Nome | Descrizione | Hashtable (input) | Hashtable (output) + +| irc | irc_parse_message | parse an IRC message | "message": IRC message | "nick": nick, "host": host, "command": command, "channel": channel, "arguments": arguments (includes channel) + +|======================================== diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index 22489762c..875f301a3 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -521,6 +521,10 @@ char *str = weechat_strndup ("abcdef", 3); /* result: "abc" */ free (str); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_tolower ^^^^^^^^^^^^^^^^^^^^^^ @@ -545,6 +549,10 @@ char *str = "AbCdé"; weechat_string_tolower (str); /* str ora è: "abcdé" */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_toupper ^^^^^^^^^^^^^^^^^^^^^^ @@ -569,6 +577,10 @@ char *str = "AbCdé"; weechat_string_tolower (str); /* str ora è: "ABCDé" */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_strcasecmp ^^^^^^^^^^^^^^^^^^ @@ -601,6 +613,10 @@ Esempio in C: int diff = weechat_strcasecmp ("aaa", "CCC"); /* == -2 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_strncasecmp ^^^^^^^^^^^^^^^^^^^ @@ -634,6 +650,10 @@ Esempio in C: int diff = weechat_strncasecmp ("aabb", "aacc", 2); /* == 0 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_strcmp_ignore_chars ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -671,6 +691,10 @@ Esempio in C: int diff = weechat_strcmp_ignore_chars ("a-b", "--a-e", "-", 1); /* == -3 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_strcasestr ^^^^^^^^^^^^^^^^^^ @@ -700,6 +724,10 @@ Esempio in C: char *pos = weechat_strcasestr ("aBcDeF", "de"); /* risultato: puntatore a "DeF" */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_match ^^^^^^^^^^^^^^^^^^^^ @@ -780,6 +808,10 @@ char *str = weechat_string_replace ("test", "s", "x"); /* result: "text" */ free (str); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_expand_home ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -814,6 +846,10 @@ char *str = weechat_string_expand_home ("~/file.txt"); free (str); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_remove_quotes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -847,6 +883,10 @@ char *str = weechat_string_remove_quotes (string, " 'Non posso' ", "'"); free (str); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_strip ^^^^^^^^^^^^^^^^^^^^ @@ -880,6 +920,10 @@ char *str = weechat_string_strip (".abc -", 0, 1, "- ."); /* risultato: ".abc" * free (str); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_has_highlight ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1046,6 +1090,10 @@ argv = weechat_string_split (string, " ", 0, 0, &argc); weechat_string_free_split (argv); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_build_with_split_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1083,6 +1131,10 @@ char *str = weechat_string_build_with_split_string (argv, ";"); free (str); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_split_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1117,6 +1169,10 @@ char **argv = weechat_string_split_command ("/command1 arg;/command2", ';'); weechat_free_split_command (argv); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_free_split_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1143,6 +1199,10 @@ char **argv = weechat_string_split_command ("/command1 arg;/command2", ';'); weechat_free_split_command (argv); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_format_size ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1268,6 +1328,10 @@ weechat_string_encode_base64 (string, strlen (string), result); /* result == "YWJjZGVmZ2g=" */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_decode_base64 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1302,6 +1366,10 @@ length = weechat_string_decode_base64 (string, result); /* length == 8, result == "abcdefgh" */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_string_is_command_char ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1326,7 +1394,7 @@ Valore restituito: * 1 se il primo carattere della stringa è un comando carattere, altrimenti 0 -C examples: +Esempi in C: [source,C] ---------------------------------------- @@ -1341,7 +1409,7 @@ Script (Python): # prototype is_cmdchar = weechat.string_is_command_char(string) -# examples +# esempi command_char1 = weechat.string_is_command_char("/test") # == 1 command_char2 = weechat.string_is_command_char("test") # == 0 ---------------------------------------- @@ -1369,7 +1437,7 @@ Valore restituito: * puntatore all'interno di "string", oppure NULL -C examples: +Esempi in C: [source,C] ---------------------------------------- @@ -1385,7 +1453,7 @@ Script (Python): # prototype str = weechat.string_input_for_buffer(string) -# examples +# esempi str1 = weechat.string_input_for_buffer("test") # "test" str2 = weechat.string_input_for_buffer("/test") # "" str3 = weechat.string_input_for_buffer("//test") # "/test" @@ -1427,6 +1495,10 @@ if (weechat_utf8_has_8bits (string)) } ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_is_valid ^^^^^^^^^^^^^^^^^^^^^ @@ -1464,6 +1536,10 @@ else } ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_normalize ^^^^^^^^^^^^^^^^^^^^^^ @@ -1489,6 +1565,10 @@ Esempio in C: weechat_utf8_normalize (string, '?'); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_prev_char ^^^^^^^^^^^^^^^^^^^^^^ @@ -1519,6 +1599,10 @@ Esempio in C: char *prev_char = weechat_utf8_prev_char (string, ptr_in_string); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_next_char ^^^^^^^^^^^^^^^^^^^^^^ @@ -1547,6 +1631,10 @@ Esempio in C: char *next_char = weechat_utf8_next_char (string); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_char_int ^^^^^^^^^^^^^^^^^^^^^ @@ -1574,6 +1662,10 @@ Esempio in C: int char_int = weechat_utf8_char_int ("être"); /* "ê" come intero */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_char_size ^^^^^^^^^^^^^^^^^^^^^^ @@ -1601,6 +1693,10 @@ Esempio in C: int char_size = weechat_utf8_char_size ("être"); /* == 2 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_strlen ^^^^^^^^^^^^^^^^^^^ @@ -1628,6 +1724,10 @@ Esempio in C: int length = weechat_utf8_strlen ("chêne"); /* == 5 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_strnlen ^^^^^^^^^^^^^^^^^^^^ @@ -1657,6 +1757,10 @@ Esempio in C: int length = weechat_utf8_strnlen ("chêne", 4); /* == 3 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_strlen_screen ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1686,6 +1790,10 @@ Esempio in C: int length_on_screen = weechat_utf8_strlen_screen ("é"); /* == 1 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_charcmp ^^^^^^^^^^^^^^^^^^^^ @@ -1717,6 +1825,10 @@ Esempio in C: int diff = weechat_utf8_charcmp ("aaa", "ccc"); /* == -2 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_charcasecmp ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1748,6 +1860,10 @@ Esempio in C: int diff = weechat_utf8_charcasecmp ("aaa", "CCC"); /* == -2 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_char_size_screen ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1777,6 +1893,10 @@ Esempio in C: int length_on_screen = weechat_utf8_char_size_screen ("é"); /* == 1 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_add_offset ^^^^^^^^^^^^^^^^^^^^^^^ @@ -1806,6 +1926,10 @@ char *str = "chêne"; char *str2 = weechat_utf8_add_offset (str, 3); /* points to "ne" */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_real_pos ^^^^^^^^^^^^^^^^^^^^^ @@ -1834,6 +1958,10 @@ Esempio in C: int pos = weechat_utf8_real_pos ("chêne", 3); /* == 4 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_pos ^^^^^^^^^^^^^^^^ @@ -1862,6 +1990,10 @@ Esempio in C: int pos = weechat_utf8_pos ("chêne", 4); /* == 3 */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_utf8_strndup ^^^^^^^^^^^^^^^^^^^^ @@ -1892,6 +2024,10 @@ char *string = weechat_utf8_strndup ("chêne", 3); /* restituisce "chê" */ free (string); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + [[directories]] Cartelle ~~~~~~~~ @@ -2061,6 +2197,10 @@ void callback (void *data, const char *filename) weechat_exec_on_files ("/tmp", 0, NULL, &callback); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_file_get_content ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2095,6 +2235,10 @@ content = weechat_file_get_content ("/tmp/test.txt"); free (content); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + [[util]] Utilità ~~~~~~~ @@ -2134,6 +2278,10 @@ if (weechat_util_timeval_cmp (&tv1, &tv2) > 0) } ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_util_timeval_diff ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2162,6 +2310,10 @@ Esempio in C: long diff = weechat_util_timeval_diff (&tv1, &tv2); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_util_timeval_add ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2186,6 +2338,10 @@ Esempio in C: weechat_util_timeval_add (&tv, 2000); /* aggiunge 2 secondi */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_util_get_time_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2213,6 +2369,10 @@ weechat_printf (NULL, "date: %s", weechat_util_get_time_string (&date)); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + [[sorted_lists]] Elenchi ordinati ~~~~~~~~~~~~~~~~ @@ -2783,6 +2943,10 @@ struct t_hashtable *hashtable = weechat_hashtable_new (8, NULL); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_set_with_size ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2822,6 +2986,10 @@ weechat_hashtable_set_with_size (hashtable, "my_key", 0, my_buffer, sizeof (my_buffer_struct)); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_set ^^^^^^^^^^^^^^^^^^^^^ @@ -2884,6 +3052,10 @@ Esempio in C: void *value = weechat_hashtable_get (hashtable, "my_key"); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_map ^^^^^^^^^^^^^^^^^^^^^ @@ -2926,6 +3098,10 @@ map_cb (void *data, struct t_hashtable *hashtable, weechat_hashtable_map (hashtable, &map_cb, NULL); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_get_integer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2959,6 +3135,58 @@ Esempio in C: int items_count = weechat_hashtable_get_integer (hashtable, "items_count"); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + +// TRANSLATION MISSING +weechat_hashtable_get_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.4._ + +Return string value of a hashtable property. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_hashtable_get_string (struct t_hashtable *hashtable, + void *property); +---------------------------------------- + +Arguments: + +* 'hashtable': hashtable pointer +* 'property': property name: +** 'type_keys': type for keys: +*** 'integer': integer +*** 'string': string +*** 'pointer': pointer +*** 'buffer': buffer +*** 'time': time +** 'type_values': type for values: +*** 'integer': integer +*** 'string': string +*** 'pointer': pointer +*** 'buffer': buffer +*** 'time': time + +Return value: + +* string value of property + +Esempio in C: + +[source,C] +---------------------------------------- +const char *type_keys = weechat_hashtable_get_string (hashtable, "type_keys"); +---------------------------------------- + +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_add_to_infolist ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3002,6 +3230,10 @@ weechat_hashtable_add_to_infolist (hashtable, infolist_item, "testhash"); */ ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_remove ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3028,6 +3260,10 @@ Esempio in C: weechat_hashtable_remove (hashtable, "my_key"); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_remove_all ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3053,6 +3289,10 @@ Esempio in C: weechat_hashtable_remove_all (hashtable); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_hashtable_free ^^^^^^^^^^^^^^^^^^^^^^ @@ -3078,6 +3318,10 @@ Esempio in C: weechat_hashtable_free (hashtable); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + [[configuration_files]] File di configurazione ~~~~~~~~~~~~~~~~~~~~~~ @@ -3707,6 +3951,10 @@ else } ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_config_search_with_string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3754,6 +4002,10 @@ else } ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_config_string_to_boolean ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -4132,6 +4384,10 @@ Esempio in C: char *description = weechat_config_option_get_pointer (option, "description"); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_config_option_is_null ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -5403,6 +5659,10 @@ Esempio in C: weechat_printf_date (NULL, time (NULL) - 120, "Ciao, 2 minuti fa"); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_printf_tags ^^^^^^^^^^^^^^^^^^^ @@ -5431,6 +5691,10 @@ weechat_printf_tags (NULL, "notify_message", "Messaggio con tag 'notify_message'"); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_printf_date_tags ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -5576,7 +5840,7 @@ removed from string). Default priority is 1000. -C example: +Esempio in C: [source,C] ---------------------------------------- @@ -6951,7 +7215,8 @@ weechat.hook_modifier_exec("my_modifier", my_data, my_string) weechat_hook_info ^^^^^^^^^^^^^^^^^ -Hook su una informazione. +// TRANSLATION MISSING +Hook su una informazione (callback takes and returns a string). Prototipo: @@ -7016,6 +7281,83 @@ hook = weechat.hook_info("my_info", "Some info", "Info about arguments", "my_info_cb", "") ---------------------------------------- +// TRANSLATION MISSING +weechat_hook_info_hashtable +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.4._ + +Hook an information (callback takes and returns a hashtable). + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_info_hashtable (const char *info_name, + const char *description, + const char *args_description, + const char *output_description, + struct t_hashtable *(*callback)(void *data, + const char *info_name, + struct t_hashtable *hashtable), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'info_name': name of info + (priority allowed, see note about <<hook_priority,priority>>) +* 'description': description +* 'args_description': description of expected hashtable (optional, can be NULL) +* 'output_description': description of hashtable returned by callback + (optional, can be NULL) +* 'callback': function called when info is asked, arguments: +** 'void *data': pointer +** 'const char *info_name': name of info +** 'struct t_hashtable *hashtable': hashtable, depending on info +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hashtable * +my_info_hashtable_cb (void *data, const char *info_name, struct t_hashtable *hashtable) +{ + /* ... */ + return pointer_to_new_hashtable; +} + +/* add info "my_info_hashtable" */ +struct t_hook *my_info_hook = weechat_hook_info_hashtable ("my_info_hashtable", + "Some info", + "Info about input hashtable", + "Info about output hashtable", + &my_info_hashtable_cb, NULL); +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +hook = weechat.hook_info_hashtable(info_name, description, args_description, + output_description, callback, callback_data) + +# esempio +def my_info_hashtable_cb(data, info_name, hashtable): + return { "test_key": "test_value" } + +hook = weechat.hook_info_hashtable("my_info_hashtable", "Some info", + "Info about input hashtable", + "Info about output hashtable", + "my_info_hashtable_cb", "") +---------------------------------------- + weechat_hook_infolist ^^^^^^^^^^^^^^^^^^^^^ @@ -7898,6 +8240,10 @@ my_close_cb (void *data, struct t_gui_buffer *buffer) weechat_buffer_set_pointer (my_buffer, "close_callback", &my_close_cb); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_buffer_string_replace_local_var ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9017,6 +9363,10 @@ else } ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_network_connect_to ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9068,6 +9418,10 @@ else } ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + [[infos]] Info ~~~~ @@ -9077,7 +9431,8 @@ Funzioni per ottenere info. weechat_info_get ^^^^^^^^^^^^^^^^ -Restituisce informazioni da WeeChat o da un plugin. +// TRANSLATION MISSING +Return info, as string, from WeeChat or a plugin. Prototipo: @@ -9121,6 +9476,76 @@ weechat.prnt("", "Current WeeChat version is: %s (compiled on %s)" weechat.prnt("", "WeeChat home is: %s" % weechat.info_get("weechat_dir")) ---------------------------------------- +// TRANSLATION MISSING +weechat_info_get_hashtable +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_Novità nella versione 0.3.4._ + +Return info, as hashtable, from WeeChat or a plugin. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hashtable *weechat_info_get_hashtable (const char *info_name, + struct t_hashtable *hashtable); +---------------------------------------- + +Arguments: + +* 'info_name': name of info to read: +include::autogen/plugin_api/infos_hashtable.txt[] +* 'hashtable': hashtable with arguments (depends on info asked) (optional, NULL + if no argument is needed) + +Return value: + +* hashtable with info asked, NULL if an error occured + +Esempio in C: + +[source,C] +---------------------------------------- +struct t_hashtable *hashtable_in, *hashtable_out; + +hashtable_in = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +if (hashtable_in) +{ + weechat_hashtable_set (hashtable_in, "message", + ":nick!user@host PRIVMSG #weechat :message here"); + hashtable_out = weechat_info_get_hashtable ("irc_parse_message", + hashtable_in); + /* + * now hashtable_out has following keys/values: + * "nick" : "nick" + * "host" : "nick!user@host" + * "command" : "PRIVMSG" + * "channel" : "#weechat" + * "arguments": "#weechat :message here" + */ + weechat_hashtable_free (hashtable_in); + weechat_hashtable_free (hashtable_out); +} +---------------------------------------- + +Script (Python): + +[source,python] +---------------------------------------- +# prototype +dict = weechat.info_get_hashtable(info_name, dict_in) + +# esempio +dict_in = { "message": ":nick!user@host PRIVMSG #weechat :message here" } +weechat.prnt("", "message parsed: %s" + % weechat.info_get_hashtable("irc_parse_message", dict_in)) +---------------------------------------- + [[infolists]] Liste info ~~~~~~~~~~ @@ -9385,6 +9810,10 @@ struct t_infolist_var *var = weechat_infolist_new_variable_buffer (item, sizeof (buffer)); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_infolist_new_var_time ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9816,6 +10245,10 @@ weechat_printf (NULL, "buffer = 0x%lx, size = %d", pointer, size); ---------------------------------------- +[NOTE] +// TRANSLATION MISSING +This function is not available in scripting API. + weechat_infolist_time ^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/it/weechat_scripting.it.txt b/doc/it/weechat_scripting.it.txt index 75787e1da..62d51cb62 100644 --- a/doc/it/weechat_scripting.it.txt +++ b/doc/it/weechat_scripting.it.txt @@ -281,7 +281,7 @@ Elenco di funzioni nelle API per gli script: hook_command, hook_command_run, hook_timer, hook_fd, hook_process, hook_connect, hook_print, hook_signal, hook_signal_send, hook_config, hook_completion, hook_completion_list_add, hook_modifier, hook_modifier_exec, - hook_info, hook_infolist, unhook, unhook_all + hook_info, hook_info_hashtable, hook_infolist, unhook, unhook_all | buffer | buffer_new, current_buffer, buffer_search, buffer_search_main, buffer_clear, buffer_close, buffer_merge, buffer_unmerge, buffer_get_integer, @@ -300,7 +300,7 @@ Elenco di funzioni nelle API per gli script: | comandi | comando | info | - info_get + info_get, info_get_hashtable | liste info | infolist_new, infolist_new_item, infolist_new_var_integer, infolist_new_var_string, infolist_new_var_pointer, infolist_new_var_time, + diff --git a/doc/it/weechat_user.it.txt b/doc/it/weechat_user.it.txt index de0f9f339..5693a1db5 100644 --- a/doc/it/weechat_user.it.txt +++ b/doc/it/weechat_user.it.txt @@ -102,7 +102,7 @@ compilare WeeChat. | python-dev | no | plugin python | ruby1.8-dev | no | plugin ruby | liblua5.1-0-dev | no | plugin lua -| tcl-dev | no | plugin tcl +| tcl-dev (>= 8.5) | no | plugin tcl | asciidoc (>= 8.2) | no | compilazione della documentazione (file HTML) | source-highlight | no | evidenziazione della sintassi per i sorgenti nella documentazione HTML |======================================== @@ -525,7 +525,7 @@ Tasti per la riga di comando // TRANSLATION MISSING | Ctrl + R | Cerca il testo nella cronologia del buffer (due volte: cerca testo esatto), - next/previous occurences can be found with up and down arrows + + next/previous occurrences can be found with up and down arrows + `/input search_text` | Ctrl + T | |