mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 08:13:14 +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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user