1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 08:43:13 +02:00

Added alias plugin, added missing config file functions in plugins API

This commit is contained in:
Sebastien Helleu
2007-12-03 18:03:10 +01:00
parent e0826e1ce7
commit 2888d41425
29 changed files with 1242 additions and 914 deletions
+92
View File
@@ -199,6 +199,34 @@ plugin_api_string_free_exploded (struct t_weechat_plugin *plugin,
string_free_exploded (exploded_string);
}
/*
* plugin_api_string_split_command: split a ocmmanc
*/
char **
plugin_api_string_split_command (struct t_weechat_plugin *plugin, char *string,
char separator)
{
if (!plugin || !string)
return NULL;
return string_split_command (string, separator);
}
/*
* plugin_api_string_free_splitted_command: free splitted command
*/
void
plugin_api_string_free_splitted_command (struct t_weechat_plugin *plugin,
char **splitted_command)
{
/* make C compiler happy */
(void) plugin;
string_free_splitted_command (splitted_command);
}
/*
* plugin_api_mkdir_home: create a directory in WeeChat home
*/
@@ -397,6 +425,70 @@ plugin_api_config_color (struct t_weechat_plugin *plugin, void *option)
return 0;
}
/*
* plugin_api_config_read: read a configuration file
*/
int
plugin_api_config_read (struct t_weechat_plugin *plugin, void *config_file)
{
if (plugin && config_file_valid_for_plugin (plugin, config_file))
return config_file_read ((struct t_config_file *)config_file);
else
return -1;
}
/*
* plugin_api_config_reload: reload a configuration file
*/
int
plugin_api_config_reload (struct t_weechat_plugin *plugin, void *config_file)
{
if (plugin && config_file_valid_for_plugin (plugin, config_file))
return config_file_reload ((struct t_config_file *)config_file);
else
return -1;
}
/*
* plugin_api_config_write: write a configuration file
*/
int
plugin_api_config_write (struct t_weechat_plugin *plugin, void *config_file)
{
if (plugin && config_file_valid_for_plugin (plugin, config_file))
return config_file_write ((struct t_config_file *)config_file, 0);
else
return -1;
}
/*
* plugin_api_config_write_line: write a line in configuration file
*/
void
plugin_api_config_write_line (struct t_weechat_plugin *plugin,
void *config_file, char *option_name,
char *value)
{
if (plugin && config_file_valid_for_plugin (plugin, config_file))
config_file_write_line ((struct t_config_file *)config_file,
option_name, value);
}
/*
* plugin_api_config_free: free a configuration file
*/
void
plugin_api_config_free (struct t_weechat_plugin *plugin, void *config_file)
{
if (plugin && config_file_valid_for_plugin (plugin, config_file))
config_file_free ((struct t_config_file *)config_file);
}
/*
* plugin_api_get_config_str_value: return string value for any option
* This function should never be called directly