diff options
Diffstat (limited to 'doc/weechat_doc_es.texi')
-rw-r--r-- | doc/weechat_doc_es.texi | 877 |
1 files changed, 801 insertions, 76 deletions
diff --git a/doc/weechat_doc_es.texi b/doc/weechat_doc_es.texi index df574373c..de0cd21fe 100644 --- a/doc/weechat_doc_es.texi +++ b/doc/weechat_doc_es.texi @@ -36,7 +36,7 @@ @title WeeChat - Gui@'on de usuario. @subtitle Cliente IRC r@'apido, peque@~no y extensible -@subtitle Documentaci@'on para WeeChat v0.1.6-cvs - 2 de octubre de 2005 +@subtitle Documentaci@'on para WeeChat v0.1.6-cvs - 17 de octubre de 2005 @author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}> @@ -66,7 +66,7 @@ License versi@'on 2 o posterior. * Introduccion:: Presentaci@'on de WeeChat * Instalacion:: Instalaci@'on de WeeChat * Uso:: Utilizaci@'on de WeeChat -* Extensiones:: Extensiones de WeeChat +* Plugins:: WeeChat plugins * Autores / Soporte:: Contactar los autores y obtener soporte @end menu @@ -201,7 +201,7 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente @c ******************************* Utilisaci@'on ******************************** -@node Uso, Extensiones, Instalacion, Top +@node Uso, Plugins, Instalacion, Top @chapter Uso @menu @@ -429,7 +429,7 @@ Color para el texto de entrada (alias)@* Typo: color (color Curses @'o Gtk), valor por defecto: 'lightcyan'@* @item col_input_delimiters Color for input text (delimiters)@* -Typo: color (color Curses @'o Gtk), valor por defecto: 'cyan'@* +Typo: color (color Curses @'o Gtk), valor por defecto: 'lightgreen'@* @item col_input_bg Color de fondo para la ventana de entrada@* Typo: color (color Curses @'o Gtk), valor por defecto: 'default'@* @@ -628,6 +628,15 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@* @item proxy_password Contrase@~na para el servidor proxy@* Typo: cadena (cualquier cadena), valor por defecto: ''@* +@item plugins_path +Path for searching plugins@* +Typo: cadena (cualquier cadena), valor por defecto: '~/.weechat/plugins'@* +@item plugins_autoload +Comma separated list of plugins to load automatically at startup, "*" means all plugins found (names may be partial, for example "perl" is ok for "libperl.so")@* +Typo: cadena (cualquier cadena), valor por defecto: '*'@* +@item plugins_extension +Standard plugins extension in filename, used for autoload (if empty, then all files are loaded when autoload is "*")@* +Typo: cadena (cualquier cadena), valor por defecto: '.so'@* @item server_name Nombre asociado al servidor IRC (para mostrar solamente)@* Typo: cadena (cualquier cadena), valor por defecto: ''@* @@ -906,29 +915,13 @@ desatar: desata una clave(si "all", se restauran los anclajes por defecto)@* funciones: lista funciones internas para el anclaje de claves@* reset: restaura anclajes a los valores por defecto y elimina todos los anclajes personales (usar cuidadosamente)@* @* -@item perl [load fichero] | [autoload] | [reload] | [unload] -@* -lista/carga/descarga de los Perl scripts@* -@* -fichero: Perl script (archivo) a cargar@* -@* -Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@* -@* -@item python [load fichero] | [autoload] | [reload] | [unload] +@item plugin [load fichero] | [autoload] | [reload] | [unload] @* -lista/carga/descarga de los Python scripts@* +list/load/unload plugins@* @* -fichero: Python script (archivo) a cargar@* +filename: WeeChat plugin (file) to load@* @* -Sin argumentos, el comando /python lista todos los Python scripts cargados.@* -@* -@item ruby [load fichero] | [autoload] | [reload] | [unload] -@* -lista/carga/descarga de los Ruby scripts@* -@* -fichero: Ruby script (archivo) a cargar@* -@* -Sin argumentos, el comando /ruby lista todos los Ruby scripts cargados.@* +Without argument, /plugin command lists all loaded plugins.@* @* @item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-ipv6] [-ssl] [-pwd contrase@~na] [-nicks alias1 alias2 alias3] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor] @* @@ -1141,25 +1134,26 @@ mensaje: mensaje a enviar@* @* cambiar modo del canal o del usuario@* @* -modos del canal:@* - canal: nombre del canal a modificar@* - o: dar/coger privilegios de operador de canal@* - p: indicador de canal privado@* - s: indicador de canal secreto@* - i: indicador de canal s@'olo con invitaci@'on@* - t: indicador de tema s@'olo modificable por operador de canal@* - n: ningún mensaje al canal desde el exterior@* - m: canal moderado@* - l: fijar el l@'imite de usuarios para el canal@* - b: establecer una m@'ascara de baneo para mantener fuera a usuarios@* - v: dar/quitar la capacidad de hablar en un canal moderado@* - k: definir una clave (contrase@~na) de canal@* -modos de usuario:@* - usuario: usuario a modificar@* - i: marcar a un usuario como invisible@* - s: marcar a un usuario para recibir noticias del servidor@* - w: el usuario recibe golpes@* - o: indicador de operador@* +channel modes:@* + channel: channel name to modify@* + o: give/take channel operator privileges@* + p: private channel flag@* + s: secret channel flag@* + i: invite-only channel flag@* + t: topic settable by channel operator only flag@* + n: no messages to channel from clients on the outside@* + m: moderated channel@* + l: set the user limit to channel@* + b: set a ban mask to keep users out@* + e: set exception mask@* + v: give/take the ability to speak on a moderated channel@* + k: set a channel key (password)@* +user modes:@* + nickname: nickname to modify@* + i: mark a user as invisible@* + s: mark a user for receive server notices@* + w: user receives wallops@* + o: operator flag@* @* @item motd [target] @* @@ -1502,21 +1496,613 @@ Si el script se llama "auto_weechat_command", puedes ejecutarlo hac@'i:@* @command{./auto_weechat_command "freenode,#weechat *Hola"} -@c ******************************* Extensions ********************************* +@c ******************************** Plugins *********************************** -@node Extensiones, Autores / Soporte, Uso, Top -@chapter Extensiones +@node Plugins, Autores / Soporte, Uso, Top +@chapter Plugins @menu -* Programas Perl:: -* Programas Python:: -* Programas Ruby:: +* Plugins in WeeChat:: +* Write a plugin:: +* Plugin example:: +* Scripts plugins:: @end menu -@node Programas Perl, Programas Python, Extensiones, Extensiones -@section Programas Perl +@node Plugins in WeeChat, Write a plugin, Plugins, Plugins +@section Plugins in WeeChat + +A plugin is a C program which can call WeeChat functions defined in an +interface.@* +@* +This C program does not need WeeChat sources to compile and can be +dynamically loaded into WeeChat with command @command{/plugin}.@* +@* +The plugin has to be a dynamic library, for dynamic loading by +operating system. +Under GNU/Linux, the file has ``.so'' extension. + +@node Write a plugin, Plugin example, Plugins in WeeChat, Plugins +@section Write a plugin + +@subsection Base rules + +The plugin should include ``weechat-plugin.h'' file (available in +WeeChat source code).@* +This file defines structures and types used to communicate with WeeChat.@* +@* +The plugin must have some variables and functions (mandatory, without +them the plugin can't load):@* +@itemize @bullet +@item variables for plugin description: +@itemize @minus +@item plugin_name[]: plugin name +@item plugin_version[]: plugin version +@item plugin_description[]: short description of plugin +@end itemize +@item functions for init and end of plugin: +@itemize @minus +@item weechat_plugin_init: function called when plugin is loaded +@item weechat_plugin_end: function called when plugin is unloaded +@end itemize +@end itemize + +@subsection API functions + +The plugin can call some functions defined in t_weechat_plugin structure.@* +These functions are detailed below: + +@itemize @bullet +@item +@command{int ascii_strcasecmp (t_weechat_plugin *plugin, +char *string1, char *string2)}@* +@* +locale and case independent string comparison.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{string1}: first string for comparison +@item @option{string2}: second string for comparison +@end itemize +@* +@emph{Return value:}@* +@* +Difference between two strings: negative if chaine1 < chaine2, +nul if chaine1 == chaine 2, positive if chaine1 > chaine2@* +@* +@emph{Example:}@* +@* +@code{if (plugin->ascii_strcasecmp (plugin, "abc", "def") != 0) ...}@* + +@* + +@item +@command{char **explode_string (t_weechat_plugin *plugin, +char *string, char *separators, int num_items_max, int *num_items)}@* +@* +Explode a string according to one or more delimiter(s).@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{string}: string to explode +@item @option{separators}: delimiters used for explosion +@item @option{num_items_max}: maximum number of items created (0 means +no limit) +@item @option{num_items}: pointer to int which will contain number of +items created +@end itemize +@* +@emph{Return value:}@* +@* +Array of strings, NULL if problem.@* +Note: the result has to be free by a call to ``free_exploded_string'' +function after use.@* +@* +@emph{Example:}@* +@* +@code{char *argv;}@* +@code{int argc;}@* +@code{argv = plugin->explode_string (plugin, string, " ", 0, &argc);}@* +@code{...}@* +@code{if (argv != NULL)}@* +@code{plugin->free_exploded_string (plugin, argv);}@* +@* + +@item +@command{char **free_exploded_string (t_weechat_plugin *plugin, +char **string)}@* +@* +Free memory used by a string explosion.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{string}: string exploded by ``explode_string'' function +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example:}@* +@* +@code{char *argv;}@* +@code{int argc;}@* +@code{argv = plugin->explode_string (plugin, string, " ", 0, &argc);}@* +@code{...}@* +@code{if (argv != NULL)}@* +@code{plugin->free_exploded_string (plugin, argv);}@* +@* + +@item +@command{void exec_on_files (t_weechat_plugin *plugin, char *directory, +int (*callback)(t_weechat_plugin *, char *))}@* +@* +Execute a function on all files of a directory.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{directory}: directory for searching files +@item @option{callback}: function called for each file found +@end itemize +@* +@emph{Return value:}@* +@* +Aucune.@* +@* +@emph{Exemple :}@* +@* +@code{int callback (t_weechat_plugin *plugin, char *file)}@* +@code{@{}@* +@code{@ @ @ @ plugin->printf_server (plugin, "file: %s", file);}@* +@code{@ @ @ @ return 1;}@* +@code{@}}@* +@code{}@* +@code{...}@* +@code{plugin->exec_on_files (plugin, "/tmp", &callback);}@* +@* + +@item +@command{void printf (t_weechat_plugin *plugin, +char *server, char *channel, char *message, ...)}@* +@* +Display a message on a WeeChat buffer, identified by server and +channel (both may be NULL).@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{server}: name of server to find buffer for message +display (may be NULL) +@item @option{channel}: name of channel to find buffer for message +display (may be NULL) +@item @option{message}: message +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Examples:}@* +@* +@code{plugin->printf (NULL, NULL, "hello");}@* +@code{plugin->printf (NULL, "#weechat", "hello");}@* +@code{plugin->printf ("freenode", "#weechat", "hello");}@* +@* + +@item +@command{void printf_server (t_weechat_plugin *plugin, +char *message, ...)}@* +@* +Display a message on server buffer.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{message}: message +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example:}@* +@* +@code{plugin->printf_server ("hello");}@* +@* + +@item +@command{void printf_infobar (t_weechat_plugin *plugin, +int time, char *message, ...)}@* +@* +Display a message in infobar for a specified time.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{time}: time in seconds for displaying message (0 means +never erased) +@item @option{message}: message +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example:}@* +@* +@code{plugin->printf_infobar (5, "hello");}@* +@* + +@item +@command{t_plugin_msg_handler *msg_handler_add (t_weechat_plugin +*plugin, char *message, t_plugin_handler_func *handler_func, +char *handler_args, void *handler_pointer)}@* +@* +Add an IRC message handler, called when an IRC message is received.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{message}: IRC message (for example: ``PRIVMSG'') +@item @option{handler_func}: function called when message is received +@item @option{handler_args}: arguments given to function when called +@item @option{handler_pointer}: pointer given to function when called +@end itemize +@* +@emph{Return value:}@* +@* +Pointer to new message handler.@* +@* +@emph{Example:}@* +@* +@code{int msg_kick (t_weechat_plugin *plugin, char *server, +char *command, char *arguments, char *handler_args, +void *handler_pointer)}@* +@code{@{}@* +@code{@ @ @ @ plugin->printf (plugin, server, NULL, "KICK received");}@* +@code{@}}@* +@code{...}@* +@code{plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);}@* +@* + +@item +@command{void msg_handler_remove (t_weechat_plugin *plugin, +t_plugin_msg_handler *msg_handler)}@* +@* +Remove an IRC message handler.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{msg_handler}: handler to remove +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example:}@* +@* +@code{plugin->msg_handler_remove (plugin, my_msg_handler);}@* +@* + +@item +@command{void msg_handler_remove_all (t_weechat_plugin *plugin)}@* +@* +Remove all IRC message handlers for a plugin.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example:}@* +@* +@code{plugin->msg_handler_remove_all (plugin);}@* +@* + +@item +@command{t_plugin_cmd_handler *cmd_handler_add (t_weechat_plugin +*plugin, char *command, char *description, char *arguments, +char *arguments_description, t_plugin_handler_func *handler_func, +char *handler_args, void *handler_pointer)}@* +@* +Add a WeeChat command handler, called when user uses command +(for example /command).@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{commande}: the new command +@item @option{description}: command description (displayed by /help +command) +@item @option{arguments}: short description of command arguments +(displayed by /help command) +@item @option{arguments_description}: long description of command +arguments (displayed by /help command) +@item @option{handler_func}: function called when comand is executed +@item @option{handler_args}: arguments given to function when called +@item @option{handler_pointer}: pointer given to function when called +@end itemize +@* +@emph{Return value:}@* +@* +Pointer to new command handler.@* +@* +@emph{Example:}@* +@* +@code{int cmd_test (t_weechat_plugin *plugin, char *server, +char *command, char *arguments, char *handler_args, +void *handler_pointer)}@* +@code{@{}@* +@code{@ @ @ @ plugin->printf (plugin, server, NULL, "test command, +file: %s", (arguments) ? arguments : "none");}@* +@code{@}}@* +@code{...}@* +@code{plugin->cmd_handler_add (plugin, "test", "Test command", +"[file]", "file: a file name", &cmd_test, NULL, NULL);}@* +@* + +@item +@command{void cmd_handler_remove (t_weechat_plugin *plugin, +t_plugin_cmd_handler *cmd_handler)}@* +@* +Remove a command handler.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{cmd_handler}: command handler to remove +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example:}@* +@* +@code{plugin->cmd_handler_remove (plugin, my_cmd_handler);}@* +@* + +@item +@command{void cmd_handler_remove_all (t_weechat_plugin *plugin)}@* +@* +Remove all command handlers for a plugin.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example :}@* +@* +@code{plugin->cmd_handler_remove_all (plugin);}@* +@* + +@item +@command{void exec_command (t_weechat_plugin +*plugin, char *server, char *channel, char *command)}@* +@* +Execute a WeeChat command (or send a message to a channel).@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{server}: name of server for executing command (may be +NULL) +@item @option{channel}: name of channel for executing command (may be +NULL) +@item @option{command}: command +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Examples:}@* +@* +@code{plugin->exec_command (plugin, NULL, NULL, "/help nick");}@* +@code{plugin->exec_command (plugin, "freenode", "#weechat", "hello");}@* +@* + +@item +@command{char *get_info (t_weechat_plugin +*plugin, char *info, char *server, char *channel)}@* +@* +Return an info about WeeChat or a channel.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{info}: name of info to read: +@itemize @minus +@item @option{version}: get WeeChat's version +@item @option{nick}: get nick +@item @option{channel}: get channel name +@item @option{server}: get server name +@item @option{away}: get ``away'' flag +@item @option{weechat_dir}: get WeeChat home dir +@item @option{weechat_libdir}: get WeeChat system lib dir +@item @option{weechat_sharedir}: get WeeChat system share dir +@end itemize +@item @option{server}: name of server for reading info (if needed) +@item @option{channel}: name of channel for reading info (if needed) +@end itemize +@* +@emph{Return value:}@* +@* +Information asked, NULL if not found.@* +Note: result has to be free by a call to ``free'' function after +use.@* +@* +@emph{Examples:}@* +@* +@code{char *version = plugin->get_info (plugin, "version", NULL, NULL);}@* +@code{char *nick = plugin->get_info (plugin, "nick", "freenode", NULL);}@* +@* + +@item +@command{t_plugin_info_dcc *get_dcc_info (t_weechat_plugin *plugin)}@* +@* +Returns list of DCC currently active or finished.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@end itemize +@* +@emph{Return value:}@* +@* +Chained list of DCC.@* +Note: result has to be free by a call to ``free_dcc_info'' function +after use.@* +@* +@emph{Example:}@* +@* +@code{t_plugin_dcc_info *dcc_info = plugin->get_dcc_info (plugin);}@* +@code{for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = +ptr_dcc->next_dcc)}@* +@code{@{}@* +@code{@ @ @ @ plugin->printf_server (plugin, "DCC type=%d, with: %s", +ptr_dcc->type, ptr_dcc->nick);}@* +@code{@}}@* +@* + +@item +@command{void free_dcc_info (t_weechat_plugin *plugin, +t_plugin_dcc_info *dcc_info)}@* +@* +Free memory used by a DCC list.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{dcc_info}: pointer to DCC list returned by +``get_dcc_info'' function +@end itemize +@* +@emph{Return value:}@* +@* +None.@* +@* +@emph{Example:}@* +@* +@code{plugin->free_dcc_info (plugin, dcc_info);}@* +@* + +@item +@command{char *get_config (t_weechat_plugin +*plugin, char *option)}@* +@* +Return value of a WeeChat config option.@* + +@emph{Arguments:} +@itemize @minus +@item @option{plugin}: pointer to plugin structure +@item @option{option}: name of option to read +@end itemize +@* +@emph{Return value:}@* +@* +Value of option, NULL if not found.@* +Note: result has to be free by a call to ``free'' function after +use.@* +@* +@emph{Examples:}@* +@* +@code{char *value1 = plugin->get_config (plugin, "look_set_title");}@* +@code{char *value2 = plugin->get_config (plugin, "freenode.server_autojoin");}@* +@* + +@end itemize + +@subsection Compile plugin + +Compile does not need WeeChat sources, only file +``weechat-plugin.h''.@* + +To compile a plugin which has one file ``toto.c'' (sous GNU/Linux):@* +@* +gcc -fPIC -Wall -c toto.c@* +gcc -shared -fPIC -o libtoto.so toto.o + +@subsection Load plugin under WeeChat -@subsection Cargar/descargar programas Perl +Copy ``libtoto.so'' file into general plugins dir (for example +/usr/local/lib/weechat/plugins) or into user's plugins dir (for +example /home/xxxxx/.weechat/plugins).@* +@* +Under WeeChat:@* +@command{/plugin load toto} + +@node Plugin example, Scripts plugins, Write a plugin, Plugins +@section Plugin example + +Full example of plugin, which adds a /double command, which displays +two times arguments on current channel (ok that's not very useful, but +that's just an example!): + +@verbatim +#include <stdlib.h> + +#include "weechat-plugin.h" + +char plugin_name[] = "Toto"; +char plugin_version[] = "0.1"; +char plugin_description[] = "Test plugin for WeeChat"; + +/* gestionnaire de commande "/hello" */ + +int toto_cmd_double (t_weechat_plugin *plugin, char *server, + char *command, char *arguments, + char *handler_args, void *handler_pointer) +{ + if (arguments && arguments[0] && (arguments[0] != '/')) + { + plugin->exec_command (plugin, NULL, NULL, arguments); + plugin->exec_command (plugin, NULL, NULL, arguments); + } + return 1; +} + +int weechat_plugin_init (t_weechat_plugin *plugin) +{ + plugin->cmd_handler_add (plugin, "double", + "Display two times a message", + "msg", + "msg: message", + &toto_cmd_double, + NULL, NULL); + return 1; +} + +int weechat_plugin_end (t_weechat_plugin *plugin) +{ + /* on ne fait rien ici */ + return 1; +} +@end verbatim + +@node Scripts plugins, , Plugin example, Plugins +@section Scripts plugins + +Three plugins are provided with WeeChat to load scripts: Perl, +Python and Ruby. + +@subsection Perl scripts + +@subsubsection Cargar/descargar programas Perl Los programas Perl se cargan y descargan con el comando @command{/perl} (escribiendo @kbd{/help perl} en WeeChat para obtener la ayuda acerca del comando).@* @@ -1530,7 +2116,7 @@ Cargar un programa Perl: @kbd{/perl load /tmp/ejemplo.pl}@* Listar los programas Perl cargados: @kbd{/perl}@* @end itemize -@subsection Interfaz WeeChat / Perl +@subsubsection Interfaz WeeChat / Perl @itemize @bullet @item @@ -1550,6 +2136,7 @@ tener un nombre distinto) @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@* @* @@ -1565,7 +2152,8 @@ Escribe un mensaje en un canal.@* @item @option{servidor}: (opcional) nombre interno del servidor @end itemize @* -@emph{Ejemplo:}@* +@emph{Ejemplos:}@* +@* @code{weechat::print ("mensaje");}@* @code{weechat::print ("mensaje", "#weechat");}@* @code{weechat::print ("mensaje", "#weechat", "freenode");}@* @@ -1584,6 +2172,7 @@ Escribir un mensaje en la barra de informaciones.@* @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat::print_infobar (5, "mensaje");}@* @* @@ -1604,6 +2193,7 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat::add_message_handler ("privmsg", mi_funcion);}@* @code{sub mi_funcion}@* @code{@{ }@* @@ -1627,9 +2217,16 @@ Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder al antiguo comando si el script Perl est@'a cargado. @item @option{funcion}: funci@'on Perl assiciada al comando. +@item @option{description}: command description (displayed by /help +command) +@item @option{arguments}: short description of command arguments +(displayed by /help command) +@item @option{arguments_description}: long description of command +arguments (displayed by /help command) @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat::add_command_handler ("comando", mi_comando);}@* @code{sub mi_comando}@* @code{@{ }@* @@ -1651,6 +2248,7 @@ Execute a command or send a message to a channel.@* @end itemize @* @emph{Examples:}@* +@* @code{weechat::command ("hello world!");}@* @code{weechat::command ("/kick toto please leave this chan", "#weechat");}@* @code{weechat::command ("/nick newnick", "", "freenode");}@* @@ -1664,28 +2262,85 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @emph{Par@'ametros:} @itemize @minus @item @option{nombre}: nombre de la informaci@'on que se quiere obtener: -@item @option{servidor}: nombre interno del servidor @itemize @minus -@item @option{0 o version}: obtener la versi@'on de WeeChat -@item @option{1 o nick}: obtener el seud@'onimo -@item @option{2 o channel}: obtener el nombre del canal -@item @option{3 o server}: obtener el nombre del servidor -@item @option{4 o weechatdir}: obtener el directorio home de WeeChat -@item @option{5 o away}: obtener la informaci@'on "away" del servidor +@item @option{version}: obtener la versi@'on de WeeChat +@item @option{nick}: obtener el seud@'onimo +@item @option{channel}: obtener el nombre del canal +@item @option{server}: obtener el nombre del servidor +@item @option{away}: get ``away'' flag +@item @option{weechat_dir}: get WeeChat home dir +@item @option{weechat_libdir}: get WeeChat system lib dir +@item @option{weechat_sharedir}: get WeeChat system share dir @end itemize +@item @option{servidor}: nombre interno del servidor @end itemize @* @emph{Ejemplos:}@* +@* @code{$version = weechat::get_info("version");}@* @code{$nick = weechat::get_info("nick", "freenode");}@* @* +@item +@command{weechat::get_dcc_info ( );}@* +@* +Get DCC list.@* + +Returned array has following fields: +@itemize @minus +@item server: IRC server +@item channel: IRC channel +@item type: DCC type: +@itemize @minus +@item 0: chat (received) +@item 1: chat (sent) +@item 2: file (receiving) +@item 3: file (sending) +@end itemize +@item status: DCC status: +@itemize @minus +@item 0: waiting +@item 1: connecting +@item 2: active +@item 3: done +@item 4: failed +@item 5: aborted +@end itemize +@item start_time: date/time of DCC creation +@item start_transfer: date/time of transfer start +@item addr: remote address +@item port: port used for DCC +@item nick: remote nick +@item filename: filename +@item local_filename: local filename +@item size: file size +@item pos: current position in file +@item start_resume: restart position after interruption +@item bytes_per_sec: bytes sent/received per second +@end itemize +@* + +@item +@command{weechat::get_config ( name );}@* +@* +Get WeeChat config option value.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of option +@end itemize +@* +@emph{Examples:}@* +@* +@code{$value1 = weechat::get_config ("look_set_title");}@* +@code{$value2 = weechat::get_config ("freenode.server_autojoin");}@* +@* + @end itemize -@node Programas Python, Programas Ruby, Programas Perl, Extensiones -@section Programas Python +@subsection Python scripts -@subsection Cargar/descargar programas Python +@subsubsection Cargar/descargar programas Python Los programas Python se cargan y descargan con el comando @command{/python} (escribiendo @kbd{/help python} en WeeChat para obtener la ayuda acerca del comando).@* @@ -1699,7 +2354,7 @@ Cargar un programa Python: @kbd{/python load /tmp/ejemplo.py}@* Listar los programas Python cargados: @kbd{/python}@* @end itemize -@subsection Interfaz WeeChat / Python +@subsubsection Interfaz WeeChat / Python @itemize @bullet @item @@ -1719,6 +2374,7 @@ tener un nombre distinto) @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...")}@* @* @@ -1734,7 +2390,8 @@ Escribe un mensaje en un canal.@* @item @option{servidor}: (opcional) nombre interno del servidor @end itemize @* -@emph{Ejemplo:}@* +@emph{Ejemplos:}@* +@* @code{weechat.prnt ("mensaje")}@* @code{weechat.prnt ("mensaje", "#weechat")}@* @code{weechat.prnt ("mensaje", "#weechat", "freenode")}@* @@ -1753,6 +2410,7 @@ Escribir un mensaje en la barra de informaciones.@* @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat.print_infobar (5, "mensaje")}@* @* @@ -1773,6 +2431,7 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat.add_message_handler ("privmsg", mi_funcion)}@* @code{def mi_funcion(servidor, args):}@* @code{@ @ @ @ weechat.prnt("servidor="+servidor)}@* @@ -1794,9 +2453,16 @@ Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder al antiguo comando si el script Python est@'a cargado. @item @option{funcion}: funci@'on Python assiciada al comando. +@item @option{description}: command description (displayed by /help +command) +@item @option{arguments}: short description of command arguments +(displayed by /help command) +@item @option{arguments_description}: long description of command +arguments (displayed by /help command) @end itemize @* @emph{Ejemplo:}@* +@* @code{weechat.add_command_handler ("comando", mi_comando)}@* @code{def mi_comando(servidor, args):}@* @code{@ @ @ @ weechat.prnt("Servidor:"+servidor+" Par@'ametros:"+args)}@* @@ -1815,6 +2481,7 @@ Execute a command or send a message to a channel.@* @end itemize @* @emph{Examples:}@* +@* @code{weechat.command ("hello world!")}@* @code{weechat.command ("/kick toto please leave this chan", "#weechat")}@* @code{weechat.command ("/nick newnick", "", "freenode")}@* @@ -1828,32 +2495,90 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @emph{Par@'ametros:} @itemize @minus @item @option{nombre}: nombre de la informaci@'on que se quiere obtener: -@item @option{servidor}: nombre interno del servidor @itemize @minus -@item @option{0 o version}: obtener la versi@'on de WeeChat -@item @option{1 o nick}: obtener el seud@'onimo -@item @option{2 o channel}: obtener el nombre del canal -@item @option{3 o server}: obtener el nombre del servidor -@item @option{4 o weechatdir}: obtener el directorio home de WeeChat -@item @option{5 o away}: obtener la informaci@'on "away" del servidor +@item @option{version}: obtener la versi@'on de WeeChat +@item @option{nick}: obtener el seud@'onimo +@item @option{channel}: obtener el nombre del canal +@item @option{server}: obtener el nombre del servidor +@item @option{away}: get ``away'' flag +@item @option{weechat_dir}: get WeeChat home dir +@item @option{weechat_libdir}: get WeeChat system lib dir +@item @option{weechat_sharedir}: get WeeChat system share dir @end itemize +@item @option{servidor}: nombre interno del servidor @end itemize @* @emph{Ejemplos:}@* +@* @code{$version = weechat.get_info("version")}@* @code{$nick = weechat.get_info("nick", "freenode")}@* @* +@item +@command{weechat.get_dcc_info ( );}@* +@* +Get DCC list.@* + +Returned array has following fields: +@itemize @minus +@item server: IRC server +@item channel: IRC channel +@item type: DCC type: +@itemize @minus +@item 0: chat (received) +@item 1: chat (sent) +@item 2: file (receiving) +@item 3: file (sending) +@end itemize +@item status: DCC status: +@itemize @minus +@item 0: waiting +@item 1: connecting +@item 2: active +@item 3: done +@item 4: failed +@item 5: aborted +@end itemize +@item start_time: date/time of DCC creation +@item start_transfer: date/time of transfer start +@item addr: remote address +@item port: port used for DCC +@item nick: remote nick +@item filename: filename +@item local_filename: local filename +@item size: file size +@item pos: current position in file +@item start_resume: restart position after interruption +@item bytes_per_sec: bytes sent/received per second +@end itemize +@* + +@item +@command{weechat.get_config ( name );}@* +@* +Get WeeChat config option value.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of option +@end itemize +@* +@emph{Examples:}@* +@* +@code{$value1 = weechat.get_config ("look_set_title");}@* +@code{$value2 = weechat.get_config ("freenode.server_autojoin");}@* +@* + @end itemize -@node Programas Ruby, , Programas Python, Extensiones -@section Programas Ruby +@subsection Ruby scripts @exclamdown{}No desarrollado! + @c **************************** Autores / Soporte ***************************** -@node Autores / Soporte, , Extensiones, Top +@node Autores / Soporte, , Plugins, Top @chapter Autores / Soporte @ifhtml |