36 |
|
|
37 |
@title WeeChat - Guia do Utilizador |
@title WeeChat - Guia do Utilizador |
38 |
@subtitle Cliente de IRC rapido, leve e extencivel |
@subtitle Cliente de IRC rapido, leve e extencivel |
39 |
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.6-cvs - 25 de outubro de 2005 |
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.6-cvs - 28 de outubro de 2005 |
40 |
|
|
41 |
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}> |
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}> |
42 |
|
|
585 |
Create a FIFO pipe for remote control@* |
Create a FIFO pipe for remote control@* |
586 |
Type: boolean (values: 'on' or 'off'), default value: 'off'@* |
Type: boolean (values: 'on' or 'off'), default value: 'off'@* |
587 |
@item irc_highlight |
@item irc_highlight |
588 |
Comma separated list of words to highlight (case insensitive comparison)@* |
Comma separated list of words to highlight (case insensitive comparison, words may begin or end with "*" for partial match)@* |
589 |
Type: string (any string), default value: ''@* |
Type: string (any string), default value: ''@* |
590 |
@item dcc_auto_accept_files |
@item dcc_auto_accept_files |
591 |
Automatically accept incoming dcc files@* |
Automatically accept incoming dcc files@* |
1556 |
@item functions for init and end of plugin: |
@item functions for init and end of plugin: |
1557 |
@itemize @minus |
@itemize @minus |
1558 |
@item weechat_plugin_init: function called when plugin is loaded, |
@item weechat_plugin_init: function called when plugin is loaded, |
1559 |
must return 1 if successful, 0 if error |
must return PLUGIN_RC_OK (0) if successful, PLUGIN_RC_KO (-1) if error |
1560 |
@item weechat_plugin_end: function called when plugin is unloaded, |
@item weechat_plugin_end: function called when plugin is unloaded |
|
must return 1 if successful, 0 if error |
|
1561 |
@end itemize |
@end itemize |
1562 |
@end itemize |
@end itemize |
1563 |
|
|
1573 |
@command{int ascii_strcasecmp (t_weechat_plugin *plugin, |
@command{int ascii_strcasecmp (t_weechat_plugin *plugin, |
1574 |
char *string1, char *string2)}@* |
char *string1, char *string2)}@* |
1575 |
@* |
@* |
1576 |
locale and case independent string comparison.@* |
Locale and case independent string comparison.@* |
1577 |
|
|
1578 |
@emph{Arguments:} |
@emph{Arguments:} |
1579 |
@itemize @minus |
@itemize @minus |
1596 |
@command{int ascii_strncasecmp (t_weechat_plugin *plugin, |
@command{int ascii_strncasecmp (t_weechat_plugin *plugin, |
1597 |
char *string1, char *string2, int max)}@* |
char *string1, char *string2, int max)}@* |
1598 |
@* |
@* |
1599 |
locale and case independent string comparison, for ``max'' chars.@* |
Locale and case independent string comparison, for ``max'' chars.@* |
1600 |
|
|
1601 |
@emph{Arguments:} |
@emph{Arguments:} |
1602 |
@itemize @minus |
@itemize @minus |
1709 |
char *server, char *channel, char *message, ...)}@* |
char *server, char *channel, char *message, ...)}@* |
1710 |
@* |
@* |
1711 |
Display a message on a WeeChat buffer, identified by server and |
Display a message on a WeeChat buffer, identified by server and |
1712 |
channel (both may be NULL).@* |
channel (both may be NULL for current buffer).@* |
1713 |
|
|
1714 |
@emph{Arguments:} |
@emph{Arguments:} |
1715 |
@itemize @minus |
@itemize @minus |
1803 |
void *handler_pointer)}@* |
void *handler_pointer)}@* |
1804 |
@code{@{}@* |
@code{@{}@* |
1805 |
@code{@ @ @ @ plugin->printf (plugin, server, NULL, "KICK received");}@* |
@code{@ @ @ @ plugin->printf (plugin, server, NULL, "KICK received");}@* |
1806 |
|
@code{@ @ @ @ return PLUGIN_RC_OK;}@* |
1807 |
@code{@}}@* |
@code{@}}@* |
1808 |
@code{...}@* |
@code{...}@* |
1809 |
@code{plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);}@* |
@code{plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);}@* |
1810 |
@* |
@* |
1811 |
|
@emph{Notes:}@* |
1812 |
|
@* |
1813 |
|
Function called when message is received has to return one of these values:@* |
1814 |
|
@itemize @minus |
1815 |
|
@item @option{PLUGIN_RC_KO or -1}: function failed |
1816 |
|
@item @option{PLUGIN_RC_OK or 0}: function successfully completed |
1817 |
|
@item @option{PLUGIN_RC_OK_IGNORE_WEECHAT or 1}: message will not be sent to |
1818 |
|
WeeChat |
1819 |
|
@item @option{PLUGIN_RC_OK_IGNORE_PLUGINS or 2}: message will not be sent to |
1820 |
|
other plugins |
1821 |
|
@item @option{PLUGIN_RC_OK_IGNORE_ALL or 3}: message will not be sent to |
1822 |
|
WeeChat neither other plugins |
1823 |
|
@end itemize |
1824 |
|
@* |
1825 |
|
|
1826 |
@item |
@item |
1827 |
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin |
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin |
1835 |
@emph{Arguments:} |
@emph{Arguments:} |
1836 |
@itemize @minus |
@itemize @minus |
1837 |
@item @option{plugin}: pointer to plugin structure |
@item @option{plugin}: pointer to plugin structure |
1838 |
@item @option{commande}: the new command |
@item @option{command}: the new command |
1839 |
@item @option{description}: command description (displayed by /help |
@item @option{description}: command description (displayed by /help |
1840 |
command) |
command) |
1841 |
@item @option{arguments}: short description of command arguments |
@item @option{arguments}: short description of command arguments |
1859 |
@code{@{}@* |
@code{@{}@* |
1860 |
@code{@ @ @ @ plugin->printf (plugin, server, NULL, "test command, |
@code{@ @ @ @ plugin->printf (plugin, server, NULL, "test command, |
1861 |
file: %s", (arguments) ? arguments : "none");}@* |
file: %s", (arguments) ? arguments : "none");}@* |
1862 |
|
@code{@ @ @ @ return PLUGIN_RC_OK;}@* |
1863 |
@code{@}}@* |
@code{@}}@* |
1864 |
@code{...}@* |
@code{...}@* |
1865 |
@code{plugin->cmd_handler_add (plugin, "test", "Test command", |
@code{plugin->cmd_handler_add (plugin, "test", "Test command", |
1866 |
"[file]", "file: a file name", &cmd_test, NULL, NULL);}@* |
"[file]", "file: a file name", &cmd_test, NULL, NULL);}@* |
1867 |
@* |
@* |
1868 |
|
@emph{Notes:}@* |
1869 |
|
@* |
1870 |
|
Function called when message is received has to return one of these values:@* |
1871 |
|
@itemize @minus |
1872 |
|
@item @option{PLUGIN_RC_KO or -1}: function failed |
1873 |
|
@item @option{PLUGIN_RC_OK or 0}: function successfully completed |
1874 |
|
@end itemize |
1875 |
|
@* |
1876 |
|
|
1877 |
@item |
@item |
1878 |
@command{void handler_remove (t_weechat_plugin *plugin, |
@command{void handler_remove (t_weechat_plugin *plugin, |
2153 |
char plugin_version[] = "0.1"; |
char plugin_version[] = "0.1"; |
2154 |
char plugin_description[] = "Test plugin for WeeChat"; |
char plugin_description[] = "Test plugin for WeeChat"; |
2155 |
|
|
2156 |
/* gestionnaire de commande "/hello" */ |
/* "/hello" command handler */ |
2157 |
|
|
2158 |
int toto_cmd_double (t_weechat_plugin *plugin, char *server, |
int toto_cmd_double (t_weechat_plugin *plugin, char *server, |
2159 |
char *command, char *arguments, |
char *command, char *arguments, |
2164 |
plugin->exec_command (plugin, NULL, NULL, arguments); |
plugin->exec_command (plugin, NULL, NULL, arguments); |
2165 |
plugin->exec_command (plugin, NULL, NULL, arguments); |
plugin->exec_command (plugin, NULL, NULL, arguments); |
2166 |
} |
} |
2167 |
return 1; |
return PLUGIN_RC_OK; |
2168 |
} |
} |
2169 |
|
|
2170 |
int weechat_plugin_init (t_weechat_plugin *plugin) |
int weechat_plugin_init (t_weechat_plugin *plugin) |
2175 |
"msg: message", |
"msg: message", |
2176 |
&toto_cmd_double, |
&toto_cmd_double, |
2177 |
NULL, NULL); |
NULL, NULL); |
2178 |
return 1; |
return PLUGIN_RC_OK; |
2179 |
} |
} |
2180 |
|
|
2181 |
int weechat_plugin_end (t_weechat_plugin *plugin) |
void weechat_plugin_end (t_weechat_plugin *plugin) |
2182 |
{ |
{ |
2183 |
/* on ne fait rien ici */ |
/* nothing done here */ |
|
return 1; |
|
2184 |
} |
} |
2185 |
@end verbatim |
@end verbatim |
2186 |
|
|
2304 |
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@* |
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@* |
2305 |
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@* |
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@* |
2306 |
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* |
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* |
2307 |
|
@code{@ @ @ @ return 0;}@* |
2308 |
@code{@} }@* |
@code{@} }@* |
2309 |
@* |
@* |
2310 |
|
@emph{Notes:}@* |
2311 |
|
@* |
2312 |
|
Function called when message is received has to return one of these values:@* |
2313 |
|
@itemize @minus |
2314 |
|
@item @option{-1}: function failed |
2315 |
|
@item @option{0}: function successfully completed |
2316 |
|
@item @option{1}: message will not be sent to WeeChat |
2317 |
|
@item @option{2}: message will not be sent to other plugins |
2318 |
|
@item @option{3}: message will not be sent to WeeChat neither other plugins |
2319 |
|
@end itemize |
2320 |
|
@* |
2321 |
|
|
2322 |
@item |
@item |
2323 |
@command{weechat::add_command_handler ( nome, fun@,{c}@~ao );}@* |
@command{weechat::add_command_handler ( nome, fun@,{c}@~ao );}@* |
2351 |
@code{@ @ @ @ return 0;}@* |
@code{@ @ @ @ return 0;}@* |
2352 |
@code{@} }@* |
@code{@} }@* |
2353 |
@* |
@* |
2354 |
|
@emph{Notes:}@* |
2355 |
|
@* |
2356 |
|
Function called when command is executed has to return one of these values:@* |
2357 |
|
@itemize @minus |
2358 |
|
@item @option{-1}: function failed |
2359 |
|
@item @option{0}: function successfully completed |
2360 |
|
@end itemize |
2361 |
|
@* |
2362 |
|
|
2363 |
@item |
@item |
2364 |
@command{weechat::remove_handler ( name, function );}@* |
@command{weechat::remove_handler ( name, function );}@* |
2680 |
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@* |
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@* |
2681 |
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@* |
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@* |
2682 |
@code{@ @ @ @ weechat.prnt("host="+hostmask+", chan="+channel+", msg="+message)}@* |
@code{@ @ @ @ weechat.prnt("host="+hostmask+", chan="+channel+", msg="+message)}@* |
2683 |
|
@code{@ @ @ @ return 0}@* |
2684 |
|
@* |
2685 |
|
@emph{Notes:}@* |
2686 |
|
@* |
2687 |
|
Function called when message is received has to return one of these values:@* |
2688 |
|
@itemize @minus |
2689 |
|
@item @option{-1}: function failed |
2690 |
|
@item @option{0}: function successfully completed |
2691 |
|
@item @option{1}: message will not be sent to WeeChat |
2692 |
|
@item @option{2}: message will not be sent to other plugins |
2693 |
|
@item @option{3}: message will not be sent to WeeChat neither other plugins |
2694 |
|
@end itemize |
2695 |
@* |
@* |
2696 |
|
|
2697 |
@item |
@item |
2723 |
@code{def my_command(server, args):}@* |
@code{def my_command(server, args):}@* |
2724 |
@code{@ @ @ @ weechat.prnt("Servidor:"+server+" Argumentos:"+args)}@* |
@code{@ @ @ @ weechat.prnt("Servidor:"+server+" Argumentos:"+args)}@* |
2725 |
@* |
@* |
2726 |
|
@emph{Notes:}@* |
2727 |
|
@* |
2728 |
|
Function called when command is executed has to return one of these values:@* |
2729 |
|
@itemize @minus |
2730 |
|
@item @option{-1}: function failed |
2731 |
|
@item @option{0}: function successfully completed |
2732 |
|
@end itemize |
2733 |
|
@* |
2734 |
|
|
2735 |
@item |
@item |
2736 |
@command{weechat.remove_handler ( name, function );}@* |
@command{weechat.remove_handler ( name, function );}@* |