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

core: remove unused functions config_file_config_insert and config_file_section_insert_in_config (issue #1012)

This commit is contained in:
Sébastien Helleu
2017-06-09 07:54:27 +02:00
parent 0094be17a8
commit 193ff0db37
-92
View File
@@ -106,52 +106,6 @@ config_file_config_find_pos (const char *name)
return NULL;
}
/*
* Inserts a configuration file in list (keeping configuration files sorted by
* name).
*/
void
config_file_config_insert (struct t_config_file *config_file)
{
struct t_config_file *pos_config;
if (!config_file)
return;
if (config_files)
{
pos_config = config_file_config_find_pos (config_file->name);
if (pos_config)
{
/* insert configuration file into the list (before config found) */
config_file->prev_config = pos_config->prev_config;
config_file->next_config = pos_config;
if (pos_config->prev_config)
(pos_config->prev_config)->next_config = config_file;
else
config_files = config_file;
pos_config->prev_config = config_file;
}
else
{
/* add configuration file to the end of list */
config_file->prev_config = last_config_file;
config_file->next_config = NULL;
last_config_file->next_config = config_file;
last_config_file = config_file;
}
}
else
{
/* first configuration file */
config_file->prev_config = NULL;
config_file->next_config = NULL;
config_files = config_file;
last_config_file = config_file;
}
}
/*
* Creates a new configuration file.
*
@@ -247,52 +201,6 @@ config_file_section_find_pos (struct t_config_file *config_file,
return NULL;
}
/*
* Inserts a section in configuration file (keeping sections sorted by name).
*/
void
config_file_section_insert_in_config (struct t_config_section *section)
{
struct t_config_section *pos_section;
if (!section || !section->config_file)
return;
if (section->config_file->sections)
{
pos_section = config_file_section_find_pos (section->config_file,
section->name);
if (pos_section)
{
/* insert section into the list (before section found) */
section->prev_section = pos_section->prev_section;
section->next_section = pos_section;
if (pos_section->prev_section)
(pos_section->prev_section)->next_section = section;
else
(section->config_file)->sections = section;
pos_section->prev_section = section;
}
else
{
/* add section to end of sections */
section->prev_section = (section->config_file)->last_section;
section->next_section = NULL;
(section->config_file)->last_section->next_section = section;
(section->config_file)->last_section = section;
}
}
else
{
/* first section of file */
section->prev_section = NULL;
section->next_section = NULL;
(section->config_file)->sections = section;
(section->config_file)->last_section = section;
}
}
/*
* Creates a new section in a configuration file.
*