1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Comments are now allowed everywhere in config files.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2374 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-02-02 17:37:44 +00:00 committed by cras
parent 85b63bf546
commit 0ce3f8243e
14 changed files with 45 additions and 52 deletions

View File

@ -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);
}
}

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);

View File

@ -360,11 +360,11 @@ static GList *completion_get_aliases(const char *alias, char cmdchar)
/* get list of aliases from mainconfig */
node = iconfig_node_traverse("aliases", FALSE);
tmp = node == NULL ? NULL : node->value;
tmp = node == NULL ? NULL : config_node_first(node->value);
len = strlen(alias);
complist = NULL;
for (; tmp != NULL; tmp = tmp->next) {
for (; tmp != NULL; tmp = config_node_next(tmp)) {
CONFIG_NODE *node = tmp->data;
if (node->type != NODE_TYPE_KEY)

View File

@ -173,12 +173,12 @@ static void show_aliases(const char *alias)
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_ALIASLIST_HEADER);
node = iconfig_node_traverse("aliases", FALSE);
tmp = node == NULL ? NULL : node->value;
tmp = node == NULL ? NULL : config_node_first(node->value);
/* first get the list of aliases sorted */
list = NULL;
aliaslen = strlen(alias);
for (; tmp != NULL; tmp = tmp->next) {
for (; tmp != NULL; tmp = config_node_next(tmp)) {
CONFIG_NODE *node = tmp->data;
if (node->type != NODE_TYPE_KEY)

View File

@ -399,7 +399,8 @@ static void read_hilight_config(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)

View File

@ -114,7 +114,8 @@ static CONFIG_NODE *key_config_find(const char *key)
/* remove old keyboard settings */
node = iconfig_node_traverse("(keyboard", TRUE);
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 (strcmp(config_node_get_str(node, "key", ""), key) == 0)
@ -794,7 +795,8 @@ static void read_keyboard_config(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))
key_config_read(tmp->data);
key_configure_thaw();

View File

@ -81,7 +81,8 @@ static void window_add_items(WINDOW_REC *window, CONFIG_NODE *node)
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)) {
CONFIG_NODE *node = tmp->data;
type = config_node_get_str(node, "type", NULL);
@ -106,7 +107,8 @@ static void sig_layout_restore(void)
node = iconfig_node_traverse("windows", 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)) {
CONFIG_NODE *node = tmp->data;
window = window_find_refnum(atoi(node->key));

View File

@ -99,7 +99,8 @@ static GSList *get_sorted_windows_config(CONFIG_NODE *node)
GSList *tmp, *output;
output = NULL;
for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
tmp = config_node_first(node->value);
for (; tmp != NULL; tmp = config_node_next(tmp)) {
output = g_slist_insert_sorted(output, tmp->data,
(GCompareFunc) window_node_cmp);
}

View File

@ -65,7 +65,8 @@ void notifylist_read_config(void)
node = iconfig_node_traverse("notifies", 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)