From 193ff0db373dc540e013f713dac23d88323f553a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 9 Jun 2017 07:54:27 +0200 Subject: [PATCH] core: remove unused functions config_file_config_insert and config_file_section_insert_in_config (issue #1012) --- src/core/wee-config-file.c | 92 -------------------------------------- 1 file changed, 92 deletions(-) diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index f0a7a33eb..199b0d1bc 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -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. *