diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-03-20 13:32:08 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-03-20 13:32:08 +0100 |
commit | 9d96090d7d6fe7841973f10c51710ec505ef034e (patch) | |
tree | 5d7a61bc51527f8be30bfc4aafa819f0352dbe77 /doc | |
parent | 2801b8437c0ee1c529244c1b7f7a6603e029a5a5 (diff) | |
download | weechat-9d96090d7d6fe7841973f10c51710ec505ef034e.zip |
Add functions string_match, string_has_highlight and string_mask_to_regex in script plugin API
Diffstat (limited to 'doc')
-rw-r--r-- | doc/en/weechat_plugin_api.en.txt | 64 | ||||
-rw-r--r-- | doc/en/weechat_scripting.en.txt | 7 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.txt | 64 | ||||
-rw-r--r-- | doc/fr/weechat_scripting.fr.txt | 7 |
4 files changed, 106 insertions, 36 deletions
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index d3e888f3b..651ca0ec9 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -681,6 +681,20 @@ int match3 = weechat_string_match ("abcdef", "*def", 0); /* == 1 */ int match4 = weechat_string_match ("abcdef", "*de*", 0); /* == 1 */ ---------------------------------------- +Script (Python): + +[source,python] +---------------------------------------- +# prototype +match = weechat.string_match(string, mask, case_sensitive) + +# examples +match1 = weechat.string_match("abcdef", "abc*", 0) # 1 +match2 = weechat.string_match("abcdef", "*dd*", 0) # 0 +match3 = weechat.string_match("abcdef", "*def", 0) # 1 +match4 = weechat.string_match("abcdef", "*de*", 0) # 1 +---------------------------------------- + weechat_string_replace ^^^^^^^^^^^^^^^^^^^^^^ @@ -809,6 +823,17 @@ C example: int hl = weechat_string_has_highlight ("my test string", "test,word2"); /* == 1 */ ---------------------------------------- +Script (Python): + +[source,python] +---------------------------------------- +# prototype +highlight = weechat.string_has_highlight(string, highlight_words) + +# example +highlight = weechat.string_has_highlight("my test string", "test,word2") # 1 +---------------------------------------- + weechat_string_mask_to_regex ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -840,6 +865,17 @@ char *str_regex = weechat_string_mask_to_regex ("test*mask"); free (str_regex); ---------------------------------------- +Script (Python): + +[source,python] +---------------------------------------- +# prototype +regex = weechat.string_mask_to_regex(mask) + +# example +regex = weechat.string_mask_to_regex("test*mask") # "test.*mask" +---------------------------------------- + weechat_string_split ^^^^^^^^^^^^^^^^^^^^ @@ -1204,7 +1240,7 @@ Script (Python): [source,python] ---------------------------------------- # prototype -weechat.string_is_command_char(string) +is_cmdchar = weechat.string_is_command_char(string) # examples command_char1 = weechat.string_is_command_char("/test") # == 1 @@ -3509,7 +3545,7 @@ Script (Python): [source,python] ---------------------------------------- # prototype -weechat.config_option_is_null(option) +is_null = weechat.config_option_is_null(option) # example if weechat.config_option_is_null(option): @@ -3556,7 +3592,7 @@ Script (Python): [source,python] ---------------------------------------- # prototype -weechat.config_option_default_is_null(option) +is_null = weechat.config_option_default_is_null(option) # example if weechat.config_option_default_is_null(option): @@ -9134,9 +9170,9 @@ Prototype: [source,C] ---------------------------------------- -struct t_upgrade_file *weechat_upgrade_write_object (struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist); +int weechat_upgrade_write_object (struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist); ---------------------------------------- Arguments: @@ -9168,7 +9204,7 @@ Script (Python): [source,python] ---------------------------------------- # prototype -weechat.upgrade_write_object(upgrade_file, object_id, infolist) +rc = weechat.upgrade_write_object(upgrade_file, object_id, infolist) # example weechat.upgrade_write_object(upgrade_file, 1, infolist) @@ -9183,12 +9219,12 @@ Prototype: [source,C] ---------------------------------------- -struct t_upgrade_file *weechat_upgrade_read (struct t_upgrade_file *upgrade_file, - int (*callback_read)(void *data, - struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist), - void *callback_read_data); +int weechat_upgrade_read (struct t_upgrade_file *upgrade_file, + int (*callback_read)(void *data, + struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist), + void *callback_read_data); ---------------------------------------- Arguments: @@ -9223,7 +9259,7 @@ Script (Python): [source,python] ---------------------------------------- # prototype -weechat.upgrade_read(upgrade_file, callback_read, callback_read_data) +rc = weechat.upgrade_read(upgrade_file, callback_read, callback_read_data) # example def my_upgrade_read_cb(upgrade_file, object_id, infolist): diff --git a/doc/en/weechat_scripting.en.txt b/doc/en/weechat_scripting.en.txt index cc223f618..ef4e58050 100644 --- a/doc/en/weechat_scripting.en.txt +++ b/doc/en/weechat_scripting.en.txt @@ -242,10 +242,9 @@ List of functions in script API: | plugins | plugin_get_name | strings | - charset_set, iconv_to_internal, iconv_from_internal, + - gettext, ngettext, - string_remove_color, + - string_is_command_char, string_input_for_buffer + charset_set, iconv_to_internal, iconv_from_internal, gettext, ngettext, + + string_match, string_has_highlight, string_mask_to_regex, + string_remove_color, string_is_command_char, string_input_for_buffer | directories | mkdir_home, mkdir, mkdir_parents | sorted lists | diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index 2213d75d4..435551aa5 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -688,6 +688,20 @@ int match3 = weechat_string_match ("abcdef", "*def", 0); /* == 1 */ int match4 = weechat_string_match ("abcdef", "*de*", 0); /* == 1 */ ---------------------------------------- +Script (Python) : + +[source,python] +---------------------------------------- +# prototype +match = weechat.string_match(string, mask, case_sensitive) + +# exemples +match1 = weechat.string_match("abcdef", "abc*", 0) # 1 +match2 = weechat.string_match("abcdef", "*dd*", 0) # 0 +match3 = weechat.string_match("abcdef", "*def", 0) # 1 +match4 = weechat.string_match("abcdef", "*de*", 0) # 1 +---------------------------------------- + weechat_string_replace ^^^^^^^^^^^^^^^^^^^^^^ @@ -818,6 +832,17 @@ Exemple en C : int hl = weechat_string_has_highlight ("my test string", "test,word2"); /* == 1 */ ---------------------------------------- +Script (Python) : + +[source,python] +---------------------------------------- +# prototype +highlight = weechat.string_has_highlight(string, highlight_words) + +# exemple +highlight = weechat.string_has_highlight("my test string", "test,word2") # 1 +---------------------------------------- + weechat_string_mask_to_regex ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -851,6 +876,17 @@ char *str_regex = weechat_string_mask_to_regex ("test*mask"); free (str_regex); ---------------------------------------- +Script (Python) : + +[source,python] +---------------------------------------- +# prototype +regex = weechat.string_mask_to_regex(mask) + +# exemple +regex = weechat.string_mask_to_regex("test*mask") # "test.*mask" +---------------------------------------- + weechat_string_split ^^^^^^^^^^^^^^^^^^^^ @@ -1219,7 +1255,7 @@ Script (Python) : [source,python] ---------------------------------------- # prototype -weechat.string_is_command_char(string) +is_cmdchar = weechat.string_is_command_char(string) # exemples command_char1 = weechat.string_is_command_char("/test") # == 1 @@ -3553,7 +3589,7 @@ Script (Python) : [source,python] ---------------------------------------- # prototype -weechat.config_option_is_null(option) +is_null = weechat.config_option_is_null(option) # exemple if weechat.config_option_is_null(option): @@ -3600,7 +3636,7 @@ Script (Python) : [source,python] ---------------------------------------- # prototype -weechat.config_option_default_is_null(option) +is_null = weechat.config_option_default_is_null(option) # exemple if weechat.config_option_default_is_null(option): @@ -9273,9 +9309,9 @@ Prototype : [source,C] ---------------------------------------- -struct t_upgrade_file *weechat_upgrade_write_object (struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist); +int weechat_upgrade_write_object (struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist); ---------------------------------------- Paramètres : @@ -9307,7 +9343,7 @@ Script (Python) : [source,python] ---------------------------------------- # prototype -weechat.upgrade_write_object(upgrade_file, object_id, infolist) +rc = weechat.upgrade_write_object(upgrade_file, object_id, infolist) # exemple weechat.upgrade_write_object(upgrade_file, 1, infolist) @@ -9322,12 +9358,12 @@ Prototype : [source,C] ---------------------------------------- -struct t_upgrade_file *weechat_upgrade_read (struct t_upgrade_file *upgrade_file, - int (*callback_read)(void *data, - struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist), - void *callback_read_data); +int weechat_upgrade_read (struct t_upgrade_file *upgrade_file, + int (*callback_read)(void *data, + struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist), + void *callback_read_data); ---------------------------------------- Paramètres : @@ -9363,7 +9399,7 @@ Script (Python) : [source,python] ---------------------------------------- # prototype -weechat.upgrade_read(upgrade_file, callback_read, callback_read_data) +rc = weechat.upgrade_read(upgrade_file, callback_read, callback_read_data) # exemple def my_upgrade_read_cb(upgrade_file, object_id, infolist): diff --git a/doc/fr/weechat_scripting.fr.txt b/doc/fr/weechat_scripting.fr.txt index d224ffcbe..ba9aa1e2d 100644 --- a/doc/fr/weechat_scripting.fr.txt +++ b/doc/fr/weechat_scripting.fr.txt @@ -251,10 +251,9 @@ Liste des fonctions de l'API script : | extensions | plugin_get_name | chaînes | - charset_set, iconv_to_internal, iconv_from_internal, + - gettext, ngettext, - string_remove_color, + - string_is_command_char, string_input_for_buffer + charset_set, iconv_to_internal, iconv_from_internal, gettext, ngettext, + + string_match, string_has_highlight, string_mask_to_regex, + string_remove_color, string_is_command_char, string_input_for_buffer | répertoires | mkdir_home, mkdir, mkdir_parents | listes triées | |