1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 21:06:38 +02:00

core, plugins: fix typos in comments on functions, use imperative

This commit is contained in:
Sébastien Helleu
2026-03-23 20:45:36 +01:00
parent d34eb40187
commit f53e7fb9ef
342 changed files with 6669 additions and 6729 deletions
+24 -24
View File
@@ -44,7 +44,7 @@ void script_action_run_install (int quiet);
/*
* Lists loaded scripts (all languages).
* List loaded scripts (all languages).
*/
void
@@ -95,9 +95,9 @@ script_action_run_list (void)
}
/*
* Lists loaded scripts (all languages) in input.
* List loaded scripts (all languages) in input.
*
* Sends input to buffer if send_to_buffer == 1.
* Send input to buffer if send_to_buffer == 1.
* String is translated if translated == 1 (otherwise it's English).
*/
@@ -178,7 +178,7 @@ script_action_run_list_input (struct t_gui_buffer *buffer,
}
/*
* Loads a script.
* Load a script.
*/
void
@@ -221,7 +221,7 @@ script_action_run_load (const char *name, int quiet)
}
/*
* Unloads a script.
* Unload a script.
*/
void
@@ -326,7 +326,7 @@ script_action_run_unload (const char *name, int quiet)
}
/*
* Reloads a script.
* Reload a script.
*/
void
@@ -431,7 +431,7 @@ script_action_run_reload (const char *name, int quiet)
}
/*
* Enables/disables autoload for a script.
* Enable/disable autoload for a script.
*
* Argument "autoload" can be:
* 0: disables autoload
@@ -542,7 +542,7 @@ script_action_run_autoload (const char *name, int quiet, int autoload)
}
/*
* Installs next script.
* Install next script.
*/
int
@@ -559,7 +559,7 @@ script_action_installnext_timer_cb (const void *pointer, void *data,
}
/*
* Installs script (after download of script).
* Install script (after download of script).
*/
int
@@ -644,7 +644,7 @@ script_action_install_url_cb (const void *pointer, void *data,
}
/*
* Gets next script to install according to "install_order" in scripts.
* Get next script to install according to "install_order" in scripts.
*/
struct t_script_repo *
@@ -669,7 +669,7 @@ script_action_get_next_script_to_install (void)
}
/*
* Installs scrip(s) marked for install.
* Install scrip(s) marked for install.
*/
void
@@ -745,7 +745,7 @@ script_action_run_install (int quiet)
}
/*
* Removes a script.
* Remove a script.
*/
void
@@ -820,9 +820,9 @@ script_action_run_remove (const char *name, int quiet)
}
/*
* Un(hold)s a script.
* Un(hold) a script.
*
* Returns:
* Return:
* 1: OK
* 0: error
*/
@@ -873,7 +873,7 @@ script_action_run_hold (const char *name, int quiet)
}
/*
* Shows a diff between script installed and script in repository (after
* Show a diff between script installed and script in repository (after
* download of script).
*/
@@ -974,7 +974,7 @@ script_action_show_diff_process_cb (const void *pointer, void *data,
}
/*
* Shows source code of script (after download of script).
* Show source code of script (after download of script).
*/
int
@@ -1119,7 +1119,7 @@ script_action_show_source_url_cb (const void *pointer, void *data,
}
/*
* Shows detailed info on a script.
* Show detailed info on a script.
*/
void
@@ -1198,7 +1198,7 @@ script_action_run_show (const char *name, int quiet)
}
/*
* Jumps to diff on buffer with detail of script.
* Jump to diff on buffer with detail of script.
*/
void
@@ -1235,7 +1235,7 @@ script_action_run_showdiff (void)
}
/*
* Adds an action to list of actions.
* Add an action to list of actions.
*/
void
@@ -1261,7 +1261,7 @@ script_action_add (struct t_gui_buffer *buffer, const char *action)
}
/*
* Clears list of actions.
* Clear list of actions.
*/
void
@@ -1272,9 +1272,9 @@ script_action_clear (void)
}
/*
* Runs planned actions.
* Run planned actions.
*
* Returns:
* Return:
* 1: at least an action was executed
* 0: no action executed
*/
@@ -1571,7 +1571,7 @@ script_action_run_all (void)
}
/*
* Schedules an action.
* Schedule an action.
*
* If "need_repository" is 1:
* - if repository is up-to-date: action is executed
@@ -1621,7 +1621,7 @@ script_action_schedule (struct t_gui_buffer *buffer,
}
/*
* Ends script action.
* End script action.
*/
void
+16 -17
View File
@@ -42,7 +42,7 @@ int script_buffer_detail_script_line_diff = -1;
/*
* Displays a line with script.
* Display a line with script.
*/
void
@@ -335,9 +335,9 @@ script_buffer_display_line_script (int line, struct t_script_repo *script)
}
/*
* Gets header of a line for detail of script.
* Get header of a line for detail of script.
*
* Returns a string aligned on the right.
* Return a string aligned on the right.
*/
const char *
@@ -359,7 +359,7 @@ script_buffer_detail_label (const char *text, int max_length)
}
/*
* Gets pointer to a script (to the script managed by the appropriate plugin,
* Get pointer to a script (to the script managed by the appropriate plugin,
* for example python).
*/
@@ -398,7 +398,7 @@ script_buffer_get_script_pointer (struct t_script_repo *script,
}
/*
* Gets a list with usage of the script (commands, config options...).
* Get a list with usage of the script (commands, config options...).
*/
struct t_weelist *
@@ -592,7 +592,7 @@ script_buffer_get_script_usage (struct t_script_repo *script)
}
/*
* Displays detail on a script.
* Display detail on a script.
*/
void
@@ -751,7 +751,7 @@ script_buffer_display_detail_script (struct t_script_repo *script)
}
/*
* Updates list of scripts in script buffer.
* Update list of scripts in script buffer.
*/
void
@@ -813,7 +813,7 @@ script_buffer_refresh (int clear)
}
/*
* Sets current selected line.
* Set current selected line.
*/
void
@@ -837,7 +837,7 @@ script_buffer_set_current_line (int line)
}
/*
* Shows detailed info on a script.
* Show detailed info on a script.
*/
void
@@ -859,7 +859,7 @@ script_buffer_show_detail_script (struct t_script_repo *script)
}
/*
* Gets info about a window.
* Get info about a window.
*/
void
@@ -895,9 +895,9 @@ script_buffer_get_window_info (struct t_gui_window *window,
}
/*
* Checks if current line is outside window.
* Check if current line is outside window.
*
* Returns:
* Return:
* 1: line is outside window
* 0: line is inside window
*/
@@ -1070,8 +1070,7 @@ script_buffer_close_cb (const void *pointer, void *data,
}
/*
* Restore buffer callbacks (input and close) for buffer created by script
* plugin.
* Restore buffer callbacks (input and close) for buffer created by script plugin.
*/
void
@@ -1089,7 +1088,7 @@ script_buffer_set_callbacks (void)
}
/*
* Sets keys on script buffer.
* Set keys on script buffer.
*
* If hashtable is not NULL, it is used to set keys, otherwise keys are directly
* set in the script buffer.
@@ -1140,7 +1139,7 @@ script_buffer_set_keys (struct t_hashtable *hashtable)
}
/*
* Sets the local variable "filter" in the script buffer.
* Set the local variable "filter" in the script buffer.
*/
void
@@ -1154,7 +1153,7 @@ script_buffer_set_localvar_filter (void)
}
/*
* Opens script buffer.
* Open script buffer.
*/
void
+2 -2
View File
@@ -35,7 +35,7 @@
/*
* Runs an action.
* Run an action.
*/
void
@@ -313,7 +313,7 @@ script_command_script (const void *pointer, void *data,
}
/*
* Hooks script command.
* Hook script command.
*/
void
+8 -8
View File
@@ -32,7 +32,7 @@
/*
* Adds script languages (python, perl, ruby, ...) to completion list.
* Add script languages (python, perl, ruby, ...) to completion list.
*/
int
@@ -60,7 +60,7 @@ script_completion_languages_cb (const void *pointer, void *data,
}
/*
* Adds script extensions (py, pl, rb, ...) to completion list.
* Add script extensions (py, pl, rb, ...) to completion list.
*/
int
@@ -88,7 +88,7 @@ script_completion_extensions_cb (const void *pointer, void *data,
}
/*
* Adds scripts to completion list.
* Add scripts to completion list.
*/
int
@@ -117,7 +117,7 @@ script_completion_scripts_cb (const void *pointer, void *data,
}
/*
* Adds installed scripts to completion list.
* Add installed scripts to completion list.
*/
int
@@ -149,7 +149,7 @@ script_completion_scripts_installed_cb (const void *pointer, void *data,
}
/*
* Adds files in script directories to completion list.
* Add files in script directories to completion list.
*/
void
@@ -182,7 +182,7 @@ script_completion_exec_file_cb (void *data, const char *filename)
}
/*
* Adds files in script directories to completion list.
* Add files in script directories to completion list.
*/
int
@@ -235,7 +235,7 @@ script_completion_scripts_files_cb (const void *pointer, void *data,
}
/*
* Adds tags from scripts in repository to completion list.
* Add tags from scripts in repository to completion list.
*/
int
@@ -285,7 +285,7 @@ script_completion_tags_cb (const void *pointer, void *data,
}
/*
* Hooks completions.
* Hook completions.
*/
void
+13 -13
View File
@@ -95,11 +95,11 @@ struct t_config_option *script_config_scripts_url = NULL;
/*
* Gets the diff command (option "script.look.diff_command").
* Get the diff command (option "script.look.diff_command").
*
* If option is "auto", try to find git, and fallbacks on "diff" if not found.
*
* Returns NULL if no diff command is set.
* Return NULL if no diff command is set.
*/
const char *
@@ -155,7 +155,7 @@ script_config_get_diff_command (void)
}
/*
* Gets filename with list of scripts.
* Get filename with list of scripts.
*
* Note: result must be freed after use.
*/
@@ -182,8 +182,8 @@ script_config_get_xml_filename (void)
}
/*
* Gets filename for a script to download.
* If suffix is not NULL, it is added to filename.
* Get filename for a script to download.
* If suffix is not NULL, add it to the filename.
*
* Note: result must be freed after use.
*/
@@ -289,7 +289,7 @@ script_config_change_hold_cb (const void *pointer, void *data,
}
/*
* Holds a script.
* Hold a script.
*
* Note: the option is changed, but the status "held" in script is NOT updated
* by this function.
@@ -337,7 +337,7 @@ script_config_hold (const char *name_with_extension)
}
/*
* Unholds a script.
* Unhold a script.
*
* Note: the option is changed, but the status "held" in script is NOT updated
* by this function.
@@ -382,7 +382,7 @@ script_config_unhold (const char *name_with_extension)
}
/*
* Reloads script configuration file.
* Reload script configuration file.
*/
int
@@ -397,9 +397,9 @@ script_config_reload (const void *pointer, void *data,
}
/*
* Initializes script configuration file.
* Initialize script configuration file.
*
* Returns:
* Return:
* 1: OK
* 0: error
*/
@@ -796,7 +796,7 @@ script_config_init (void)
}
/*
* Reads script configuration file.
* Read script configuration file.
*/
int
@@ -806,7 +806,7 @@ script_config_read (void)
}
/*
* Writes script configuration file.
* Write script configuration file.
*/
int
@@ -816,7 +816,7 @@ script_config_write (void)
}
/*
* Frees script configuration file.
* Free script configuration file.
*/
void
+4 -4
View File
@@ -31,7 +31,7 @@
/*
* Returns script info "script_info".
* Return script info "script_info".
*/
char *
@@ -109,7 +109,7 @@ end:
}
/*
* Returns script info "script_loaded".
* Return script info "script_loaded".
*/
char *
@@ -160,7 +160,7 @@ script_info_info_script_loaded_cb (const void *pointer, void *data,
}
/*
* Returns script infolist "script_script".
* Return script infolist "script_script".
*/
struct t_infolist *
@@ -218,7 +218,7 @@ script_info_infolist_script_script_cb (const void *pointer, void *data,
}
/*
* Hooks infolist and hdata.
* Hook infolist and hdata.
*/
void
+3 -3
View File
@@ -113,9 +113,9 @@ script_mouse_focus_chat_cb (const void *pointer, void *data,
}
/*
* Initializes mouse.
* Initialize mouse.
*
* Returns:
* Return:
* 1: OK
* 0: error
*/
@@ -161,7 +161,7 @@ script_mouse_init (void)
}
/*
* Ends mouse.
* End mouse.
*/
void
+43 -43
View File
@@ -56,9 +56,9 @@ char *script_repo_filter = NULL;
/*
* Checks if a script pointer is valid.
* Check if a script pointer is valid.
*
* Returns:
* Return:
* 1: script exists
* 0: script does not exist
*/
@@ -83,9 +83,9 @@ script_repo_script_valid (struct t_script_repo *script)
}
/*
* Searches for a script displayed by number (first script displayed is 0).
* Search for a script displayed by number (first script displayed is 0).
*
* Returns pointer to script found, NULL if not found.
* Return pointer to script found, NULL if not found.
*/
struct t_script_repo *
@@ -114,9 +114,9 @@ script_repo_search_displayed_by_number (int number)
}
/*
* Searches for a script by name (example: "go").
* Search for a script by name (example: "go").
*
* Returns pointer to script found, NULL if not found.
* Return pointer to script found, NULL if not found.
*/
struct t_script_repo *
@@ -139,9 +139,9 @@ script_repo_search_by_name (const char *name)
}
/*
* Searches for a script by name/extension (example: "go.py").
* Search for a script by name/extension (example: "go.py").
*
* Returns pointer to script found, NULL if not found.
* Return pointer to script found, NULL if not found.
*/
struct t_script_repo *
@@ -164,8 +164,8 @@ script_repo_search_by_name_ext (const char *name_with_extension)
}
/*
* Gets filename of a loaded script (returns name of file and not the link, if
* there is a symbolic to file).
* Get filename of a loaded script: return name of file and not the link, if
* there is a symbolic to file.
*
* Note: result must be freed after use.
*/
@@ -223,7 +223,7 @@ script_repo_get_filename_loaded (struct t_script_repo *script)
}
/*
* Gets status for display.
* Get status for display.
*
* Argument "list" is the codes of status to display:
* * popular
@@ -288,7 +288,7 @@ script_repo_get_status_for_display (struct t_script_repo *script,
}
/*
* Gets status description for display.
* Get status description for display.
*
* Argument "list" is the codes of status to display (see function
* script_repo_get_status_for_display() above).
@@ -371,9 +371,9 @@ script_repo_get_status_desc_for_display (struct t_script_repo *script,
}
/*
* Allocates a script structure.
* Allocate a script structure.
*
* Returns pointer to new script, NULL if error.
* Return pointer to new script, NULL if error.
*/
struct t_script_repo *
@@ -413,9 +413,9 @@ script_repo_alloc (void)
}
/*
* Compares two scripts using sort key(s) (from option script.look.sort).
* Compare two scripts using sort key(s) (from option script.look.sort).
*
* Returns:
* Return:
* < 0: script1 < script2
* 0: script1 == script2
* > 0: script1 > script2
@@ -515,7 +515,7 @@ script_repo_compare_scripts (struct t_script_repo *script1,
}
/*
* Searches for position for script in list (to keep list sorted).
* Search for position for script in list (to keep list sorted).
*/
struct t_script_repo *
@@ -535,7 +535,7 @@ script_repo_find_pos (struct t_script_repo *script)
}
/*
* Sets max length for a field in hashtable "script_repo_max_length_field".
* Set max length for a field in hashtable "script_repo_max_length_field".
*/
void
@@ -549,7 +549,7 @@ script_repo_set_max_length_field (const char *field, int length)
}
/*
* Adds a script to list of scripts.
* Add a script to list of scripts.
*/
void
@@ -616,7 +616,7 @@ script_repo_add (struct t_script_repo *script)
}
/*
* Frees data in a script.
* Free data in a script.
*/
void
@@ -644,7 +644,7 @@ script_repo_free (struct t_script_repo *script)
}
/*
* Removes a script from list.
* Remove a script from list.
*/
void
@@ -686,7 +686,7 @@ script_repo_remove (struct t_script_repo *script)
}
/*
* Removes all scripts from list.
* Remove all scripts from list.
*/
void
@@ -704,9 +704,9 @@ script_repo_remove_all (void)
}
/*
* Checks if a script is held.
* Check if a script is held.
*
* Returns:
* Return:
* 1: script is held
* 0: script is not held
*/
@@ -737,7 +737,7 @@ script_repo_script_is_held (struct t_script_repo *script)
}
/*
* Computes SHA-512 checksum for the content of a file.
* Compute SHA-512 checksum for the content of a file.
*
* Note: result must be freed after use.
*/
@@ -757,7 +757,7 @@ script_repo_sha512sum_file (const char *filename)
}
/*
* Updates following status of a script:
* Update following status of a script:
* - script installed?
* - script running?
* - new version available?
@@ -853,7 +853,7 @@ script_repo_update_status (struct t_script_repo *script)
}
/*
* Updates status of all scripts.
* Update status of all scripts.
*/
void
@@ -869,7 +869,7 @@ script_repo_update_status_all (void)
}
/*
* Sets filter for scripts.
* Set filter for scripts.
*/
void
@@ -882,9 +882,9 @@ script_repo_set_filter (const char *filter)
}
/*
* Checks if a script is matching a filter string.
* Check if a script is matching a filter string.
*
* Returns:
* Return:
* 1: script is matching filter string
* 0: script does not match filter string
*/
@@ -975,7 +975,7 @@ script_repo_match_filter (struct t_script_repo *script)
}
/*
* Filters scripts (search string in name/description/tags) and marks scripts
* Filter scripts (search string in name/description/tags) and marks scripts
* found as "displayed" (0 in displayed for non-matching scripts).
*/
@@ -1000,9 +1000,9 @@ script_repo_filter_scripts (const char *search)
}
/*
* Checks if repository file (plugins.xml.gz) exists.
* Check if repository file (plugins.xml.gz) exists.
*
* Returns:
* Return:
* 1: repository file exists
* 0: repository file does not exist
*/
@@ -1028,10 +1028,10 @@ script_repo_file_exists (void)
}
/*
* Checks if repository file (plugins.xml.gz) is up-to-date (file exists and it
* Check if repository file (plugins.xml.gz) is up-to-date (file exists and it
* not outdated).
*
* Returns:
* Return:
* 1: repository file is up-to-date
* 0: repository file does not exist or is outdated
* (file has to be downloaded)
@@ -1093,9 +1093,9 @@ script_repo_file_is_uptodate (void)
}
/*
* Reads scripts in repository file (plugins.xml.gz).
* Read scripts in repository file (plugins.xml.gz).
*
* Returns:
* Return:
* 1: OK
* 0: error
*/
@@ -1433,9 +1433,9 @@ script_repo_file_update_url_cb (const void *pointer, void *data,
}
/*
* Updates repository file and reads it.
* Update repository file and reads it.
*
* Returns:
* Return:
* 0: error
* 1: OK
*/
@@ -1484,7 +1484,7 @@ script_repo_file_update (int quiet)
}
/*
* Returns hdata for script.
* Return hdata for script.
*/
struct t_hdata *
@@ -1531,9 +1531,9 @@ script_repo_hdata_script_cb (const void *pointer, void *data,
}
/*
* Adds a script in an infolist.
* Add a script in an infolist.
*
* Returns:
* Return:
* 1: OK
* 0: error
*/
@@ -1598,7 +1598,7 @@ script_repo_add_to_infolist (struct t_infolist *infolist,
}
/*
* Prints scripts in WeeChat log file (usually for crash dump).
* Print scripts in WeeChat log file (usually for crash dump).
*/
void
+10 -10
View File
@@ -59,9 +59,9 @@ struct t_hook *script_timer_refresh = NULL;
/*
* Searches for a language.
* Search for a language.
*
* Returns index of language, -1 if not found.
* Return index of language, -1 if not found.
*/
int
@@ -83,9 +83,9 @@ script_language_search (const char *language)
}
/*
* Searches for a language by extension.
* Search for a language by extension.
*
* Returns index of language, -1 if not found.
* Return index of language, -1 if not found.
*/
int
@@ -107,9 +107,9 @@ script_language_search_by_extension (const char *extension)
}
/*
* Checks if download of scripts is enabled.
* Check if download of scripts is enabled.
*
* Returns:
* Return:
* 0: download NOT enabled (an error is displayed if display_error is 1)
* 1: download enabled
*/
@@ -133,7 +133,7 @@ script_download_enabled (int display_error)
}
/*
* Gets loaded plugins (in array of integers).
* Get loaded plugins (in array of integers).
*/
void
@@ -161,7 +161,7 @@ script_get_loaded_plugins (void)
}
/*
* Gets scripts (in hashtable).
* Get scripts (in hashtable).
*/
void
@@ -326,7 +326,7 @@ script_signal_script_cb (const void *pointer, void *data,
}
/*
* Initializes script plugin.
* Initialize script plugin.
*/
int
@@ -379,7 +379,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
}
/*
* Ends script plugin.
* End script plugin.
*/
int