summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-02 17:37:44 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-02 17:37:44 +0000
commit0ce3f8243eb564063c66a1b32169109af17e4081 (patch)
tree834275a5cb412c07efafc83a2f180e3cf5d697d0 /src/core
parent85b63bf5465f4cc6d2fd1472cb9e87c5b6719f63 (diff)
downloadirssi-0ce3f8243eb564063c66a1b32169109af17e4081.zip
Comments are now allowed everywhere in config files.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2374 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r--src/core/channels-setup.c3
-rw-r--r--src/core/chatnets.c8
-rw-r--r--src/core/ignore.c3
-rw-r--r--src/core/log.c6
-rw-r--r--src/core/servers-setup.c3
-rw-r--r--src/core/session.c9
-rw-r--r--src/core/settings.c36
7 files changed, 27 insertions, 41 deletions
diff --git a/src/core/channels-setup.c b/src/core/channels-setup.c
index a53bd3f3..e434cd9c 100644
--- a/src/core/channels-setup.c
+++ b/src/core/channels-setup.c
@@ -158,7 +158,8 @@ static void channels_read_config(void)
/* Read channels */
node = iconfig_node_traverse("channels", FALSE);
if (node != NULL) {
- for (tmp = node->value; tmp != NULL; tmp = tmp->next)
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp))
channel_setup_read(tmp->data);
}
}
diff --git a/src/core/chatnets.c b/src/core/chatnets.c
index 62c31c98..1b1b718c 100644
--- a/src/core/chatnets.c
+++ b/src/core/chatnets.c
@@ -162,6 +162,7 @@ static void chatnet_read(CONFIG_NODE *node)
static void read_chatnets(void)
{
CONFIG_NODE *node;
+ GSList *tmp;
while (chatnets != NULL)
chatnet_destroy(chatnets->data);
@@ -178,8 +179,11 @@ static void read_chatnets(void)
}
}
- if (node != NULL)
- g_slist_foreach(node->value, (GFunc) chatnet_read, NULL);
+ if (node != NULL) {
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp))
+ chatnet_read(tmp->data);
+ }
}
void chatnets_init(void)
diff --git a/src/core/ignore.c b/src/core/ignore.c
index 8c7c5d12..c98646c1 100644
--- a/src/core/ignore.c
+++ b/src/core/ignore.c
@@ -408,7 +408,8 @@ static void read_ignores(void)
return;
}
- for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp)) {
node = tmp->data;
if (node->type != NODE_TYPE_BLOCK)
diff --git a/src/core/log.c b/src/core/log.c
index f88bdb0a..ccad07ca 100644
--- a/src/core/log.c
+++ b/src/core/log.c
@@ -473,7 +473,8 @@ static void log_items_read_config(CONFIG_NODE *node, LOG_REC *log)
char *item;
int type;
- for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp)) {
node = tmp->data;
if (node->type != NODE_TYPE_BLOCK)
@@ -516,7 +517,8 @@ static void log_read_config(void)
node = iconfig_node_traverse("logs", FALSE);
if (node == NULL) return;
- for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp)) {
node = tmp->data;
if (node->type != NODE_TYPE_BLOCK)
diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c
index 8289b2c3..1412a1a7 100644
--- a/src/core/servers-setup.c
+++ b/src/core/servers-setup.c
@@ -493,7 +493,8 @@ static void read_servers(void)
/* Read servers */
node = iconfig_node_traverse("servers", FALSE);
if (node != NULL) {
- for (tmp = node->value; tmp != NULL; tmp = tmp->next)
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp))
server_setup_read(tmp->data);
}
}
diff --git a/src/core/session.c b/src/core/session.c
index e72bf64a..0248f13e 100644
--- a/src/core/session.c
+++ b/src/core/session.c
@@ -201,7 +201,8 @@ static void session_restore_channel_nicks(CHANNEL_REC *channel,
/* restore nicks */
node = config_node_section(node, "nicks", -1);
if (node != NULL && node->type == NODE_TYPE_LIST) {
- for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp)) {
signal_emit("session restore nick", 2,
channel, tmp->data);
}
@@ -233,7 +234,8 @@ static void session_restore_server_channels(SERVER_REC *server,
/* restore channels */
node = config_node_section(node, "channels", -1);
if (node != NULL && node->type == NODE_TYPE_LIST) {
- for (tmp = node->value; tmp != NULL; tmp = tmp->next)
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp))
session_restore_channel(server, tmp->data);
}
}
@@ -304,7 +306,8 @@ static void sig_session_restore(CONFIG_REC *config)
/* restore servers */
node = config_node_traverse(config, "(servers", FALSE);
if (node != NULL) {
- for (tmp = node->value; tmp != NULL; tmp = config_node_next(tmp))
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp))
session_restore_server(tmp->data);
}
diff --git a/src/core/settings.c b/src/core/settings.c
index b13163e0..1a98462a 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -280,20 +280,6 @@ static void sig_init_finished(void)
}
}
-/* FIXME: remove after 0.7.98 - only for backward compatibility */
-static void settings_move(SETTINGS_REC *rec, char *value)
-{
- CONFIG_NODE *setnode, *node;
-
- setnode = iconfig_node_traverse("settings", TRUE);
- node = config_node_section(setnode, rec->module, NODE_TYPE_BLOCK);
-
- iconfig_node_set_str(node, rec->key, value);
- iconfig_node_set_str(setnode, rec->key, NULL);
-
- config_changed = TRUE;
-}
-
static void settings_clean_invalid_module(const char *module)
{
CONFIG_NODE *node;
@@ -306,9 +292,9 @@ static void settings_clean_invalid_module(const char *module)
node = config_node_section(node, module, -1);
if (node == NULL) return;
- for (tmp = node->value; tmp != NULL; tmp = next) {
+ for (tmp = config_node_first(node->value); tmp != NULL; tmp = next) {
CONFIG_NODE *subnode = tmp->data;
- next = tmp->next;
+ next = config_node_next(tmp);
set = g_hash_table_lookup(settings, subnode->key);
if (set == NULL || strcmp(set->module, module) != 0)
@@ -338,25 +324,12 @@ void settings_check_module(const char *module)
SETTINGS_REC *set;
CONFIG_NODE *node;
GString *errors;
- GSList *tmp, *next;
+ GSList *tmp;
int count;
g_return_if_fail(module != NULL);
node = iconfig_node_traverse("settings", FALSE);
- if (node != NULL) {
- /* FIXME: remove after 0.7.98 */
- for (tmp = node->value; tmp != NULL; tmp = next) {
- CONFIG_NODE *node = tmp->data;
-
- next = tmp->next;
- if (node->type != NODE_TYPE_KEY)
- continue;
- set = g_hash_table_lookup(settings, node->key);
- if (set != NULL)
- settings_move(set, node->value);
- }
- }
node = node == NULL ? NULL : config_node_section(node, module, -1);
if (node == NULL) return;
@@ -365,7 +338,8 @@ void settings_check_module(const char *module)
"file for module %s:", module);
count = 0;
- for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
+ tmp = config_node_first(node->value);
+ for (; tmp != NULL; tmp = config_node_next(tmp)) {
node = tmp->data;
set = g_hash_table_lookup(settings, node->key);