From 75eb47ee9e4edda335f8690375b7c4f760746e3c Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 5 Feb 2006 20:57:42 +0000 Subject: Added new plugins API functions (get_server_info, free_server_info, get_channel_info, free_channel_info, get_nick_info, free_nick_info) --- doc/en/weechat.en.xml | 604 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 599 insertions(+), 5 deletions(-) (limited to 'doc/en') diff --git a/doc/en/weechat.en.xml b/doc/en/weechat.en.xml index e2a4d0abc..e47c2cea4 100644 --- a/doc/en/weechat.en.xml +++ b/doc/en/weechat.en.xml @@ -782,9 +782,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - %Cnn + %Cxx - text color "nn" (see colors table below) + text color "xx" + (see colors table below) + + + + %Cxx,yy + + text color "xx" + and background "yy" + (see colors table below) @@ -2186,20 +2195,24 @@ char *nick = plugin->get_info (plugin, "nick", "freenode"); + Type Field Description + char * server IRC server + char * channel IRC channel + int type DCC type: @@ -2210,6 +2223,7 @@ char *nick = plugin->get_info (plugin, "nick", "freenode"); + int* status DCC status: @@ -2222,51 +2236,82 @@ char *nick = plugin->get_info (plugin, "nick", "freenode"); + time_t start_time date/time of DCC creation + time_t start_transfer date/time of DCC transfer start + unsigned long addr IP address of remote user + int port port used for DCC + char * nick remote nick + char * filename file name + char * local_filename local file name + int + filename_suffix + suffix if renaming file + + + unsigned long size file size + unsigned long pos position in file + unsigned long start_resume start position after interruption + unsigned long bytes_per_sec number of bytes per second since transfer start + + t_plugin_dcc_info * + prev_dcc + + pointer to previous DCC info + + + + t_plugin_dcc_info * + next_dcc + + pointer to next DCC info + + + @@ -2294,7 +2339,7 @@ if (dcc_info) free_dcc_info - Prototype : + Prototype: void free_dcc_info (t_weechat_plugin *plugin, t_plugin_dcc_info *dcc_info) @@ -2327,12 +2372,561 @@ if (dcc_info) plugin->free_dcc_info (plugin, dcc_info); + +
+ get_server_info + + + Prototype: + + t_plugin_server_info *get_server_info (t_weechat_plugin *plugin) + + + + Return list of IRC servers (connected or not). + + + Arguments: + + + + : pointer to plugin structure + + + + + + Return value: linked list of IRC servers. + + + + + Type + Field + Description + + + + + char * + name + server internal name + + + int + autoconnect + 1 if autoconnect at start-up, 0 otherwise + + + int + autoreconnect + + 1 if autoreconnect when disconnected, + 0 otherwise + + + + int + autoreconnect_delay + delay before trying again connection + + + int + command_line + + 1 if server was on command line (so it is temporary), + 0 otherwise + + + + char * + address + server address (host or IP) + + + int + port + port + + + int + ipv6 + IPv6 connection + + + int + ssl + SSL connection + + + char * + password + server password + + + char * + nick1 + first nickname + + + char * + nick2 + alternate nickname + + + char * + nick3 + second alternate nickname + + + char * + username + user name + + + char * + real name + real name + + + char * + command + command run once connected + + + int + command_delay + delay after execution of command + + + char * + autojoin + channels joined automatically + + + int + autorejoin + + 1 if channels are rejoined when kicked, + 0 otherwise + + + + char * + notify_levels + channels notify levels + + + char * + charset_decode_iso + channels charsets for decoding ISO + + + char * + charset_decode_utf + channels charsets for decoding UTF + + + char * + charset_encode + channels charsets for encoding messages + + + int + is_connected + 1 if connected to server, 0 otherwise + + + int + ssl_connected + 1 if connected with SSL, 0 otherwise + + + char * + nick + current nickname + + + int + is_away + 1 if away, 0 otherwise + + + time_t + away_time + time when user is marking as away + + + int + lag + lag (in milliseconds) + + + t_plugin_server_info * + prev_server + pointer to previous server info + + + t_plugin_server_info * + next_server + pointer to next server info + + + + + + + Note: result has to be free by a call to "free_server_info" + function after use. + + + Example: + +t_plugin_server_info *server_info, *ptr_server_info; +server_info = plugin->get_server_info (plugin); +if (server_info) +{ + for (ptr_server_info = server_info; ptr_server_info; + ptr_server_info = ptr_server_info->next_server) + { + plugin->printf (plugin, NULL, NULL, + "server: %s, address: %s, port: %d %s", + ptr_server_info->name, + ptr_server_info->address, + ptr_server_info->port, + (ptr_server_info->is_connected) ? "(connected)" : ""); + } + plugin->free_server_info (plugin, server_info); +} + + +
+ +
+ free_server_info + + + Prototype: + + void free_server_info (t_weechat_plugin *plugin, + t_plugin_server_info *server_info) + + + + Free memory used by server info list. + + + Arguments: + + + + : pointer to plugin structure + + + + + : pointer to server list + returned by "get_server_info" function + + + + + + Return value: none. + + + Example: + plugin->free_server_info (plugin, server_info); + +
+ +
+ get_channel_info + + + Prototype: + + t_plugin_channel_info *get_channel_info (t_weechat_plugin *plugin, + char *server) + + + + Return list of IRC channels for a server. + + + Arguments: + + + + : pointer to plugin structure + + + : internal server name + + + + + + Return value: linked list of IRC channels for server. + + + + + Type + Field + Description + + + + + int + type + 0 for a channel, 1 for a private + + + char * + name + name of channel + + + char * + topic + topic of channel + + + char * + modes + channel modes + + + int + limit + user limit + + + char * + key + channel key + + + int + nicks_count + number of nicks on channel + + + t_plugin_channel_info * + prev_channel + pointer to previous channel info + + + t_plugin_channel_info * + next_channel + pointer to next channel info + + + + + + + Note: result has to be free by a call to "free_channel_info" + function after use. + + + Example: + +t_plugin_channel_info *channel_info, *ptr_chan_info; +channel_info = plugin->get_channel_info (plugin, "freenode"); +if (channel_info) +{ + for (ptr_chan_info = channel_info; ptr_chan_info; + ptr_chan_info = ptr_chan_info->next_channel) + { + plugin->printf (plugin, NULL, NULL, + " %s (type %d)", + ptr_chan_info->name, + ptr_chan_info->type); + } + plugin->free_channel_info (plugin, channel_info); +} + + +
+ +
+ free_channel_info + + + Prototype: + + void free_channel_info (t_weechat_plugin *plugin, + t_plugin_channel_info *channel_info) + + + + Free memory used by channel info list. + + + Arguments: + + + + : pointer to plugin structure + + + + + : pointer to channel info list + returned by "get_channel_info" function + + + + + + Return value: none. + + + Example: + plugin->free_channel_info (plugin, channel_info); + +
+ +
+ get_nick_info + + + Prototype: + + t_plugin_nick_info *get_nick_info (t_weechat_plugin *plugin, + char *server, char *channel) + + + + Return list of nicks for a channel. + + + Arguments: + + + + : pointer to plugin structure + + + : internal server name + + + : channel name + + + + + + Return value: linked list of nicks on channel. + + + + + Type + Field + Description + + + + + char * + nick + nick name + + + int + flags + + nick flags, binary "or" between values (1 = channel + owner, 2 = channel admin, 4 = op, 8 = halfop, + 16 = voice, 32 = away) + + + + t_plugin_nick_info * + prev_nick + pointer to previous nick info + + + t_plugin_nick_info * + next_nick + pointer to next nick info + + + + + + + Note: result has to be free by a call to "free_nick_info" + function after use. + + + Example: + +t_plugin_nick_info *nick_info, *ptr_nick_info; +nick_info = plugin->get_nick_info (plugin, "freenode", "#weechat"); +if (nick_info) +{ + for (ptr_nick_info = nick_info; ptr_nick_info; + ptr_nick_info = ptr_nick_info->next_nick) + { + plugin->printf (plugin, NULL, NULL, + " %s (flags: %d)", + ptr_nick_info->nick, + ptr_nick_info->flags); + } + plugin->free_nick_info (plugin, nick_info); +} + + +
+ +
+ free_nick_info + + + Prototype: + + void free_nick_info (t_weechat_plugin *plugin, + t_plugin_nick_info *nick_info) + + + + Free memory used by nick info list. + + + Arguments: + + + + : pointer to plugin structure + + + + + : pointer to nick info list + returned by "get_nick_info" function + + + + + + Return value: none. + + + Example: + plugin->free_nick_info (plugin, nick_info); + +
get_config - Prototype : + Prototype: char *get_config (t_weechat_plugin *plugin, char *option) @@ -3285,7 +3879,7 @@ nick = weechat.get_info ("nick", "freenode") - Ruby prototype : + Ruby prototype: Weechat.get_dcc_info ( ) -- cgit v1.2.3