summaryrefslogtreecommitdiff
path: root/src/lib-config
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-11-26 10:24:30 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-11-26 10:24:30 +0000
commit0d8239e40e504cb1a4cce5e8d48cc0c7898c6e31 (patch)
treeb2ad2e439210d1a1e92a406c5e03853cd7b0de45 /src/lib-config
parenta392b41f2ff5f4d3417d28508ec1a8c8a013fce0 (diff)
downloadirssi-0d8239e40e504cb1a4cce5e8d48cc0c7898c6e31.zip
config changes, CONFIG_REC is now required parameter for
config_node_set_int/bool() and config_node_add_list() git-svn-id: http://svn.irssi.org/repos/irssi/trunk@886 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/lib-config')
-rw-r--r--src/lib-config/iconfig.h6
-rw-r--r--src/lib-config/set.c14
2 files changed, 10 insertions, 10 deletions
diff --git a/src/lib-config/iconfig.h b/src/lib-config/iconfig.h
index c00fdd0c..2718caa9 100644
--- a/src/lib-config/iconfig.h
+++ b/src/lib-config/iconfig.h
@@ -122,15 +122,15 @@ int config_node_get_keyvalue(CONFIG_NODE *node, const char *key, const char *val
/* Return all values from from the list `node' in a g_strsplit() array */
char **config_node_get_list(CONFIG_NODE *node);
/* Add all values in `array' to `node' */
-void config_node_add_list(CONFIG_NODE *node, char **array);
+void config_node_add_list(CONFIG_REC *rec, CONFIG_NODE *node, char **array);
char *config_node_get_str(CONFIG_NODE *parent, const char *key, const char *def);
int config_node_get_int(CONFIG_NODE *parent, const char *key, int def);
int config_node_get_bool(CONFIG_NODE *parent, const char *key, int def);
void config_node_set_str(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key, const char *value);
-void config_node_set_int(CONFIG_NODE *parent, const char *key, int value);
-void config_node_set_bool(CONFIG_NODE *parent, const char *key, int value);
+void config_node_set_int(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key, int value);
+void config_node_set_bool(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key, int value);
/* Remove one node from block/list.
..set_str() with value = NULL does the same. */
diff --git a/src/lib-config/set.c b/src/lib-config/set.c
index e0d3cf08..99b9583e 100644
--- a/src/lib-config/set.c
+++ b/src/lib-config/set.c
@@ -92,7 +92,7 @@ void config_node_set_str(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key,
CONFIG_NODE *node;
int no_key;
- g_return_if_fail(rec != NULL || value != NULL);
+ g_return_if_fail(rec != NULL);
g_return_if_fail(parent != NULL);
no_key = key == NULL;
@@ -120,17 +120,17 @@ void config_node_set_str(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key,
rec->modifycounter++;
}
-void config_node_set_int(CONFIG_NODE *parent, const char *key, int value)
+void config_node_set_int(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key, int value)
{
char str[MAX_INT_STRLEN];
g_snprintf(str, sizeof(str), "%d", value);
- config_node_set_str(NULL, parent, key, str);
+ config_node_set_str(rec, parent, key, str);
}
-void config_node_set_bool(CONFIG_NODE *parent, const char *key, int value)
+void config_node_set_bool(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key, int value)
{
- config_node_set_str(NULL, parent, key, value ? "yes" : "no");
+ config_node_set_str(rec, parent, key, value ? "yes" : "no");
}
int config_set_str(CONFIG_REC *rec, const char *section, const char *key, const char *value)
@@ -160,10 +160,10 @@ int config_set_bool(CONFIG_REC *rec, const char *section, const char *key, int v
}
/* Add all values in `array' to `node' */
-void config_node_add_list(CONFIG_NODE *node, char **array)
+void config_node_add_list(CONFIG_REC *rec, CONFIG_NODE *node, char **array)
{
char **tmp;
for (tmp = array; *tmp != NULL; tmp++)
- config_node_set_str(NULL, node, NULL, *tmp);
+ config_node_set_str(rec, node, NULL, *tmp);
}