mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 08:02:13 +02:00
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
This commit is contained in:
parent
a392b41f2f
commit
0d8239e40e
12 changed files with 39 additions and 36 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue