mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 11:13:12 +02:00
core, plugins: fix typos in comments on functions, use imperative
This commit is contained in:
@@ -110,9 +110,9 @@
|
||||
|
||||
|
||||
/*
|
||||
* Sends JSON response to client (internal use).
|
||||
* Send JSON response to client (internal use).
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -208,9 +208,9 @@ relay_api_msg_send_json_internal (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends JSON response to client (internal use).
|
||||
* Send JSON response to client (internal use).
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -232,9 +232,9 @@ relay_api_msg_send_json (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends JSON error to client.
|
||||
* Send JSON error to client.
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -293,9 +293,9 @@ relay_api_msg_send_error_json (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends event to the client.
|
||||
* Send event to the client.
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -315,7 +315,7 @@ relay_api_msg_send_event (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a buffer local variable into a JSON object.
|
||||
* Add a buffer local variable into a JSON object.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -338,7 +338,7 @@ relay_api_msg_buffer_add_local_vars_cb (void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a JSON object with a buffer.
|
||||
* Create a JSON object with a buffer.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -420,7 +420,7 @@ relay_api_msg_buffer_to_json (struct t_gui_buffer *buffer,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a JSON object with a buffer key.
|
||||
* Create a JSON object with a buffer key.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -448,7 +448,7 @@ relay_api_msg_key_to_json (struct t_gui_key *key)
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a JSON object with an array of buffer keys.
|
||||
* Create a JSON object with an array of buffer keys.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -472,7 +472,7 @@ relay_api_msg_keys_to_json (struct t_gui_buffer *buffer)
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a JSON object with a buffer line data.
|
||||
* Create a JSON object with a buffer line data.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -526,7 +526,7 @@ relay_api_msg_line_data_to_json (struct t_gui_line_data *line_data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a JSON object with an array of buffer lines.
|
||||
* Create a JSON object with an array of buffer lines.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -595,7 +595,7 @@ relay_api_msg_lines_to_json (struct t_gui_buffer *buffer,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a nick JSON object.
|
||||
* Create a nick JSON object.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -638,7 +638,7 @@ relay_api_msg_nick_to_json (struct t_gui_nick *nick,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a nick group JSON object.
|
||||
* Create a nick group JSON object.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -712,7 +712,7 @@ relay_api_msg_nick_group_to_json (struct t_gui_nick_group *nick_group,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a JSON object with a completion entry.
|
||||
* Create a JSON object with a completion entry.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
@@ -778,7 +778,7 @@ relay_api_msg_completion_to_json (struct t_gui_completion *completion)
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a JSON object with a hotlist entry.
|
||||
* Create a JSON object with a hotlist entry.
|
||||
*/
|
||||
|
||||
cJSON *
|
||||
|
||||
@@ -44,7 +44,7 @@ int relay_api_protocol_command_delay = 1; /* delay to execute command */
|
||||
|
||||
|
||||
/*
|
||||
* Searches buffer by id or full name.
|
||||
* Search buffer by id or full name.
|
||||
*/
|
||||
|
||||
struct t_gui_buffer *
|
||||
@@ -1130,7 +1130,7 @@ RELAY_API_PROTOCOL_CALLBACK(sync)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads one request from client.
|
||||
* Read one request from client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1197,7 +1197,7 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads JSON string from a client: when connected via websocket (persistent
|
||||
* Read JSON string from a client: when connected via websocket (persistent
|
||||
* connection), the client is sending JSON data as a request, which is
|
||||
* converted to HTTP request by this function, before calling the function
|
||||
* relay_api_protocol_recv_http.
|
||||
@@ -1269,7 +1269,7 @@ relay_api_protocol_recv_json (struct t_relay_client *client, const char *json)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads a HTTP request from a client.
|
||||
* Read a HTTP request from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Returns buffer id.
|
||||
* Return buffer id.
|
||||
*/
|
||||
|
||||
long long
|
||||
@@ -70,7 +70,7 @@ relay_api_get_buffer_id (struct t_gui_buffer *buffer)
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns value of "colors" URL parameter, an enum with one of these values:
|
||||
* Return value of "colors" URL parameter, an enum with one of these values:
|
||||
* - RELAY_API_COLORS_ANSI (default)
|
||||
* - RELAY_API_COLORS_WEECHAT
|
||||
* - RELAY_API_COLORS_STRIP
|
||||
@@ -93,7 +93,7 @@ relay_api_search_colors (const char *colors)
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks signals for a client.
|
||||
* Hook signals for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -154,7 +154,7 @@ relay_api_hook_signals (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Unhooks signals for a client.
|
||||
* Unhook signals for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -183,7 +183,7 @@ relay_api_unhook_signals (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads HTTP request from a client.
|
||||
* Read HTTP request from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -193,7 +193,7 @@ relay_api_recv_http (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads JSON string from a client.
|
||||
* Read JSON string from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -203,7 +203,7 @@ relay_api_recv_json (struct t_relay_client *client, const char *json)
|
||||
}
|
||||
|
||||
/*
|
||||
* Closes connection with a client.
|
||||
* Close connection with a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -220,7 +220,7 @@ relay_api_close_connection (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay data specific to API protocol.
|
||||
* Initialize relay data specific to API protocol.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -247,7 +247,7 @@ relay_api_alloc (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay data specific to API protocol with an infolist.
|
||||
* Initialize relay data specific to API protocol with an infolist.
|
||||
*
|
||||
* This is called after /upgrade.
|
||||
*/
|
||||
@@ -287,7 +287,7 @@ relay_api_alloc_with_infolist (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the client initial status: it is always "authenticating" for API
|
||||
* Return the client initial status: it is always "authenticating" for API
|
||||
* protocol because we always expect the client to authenticate.
|
||||
*/
|
||||
|
||||
@@ -301,7 +301,7 @@ relay_api_get_initial_status (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees relay data specific to API protocol.
|
||||
* Free relay data specific to API protocol.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -325,13 +325,13 @@ relay_api_free (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds client API data in an infolist.
|
||||
* Add client API data in an infolist.
|
||||
*
|
||||
* If force_disconnected_state == 1, the infolist contains the client
|
||||
* in a disconnected state (but the client is unchanged, still connected if it
|
||||
* was).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -368,7 +368,7 @@ relay_api_add_to_infolist (struct t_infolist_item *item,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints client API data in WeeChat log file (usually for crash dump).
|
||||
* Print client API data in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -65,9 +65,9 @@
|
||||
|
||||
|
||||
/*
|
||||
* Searches a buffer used for a remote.
|
||||
* Search a buffer used for a remote.
|
||||
*
|
||||
* Returns pointer to buffer, NULL if not found.
|
||||
* Return pointer to buffer, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_gui_buffer *
|
||||
@@ -104,9 +104,9 @@ relay_remote_event_search_buffer (struct t_relay_remote *remote, long long id)
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets the remote buffer id.
|
||||
* Get the remote buffer id.
|
||||
*
|
||||
* Returns id found, -1 if error.
|
||||
* Return id found, -1 if error.
|
||||
*/
|
||||
|
||||
long long
|
||||
@@ -132,9 +132,9 @@ relay_remote_event_get_buffer_id (struct t_gui_buffer *buffer)
|
||||
}
|
||||
|
||||
/*
|
||||
* Builds a string with tags of a received line.
|
||||
* Build a string with tags of a received line.
|
||||
*
|
||||
* Returns dynamically string built, NULL if error.
|
||||
* Return dynamically string built, NULL if error.
|
||||
*/
|
||||
|
||||
char **
|
||||
@@ -194,7 +194,7 @@ relay_remote_build_string_tags (cJSON *json_tags, int line_id, int highlight)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a new line in a buffer.
|
||||
* Add a new line in a buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -257,10 +257,10 @@ relay_remote_event_line_add (struct t_relay_remote_event *event)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches a line by its id in relay remote buffer (by searching tag
|
||||
* Search a line by its id in relay remote buffer (by searching tag
|
||||
* "relay_remote_id_123456", where 123456 is the line id).
|
||||
*
|
||||
* Returns pointer to line found, NULL if not found.
|
||||
* Return pointer to line found, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_gui_line *
|
||||
@@ -307,7 +307,7 @@ relay_remote_event_search_line_by_id (struct t_gui_buffer *buffer, int id)
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates a line in a buffer.
|
||||
* Update a line in a buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -405,7 +405,7 @@ RELAY_REMOTE_EVENT_CALLBACK(line)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds or updates a nick on a buffer using JSON object.
|
||||
* Add or update a nick on a buffer using JSON object.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -465,7 +465,7 @@ relay_remote_event_handle_nick (struct t_gui_buffer *buffer, cJSON *json)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds or updates a nick group on a buffer using JSON object.
|
||||
* Add or update a nick group on a buffer using JSON object.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -598,7 +598,7 @@ RELAY_REMOTE_EVENT_CALLBACK(nick)
|
||||
}
|
||||
|
||||
/*
|
||||
* Applies properties to a buffer.
|
||||
* Apply properties to a buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -678,7 +678,7 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a local variable received in JSON object "local_variables" can
|
||||
* Check if a local variable received in JSON object "local_variables" can
|
||||
* be used.
|
||||
*
|
||||
* The following variables are ignored and must NOT be used:
|
||||
@@ -687,7 +687,7 @@ error:
|
||||
* - "relay_remote*": variables reserved for relay remote (in case of nested
|
||||
* remotes, the variables are not propagated)
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: variable can be used
|
||||
* 0: variable must NOT be used (reserved)
|
||||
*/
|
||||
@@ -1079,7 +1079,7 @@ RELAY_REMOTE_EVENT_CALLBACK(input)
|
||||
}
|
||||
|
||||
/*
|
||||
* Clears buffers lines/nicklist for a remote.
|
||||
* Clear buffers lines/nicklist for a remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1105,7 +1105,7 @@ relay_remote_event_clear_buffers (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Synchronizes with remote by sending two requests:
|
||||
* Synchronize with remote by sending two requests:
|
||||
* - "GET /api/buffers": fetch buffers data
|
||||
* - "POST /api/sync": synchronize with remote to receive events
|
||||
*/
|
||||
@@ -1242,7 +1242,7 @@ RELAY_REMOTE_EVENT_CALLBACK(quit)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads an event from a remote.
|
||||
* Read an event from a remote.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Gets URL to an API resource.
|
||||
* Get URL to an API resource.
|
||||
*
|
||||
* For example if remote URL is "https://localhost:9000" and the resource is
|
||||
* "handshake", it returns: "https://localhost:9000/api/handshake".
|
||||
@@ -122,7 +122,7 @@ relay_remote_network_close_connection (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Disconnects from remote.
|
||||
* Disconnect from remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -138,9 +138,9 @@ relay_remote_network_disconnect (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if authentication via websocket handshake was successful.
|
||||
* Check if authentication via websocket handshake was successful.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: authentication successful
|
||||
* 0: authentication has failed
|
||||
*/
|
||||
@@ -248,9 +248,9 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends data to the remote.
|
||||
* Send data to the remote.
|
||||
*
|
||||
* Returns the number of bytes sent to the remote.
|
||||
* Return the number of bytes sent to the remote.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -276,10 +276,10 @@ relay_remote_network_send_data (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends data to the remote.
|
||||
* Send data to the remote.
|
||||
* If the remote is connected, encapsulate data in a websocket frame.
|
||||
*
|
||||
* Returns the number of bytes sent to the remote.
|
||||
* Return the number of bytes sent to the remote.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -345,9 +345,9 @@ relay_remote_network_send (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends JSON data to the remote.
|
||||
* Send JSON data to the remote.
|
||||
*
|
||||
* Returns the number of bytes sent to the remote.
|
||||
* Return the number of bytes sent to the remote.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -373,7 +373,7 @@ relay_remote_network_send_json (struct t_relay_remote *remote, cJSON *json)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads text buffer from a remote.
|
||||
* Read text buffer from a remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -408,7 +408,7 @@ relay_remote_network_recv_text (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads websocket frames.
|
||||
* Read websocket frames.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -478,7 +478,7 @@ relay_remote_network_read_websocket_frames (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads a buffer of bytes from a remote.
|
||||
* Read a buffer of bytes from a remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -651,7 +651,7 @@ relay_remote_network_recv_cb (const void *pointer, void *data, int fd)
|
||||
}
|
||||
|
||||
/*
|
||||
* Connects to remote using websocket, with authentication.
|
||||
* Connect to remote using websocket, with authentication.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -967,7 +967,7 @@ relay_remote_network_connect_cb (const void *pointer, void *data, int status,
|
||||
/*
|
||||
* GnuTLS callback called during handshake.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 0: certificate OK
|
||||
* -1: error in certificate
|
||||
*/
|
||||
@@ -1390,7 +1390,7 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Builds a string with the API HTTP handshake request.
|
||||
* Build a string with the API HTTP handshake request.
|
||||
*
|
||||
* Note: result must be freed after use.
|
||||
*/
|
||||
@@ -1430,9 +1430,9 @@ relay_remote_network_get_handshake_request (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Connects to a remote WeeChat relay/api.
|
||||
* Connect to a remote WeeChat relay/api.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
|
||||
@@ -49,9 +49,9 @@ char *relay_irc_server_capabilities[RELAY_IRC_NUM_CAPAB] =
|
||||
|
||||
|
||||
/*
|
||||
* Checks if IRC command has to be relayed to client.
|
||||
* Check if IRC command has to be relayed to client.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: command must be relayed
|
||||
* 0: command must not be relayed
|
||||
*/
|
||||
@@ -75,9 +75,9 @@ relay_irc_command_relayed (const char *irc_command)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if an IRC command from client must be ignored.
|
||||
* Check if an IRC command from client must be ignored.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: command must be ignored
|
||||
* 0: command must not be ignored
|
||||
*/
|
||||
@@ -101,9 +101,9 @@ relay_irc_command_ignored (const char *irc_command)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a tag of a command (in backlog).
|
||||
* Search for a tag of a command (in backlog).
|
||||
*
|
||||
* Returns index of tag in enum t_relay_irc_command, -1 if tag is not found.
|
||||
* Return index of tag in enum t_relay_irc_command, -1 if tag is not found.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -125,9 +125,9 @@ relay_irc_search_backlog_commands_tags (const char *tag)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a server capability.
|
||||
* Search for a server capability.
|
||||
*
|
||||
* Returns index of server capability in enum t_relay_irc_server_capab, -1 if
|
||||
* Return index of server capability in enum t_relay_irc_server_capab, -1 if
|
||||
* server capability is not found.
|
||||
*/
|
||||
|
||||
@@ -150,9 +150,9 @@ relay_irc_search_server_capability (const char *capability)
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses an IRC message.
|
||||
* Parse an IRC message.
|
||||
*
|
||||
* Returns hashtable with parsed message, NULL if error.
|
||||
* Return hashtable with parsed message, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
@@ -194,7 +194,7 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends formatted data to client.
|
||||
* Send formatted data to client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -294,7 +294,7 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses CAP command received from IRC server.
|
||||
* Parse CAP command received from IRC server.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -410,10 +410,10 @@ relay_irc_signal_irc_in2_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets id of client by looking for tag "relay_client_NNN" in list of tags
|
||||
* Get 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.
|
||||
* Return number found (NNN), -1 if not found.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -683,7 +683,7 @@ relay_irc_hsignal_irc_redir_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets info about a line in a buffer:
|
||||
* Get info about a line in a buffer:
|
||||
* - irc command
|
||||
* - date
|
||||
* - nick
|
||||
@@ -861,7 +861,7 @@ relay_irc_get_line_info (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends channel backlog to client.
|
||||
* Send channel backlog to client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1054,7 +1054,7 @@ relay_irc_send_channel_backlog (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends IRC "JOIN" for a channel to client.
|
||||
* Send IRC "JOIN" for a channel to client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1157,7 +1157,7 @@ relay_irc_send_join (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends IRC "JOIN" for all channels of an IRC server to client.
|
||||
* Send IRC "JOIN" for all channels of an IRC server to client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1197,7 +1197,7 @@ relay_irc_send_join_channels (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends text or command on an IRC buffer.
|
||||
* Send text or command on an IRC buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1241,7 +1241,7 @@ relay_irc_input_send (struct t_relay_client *client, const char *irc_channel,
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks signals for a client.
|
||||
* Hook signals for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1296,9 +1296,9 @@ relay_irc_hook_signals (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Compares two capabilities.
|
||||
* Compare two capabilities.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* < 0: capability 1 < capability 2
|
||||
* 0: capability 1 == capability 2
|
||||
* > 0: capability 1 > capability 2
|
||||
@@ -1318,7 +1318,7 @@ relay_irc_capability_compare_cb (void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a capability in list.
|
||||
* Free a capability in list.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1334,9 +1334,9 @@ relay_irc_capability_free_db (void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a capability is currently enabled in IRC server.
|
||||
* Check if a capability is currently enabled in IRC server.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: capability is enabled in server
|
||||
* 0: capability is NOT enabled in server
|
||||
*/
|
||||
@@ -1362,7 +1362,7 @@ relay_irc_cap_enabled (struct t_relay_client *client, const char *capability)
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns an integer with bits set for each supported capability (ie that
|
||||
* Return an integer with bits set for each supported capability (ie that
|
||||
* is either always supported, or enabled in the IRC server).
|
||||
*/
|
||||
|
||||
@@ -1386,7 +1386,7 @@ relay_irc_get_supported_caps (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns a sorted list of supported all server capabilities by relay (even
|
||||
* Return a sorted list of supported all server capabilities by relay (even
|
||||
* those that should not be sent to clients when the IRC server doesn't
|
||||
* support them).
|
||||
*
|
||||
@@ -1414,7 +1414,7 @@ relay_irc_get_list_caps (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Processes the "CAP" irc command (received from client)
|
||||
* Process the "CAP" irc command (received from client)
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1538,7 +1538,7 @@ relay_irc_recv_command_capab (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses CTCP message and return CTCP type and parameters.
|
||||
* Parse CTCP message and return CTCP type and parameters.
|
||||
* If message is not a valid CTCP format, type and parameters are set to NULL.
|
||||
*
|
||||
* Examples:
|
||||
@@ -1585,7 +1585,7 @@ relay_irc_parse_ctcp (const char *message, char **ctcp_type, char **ctcp_params)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads one message from client.
|
||||
* Read one message from client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -2138,7 +2138,7 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Closes connection with client.
|
||||
* Close connection with client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -2169,7 +2169,7 @@ relay_irc_close_connection (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay data specific to IRC protocol.
|
||||
* Initialize relay data specific to IRC protocol.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -2202,7 +2202,7 @@ relay_irc_alloc (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay data specific to IRC protocol using an infolist.
|
||||
* Initialize relay data specific to IRC protocol using an infolist.
|
||||
*
|
||||
* This is called after /upgrade.
|
||||
*/
|
||||
@@ -2241,7 +2241,7 @@ relay_irc_alloc_with_infolist (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the client initial status: it can be "authenticating" or "connected",
|
||||
* Return the client initial status: it can be "authenticating" or "connected",
|
||||
* depending if a password is expected or not.
|
||||
*/
|
||||
|
||||
@@ -2253,7 +2253,7 @@ relay_irc_get_initial_status (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees relay data specific to IRC protocol.
|
||||
* Free relay data specific to IRC protocol.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -2278,13 +2278,13 @@ relay_irc_free (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds client IRC data in an infolist.
|
||||
* Add client IRC data in an infolist.
|
||||
*
|
||||
* If force_disconnected_state == 1, the infolist contains the client
|
||||
* in a disconnected state (but the client is unchanged, still connected if it
|
||||
* was).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -2336,7 +2336,7 @@ relay_irc_add_to_infolist (struct t_infolist_item *item,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints client IRC data in WeeChat log file (usually for crash dump).
|
||||
* Print client IRC data in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -45,9 +45,9 @@ char *relay_auth_password_hash_algo_name[RELAY_NUM_PASSWORD_HASH_ALGOS] =
|
||||
|
||||
|
||||
/*
|
||||
* Searches for a password hash algorithm.
|
||||
* Search for a password hash algorithm.
|
||||
*
|
||||
* Returns index in enum t_relay_auth_password_hash_algo,
|
||||
* Return index in enum t_relay_auth_password_hash_algo,
|
||||
* -1 if password hash algorithm is not found.
|
||||
*/
|
||||
|
||||
@@ -70,7 +70,7 @@ relay_auth_password_hash_algo_search (const char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
* Generates a nonce: a buffer of unpredictable bytes.
|
||||
* Generate a nonce: a buffer of unpredictable bytes.
|
||||
*
|
||||
* Note: result must be freed after use.
|
||||
*/
|
||||
@@ -103,9 +103,9 @@ relay_auth_generate_nonce (int size)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if password received as plain text is valid.
|
||||
* Check if password received as plain text is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 0: password is valid
|
||||
* -1: (plain-text password ("plain") is not allowed
|
||||
* -2: password is not valid
|
||||
@@ -131,7 +131,7 @@ relay_auth_check_password_plain (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses SHA256 or SHA512 parameters from string with format:
|
||||
* Parse SHA256 or SHA512 parameters from string with format:
|
||||
*
|
||||
* salt:hash
|
||||
*
|
||||
@@ -202,7 +202,7 @@ relay_auth_parse_sha (const char *parameters,
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses PBKDF2 parameters from string with format:
|
||||
* Parse PBKDF2 parameters from string with format:
|
||||
*
|
||||
* salt:iterations:hash
|
||||
*
|
||||
@@ -281,7 +281,7 @@ relay_auth_parse_pbkdf2 (const char *parameters,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if the salt received from the client is valid.
|
||||
* Check if the salt received from the client is valid.
|
||||
*
|
||||
* For "api" protocol, it is valid if both conditions are true:
|
||||
* 1. the salt is a valid integer (unix timestamp)
|
||||
@@ -293,7 +293,7 @@ relay_auth_parse_pbkdf2 (const char *parameters,
|
||||
* client nonce
|
||||
* 2. the salt begins with the server nonce (client->nonce)
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: salt is valid
|
||||
* 0: salt is not valid
|
||||
*/
|
||||
@@ -333,9 +333,9 @@ relay_auth_check_salt (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if password received as SHA256/SHA512 hash is valid.
|
||||
* Check if password received as SHA256/SHA512 hash is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: password is valid
|
||||
* 0: password is not valid
|
||||
*/
|
||||
@@ -378,9 +378,9 @@ relay_auth_check_hash_sha (const char *hash_algo,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if password received as PBKDF2 hash is valid.
|
||||
* Check if password received as PBKDF2 hash is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: password is valid
|
||||
* 0: password is not valid
|
||||
*/
|
||||
@@ -417,9 +417,9 @@ relay_auth_check_hash_pbkdf2 (const char *hash_pbkdf2_algo,
|
||||
}
|
||||
|
||||
/*
|
||||
* Authenticates with password hash.
|
||||
* Authenticate with password hash.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 0: authentication OK
|
||||
* -1: invalid hash algorithm
|
||||
* -2: invalid salt
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Returns content of bar item "input_prompt".
|
||||
* Return content of bar item "input_prompt".
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -91,7 +91,7 @@ relay_bar_item_input_prompt (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay bar items.
|
||||
* Initialize relay bar items.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -40,9 +40,9 @@ int relay_buffer_selected_line = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Checks if the buffer pointer is a relay buffer (relay raw/list).
|
||||
* Check if the buffer pointer is a relay buffer (relay raw/list).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: buffer is a relay buffer (raw/list)
|
||||
* 0: buffer is NOT a relay buffer
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ relay_buffer_is_relay (struct t_gui_buffer *buffer)
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates a client in buffer and updates hotlist for relay buffer.
|
||||
* Update a client in buffer and updates hotlist for relay buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -274,7 +274,7 @@ relay_buffer_close_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Opens relay buffer.
|
||||
* Open relay buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -60,9 +60,9 @@ int relay_client_count = 0; /* number of clients */
|
||||
|
||||
|
||||
/*
|
||||
* Checks if a client pointer is valid.
|
||||
* Check if a client pointer is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: client exists
|
||||
* 0: client does not exist
|
||||
*/
|
||||
@@ -87,9 +87,9 @@ relay_client_valid (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a client by number (first client is 0).
|
||||
* Search for a client by number (first client is 0).
|
||||
*
|
||||
* Returns pointer to client found, NULL if not found.
|
||||
* Return pointer to client found, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_relay_client *
|
||||
@@ -112,9 +112,9 @@ relay_client_search_by_number (int number)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a client by id.
|
||||
* Search for a client by id.
|
||||
*
|
||||
* Returns pointer to client found, NULL if not found.
|
||||
* Return pointer to client found, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_relay_client *
|
||||
@@ -134,7 +134,7 @@ relay_client_search_by_id (int id)
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the number of active clients (connecting or connected) on a given
|
||||
* Return the number of active clients (connecting or connected) on a given
|
||||
* server port.
|
||||
*/
|
||||
|
||||
@@ -159,7 +159,7 @@ relay_client_count_active_by_port (int server_port)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a signal with the status of client ("relay_client_xxx").
|
||||
* Send a signal with the status of client ("relay_client_xxx").
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -174,7 +174,7 @@ relay_client_send_signal (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets description for a client.
|
||||
* Set description for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -289,8 +289,8 @@ relay_client_handshake_timer_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads text data from a client (messages on a single line): splits data on
|
||||
* '\n' and keeps a partial message if data does not end with '\n'.
|
||||
* Read text data from a client (messages on a single line): split data on
|
||||
* '\n' and keep a partial message if data does not end with '\n'.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -368,7 +368,7 @@ relay_client_recv_text_single_line (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads text data from a client (multi-line messages).
|
||||
* Read text data from a client (multi-line messages).
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -409,7 +409,7 @@ relay_client_recv_text_multi_line (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads text data from a client: splits data on '\n' and keeps a partial
|
||||
* Read text data from a client: split data on '\n' and keep a partial
|
||||
* message if data does not end with '\n'.
|
||||
*/
|
||||
|
||||
@@ -441,7 +441,7 @@ relay_client_recv_text (struct t_relay_client *client, const char *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads text buffer from a client.
|
||||
* Read text buffer from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -518,7 +518,7 @@ relay_client_recv_text_buffer (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads websocket frames.
|
||||
* Read websocket frames.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -597,7 +597,7 @@ relay_client_read_websocket_frames (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads a buffer of bytes from a client.
|
||||
* Read a buffer of bytes from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -707,7 +707,7 @@ relay_client_recv_buffer (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads data from a client.
|
||||
* Read data from a client.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -799,7 +799,7 @@ relay_client_recv_cb (const void *pointer, void *data, int fd)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a message in out queue.
|
||||
* Free a message in out queue.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -836,7 +836,7 @@ relay_client_outqueue_free (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees all messages in out queue.
|
||||
* Free all messages in out queue.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -849,9 +849,9 @@ relay_client_outqueue_free_all (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends data to a client.
|
||||
* Send data to a client.
|
||||
*
|
||||
* Returns the number of bytes sent to the client.
|
||||
* Return the number of bytes sent to the client.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -873,7 +873,7 @@ relay_client_send_data (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends messages in outqueue for a client.
|
||||
* Send messages in outqueue for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1026,7 +1026,7 @@ relay_client_timer_send_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a message in out queue.
|
||||
* Add a message in out queue.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1093,12 +1093,12 @@ relay_client_outqueue_add (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends data to client (adds in out queue if it's impossible to send now).
|
||||
* Send data to client (add in out queue if it's impossible to send now).
|
||||
*
|
||||
* If "message_raw_buffer" is not NULL, it is used for display in raw buffer
|
||||
* and replaces display of data, which is default.
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1353,9 +1353,9 @@ relay_client_timer (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a new client.
|
||||
* Create a new client.
|
||||
*
|
||||
* Returns pointer to new client, NULL if error.
|
||||
* Return pointer to new client, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_client *
|
||||
@@ -1574,7 +1574,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a new client using an infolist.
|
||||
* Create a new client using an infolist.
|
||||
*
|
||||
* This is called to restore clients after /upgrade.
|
||||
*/
|
||||
@@ -1749,7 +1749,7 @@ relay_client_new_with_infolist (struct t_infolist *infolist)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets status for a client.
|
||||
* Set status for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1874,7 +1874,7 @@ relay_client_set_status (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes a client.
|
||||
* Remove a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1946,7 +1946,7 @@ relay_client_free (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes all clients.
|
||||
* Remove all clients.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1959,7 +1959,7 @@ relay_client_free_all (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Disconnects one client.
|
||||
* Disconnect one client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1972,7 +1972,7 @@ relay_client_disconnect (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Disconnects all clients.
|
||||
* Disconnect all clients.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1988,13 +1988,13 @@ relay_client_disconnect_all (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a client in an infolist.
|
||||
* Add a client in an infolist.
|
||||
*
|
||||
* If force_disconnected_state == 1, the infolist contains the client
|
||||
* in a disconnected state (but the client is unchanged, still connected if it
|
||||
* was).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -2170,7 +2170,7 @@ relay_client_add_to_infolist (struct t_infolist *infolist,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints clients in WeeChat log file (usually for crash dump).
|
||||
* Print clients in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Displays list of clients.
|
||||
* Display list of clients.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -124,7 +124,7 @@ relay_command_client_list (int full)
|
||||
}
|
||||
|
||||
/*
|
||||
* Displays list of servers (list of ports on which we are listening).
|
||||
* Display list of servers (list of ports on which we are listening).
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -421,7 +421,7 @@ relay_command_relay (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Displays a relay remote.
|
||||
* Display a relay remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -866,7 +866,7 @@ relay_command_remote (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks command.
|
||||
* Hook command.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Adds protocol and name to completion list.
|
||||
* Add protocol and name to completion list.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -102,7 +102,7 @@ relay_completion_protocol_name_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds protocol and name of current relays to completion list.
|
||||
* Add protocol and name of current relays to completion list.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -131,7 +131,7 @@ relay_completion_relays_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds free ports to completion list.
|
||||
* Add free ports to completion list.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -168,7 +168,7 @@ relay_completion_free_port_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds relay remotes to completion list.
|
||||
* Add relay remotes to completion list.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -197,7 +197,7 @@ relay_completion_remotes_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks completions.
|
||||
* Hook completions.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -366,9 +366,9 @@ relay_config_change_network_tls_cert_key (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if option "relay.network.totp_secret" is valid.
|
||||
* Check if option "relay.network.totp_secret" is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: value is valid
|
||||
* 0: value is not valid
|
||||
*/
|
||||
@@ -419,9 +419,9 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if option "relay.network.tls_priorities" is valid.
|
||||
* Check if option "relay.network.tls_priorities" is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: value is valid
|
||||
* 0: value is not valid
|
||||
*/
|
||||
@@ -521,9 +521,9 @@ relay_config_change_network_websocket_allowed_origins (const void *pointer, void
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if IRC backlog tags are valid.
|
||||
* Check if IRC backlog tags are valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: IRC backlog tags are valid
|
||||
* 0: IRC backlog tags are not valid
|
||||
*/
|
||||
@@ -618,9 +618,9 @@ relay_config_change_irc_backlog_tags (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a port is valid.
|
||||
* Check if a port is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: port is valid
|
||||
* 0: port is not valid
|
||||
*/
|
||||
@@ -654,9 +654,9 @@ relay_config_check_port_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a UNIX path is too long or empty.
|
||||
* Check if a UNIX path is too long or empty.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: path is valid
|
||||
* 0: path is empty or too long
|
||||
*/
|
||||
@@ -689,10 +689,10 @@ relay_config_check_path_length (const char *path)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a UNIX path is available: it is available if not existing, or
|
||||
* Check if a UNIX path is available: it is available if not existing, or
|
||||
* if a file of type socket already exists.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 0: path is available
|
||||
* -1: path already exists and is not a socket
|
||||
* -2: invalid path
|
||||
@@ -723,9 +723,9 @@ relay_config_check_path_available (const char *path)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a path is valid.
|
||||
* Check if a path is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: path is valid
|
||||
* 0: path is not valid
|
||||
*/
|
||||
@@ -970,7 +970,7 @@ relay_config_create_option_port_path (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets remote pointer with name of option.
|
||||
* Get remote pointer with name of option.
|
||||
*/
|
||||
|
||||
struct t_relay_remote *
|
||||
@@ -1037,9 +1037,9 @@ relay_config_remote_url_change_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates an option for a remote.
|
||||
* Create an option for a remote.
|
||||
*
|
||||
* Returns pointer to new option, NULL if error.
|
||||
* Return pointer to new option, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_config_option *
|
||||
@@ -1135,7 +1135,7 @@ relay_config_create_remote_option (const char *remote_name, int index_option,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates option for a temporary remote (when reading configuration file).
|
||||
* Create option for a temporary remote (when reading configuration file).
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1154,7 +1154,7 @@ relay_config_create_option_temp (struct t_relay_remote *temp_remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Uses temporary remotes (created by reading configuration file).
|
||||
* Use temporary remotes (created by reading configuration file).
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1213,7 +1213,7 @@ relay_config_use_temp_remotes (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads a remote option in relay configuration file.
|
||||
* Read a remote option in relay configuration file.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1285,7 +1285,7 @@ relay_config_remote_read_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reloads relay configuration file.
|
||||
* Reload relay configuration file.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1303,7 +1303,7 @@ relay_config_reload (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates options in configuration file while reading the file.
|
||||
* Update options in configuration file while reading the file.
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
@@ -1408,9 +1408,9 @@ relay_config_update_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay configuration file.
|
||||
* Initialize relay configuration file.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -1929,7 +1929,7 @@ relay_config_init (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads relay configuration file.
|
||||
* Read relay configuration file.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1951,7 +1951,7 @@ relay_config_read (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Writes relay configuration file.
|
||||
* Write relay configuration file.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1961,7 +1961,7 @@ relay_config_write (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees relay configuration.
|
||||
* Free relay configuration.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Reinitializes the HTTP request status.
|
||||
* Reinitialize the HTTP request status.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -80,7 +80,7 @@ relay_http_request_reinit (struct t_relay_http_request *request)
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocates a t_relay_http_request structure.
|
||||
* Allocate a t_relay_http_request structure.
|
||||
*/
|
||||
|
||||
struct t_relay_http_request *
|
||||
@@ -170,10 +170,10 @@ relay_http_url_decode (const char *url)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads value of a query string parameter as boolean (0 or 1) into *value.
|
||||
* If the parameter is not in URL, the default value is used.
|
||||
* Read value of a query string parameter as boolean (0 or 1) into *value.
|
||||
* If the parameter is not in URL, use the default value.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, *value is set
|
||||
* 0: error (query string parameter has invalid format)
|
||||
*/
|
||||
@@ -198,10 +198,10 @@ relay_http_get_param_boolean (struct t_relay_http_request *request,
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads value of a query string parameter as long into *value.
|
||||
* If the parameter is not in URL, the default value is used.
|
||||
* Read value of a query string parameter as long into *value.
|
||||
* If the parameter is not in URL, use the default value.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, *value is set
|
||||
* 0: error (URL parameter has invalid format)
|
||||
*/
|
||||
@@ -336,9 +336,9 @@ relay_http_parse_path (const char *path,
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses and saves method and path.
|
||||
* Parse and save method and path.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, method and path saved
|
||||
* 0: error: invalid format
|
||||
*/
|
||||
@@ -394,13 +394,13 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses and saves a HTTP header in hashtable "headers".
|
||||
* Parse and save a HTTP header in hashtable "headers".
|
||||
*
|
||||
* The parameter "ws_deflate_allowed" controls whether the websocket extension
|
||||
* "permessage-deflate" is allowed or not (it is allowed only with "api"
|
||||
* protocol).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, header saved
|
||||
* 0: error: invalid format
|
||||
*/
|
||||
@@ -499,7 +499,7 @@ relay_http_parse_header (struct t_relay_http_request *request,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds bytes to HTTP body, changes the status to RELAY_HTTP_END if the body
|
||||
* Add bytes to HTTP body, change the status to RELAY_HTTP_END if the body
|
||||
* is complete.
|
||||
*/
|
||||
|
||||
@@ -573,9 +573,9 @@ relay_http_add_to_body (struct t_relay_http_request *request,
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets authentication status according to headers in the request.
|
||||
* Get authentication status according to headers in the request.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 0: authentication OK (password + TOTP if enabled)
|
||||
* -1: missing password
|
||||
* -2: invalid password
|
||||
@@ -790,9 +790,9 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks authentication in HTTP request.
|
||||
* Check authentication in HTTP request.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: authentication OK
|
||||
* 0: authentication failed
|
||||
*/
|
||||
@@ -852,7 +852,7 @@ relay_http_check_auth (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Processes HTTP websocket request.
|
||||
* Process HTTP websocket request.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -951,7 +951,7 @@ relay_http_process_websocket (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Processes HTTP request.
|
||||
* Process HTTP request.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -980,7 +980,7 @@ relay_http_process_request (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads HTTP data from a client.
|
||||
* Read HTTP data from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1077,7 +1077,7 @@ relay_http_recv (struct t_relay_client *client, const char *data, int size)
|
||||
}
|
||||
|
||||
/*
|
||||
* Compresses body of HTTP request with gzip or zstd, if all conditions are met:
|
||||
* Compress body of HTTP request with gzip or zstd, if all conditions are met:
|
||||
* - body is not empty
|
||||
* - gzip or zstd is allowed by client (header "Accept-Encoding")
|
||||
* (for zstd, WeeChat must be compiled with zstd support)
|
||||
@@ -1089,7 +1089,7 @@ relay_http_recv (struct t_relay_client *client, const char *data, int size)
|
||||
* the HTTP header "Content-Encoding", if the compression is successful
|
||||
* (for example: "Content-Encoding: gzip").
|
||||
*
|
||||
* Returns pointer to compressed data or NULL if error.
|
||||
* Return pointer to compressed data or NULL if error.
|
||||
*
|
||||
* Note: result must be freed after use.
|
||||
*/
|
||||
@@ -1234,12 +1234,12 @@ relay_http_compress (struct t_relay_http_request *request,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a HTTP message to client.
|
||||
* Send a HTTP message to client.
|
||||
*
|
||||
* Argument "http" is a HTTP code + message, for example:
|
||||
* "403 Forbidden".
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1327,9 +1327,9 @@ relay_http_send (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends JSON string to client.
|
||||
* Send JSON string to client.
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1366,9 +1366,9 @@ relay_http_send_json (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends JSON error to client.
|
||||
* Send JSON error to client.
|
||||
*
|
||||
* Returns number of bytes sent to client, -1 if error.
|
||||
* Return number of bytes sent to client, -1 if error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1410,7 +1410,7 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a HTTP request.
|
||||
* Free a HTTP request.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1432,7 +1432,7 @@ relay_http_request_free (struct t_relay_http_request *request)
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocates a t_relay_http_response structure.
|
||||
* Allocate a t_relay_http_response structure.
|
||||
*/
|
||||
|
||||
struct t_relay_http_response *
|
||||
@@ -1461,9 +1461,9 @@ relay_http_response_alloc (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses and saves response code.
|
||||
* Parse and saves response code.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, response code and HTTP version saved
|
||||
* 0: error: invalid format
|
||||
*/
|
||||
@@ -1532,9 +1532,9 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses and saves a header of a HTTP response in hashtable "headers".
|
||||
* Parse and saves a header of a HTTP response in hashtable "headers".
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, header saved
|
||||
* 0: error: invalid format
|
||||
*/
|
||||
@@ -1598,9 +1598,9 @@ relay_http_parse_response_header (struct t_relay_http_response *response,
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses HTTP response with a string.
|
||||
* Parse HTTP response with a string.
|
||||
*
|
||||
* Returns HTTP request structure, NULL if error.
|
||||
* Return HTTP request structure, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_http_response *
|
||||
@@ -1660,7 +1660,7 @@ relay_http_parse_response (const char *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a HTTP response.
|
||||
* Free a HTTP response.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1678,7 +1678,7 @@ relay_http_response_free (struct t_relay_http_response *response)
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints HTTP request in WeeChat log file (usually for crash dump).
|
||||
* Print HTTP request in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1720,7 +1720,7 @@ relay_http_print_log_request (struct t_relay_http_request *request)
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints HTTP response in WeeChat log file (usually for crash dump).
|
||||
* Print HTTP response in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Returns WeeChat info "version".
|
||||
* Return WeeChat info "version".
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -61,7 +61,7 @@ relay_info_info_relay_api_version_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns WeeChat info "version_number".
|
||||
* Return WeeChat info "version_number".
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -89,7 +89,7 @@ relay_info_info_relay_api_version_number_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns relay info "relay_client_count".
|
||||
* Return relay info "relay_client_count".
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -172,7 +172,7 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns relay infolist "relay".
|
||||
* Return relay infolist "relay".
|
||||
*/
|
||||
|
||||
struct t_infolist *
|
||||
@@ -225,7 +225,7 @@ relay_info_infolist_relay_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks infolist for relay plugin.
|
||||
* Hook infolist for relay plugin.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -41,7 +41,7 @@ gnutls_dh_params_t *relay_gnutls_dh_params = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Sets TLS certificate/key file.
|
||||
* Set TLS certificate/key file.
|
||||
*
|
||||
* If verbose == 1, a message is displayed if successful, otherwise a warning
|
||||
* (if no cert/key found in file).
|
||||
@@ -140,7 +140,7 @@ relay_network_set_tls_cert_key (int verbose)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets gnutls priority cache.
|
||||
* Set gnutls priority cache.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -160,7 +160,7 @@ relay_network_set_priority (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes network for relay.
|
||||
* Initialize network for relay.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -182,7 +182,7 @@ relay_network_init (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Ends network for relay.
|
||||
* End network for relay.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -44,7 +44,7 @@ struct t_relay_raw_message *last_relay_raw_message = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Prints a relay raw message.
|
||||
* Print a relay raw message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -63,7 +63,7 @@ relay_raw_message_print (struct t_relay_raw_message *raw_message)
|
||||
}
|
||||
|
||||
/*
|
||||
* Opens relay raw buffer.
|
||||
* Open relay raw buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -125,7 +125,7 @@ relay_raw_open (int switch_to_buffer)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a raw message and remove it from list.
|
||||
* Free a raw message and remove it from list.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -162,7 +162,7 @@ relay_raw_message_free (struct t_relay_raw_message *raw_message)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees all raw messages.
|
||||
* Free all raw messages.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -175,7 +175,7 @@ relay_raw_message_free_all (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes old raw messages if limit has been reached.
|
||||
* Remove old raw messages if limit has been reached.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -191,9 +191,9 @@ relay_raw_message_remove_old (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a new raw message to list.
|
||||
* Add a new raw message to list.
|
||||
*
|
||||
* Returns pointer to new raw message, NULL if error.
|
||||
* Return pointer to new raw message, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_raw_message *
|
||||
@@ -231,7 +231,7 @@ relay_raw_message_add_to_list (time_t date, int date_usec,
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts a binary message for raw display.
|
||||
* Convert a binary message for raw display.
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -241,7 +241,7 @@ relay_raw_convert_binary_message (const char *data, int data_size)
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts a text message for raw display.
|
||||
* Convert a text message for raw display.
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -292,7 +292,7 @@ relay_raw_convert_text_message (const char *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a new raw message to list.
|
||||
* Add a new raw message to list.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -381,7 +381,7 @@ relay_raw_message_add (enum t_relay_msg_type msg_type,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints a message for a client on relay raw buffer.
|
||||
* Print a message for a client on relay raw buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -417,7 +417,7 @@ relay_raw_print_client (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints a message for a remote on relay raw buffer.
|
||||
* Print a message for a remote on relay raw buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -450,9 +450,9 @@ relay_raw_print_remote (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a raw message in an infolist.
|
||||
* Add a raw message in an infolist.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
|
||||
@@ -59,9 +59,9 @@ struct t_relay_remote *last_relay_remote_temp = NULL; /* last temp. remote */
|
||||
|
||||
|
||||
/*
|
||||
* Searches for a remote option name.
|
||||
* Search for a remote option name.
|
||||
*
|
||||
* Returns index of option in enum t_relay_remote_option, -1 if not found.
|
||||
* Return index of option in enum t_relay_remote_option, -1 if not found.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -83,9 +83,9 @@ relay_remote_search_option (const char *option_name)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a remote pointer is valid.
|
||||
* Check if a remote pointer is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: remote exists
|
||||
* 0: remote does not exist
|
||||
*/
|
||||
@@ -110,9 +110,9 @@ relay_remote_valid (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a remote by name.
|
||||
* Search for a remote by name.
|
||||
*
|
||||
* Returns pointer to remote found, NULL if not found.
|
||||
* Return pointer to remote found, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_relay_remote *
|
||||
@@ -135,9 +135,9 @@ relay_remote_search (const char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a remote by number (first remote is 0).
|
||||
* Search for a remote by number (first remote is 0).
|
||||
*
|
||||
* Returns pointer to remote found, NULL if not found.
|
||||
* Return pointer to remote found, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_relay_remote *
|
||||
@@ -160,10 +160,10 @@ relay_remote_search_by_number (int number)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a remote name is valid: it must contain only alphabetic chars
|
||||
* Check if a remote name is valid: it must contain only alphabetic chars
|
||||
* or digits.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: name is valid
|
||||
* 0: name is invalid
|
||||
*/
|
||||
@@ -189,11 +189,11 @@ relay_remote_name_valid (const char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
* Extracts TLS, address and port from remote URL.
|
||||
* Extract TLS, address and port from remote URL.
|
||||
*
|
||||
* If address is an IPv6 like "[::1]", the square brackets are removed.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error, invalid URL
|
||||
*/
|
||||
@@ -289,9 +289,9 @@ relay_remote_parse_url (const char *url,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a remote URL is valid.
|
||||
* Check if a remote URL is valid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: URL is valid
|
||||
* 0: URL is invalid
|
||||
*/
|
||||
@@ -303,7 +303,7 @@ relay_remote_url_valid (const char *url)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a signal with the status of remote ("relay_remote_xxx").
|
||||
* Send a signal with the status of remote ("relay_remote_xxx").
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -318,9 +318,9 @@ relay_remote_send_signal (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocates and initializes new remote structure.
|
||||
* Allocate and initialize new remote structure.
|
||||
*
|
||||
* Returns pointer to new remote, NULL if error.
|
||||
* Return pointer to new remote, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_remote *
|
||||
@@ -371,7 +371,7 @@ relay_remote_alloc (const char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for position of remote in list (to keep remotes sorted by name).
|
||||
* Search for position of remote in list (to keep remotes sorted by name).
|
||||
*/
|
||||
|
||||
struct t_relay_remote *
|
||||
@@ -392,7 +392,7 @@ relay_remote_find_pos (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a remote in a linked list.
|
||||
* Add a remote in a linked list.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -428,7 +428,7 @@ relay_remote_add (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets URL in a remote.
|
||||
* Set URL in a remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -439,9 +439,9 @@ relay_remote_set_url (struct t_relay_remote *remote, const char *url)
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a new remote with options.
|
||||
* Create a new remote with options.
|
||||
*
|
||||
* Returns pointer to new remote, NULL if error.
|
||||
* Return pointer to new remote, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_remote *
|
||||
@@ -477,9 +477,9 @@ relay_remote_new_with_options (const char *name, struct t_config_option **option
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a new remote.
|
||||
* Create a new remote.
|
||||
*
|
||||
* Returns pointer to new remote, NULL if error.
|
||||
* Return pointer to new remote, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_remote *
|
||||
@@ -529,7 +529,7 @@ relay_remote_new (const char *name,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a new remote using an infolist.
|
||||
* Create a new remote using an infolist.
|
||||
*
|
||||
* This is called to restore remotes after /upgrade.
|
||||
*/
|
||||
@@ -632,7 +632,7 @@ relay_remote_new_with_infolist (struct t_infolist *infolist)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets status for a remote.
|
||||
* Set status for a remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -656,9 +656,9 @@ relay_remote_set_status (struct t_relay_remote *remote,
|
||||
}
|
||||
|
||||
/*
|
||||
* Connects to a remote WeeChat relay/api.
|
||||
* Connect to a remote WeeChat relay/api.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -706,7 +706,7 @@ relay_remote_auto_connect_timer_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Auto-connects to all remotes with option autoconnect to "on".
|
||||
* Auto-connect to all remotes with option autoconnect to "on".
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -717,9 +717,9 @@ relay_remote_auto_connect (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends JSON data to a remote WeeChat relay/api.
|
||||
* Send JSON data to a remote WeeChat relay/api.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -742,9 +742,9 @@ relay_remote_send (struct t_relay_remote *remote, const char *json)
|
||||
}
|
||||
|
||||
/*
|
||||
* Renames a remote.
|
||||
* Rename a remote.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error (remote not renamed)
|
||||
*/
|
||||
@@ -798,9 +798,9 @@ relay_remote_rename (struct t_relay_remote *remote, const char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
* Disconnects one remote.
|
||||
* Disconnect one remote.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -821,7 +821,7 @@ relay_remote_disconnect (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Schedules reconnection to remote.
|
||||
* Schedule reconnection to remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -883,9 +883,9 @@ relay_remote_reconnect_schedule (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reconnects to a remote WeeChat relay/api.
|
||||
* Reconnect to a remote WeeChat relay/api.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -947,7 +947,7 @@ relay_remote_timer (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Disconnects all remotes.
|
||||
* Disconnect all remotes.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -978,7 +978,7 @@ relay_remote_buffer_input (struct t_gui_buffer *buffer, const char *input_data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Deletes a remote.
|
||||
* Delete a remote.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1019,7 +1019,7 @@ relay_remote_free (struct t_relay_remote *remote)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes all remotes.
|
||||
* Remove all remotes.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1032,13 +1032,13 @@ relay_remote_free_all (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a remote in an infolist.
|
||||
* Add a remote in an infolist.
|
||||
*
|
||||
* If force_disconnected_state == 1, the infolist contains the remote
|
||||
* in a disconnected state (but the remote is unchanged, still connected if it
|
||||
* was).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -1133,7 +1133,7 @@ relay_remote_add_to_infolist (struct t_infolist *infolist,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints remotes in WeeChat log file (usually for crash dump).
|
||||
* Print remotes in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -48,7 +48,7 @@ struct t_relay_server *last_relay_server = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Extracts protocol, arguments and options from a string with format
|
||||
* Extract protocol, arguments and options from a string with format
|
||||
* "options.protocol.args".
|
||||
*
|
||||
* Examples:
|
||||
@@ -165,9 +165,9 @@ relay_server_get_protocol_args (const char *protocol_and_args,
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a server by protocol.args.
|
||||
* Search for a server by protocol.args.
|
||||
*
|
||||
* Returns pointer to server, NULL if not found.
|
||||
* Return pointer to server, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_relay_server *
|
||||
@@ -189,9 +189,9 @@ relay_server_search (const char *protocol_and_args)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a server by port.
|
||||
* Search for a server by port.
|
||||
*
|
||||
* Returns pointer to new server, NULL if not found.
|
||||
* Return pointer to new server, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_relay_server *
|
||||
@@ -211,9 +211,9 @@ relay_server_search_port (int port)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a server by path. Only returns servers using a UNIX socket.
|
||||
* Search for a server by path. Only return servers that are using a UNIX socket.
|
||||
*
|
||||
* Returns pointer to new server, NULL if not found.
|
||||
* Return pointer to new server, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_relay_server *
|
||||
@@ -236,7 +236,7 @@ relay_server_search_path (const char *path)
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
* Closes socket for a relay server.
|
||||
* Close socket for a relay server.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -266,7 +266,7 @@ relay_server_close_socket (struct t_relay_server *server)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads data from a client which is connecting on socket.
|
||||
* Read data from a client which is connecting on socket.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -487,9 +487,9 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates socket and server on port.
|
||||
* Create socket and server on port.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -788,9 +788,9 @@ relay_server_create_socket (struct t_relay_server *server)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a socket relaying on a port.
|
||||
* Add a socket relaying on a port.
|
||||
*
|
||||
* Returns pointer to new server, NULL if error.
|
||||
* Return pointer to new server, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_server *
|
||||
@@ -884,7 +884,7 @@ relay_server_new (const char *protocol_string, enum t_relay_protocol protocol,
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates path in a server.
|
||||
* Update path in a server.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -918,7 +918,7 @@ relay_server_update_path (struct t_relay_server *server, const char *path)
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates port in a server.
|
||||
* Update port in a server.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -938,7 +938,7 @@ relay_server_update_port (struct t_relay_server *server, int port)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes a server.
|
||||
* Remove a server.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -974,7 +974,7 @@ relay_server_free (struct t_relay_server *server)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes all servers.
|
||||
* Remove all servers.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -987,9 +987,9 @@ relay_server_free_all (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a server in an infolist.
|
||||
* Add a server in an infolist.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -1038,7 +1038,7 @@ relay_server_add_to_infolist (struct t_infolist *infolist,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints servers in WeeChat log file (usually for crash dump).
|
||||
* Print servers in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
|
||||
|
||||
/*
|
||||
* Saves relay data in relay upgrade file.
|
||||
* Save relay data in relay upgrade file.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -117,9 +117,9 @@ relay_upgrade_save_all_data (struct t_upgrade_file *upgrade_file,
|
||||
}
|
||||
|
||||
/*
|
||||
* Saves relay upgrade file.
|
||||
* Save relay upgrade file.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -143,8 +143,7 @@ relay_upgrade_save (int force_disconnected_state)
|
||||
}
|
||||
|
||||
/*
|
||||
* Restores buffer callbacks (input and close) for buffers created by relay
|
||||
* plugin.
|
||||
* Restore buffer callbacks (input and close) for buffers created by relay plugin.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -180,7 +179,7 @@ relay_upgrade_set_buffer_callbacks (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads relay upgrade file.
|
||||
* Read relay upgrade file.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -232,9 +231,9 @@ relay_upgrade_read_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Loads relay upgrade file.
|
||||
* Load relay upgrade file.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Allocates a t_relay_websocket_deflate structure.
|
||||
* Allocate a t_relay_websocket_deflate structure.
|
||||
*/
|
||||
|
||||
struct t_relay_websocket_deflate *
|
||||
@@ -63,9 +63,9 @@ relay_websocket_deflate_alloc (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes stream for deflate (compression).
|
||||
* Initialize stream for deflate (compression).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -92,7 +92,7 @@ relay_websocket_deflate_init_stream_deflate (struct t_relay_websocket_deflate *w
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a deflate stream in a deflate structure.
|
||||
* Free a deflate stream in a deflate structure.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -107,9 +107,9 @@ relay_websocket_deflate_free_stream_deflate (struct t_relay_websocket_deflate *w
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes stream for inflate (decompression).
|
||||
* Initialize stream for inflate (decompression).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -126,7 +126,7 @@ relay_websocket_deflate_init_stream_inflate (struct t_relay_websocket_deflate *w
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees an inflate stream in a deflate structure.
|
||||
* Free an inflate stream in a deflate structure.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -141,7 +141,7 @@ relay_websocket_deflate_free_stream_inflate (struct t_relay_websocket_deflate *w
|
||||
}
|
||||
|
||||
/*
|
||||
* Reinitializes a t_relay_websocket_deflate structure.
|
||||
* Reinitialize a t_relay_websocket_deflate structure.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -159,7 +159,7 @@ relay_websocket_deflate_reinit (struct t_relay_websocket_deflate *ws_deflate)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a websocket deflate structure.
|
||||
* Free a websocket deflate structure.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -174,10 +174,10 @@ relay_websocket_deflate_free (struct t_relay_websocket_deflate *ws_deflate)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a message is a HTTP GET with resource "/weechat" (for weechat
|
||||
* Check if a message is a HTTP GET with resource "/weechat" (for weechat
|
||||
* protocol) or "/api" (for api protocol).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: message is a HTTP GET with appropriate resource
|
||||
* 0: message is NOT a HTTP GET with appropriate resource
|
||||
*/
|
||||
@@ -212,7 +212,7 @@ relay_websocket_is_valid_http_get (enum t_relay_protocol protocol,
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if a client handshake is valid.
|
||||
* Check if a client handshake is valid.
|
||||
*
|
||||
* A websocket query looks like (weechat protocol):
|
||||
* GET /weechat HTTP/1.1
|
||||
@@ -252,7 +252,7 @@ relay_websocket_is_valid_http_get (enum t_relay_protocol protocol,
|
||||
* "Origin" is checked against this regex. If header "Origin" is not set or does
|
||||
* not match regex, the handshake is considered as invalid.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 0: handshake is valid
|
||||
* -1: handshake is invalid (headers missing or with bad value)
|
||||
* -2: origin is not allowed (option relay.network.websocket_allowed_origins)
|
||||
@@ -295,7 +295,7 @@ relay_websocket_client_handshake_valid (struct t_relay_http_request *request)
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses websocket extensions (header "Sec-WebSocket-Extensions").
|
||||
* Parse websocket extensions (header "Sec-WebSocket-Extensions").
|
||||
*
|
||||
* Header is for example:
|
||||
* Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
|
||||
@@ -387,10 +387,10 @@ relay_websocket_parse_extensions (const char *extensions,
|
||||
}
|
||||
|
||||
/*
|
||||
* Builds the handshake that will be returned to client, to initialize and use
|
||||
* Build the handshake that will be returned to client, to initialize and use
|
||||
* the websocket.
|
||||
*
|
||||
* Returns a string with content of handshake to send to client, it looks like:
|
||||
* Return a string with content of handshake to send to client, it looks like:
|
||||
* HTTP/1.1 101 Switching Protocols
|
||||
* Upgrade: websocket
|
||||
* Connection: Upgrade
|
||||
@@ -516,13 +516,13 @@ relay_websocket_build_handshake (struct t_relay_http_request *request)
|
||||
}
|
||||
|
||||
/*
|
||||
* Decompresses a decoded and compressed websocket frame compressed with
|
||||
* Decompress a decoded and compressed websocket frame compressed with
|
||||
* "deflate" (when websocket extension "permessage-deflate" is enabled).
|
||||
*
|
||||
* A final '\0' is added after the decompressed data (the size_decompressed
|
||||
* does not count this final '\0').
|
||||
*
|
||||
* Returns pointer to decompressed data, NULL if error.
|
||||
* Return pointer to decompressed data, NULL if error.
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -609,14 +609,14 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Decodes a websocket frame and return a list of frames in "*frames" (each
|
||||
* Decode a websocket frame and return a list of frames in "*frames" (each
|
||||
* frame is first decompressed if "permessage-deflate" websocket extension
|
||||
* is used).
|
||||
*
|
||||
* If argument "expect_masked_frame" is 1 and a frame is not masked,
|
||||
* the function returns an error.
|
||||
* Return an error if argument "expect_masked_frame" is 1 and a frame is not
|
||||
* masked.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: frame(s) decoded successfully
|
||||
* 0: error decoding frame (connection must be closed if it happens)
|
||||
*/
|
||||
@@ -815,10 +815,10 @@ missing_data:
|
||||
}
|
||||
|
||||
/*
|
||||
* Compresses data to send in a websocket frame (when websocket extension
|
||||
* Compress data to send in a websocket frame (when websocket extension
|
||||
* "permessage-deflate" is enabled).
|
||||
*
|
||||
* Returns pointer to compressed data, NULL if error.
|
||||
* Return pointer to compressed data, NULL if error.
|
||||
*/
|
||||
|
||||
char *
|
||||
@@ -859,9 +859,9 @@ relay_websocket_deflate (const void *data, size_t size, z_stream *strm,
|
||||
}
|
||||
|
||||
/*
|
||||
* Encodes data in a websocket frame.
|
||||
* Encode data in a websocket frame.
|
||||
*
|
||||
* Returns websocket frame, NULL if error.
|
||||
* Return websocket frame, NULL if error.
|
||||
* Argument "length_frame" is set with the length of frame built.
|
||||
*
|
||||
* Argument "mask_frame" must be 1 when sending to server (remote) and 0 when
|
||||
@@ -1001,7 +1001,7 @@ relay_websocket_encode_frame (struct t_relay_websocket_deflate *ws_deflate,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints websocket deflate data in WeeChat log file (usually for crash dump).
|
||||
* Print websocket deflate data in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -80,9 +80,9 @@ struct t_hook *relay_hook_timer = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Searches for a protocol.
|
||||
* Search for a protocol.
|
||||
*
|
||||
* Returns index of protocol in enum t_relay_protocol, -1 if protocol is not
|
||||
* Return index of protocol in enum t_relay_protocol, -1 if protocol is not
|
||||
* found.
|
||||
*/
|
||||
|
||||
@@ -105,9 +105,9 @@ relay_protocol_search (const char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a status.
|
||||
* Search for a status.
|
||||
*
|
||||
* Returns index of status in enum t_relay_status, -1 if status is not found.
|
||||
* Return index of status in enum t_relay_status, -1 if status is not found.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -255,7 +255,7 @@ relay_debug_dump_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates input text by adding local/remote command indicator, only on
|
||||
* Update input text by adding local/remote command indicator, only on
|
||||
* buffers with remote (relay api).
|
||||
*/
|
||||
|
||||
@@ -346,7 +346,7 @@ relay_timer_cb (const void *pointer, void *data, int remaining_calls)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay plugin.
|
||||
* Initialize relay plugin.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -418,7 +418,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
}
|
||||
|
||||
/*
|
||||
* Ends relay plugin.
|
||||
* End relay plugin.
|
||||
*/
|
||||
|
||||
int
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
|
||||
|
||||
/*
|
||||
* Builds a new message (for sending to client).
|
||||
* Build a new message (for sending to client).
|
||||
*
|
||||
* Returns pointer to new message, NULL if error.
|
||||
* Return pointer to new message, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_weechat_msg *
|
||||
@@ -82,7 +82,7 @@ relay_weechat_msg_new (const char *id)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds some bytes to a message.
|
||||
* Add some bytes to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -114,7 +114,7 @@ relay_weechat_msg_add_bytes (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets some bytes in a message.
|
||||
* Set some bytes in a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -128,7 +128,7 @@ relay_weechat_msg_set_bytes (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds type to a message.
|
||||
* Add type to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -139,7 +139,7 @@ relay_weechat_msg_add_type (struct t_relay_weechat_msg *msg, const char *string)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a char to a message.
|
||||
* Add a char to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -149,7 +149,7 @@ relay_weechat_msg_add_char (struct t_relay_weechat_msg *msg, char c)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds an integer to a message.
|
||||
* Add an integer to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -162,7 +162,7 @@ relay_weechat_msg_add_int (struct t_relay_weechat_msg *msg, int value)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a long integer to a message.
|
||||
* Add a long integer to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -178,7 +178,7 @@ relay_weechat_msg_add_long (struct t_relay_weechat_msg *msg, long value)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a long long integer to a message.
|
||||
* Add a long long integer to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -195,7 +195,7 @@ relay_weechat_msg_add_longlong (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds length + string to a message.
|
||||
* Add length + string to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -218,7 +218,7 @@ relay_weechat_msg_add_string (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds buffer (length + data) to a message.
|
||||
* Add buffer (length + data) to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -238,7 +238,7 @@ relay_weechat_msg_add_buffer (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a pointer to a message.
|
||||
* Add a pointer to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -255,7 +255,7 @@ relay_weechat_msg_add_pointer (struct t_relay_weechat_msg *msg, void *pointer)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a time to a message.
|
||||
* Add a time to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -271,7 +271,7 @@ relay_weechat_msg_add_time (struct t_relay_weechat_msg *msg, time_t time)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds items of hashtable to a message.
|
||||
* Add items of hashtable to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -308,7 +308,7 @@ relay_weechat_msg_hashtable_map_cb (void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a hashtable to a message.
|
||||
* Add a hashtable to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -346,9 +346,9 @@ relay_weechat_msg_add_hashtable (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds recursively hdata for a path to a message.
|
||||
* Add recursively hdata for a path to a message.
|
||||
*
|
||||
* Returns the number of hdata objects added to message.
|
||||
* Return the number of hdata objects added to message.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -567,7 +567,7 @@ relay_weechat_msg_add_hdata_path (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a hdata to a message.
|
||||
* Add a hdata to a message.
|
||||
*
|
||||
* Argument path has format:
|
||||
* hdata_head:ptr->var->var->...->var
|
||||
@@ -576,7 +576,7 @@ relay_weechat_msg_add_hdata_path (struct t_relay_weechat_msg *msg,
|
||||
* Argument keys is optional: if not NULL, comma-separated list of keys to
|
||||
* return for hdata.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: hdata added to message
|
||||
* 0: error (hdata NOT added to message)
|
||||
*/
|
||||
@@ -784,7 +784,7 @@ end:
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds an infolist to a message.
|
||||
* Add an infolist to a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -894,12 +894,12 @@ relay_weechat_msg_add_infolist (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds nicklist for a buffer, as hdata object.
|
||||
* Add nicklist for a buffer, as hdata object.
|
||||
*
|
||||
* Argument "nicklist" contains nicklist diffs. If it is NULL or don't have
|
||||
* items inside, full nicklist is sent.
|
||||
*
|
||||
* Returns the number of nicks+groups added to message.
|
||||
* Return the number of nicks+groups added to message.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1009,7 +1009,7 @@ relay_weechat_msg_add_nicklist_buffer (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds nicklist for one or all buffers, as hdata object.
|
||||
* Add nicklist for one or all buffers, as hdata object.
|
||||
*
|
||||
* Argument "nicklist" contains nicklist diffs. If it is NULL or don't have
|
||||
* items inside, full nicklist is sent.
|
||||
@@ -1059,9 +1059,9 @@ relay_weechat_msg_add_nicklist (struct t_relay_weechat_msg *msg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Compresses the message with zlib.
|
||||
* Compress the message with zlib.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, message compressed and sent
|
||||
* 0: error, no message sent
|
||||
*/
|
||||
@@ -1130,9 +1130,9 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Compresses the message with zstd.
|
||||
* Compress the message with zstd.
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK, message compressed and sent
|
||||
* 0: error, no message sent
|
||||
*/
|
||||
@@ -1209,7 +1209,7 @@ error:
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a message.
|
||||
* Send a message.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1254,7 +1254,7 @@ relay_weechat_msg_send (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a message.
|
||||
* Free a message.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
|
||||
|
||||
/*
|
||||
* Builds a new nicklist structure (to store nicklist diffs).
|
||||
* Build a new nicklist structure (to store nicklist diffs).
|
||||
*
|
||||
* Returns pointer to new nicklist structure, NULL if error.
|
||||
* Return pointer to new nicklist structure, NULL if error.
|
||||
*/
|
||||
|
||||
struct t_relay_weechat_nicklist *
|
||||
@@ -53,7 +53,7 @@ relay_weechat_nicklist_new (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a nicklist item in nicklist structure.
|
||||
* Add a nicklist item in nicklist structure.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -118,7 +118,7 @@ relay_weechat_nicklist_add_item (struct t_relay_weechat_nicklist *nicklist,
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a nicklist_item structure.
|
||||
* Free a nicklist_item structure.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -134,7 +134,7 @@ relay_weechat_nicklist_item_free (struct t_relay_weechat_nicklist_item *item)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a new nicklist structure.
|
||||
* Free a new nicklist structure.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
|
||||
|
||||
/*
|
||||
* Gets buffer pointer with argument from a command.
|
||||
* Get buffer pointer with argument from a command.
|
||||
*
|
||||
* The argument "arg" can be a pointer ("0x12345678") or a full name
|
||||
* ("irc.libera.#weechat").
|
||||
*
|
||||
* Returns pointer to buffer found, NULL if not found.
|
||||
* Return pointer to buffer found, NULL if not found.
|
||||
*/
|
||||
|
||||
struct t_gui_buffer *
|
||||
@@ -80,7 +80,7 @@ relay_weechat_protocol_get_buffer (const char *arg)
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets integer value of a synchronization flag.
|
||||
* Get integer value of a synchronization flag.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -100,7 +100,7 @@ relay_weechat_protocol_sync_flag (const char *flag)
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if buffer is synchronized with at least one of the flags given.
|
||||
* Check if buffer is synchronized with at least one of the flags given.
|
||||
*
|
||||
* First searches buffer with full_name in hashtable "buffers_sync" (if buffer
|
||||
* is not NULL).
|
||||
@@ -112,7 +112,7 @@ relay_weechat_protocol_sync_flag (const char *flag)
|
||||
* RELAY_WEECHAT_PROTOCOL_SYNC_BUFFERS
|
||||
* RELAY_WEECHAT_PROTOCOL_SYNC_UPGRADE
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: buffer is synchronized with at least one flag given
|
||||
* 0: buffer is NOT synchronized with any of the flags given
|
||||
*/
|
||||
@@ -146,7 +146,7 @@ relay_weechat_protocol_is_sync (struct t_relay_client *ptr_client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Replies to a client handshake command.
|
||||
* Reply to a client handshake command.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -1734,7 +1734,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(quit)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads a command from a client.
|
||||
* Read a command from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
@@ -53,9 +53,9 @@ char *relay_weechat_compression_string[RELAY_WEECHAT_NUM_COMPRESSIONS] = {
|
||||
|
||||
|
||||
/*
|
||||
* Searches for a compression.
|
||||
* Search for a compression.
|
||||
*
|
||||
* Returns index of compression in enum t_relay_weechat_compression, -1 if
|
||||
* Return index of compression in enum t_relay_weechat_compression, -1 if
|
||||
* compression is not found.
|
||||
*/
|
||||
|
||||
@@ -78,7 +78,7 @@ relay_weechat_compression_search (const char *compression)
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks signals for a client.
|
||||
* Hook signals for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -99,7 +99,7 @@ relay_weechat_hook_signals (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Unhooks signals for a client.
|
||||
* Unhook signals for a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -128,7 +128,7 @@ relay_weechat_unhook_signals (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks timer to update nicklist.
|
||||
* Hook timer to update nicklist.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -141,7 +141,7 @@ relay_weechat_hook_timer_nicklist (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads data from a client.
|
||||
* Read data from a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -151,7 +151,7 @@ relay_weechat_recv (struct t_relay_client *client, const char *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Closes connection with a client.
|
||||
* Close connection with a client.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -168,7 +168,7 @@ relay_weechat_close_connection (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees a value of hashtable "buffers_nicklist".
|
||||
* Free a value of hashtable "buffers_nicklist".
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -183,7 +183,7 @@ relay_weechat_free_buffers_nicklist (struct t_hashtable *hashtable,
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay data specific to WeeChat protocol.
|
||||
* Initialize relay data specific to WeeChat protocol.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -220,7 +220,7 @@ relay_weechat_alloc (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes relay data specific to WeeChat protocol with an infolist.
|
||||
* Initialize relay data specific to WeeChat protocol with an infolist.
|
||||
*
|
||||
* This is called after /upgrade.
|
||||
*/
|
||||
@@ -293,7 +293,7 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the client initial status: it is always "authenticating" for weechat
|
||||
* Return the client initial status: it is always "authenticating" for weechat
|
||||
* protocol because we always expect the "init" command, even without any
|
||||
* password.
|
||||
*/
|
||||
@@ -308,7 +308,7 @@ relay_weechat_get_initial_status (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees relay data specific to WeeChat protocol.
|
||||
* Free relay data specific to WeeChat protocol.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -333,13 +333,13 @@ relay_weechat_free (struct t_relay_client *client)
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds client WeeChat data in an infolist.
|
||||
* Add client WeeChat data in an infolist.
|
||||
*
|
||||
* If force_disconnected_state == 1, the infolist contains the client
|
||||
* in a disconnected state (but the client is unchanged, still connected if it
|
||||
* was).
|
||||
*
|
||||
* Returns:
|
||||
* Return:
|
||||
* 1: OK
|
||||
* 0: error
|
||||
*/
|
||||
@@ -372,7 +372,7 @@ relay_weechat_add_to_infolist (struct t_infolist_item *item,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints client WeeChat data in WeeChat log file (usually for crash dump).
|
||||
* Print client WeeChat data in WeeChat log file (usually for crash dump).
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user