summaryrefslogtreecommitdiff
path: root/src/plugins/relay
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/relay')
-rw-r--r--src/plugins/relay/irc/relay-irc.c87
-rw-r--r--src/plugins/relay/relay-buffer.c10
-rw-r--r--src/plugins/relay/relay-client.c65
-rw-r--r--src/plugins/relay/relay-command.c9
-rw-r--r--src/plugins/relay/relay-completion.c10
-rw-r--r--src/plugins/relay/relay-config.c44
-rw-r--r--src/plugins/relay/relay-info.c5
-rw-r--r--src/plugins/relay/relay-network.c12
-rw-r--r--src/plugins/relay/relay-raw.c28
-rw-r--r--src/plugins/relay/relay-server.c62
-rw-r--r--src/plugins/relay/relay-upgrade.c26
-rw-r--r--src/plugins/relay/relay.c13
-rw-r--r--src/plugins/relay/weechat/relay-weechat-msg.c67
-rw-r--r--src/plugins/relay/weechat/relay-weechat-protocol.c46
-rw-r--r--src/plugins/relay/weechat/relay-weechat.c34
15 files changed, 286 insertions, 232 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c
index 0ea308269..e163069dc 100644
--- a/src/plugins/relay/irc/relay-irc.c
+++ b/src/plugins/relay/irc/relay-irc.c
@@ -45,8 +45,11 @@ char *relay_irc_ignore_commands[] = { "pong", "quit", NULL };
/*
- * relay_irc_command_relayed: return 1 if IRC command has to be relayed to
- * client, or 0 if command must NOT be relayed
+ * Checks if IRC command has to be relayed to client.
+ *
+ * Returns:
+ * 1: command must be relayed
+ * 0: command must not be relayed
*/
int
@@ -68,8 +71,11 @@ relay_irc_command_relayed (const char *irc_command)
}
/*
- * relay_irc_command_ignored: return 1 if IRC command from client has to be
- * ignored
+ * Checks if an IRC command from client must be ignored.
+ *
+ * Returns:
+ * 1: command must be ignored
+ * 0: command must not be ignored
*/
int
@@ -91,7 +97,9 @@ relay_irc_command_ignored (const char *irc_command)
}
/*
- * relay_irc_message_parse: parse IRC message
+ * Parses an IRC message.
+ *
+ * Returns hashtable with parsed message, NULL if error.
*/
struct t_hashtable *
@@ -133,7 +141,7 @@ end:
}
/*
- * relay_irc_sendf: send formatted data to client
+ * Sends formatted data to client.
*/
void
@@ -198,10 +206,10 @@ relay_irc_sendf (struct t_relay_client *client, const char *format, ...)
}
/*
- * relay_irc_signal_irc_in2_cb: callback for "irc_in2" signal
- * It is called when something is received on IRC
- * server, and message can be relayed (or not) to
- * client.
+ * Callback for signal "irc_in2".
+ *
+ * This is called when something is received on IRC server, and message can be
+ * relayed (or not) to client.
*/
int
@@ -267,11 +275,9 @@ relay_irc_signal_irc_in2_cb (void *data, const char *signal,
}
/*
- * relay_irc_tag_relay_client_id: get id of client by looking for tag
- * "relay_client_NNN" in list of tags
- * (comma separated list)
- * Return number found, or -1 if tag is not
- * found.
+ * Gets id of client by looking for tag "relay_client_NNN" in list of tags (comma separated list).
+ *
+ * Returns number found (NNN), -1 if not found.
*/
int
@@ -309,10 +315,10 @@ relay_irc_tag_relay_client_id (const char *tags)
}
/*
- * relay_irc_signal_irc_outtags_cb: callback for "irc_out" signal
- * It is called when a message is sent to IRC
- * server (by irc plugin or any other
- * plugin/script).
+ * Callback for signal "irc_out".
+ *
+ * This is called when a message is sent to IRC server (by irc plugin or any
+ * other plugin/script).
*/
int
@@ -424,9 +430,9 @@ end:
}
/*
- * relay_irc_signal_irc_disc_cb: callback for "irc_disconnected" signal
- * It is called when connection to a server is
- * lost.
+ * Callback for signal "irc_disconnected".
+ *
+ * This is called when connection to an IRC server is lost.
*/
int
@@ -451,8 +457,9 @@ relay_irc_signal_irc_disc_cb (void *data, const char *signal,
}
/*
- * relay_irc_hsignal_irc_redir_cb: callback for "irc_redirection_*" hsignals
- * It is called when a command is redirected.
+ * Callback for hsignals "irc_redirection_*".
+ *
+ * This is called when an IRC command is redirected.
*/
int
@@ -494,7 +501,7 @@ relay_irc_hsignal_irc_redir_cb (void *data, const char *signal,
}
/*
- * relay_irc_send_join: send join for a channel to client
+ * Sends IRC "JOIN" for a channel to client.
*/
void
@@ -613,7 +620,7 @@ relay_irc_send_join (struct t_relay_client *client,
}
/*
- * relay_irc_send_join_channels: send join for all channels of server to client
+ * Sends IRC "JOIN" for all channels of an IRC server to client.
*/
void
@@ -639,7 +646,7 @@ relay_irc_send_join_channels (struct t_relay_client *client)
}
/*
- * relay_irc_input_send: send text or command on an IRC buffer
+ * Sends text or command on an IRC buffer.
*/
void
@@ -684,7 +691,7 @@ relay_irc_input_send (struct t_relay_client *client, const char *irc_channel,
}
/*
- * relay_irc_hook_signals: hook signals for a client
+ * Hooks signals for a client.
*/
void
@@ -735,7 +742,7 @@ relay_irc_hook_signals (struct t_relay_client *client)
}
/*
- * relay_irc_recv_one_msg: read one message from client
+ * Reads one message from client.
*/
void
@@ -1141,7 +1148,7 @@ end:
}
/*
- * relay_irc_recv: read data from client
+ * Reads data from a client.
*/
void
@@ -1162,7 +1169,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
}
/*
- * relay_irc_close_connection: called when connection with client is closed
+ * Closes connection with client.
*/
void
@@ -1192,7 +1199,7 @@ relay_irc_close_connection (struct t_relay_client *client)
}
/*
- * relay_irc_alloc: init relay data specific to IRC protocol
+ * Initializes relay data specific to IRC protocol.
*/
void
@@ -1219,8 +1226,9 @@ relay_irc_alloc (struct t_relay_client *client)
}
/*
- * relay_irc_alloc_with_infolist: init relay data specific to IRC protocol
- * using an infolist
+ * Initializes relay data specific to IRC protocol using an infolist.
+ *
+ * This is called after /upgrade.
*/
void
@@ -1255,7 +1263,7 @@ relay_irc_alloc_with_infolist (struct t_relay_client *client,
}
/*
- * relay_irc_free: free relay data specific to IRC protocol
+ * Frees relay data specific to IRC protocol.
*/
void
@@ -1283,8 +1291,11 @@ relay_irc_free (struct t_relay_client *client)
}
/*
- * relay_irc_add_to_infolist: add client irc data in an infolist item
- * return 1 if ok, 0 if error
+ * Adds client IRC data in an infolist.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
@@ -1317,7 +1328,7 @@ relay_irc_add_to_infolist (struct t_infolist_item *item,
}
/*
- * relay_irc_print_log: print IRC client infos in log (usually for crash dump)
+ * Prints client IRC data in WeeChat log file (usually for crash dump).
*/
void
diff --git a/src/plugins/relay/relay-buffer.c b/src/plugins/relay/relay-buffer.c
index f0a32d563..fbd412a8f 100644
--- a/src/plugins/relay/relay-buffer.c
+++ b/src/plugins/relay/relay-buffer.c
@@ -39,8 +39,7 @@ int relay_buffer_selected_line = 0;
/*
- * relay_buffer_refresh: update a client in buffer and update hotlist for
- * relay buffer
+ * Updates a client in buffer and updates hotlist for relay buffer.
*/
void
@@ -151,8 +150,7 @@ relay_buffer_refresh (const char *hotlist)
}
/*
- * relay_buffer_input_cb: callback called when user send data to client list
- * buffer
+ * Callback for input data in relay buffer.
*/
int
@@ -215,7 +213,7 @@ relay_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
}
/*
- * relay_buffer_close_cb: callback called when relay buffer is closed
+ * Callback called when relay buffer is closed.
*/
int
@@ -237,7 +235,7 @@ relay_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
}
/*
- * relay_buffer_open: open relay buffer (to display list of clients)
+ * Opens relay buffer.
*/
void
diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c
index aa54c72da..ac5ee65e3 100644
--- a/src/plugins/relay/relay-client.c
+++ b/src/plugins/relay/relay-client.c
@@ -57,9 +57,11 @@ int relay_client_count = 0; /* number of clients */
/*
- * relay_client_valid: check if a client pointer exists
- * return 1 if client exists
- * 0 if client is not found
+ * Checks if a client pointer is valid.
+ *
+ * Returns:
+ * 1: client exists
+ * 0: client does not exist
*/
int
@@ -82,7 +84,9 @@ relay_client_valid (struct t_relay_client *client)
}
/*
- * relay_client_search_by_number: search a client by number (first client is 0)
+ * Searches for a client by number (first client is 0).
+ *
+ * Returns pointer to client found, NULL if not found.
*/
struct t_relay_client *
@@ -105,7 +109,9 @@ relay_client_search_by_number (int number)
}
/*
- * relay_client_search_by_id: search a client by id
+ * Searches for a client by id.
+ *
+ * Returns pointer to client found, NULL if not found.
*/
struct t_relay_client *
@@ -125,7 +131,7 @@ relay_client_search_by_id (int id)
}
/*
- * relay_client_set_desc: set description for client
+ * Sets description for a client.
*/
void
@@ -149,8 +155,7 @@ relay_client_set_desc (struct t_relay_client *client)
}
/*
- * relay_client_handshake_timer_cb: timer called to do the handshake with the
- * client (for SSL connection only)
+ * Timer callback for handshake with client (for SSL connection only).
*/
#ifdef HAVE_GNUTLS
@@ -214,7 +219,7 @@ relay_client_handshake_timer_cb (void *data, int remaining_calls)
#endif
/*
- * relay_client_recv_cb: read data from a client
+ * Reads data from a client.
*/
int
@@ -303,7 +308,7 @@ relay_client_recv_cb (void *arg_client, int fd)
}
/*
- * relay_client_outqueue_add: add a message in out queue
+ * Adds a message in out queue.
*/
void
@@ -338,7 +343,7 @@ relay_client_outqueue_add (struct t_relay_client *client, const char *data,
}
/*
- * relay_client_outqueue_free: free a message in out queue
+ * Frees a message in out queue.
*/
void
@@ -371,7 +376,7 @@ relay_client_outqueue_free (struct t_relay_client *client,
}
/*
- * relay_client_outqueue_free_all: free all outqueued messages
+ * Frees all messages in out queue.
*/
void
@@ -384,9 +389,9 @@ relay_client_outqueue_free_all (struct t_relay_client *client)
}
/*
- * relay_client_send: send data to client (add in outqueue if it's impossible
- * to send now)
- * return number of bytes sent to client
+ * Sends data to client (adds in out queue if it's impossible to send now).
+ *
+ * Returns number of bytes sent to client, -1 if error.
*/
int
@@ -487,8 +492,7 @@ relay_client_send (struct t_relay_client *client, const char *data,
}
/*
- * relay_client_timer_cb: timer called each second to perform some operations
- * on clients
+ * Timer callback, called each second.
*/
int
@@ -618,7 +622,9 @@ relay_client_timer_cb (void *data, int remaining_calls)
}
/*
- * relay_client_new: create a new client
+ * Creates a new client.
+ *
+ * Returns pointer to new client, NULL if error.
*/
struct t_relay_client *
@@ -763,7 +769,9 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
}
/*
- * relay_client_new_with_infolist: create a new client using an infolist
+ * Creates a new client using an infolist.
+ *
+ * This is called to restore clients after /upgrade.
*/
struct t_relay_client *
@@ -839,7 +847,7 @@ relay_client_new_with_infolist (struct t_infolist *infolist)
}
/*
- * relay_client_set_status: set status for a client
+ * Sets status for a client.
*/
void
@@ -912,7 +920,7 @@ relay_client_set_status (struct t_relay_client *client,
}
/*
- * relay_client_free: remove a client
+ * Removes a client.
*/
void
@@ -976,7 +984,7 @@ relay_client_free (struct t_relay_client *client)
}
/*
- * relay_client_free_all: remove all clients
+ * Removes all clients.
*/
void
@@ -989,7 +997,7 @@ relay_client_free_all ()
}
/*
- * relay_client_disconnect: disconnect one client
+ * Disconnects one client.
*/
void
@@ -1002,7 +1010,7 @@ relay_client_disconnect (struct t_relay_client *client)
}
/*
- * relay_client_disconnect_all: disconnect from all clients
+ * Disconnects all clients.
*/
void
@@ -1018,8 +1026,11 @@ relay_client_disconnect_all ()
}
/*
- * relay_client_add_to_infolist: add a client in an infolist
- * return 1 if ok, 0 if error
+ * Adds a client in an infolist.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
@@ -1093,7 +1104,7 @@ relay_client_add_to_infolist (struct t_infolist *infolist,
}
/*
- * relay_client_print_log: print client infos in log (usually for crash dump)
+ * Prints clients in WeeChat log file (usually for crash dump).
*/
void
diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c
index 8de921e6e..a530ad32a 100644
--- a/src/plugins/relay/relay-command.c
+++ b/src/plugins/relay/relay-command.c
@@ -36,7 +36,7 @@
/*
- * relay_command_client_list: list clients
+ * Displays list of clients.
*/
void
@@ -120,8 +120,7 @@ relay_command_client_list (int full)
}
/*
- * relay_command_server_list: list servers (list of port on which we are
- * listening)
+ * Displays list of servers (list of ports on which we are listening).
*/
void
@@ -166,7 +165,7 @@ relay_command_server_list ()
}
/*
- * relay_command_relay: command /relay
+ * Callback for command "/relay".
*/
int
@@ -304,7 +303,7 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
}
/*
- * relay_command_init: add /relay command
+ * Hooks command.
*/
void
diff --git a/src/plugins/relay/relay-completion.c b/src/plugins/relay/relay-completion.c
index 6e5874c6f..fa1bdb9aa 100644
--- a/src/plugins/relay/relay-completion.c
+++ b/src/plugins/relay/relay-completion.c
@@ -31,8 +31,7 @@
/*
- * relay_completion_protocol_name_cb: callback for completion with protocol and
- * name
+ * Adds protocol and name to completion list.
*/
int
@@ -74,8 +73,7 @@ relay_completion_protocol_name_cb (void *data, const char *completion_item,
}
/*
- * relay_completion_relays_cb: callback for completion with protocol and name
- * of current relays
+ * Adds protocol and name of current relays to completion list.
*/
int
@@ -102,7 +100,7 @@ relay_completion_relays_cb (void *data, const char *completion_item,
}
/*
- * relay_completion_free_port_cb: callback for completion with a free port
+ * Adds free ports to completion list.
*/
int
@@ -137,7 +135,7 @@ relay_completion_free_port_cb (void *data, const char *completion_item,
}
/*
- * relay_completion_init: init completion for relay plugin
+ * Hooks completions.
*/
void
diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c
index 33a14666e..12db7d0f6 100644
--- a/src/plugins/relay/relay-config.c
+++ b/src/plugins/relay/relay-config.c
@@ -66,8 +66,7 @@ regex_t *relay_config_regex_allowed_ips = NULL;
/*
- * relay_config_refresh_cb: callback called when user changes relay option that
- * needs a refresh of relay list
+ * Callback for changes on options that require a refresh of relay list.
*/
void
@@ -82,7 +81,7 @@ relay_config_refresh_cb (void *data, struct t_config_option *option)
}
/*
- * relay_config_change_network_allowed_ips: called when allowed ips changes
+ * Callback for changes on option "relay.network.allowed_ips".
*/
void
@@ -120,9 +119,7 @@ relay_config_change_network_allowed_ips (void *data,
}
/*
- * relay_config_change_network_bind_address_cb: callback called when user
- * changes network bind address
- * option
+ * Callback for changes on option "relay.network.bind_address".
*/
void
@@ -144,8 +141,7 @@ relay_config_change_network_bind_address_cb (void *data,
}
/*
- * relay_config_change_network_ipv6_cb: callback called when user changes ipv6
- * option
+ * Callback for changes on option "relay.network.ipv6".
*/
void
@@ -169,7 +165,7 @@ relay_config_change_network_ipv6_cb (void *data, struct t_config_option *option)
}
/*
- * relay_config_change_network_ssl_cert_key: called when ssl_cert_key is changed
+ * Callback for changes on option "relay.network.ssl_cert_key".
*/
void
@@ -185,8 +181,11 @@ relay_config_change_network_ssl_cert_key (void *data,
}
/*
- * relay_config_change_port_cb: callback called when relay port option is
- * modified
+ * Checks if a port is valid.
+ *
+ * Returns:
+ * 1: port is valid
+ * 0: port is not valid
*/
int
@@ -216,8 +215,7 @@ relay_config_check_port_cb (void *data, struct t_config_option *option,
}
/*
- * relay_config_change_port_cb: callback called when relay port option is
- * modified
+ * Callback for changes on options in section "port".
*/
void
@@ -237,8 +235,7 @@ relay_config_change_port_cb (void *data, struct t_config_option *option)
}
/*
- * relay_config_delete_port_cb: callback called when relay port option is
- * deleted
+ * Callback called when an option is deleted in section "port".
*/
void
@@ -255,7 +252,7 @@ relay_config_delete_port_cb (void *data, struct t_config_option *option)
}
/*
- * relay_config_create_option_port: create a relay for a port
+ * Callback called when an option is created in section "port".
*/
int
@@ -353,7 +350,7 @@ relay_config_create_option_port (void *data,
if (relay_server_new (option_name, protocol_number, protocol_args,
port, ipv4, ipv6, ssl))
{
- /* create config option */
+ /* create configuration option */
weechat_config_new_option (
config_file, section,
option_name, "integer", NULL,
@@ -376,7 +373,7 @@ relay_config_create_option_port (void *data,
}
/*
- * relay_config_reload: reload relay configuration file
+ * Reloads relay configuration file.
*/
int
@@ -389,8 +386,11 @@ relay_config_reload (void *data, struct t_config_file *config_file)
}
/*
- * relay_config_init: init relay configuration file
- * return: 1 if ok, 0 if error
+ * Initializes relay configuration file.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
@@ -576,7 +576,7 @@ relay_config_init ()
}
/*
- * relay_config_read: read relay configuration file
+ * Reads relay configuration file.
*/
int
@@ -586,7 +586,7 @@ relay_config_read ()
}
/*
- * relay_config_write: write relay configuration file
+ * Writes relay configuration file.
*/
int
diff --git a/src/plugins/relay/relay-info.c b/src/plugins/relay/relay-info.c
index f497d42ed..fdd05fa65 100644
--- a/src/plugins/relay/relay-info.c
+++ b/src/plugins/relay/relay-info.c
@@ -30,7 +30,7 @@
/*
- * relay_info_get_infolist_cb: callback called when relay infolist is asked
+ * Returns infolist with relay info.
*/
struct t_infolist *
@@ -86,13 +86,12 @@ relay_info_get_infolist_cb (void *data, const char *infolist_name,
}
/*
- * relay_info_init: initialize info and infolist hooks for relay plugin
+ * Hooks infolist for relay plugin.
*/
void
relay_info_init ()
{
- /* relay infolist hooks */
weechat_hook_infolist ("relay", N_("list of relay clients"),
N_("relay pointer (optional)"),
NULL,
diff --git a/src/plugins/relay/relay-network.c b/src/plugins/relay/relay-network.c
index d63ade548..48606f0eb 100644
--- a/src/plugins/relay/relay-network.c
+++ b/src/plugins/relay/relay-network.c
@@ -44,10 +44,10 @@ gnutls_dh_params_t *relay_gnutls_dh_params = NULL;
/*
- * relay_network_set_ssl_cert_key: set SSL certificate/key file
- * if verbose == 1, a message is displayed if
- * successful, otherwise a warning (if no
- * cert/key found in file)
+ * Sets SSL certificate/key file.
+ *
+ * If verbose == 1, a message is displayed if successful, otherwise a warning
+ * (if no cert/key found in file).
*/
void
@@ -106,7 +106,7 @@ relay_network_set_ssl_cert_key (int verbose)
}
/*
- * relay_network_init: init network for relay
+ * Initializes network for relay.
*/
void
@@ -137,7 +137,7 @@ relay_network_init ()
}
/*
- * relay_network_end: end network for relay
+ * Ends network for relay.
*/
void
diff --git a/src/plugins/relay/relay-raw.c b/src/plugins/relay/relay-raw.c
index 2b186c616..b689d7c31 100644
--- a/src/plugins/relay/relay-raw.c
+++ b/src/plugins/relay/relay-raw.c
@@ -43,7 +43,7 @@ struct t_relay_raw_message *last_relay_raw_message = NULL;
/*
- * relay_raw_message_print: print a relay raw message
+ * Prints a relay raw message.
*/
void
@@ -60,7 +60,7 @@ relay_raw_message_print (struct t_relay_raw_message *raw_message)
}
/*
- * relay_raw_open: open Relay raw buffer
+ * Opens relay raw buffer.
*/
void
@@ -112,7 +112,7 @@ relay_raw_open (int switch_to_buffer)
}
/*
- * relay_raw_message_free: free a raw message and remove it from list
+ * Frees a raw message and remove it from list.
*/
void
@@ -148,7 +148,7 @@ relay_raw_message_free (struct t_relay_raw_message *raw_message)
}
/*
- * relay_raw_message_free_all: free all raw messages
+ * Frees all raw messages.
*/
void
@@ -161,8 +161,7 @@ relay_raw_message_free_all ()
}
/*
- * relay_raw_message_remove_old: remove old raw messages if limit has been
- * reached
+ * Removes old raw messages if limit has been reached.
*/
void
@@ -178,7 +177,9 @@ relay_raw_message_remove_old ()
}
/*
- * relay_raw_message_add_to_list: add new message to list
+ * Adds a new raw message to list.
+ *
+ * Returns pointer to new raw message, NULL if error.
*/
struct t_relay_raw_message *
@@ -215,7 +216,9 @@ relay_raw_message_add_to_list (time_t date, const char *prefix,
}
/*
- * relay_raw_message_add: add new message to list
+ * Adds a new raw message to list.
+ *
+ * Returns pointer to new raw message, NULL if error.
*/
struct t_relay_raw_message *
@@ -312,7 +315,7 @@ relay_raw_message_add (struct t_relay_client *client, int flags,
}
/*
- * relay_raw_print: print a message on Relay raw buffer
+ * Prints a message on relay raw buffer.
*/
void
@@ -342,8 +345,11 @@ relay_raw_print (struct t_relay_client *client, int flags,
}
/*
- * relay_raw_add_to_infolist: add a raw message in an infolist
- * return 1 if ok, 0 if error
+ * Adds a raw message in an infolist.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c
index 8723c5878..e7cc36dbe 100644
--- a/src/plugins/relay/relay-server.c
+++ b/src/plugins/relay/relay-server.c
@@ -45,20 +45,24 @@ struct t_relay_server *last_relay_server = NULL;
/*
- * relay_server_get_protocol_args: get protocol, arguments and options
- * from a string with format
- * "options.protocol.args", examples:
- * irc.freenode
- * ssl.irc.freenode
- * ipv4.irc.freenode
- * ipv6.irc.freenode
- * ipv4.ipv6.irc.freenode
- * ipv6.ssl.irc.freenode
- * weechat
- * ssl.weechat
- * ipv6.ssl.weechat
- * Note: *protocol and *protocol_args must be
- * freed after use
+ * Extracts protocol, arguments and options from a string with format
+ * "options.protocol.args".
+ *
+ * Examples:
+ *
+ * string ipv4 ipv6 ssl protocol protocol_args
+ * ---------------------------------------------------------------
+ * irc.freenode 1 1 0 irc freenode
+ * ssl.irc.freenode 1 1 1 irc freenode
+ * ipv4.irc.freenode 1 0 0 irc freenode
+ * ipv6.irc.freenode 0 1 0 irc freenode
+ * ipv4.ipv6.irc.freenode 1 1 0 irc freenode
+ * ipv6.ssl.irc.freenode 0 1 1 irc freenode
+ * weechat 1 1 0 weechat
+ * ssl.weechat 1 1 1 weechat
+ * ipv6.ssl.weechat 0 1 1 weechat
+ *
+ * Note: *protocol and *protocol_args must be freed after use.
*/
void
@@ -142,7 +146,9 @@ relay_server_get_protocol_args (const char *protocol_and_args,
}
/*
- * relay_server_search: search server by protocol.args
+ * Searches for a server by protocol.args.
+ *
+ * Returns pointer to server, NULL if not found.
*/
struct t_relay_server *
@@ -161,7 +167,9 @@ relay_server_search (const char *protocol_and_args)
}
/*
- * relay_server_search_port: search server by port
+ * Searches for a server by port.
+ *
+ * Returns pointer to new server, NULL if not found.
*/
struct t_relay_server *
@@ -181,7 +189,7 @@ relay_server_search_port (int port)
}
/*
- * relay_server_close_socket: close socket for a relay server
+ * Closes socket for a relay server.
*/
void
@@ -208,7 +216,7 @@ relay_server_close_socket (struct t_relay_server *server)
}
/*
- * relay_server_sock_cb: read data from a client which is connecting on socket
+ * Reads data from a client which is connecting on socket.
*/
int
@@ -316,7 +324,11 @@ relay_server_sock_cb (void *data, int fd)
}
/*
- * relay_server_create_socket: create socket and server on port
+ * Creates socket and server on port.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
@@ -454,7 +466,9 @@ relay_server_create_socket (struct t_relay_server *server)
}
/*
- * relay_server_new: add a socket relaying on a port
+ * Adds a socket relaying on a port.
+ *
+ * Returns pointer to new server, NULL if error.
*/
struct t_relay_server *
@@ -519,7 +533,7 @@ relay_server_new (const char *protocol_string, enum t_relay_protocol protocol,
}
/*
- * relay_server_update_port: update port in a server
+ * Updates port in a server.
*/
void
@@ -534,7 +548,7 @@ relay_server_update_port (struct t_relay_server *server, int port)
}
/*
- * relay_server_free: remove a server
+ * Removes a server.
*/
void
@@ -571,7 +585,7 @@ relay_server_free (struct t_relay_server *server)
}
/*
- * relay_server_free_all: remove all servers
+ * Removes all servers.
*/
void
@@ -584,7 +598,7 @@ relay_server_free_all ()
}
/*
- * relay_server_print_log: print server infos in log (usually for crash dump)
+ * Prints servers in WeeChat log file (usually for crash dump).
*/
void
diff --git a/src/plugins/relay/relay-upgrade.c b/src/plugins/relay/relay-upgrade.c
index 30f60c553..f18a18a90 100644
--- a/src/plugins/relay/relay-upgrade.c
+++ b/src/plugins/relay/relay-upgrade.c
@@ -34,7 +34,11 @@
/*
- * relay_upgrade_save_all_data: save relay data to upgrade file
+ * Saves relay data in relay upgrade file.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
@@ -89,8 +93,11 @@ relay_upgrade_save_all_data (struct t_upgrade_file *upgrade_file)
}
/*
- * relay_upgrade_save: save upgrade file
- * return 1 if ok, 0 if error
+ * Saves relay upgrade file.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
@@ -111,8 +118,8 @@ relay_upgrade_save ()
}
/*
- * relay_upgrade_set_buffer_callbacks: restore buffers callbacks (input and
- * close) for buffers created by relay plugin
+ * Restores buffer callbacks (input and close) for buffers created by relay
+ * plugin.
*/
void
@@ -148,7 +155,7 @@ relay_upgrade_set_buffer_callbacks ()
}
/*
- * relay_upgrade_read_cb: read callback for relay upgrade file
+ * Reads relay upgrade file.
*/
int
@@ -181,8 +188,11 @@ relay_upgrade_read_cb (void *data,
}
/*
- * relay_upgrade_load: load upgrade file
- * return 1 if ok, 0 if error
+ * Loads relay upgrade file.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
diff --git a/src/plugins/relay/relay.c b/src/plugins/relay/relay.c
index a60be6d04..2d73ddc5a 100644
--- a/src/plugins/relay/relay.c
+++ b/src/plugins/relay/relay.c
@@ -56,7 +56,10 @@ struct t_hook *relay_hook_timer = NULL;
/*
- * relay_protocol_search: search a protocol by name
+ * Searches for a protocol.
+ *
+ * Returns index of protocol in enum t_relay_protocol, -1 if protocol is not
+ * found.
*/
int
@@ -75,7 +78,7 @@ relay_protocol_search (const char *name)
}
/*
- * relay_signal_upgrade_cb: callback for "upgrade" signal
+ * Callback for signal "upgrade".
*/
int
@@ -144,7 +147,7 @@ relay_signal_upgrade_cb (void *data, const char *signal, const char *type_data,
}
/*
- * relay_debug_dump_cb: callback for "debug_dump" signal
+ * Callback for signal "debug_dump".
*/
int
@@ -175,7 +178,7 @@ relay_debug_dump_cb (void *data, const char *signal, const char *type_data,
}
/*
- * weechat_plugin_init: initialize relay plugin
+ * Initializes relay plugin.
*/
int
@@ -227,7 +230,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
}
/*
- * weechat_plugin_end: end relay plugin
+ * Ends relay plugin.
*/
int
diff --git a/src/plugins/relay/weechat/relay-weechat-msg.c b/src/plugins/relay/weechat/relay-weechat-msg.c
index 8994ac430..f550074da 100644
--- a/src/plugins/relay/weechat/relay-weechat-msg.c
+++ b/src/plugins/relay/weechat/relay-weechat-msg.c
@@ -43,7 +43,9 @@
/*
- * relay_weechat_msg_new: build a new message (for sending to client)
+ * Builds a new message (for sending to client).
+ *
+ * Returns pointer to new message, NULL if error.
*/
struct t_relay_weechat_msg *
@@ -76,7 +78,7 @@ relay_weechat_msg_new (const char *id)
}
/*
- * relay_weechat_msg_add_bytes: add some bytes to a message
+ * Adds some bytes to a message.
*/
void
@@ -108,7 +110,7 @@ relay_weechat_msg_add_bytes (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_set_bytes: set some bytes in a message
+ * Sets some bytes in a message.
*/
void
@@ -122,7 +124,7 @@ relay_weechat_msg_set_bytes (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_add_type: add type to a message
+ * Adds type to a message.
*/
void
@@ -133,7 +135,7 @@ relay_weechat_msg_add_type (struct t_relay_weechat_msg *msg, const char *string)
}
/*
- * relay_weechat_msg_add_char: add a char to a message
+ * Adds a char to a message.
*/
void
@@ -143,7 +145,7 @@ relay_weechat_msg_add_char (struct t_relay_weechat_msg *msg, char c)
}
/*
- * relay_weechat_msg_add_int: add an integer to a message
+ * Adds an integer to a message.
*/
void
@@ -156,7 +158,7 @@ relay_weechat_msg_add_int (struct t_relay_weechat_msg *msg, int value)
}
/*
- * relay_weechat_msg_add_long: add a long integer to a message
+ * Adds a long integer to a message.
*/
void
@@ -172,7 +174,7 @@ relay_weechat_msg_add_long (struct t_relay_weechat_msg *msg, long value)
}
/*
- * relay_weechat_msg_add_string: add length + string to a message
+ * Adds length + string to a message.
*/
void
@@ -195,7 +197,7 @@ relay_weechat_msg_add_string (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_add_buffer: add buffer (length + data) to a message
+ * Adds buffer (length + data) to a message.
*/
void
@@ -215,7 +217,7 @@ relay_weechat_msg_add_buffer (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_add_pointer: add a pointer to a message
+ * Adds a pointer to a message.
*/
void
@@ -232,7 +234,7 @@ relay_weechat_msg_add_pointer (struct t_relay_weechat_msg *msg, void *pointer)
}
/*
- * relay_weechat_msg_add_time: add a time to a message
+ * Adds a time to a message.
*/
void
@@ -248,8 +250,7 @@ relay_weechat_msg_add_time (struct t_relay_weechat_msg *msg, time_t time)
}
/*
- * relay_weechat_msg_hashtable_map_cb: callback used to add hashtable items in
- * message
+ * Adds items of hashtable to a message.
*/
void
@@ -283,7 +284,7 @@ relay_weechat_msg_hashtable_map_cb (void *data, struct t_hashtable *hashtable,
}
/*
- * relay_weechat_msg_add_hashtable: add a hashtable to a message
+ * Adds a hashtable to a message.
*/
void
@@ -319,9 +320,9 @@ relay_weechat_msg_add_hashtable (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_add_hdata_path: recursively add hdata for a path
- * return number of hdata objects added in
- * message
+ * Adds recursively hdata for a path to a message.
+ *
+ * Returns the number of hdata objects added to message.
*/
int
@@ -531,14 +532,14 @@ relay_weechat_msg_add_hdata_path (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_add_hdata: add a hdata to a message
- * path has format:
- * hdata_head:ptr->var->var->...->var
- * where ptr can be a list name or a
- * pointer (0x12345)
- * keys is optional: if not NULL,
- * comma-separated list of keys to return
- * for hdata
+ * Adds a hdata to a message.
+ *
+ * Argument path has format:
+ * hdata_head:ptr->var->var->...->var
+ * where ptr can be a list name or a pointer (0x12345)
+ *
+ * Argument keys is optional: if not NULL, comma-separated list of keys to
+ * return for hdata.
*/
void
@@ -719,7 +720,7 @@ end:
}
/*
- * relay_weechat_msg_add_infolist: add an infolist to a message
+ * Adds an infolist to a message.
*/
void
@@ -821,10 +822,9 @@ relay_weechat_msg_add_infolist (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_add_nicklist_buffer: add nicklist for a buffer, as hdata
- * object
- * return number of nicks+groups added
- * in message
+ * Adds nicklist for a buffer, as hdata object.
+ *
+ * Returns the number of nicks+groups added to message.
*/
int
@@ -909,8 +909,7 @@ relay_weechat_msg_add_nicklist_buffer (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_add_nicklist: add nicklist for one or all buffers, as
- * hdata object
+ * Adds nicklist for one or all buffers, as hdata object.
*/
void
@@ -952,7 +951,7 @@ relay_weechat_msg_add_nicklist (struct t_relay_weechat_msg *msg,
}
/*
- * relay_weechat_msg_send: send a message
+ * Sends a message.
*/
void
@@ -1023,7 +1022,7 @@ relay_weechat_msg_send (struct t_relay_client *client,
}
/*
- * relay_weechat_msg_free: free a message
+ * Frees a message.
*/
void
diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c
index 464974dc7..b3f79b257 100644
--- a/src/plugins/relay/weechat/relay-weechat-protocol.c
+++ b/src/plugins/relay/weechat/relay-weechat-protocol.c
@@ -36,10 +36,12 @@
/*
- * relay_weechat_protocol_get_buffer: get buffer pointer with argument from a
- * command, which can be a pointer
- * ("0x12345") or a full name
- * ("irc.freenode.#weechat")
+ * Gets buffer pointer with argument from a command.
+ *
+ * The argument "arg" can be a pointer ("0x12345678") or a full name
+ * ("irc.freenode.#weechat").
+ *
+ * Returns pointer to buffer found, NULL if not found.
*/
struct t_gui_buffer *
@@ -88,7 +90,7 @@ relay_weechat_protocol_get_buffer (const char *arg)
}
/*
- * relay_weechat_protocol_cb_init: 'init' command from client
+ * Callback for command "init" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(init)
@@ -131,7 +133,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(init)
}
/*
- * relay_weechat_protocol_cb_hdata: 'hdata' command from client
+ * Callback for command "hdata" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(hdata)
@@ -153,7 +155,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(hdata)
}
/*
- * relay_weechat_protocol_cb_info: 'info' command from client
+ * Callback for command "info" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(info)
@@ -179,7 +181,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(info)
}
/*
- * relay_weechat_protocol_cb_infolist: 'infolist' command from client
+ * Callback for command "infolist" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(infolist)
@@ -213,7 +215,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(infolist)
}
/*
- * relay_weechat_protocol_cb_nicklist: 'nicklist' command from client
+ * Callback for command "nicklist" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(nicklist)
@@ -244,7 +246,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(nicklist)
}
/*
- * relay_weechat_protocol_cb_input: 'input' command from client
+ * Callback for command "input" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(input)
@@ -266,7 +268,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(input)
}
/*
- * relay_weechat_protocol_signal_buffer_cb: callback for "buffer_*" signals
+ * Callback for signals "buffers_*".
*/
int
@@ -485,10 +487,8 @@ relay_weechat_protocol_signal_buffer_cb (void *data, const char *signal,
}
/*
- * relay_weechat_protocol_nicklist_map_cb: callback for entries in hashtable
- * "buffers_nicklist" of client
- * (send nicklist for each buffer in
- * this hashtable)
+ * Callback for entries in hashtable "buffers_nicklist" of client (sends
+ * nicklist for each buffer in this hashtable).
*/
void
@@ -532,7 +532,7 @@ relay_weechat_protocol_nicklist_map_cb (void *data,
}
/*
- * relay_weechat_protocol_timer_nicklist_cb: callback for nicklist timer
+ * Callback for nicklist timer.
*/
int
@@ -559,7 +559,7 @@ relay_weechat_protocol_timer_nicklist_cb (void *data, int remaining_calls)
}
/*
- * relay_weechat_protocol_signal_nicklist_cb: callback for "nicklist_*" signals
+ * Callback for signals "nicklist_*".
*/
int
@@ -600,7 +600,7 @@ relay_weechat_protocol_signal_nicklist_cb (void *data, const char *signal,
}
/*
- * relay_weechat_protocol_signal_upgrade_cb: callback for "upgrade*" signals
+ * Callback for signals "upgrade*".
*/
int
@@ -637,7 +637,7 @@ relay_weechat_protocol_signal_upgrade_cb (void *data, const char *signal,
}
/*
- * relay_weechat_protocol_cb_sync: 'sync' command from client
+ * Callback for command "sync" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(sync)
@@ -711,7 +711,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(sync)
}
/*
- * relay_weechat_protocol_cb_desync: 'desync' command from client
+ * Callback for command "desync" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(desync)
@@ -796,7 +796,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(desync)
}
/*
- * relay_weechat_protocol_cb_test: 'test' command from client
+ * Callback for command "test" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(test)
@@ -872,7 +872,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(test)
}
/*
- * relay_weechat_protocol_cb_quit: 'quit' command from client
+ * Callback for command "quit" (from client).
*/
RELAY_WEECHAT_PROTOCOL_CALLBACK(quit)
@@ -885,7 +885,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(quit)
}
/*
- * relay_weechat_protocol_recv: read a command from client
+ * Reads a command from a client.
*/
void
diff --git a/src/plugins/relay/weechat/relay-weechat.c b/src/plugins/relay/weechat/relay-weechat.c
index 5728b8055..6453697f2 100644
--- a/src/plugins/relay/weechat/relay-weechat.c
+++ b/src/plugins/relay/weechat/relay-weechat.c
@@ -48,7 +48,10 @@ char *relay_weechat_partial_message = NULL;
/*
- * relay_weechat_compression_search: search a compression by name
+ * Searches for a compression.
+ *
+ * Returns index of compression in enum t_relay_weechat_compression, -1 if
+ * compression is not found.
*/
int
@@ -67,7 +70,7 @@ relay_weechat_compression_search (const char *compression)
}
/*
- * relay_weechat_hook_signals: hook signals for a client
+ * Hooks signals for a client.
*/
void
@@ -88,7 +91,7 @@ relay_weechat_hook_signals (struct t_relay_client *client)
}
/*
- * relay_weechat_unhook_signals: unhook signals for a client
+ * Unhooks signals for a client.
*/
void
@@ -112,7 +115,7 @@ relay_weechat_unhook_signals (struct t_relay_client *client)
}
/*
- * relay_weechat_hook_timer_nicklist: timer to update nicklists for a client
+ * Hooks timer to update nicklist.
*/
void
@@ -125,7 +128,7 @@ relay_weechat_hook_timer_nicklist (struct t_relay_client *client)
}
/*
- * relay_weechat_recv: read data from client
+ * Reads data from a client.
*/
void
@@ -176,7 +179,7 @@ relay_weechat_recv (struct t_relay_client *client, const char *data)
}
/*
- * relay_weechat_close_connection: called when connection with client is closed
+ * Closes connection with a client.
*/
void
@@ -186,7 +189,7 @@ relay_weechat_close_connection (struct t_relay_client *client)
}
/*
- * relay_weechat_alloc: init relay data specific to weechat protocol
+ * Initializes relay data specific to WeeChat protocol.
*/
void
@@ -222,8 +225,9 @@ relay_weechat_alloc (struct t_relay_client *client)
}
/*
- * relay_weechat_alloc_with_infolist: init relay data specific to weechat
- * protocol with an infolist
+ * Initializes relay data specific to WeeChat protocol with an infolist.
+ *
+ * This is called after /upgrade.
*/
void
@@ -297,7 +301,7 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
}
/*
- * relay_weechat_free: free relay data specific to weechat protocol
+ * Frees relay data specific to WeeChat protocol.
*/
void
@@ -323,8 +327,11 @@ relay_weechat_free (struct t_relay_client *client)
}
/*
- * relay_weechat_add_to_infolist: add client weechat data in an infolist item
- * return 1 if ok, 0 if error
+ * Adds client WeeChat data in an infolist.
+ *
+ * Returns:
+ * 1: OK
+ * 0: error
*/
int
@@ -347,8 +354,7 @@ relay_weechat_add_to_infolist (struct t_infolist_item *item,
}
/*
- * relay_weechat_print_log: print weechat client infos in log (usually for
- * crash dump)
+ * Prints client WeeChat data in WeeChat log file (usually for crash dump).
*/
void