mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
removed useless functions
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2804 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3ecf864f18
commit
7b2f9bc50a
@ -171,46 +171,6 @@ int config_get_bool(CONFIG_REC *rec, const char *section, const char *key, int d
|
|||||||
return i_toupper(*str) == 'T' || i_toupper(*str) == 'Y';
|
return i_toupper(*str) == 'T' || i_toupper(*str) == 'Y';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return value of key `value_key' from list item where `key' is `value' */
|
|
||||||
const char *config_list_find(CONFIG_REC *rec, const char *section, const char *key, const char *value, const char *value_key)
|
|
||||||
{
|
|
||||||
CONFIG_NODE *node;
|
|
||||||
|
|
||||||
node = config_list_find_node(rec, section, key, value, value_key);
|
|
||||||
return node != NULL && node->type == NODE_TYPE_KEY ?
|
|
||||||
node->value : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Like config_list_find(), but return node instead of it's value */
|
|
||||||
CONFIG_NODE *config_list_find_node(CONFIG_REC *rec, const char *section, const char *key, const char *value, const char *value_key)
|
|
||||||
{
|
|
||||||
CONFIG_NODE *node, *keynode;
|
|
||||||
GSList *tmp;
|
|
||||||
|
|
||||||
g_return_val_if_fail(rec != NULL, NULL);
|
|
||||||
g_return_val_if_fail(key != NULL, NULL);
|
|
||||||
g_return_val_if_fail(value_key != NULL, NULL);
|
|
||||||
|
|
||||||
node = config_node_traverse(rec, section, FALSE);
|
|
||||||
if (node == NULL || !is_node_list(node)) return NULL;
|
|
||||||
|
|
||||||
for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
|
|
||||||
node = tmp->data;
|
|
||||||
|
|
||||||
if (node->type != NODE_TYPE_BLOCK)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* key matches value? */
|
|
||||||
keynode = config_node_find(node, key);
|
|
||||||
if (keynode == NULL || keynode->type != NODE_TYPE_KEY ||
|
|
||||||
g_strcasecmp(keynode->value, value) != 0) continue;
|
|
||||||
|
|
||||||
return config_node_find(node, value_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *config_node_get_str(CONFIG_NODE *parent, const char *key, const char *def)
|
char *config_node_get_str(CONFIG_NODE *parent, const char *key, const char *def)
|
||||||
{
|
{
|
||||||
CONFIG_NODE *node;
|
CONFIG_NODE *node;
|
||||||
|
@ -93,10 +93,6 @@ char *config_get_str(CONFIG_REC *rec, const char *section, const char *key, cons
|
|||||||
int config_get_int(CONFIG_REC *rec, const char *section, const char *key, int def);
|
int config_get_int(CONFIG_REC *rec, const char *section, const char *key, int def);
|
||||||
int config_get_bool(CONFIG_REC *rec, const char *section, const char *key, int def);
|
int config_get_bool(CONFIG_REC *rec, const char *section, const char *key, int def);
|
||||||
|
|
||||||
/* Return value of key `value_key' from list item where `key' is `value' */
|
|
||||||
const char *config_list_find(CONFIG_REC *rec, const char *section, const char *key, const char *value, const char *value_key);
|
|
||||||
/* Like config_list_find(), but return node instead of it's value */
|
|
||||||
CONFIG_NODE *config_list_find_node(CONFIG_REC *rec, const char *section, const char *key, const char *value, const char *value_key);
|
|
||||||
/* Returns n'th node from list. */
|
/* Returns n'th node from list. */
|
||||||
CONFIG_NODE *config_node_nth(CONFIG_NODE *node, int index);
|
CONFIG_NODE *config_node_nth(CONFIG_NODE *node, int index);
|
||||||
/* Returns index for given key */
|
/* Returns index for given key */
|
||||||
|
Loading…
Reference in New Issue
Block a user