mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 00:52:30 +02:00
iconfig's caching was a bit buggy - it didn't notice if some config node was
removed. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@213 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
afc4fbc223
commit
bb4d7566c2
12 changed files with 106 additions and 62 deletions
|
|
@ -50,7 +50,8 @@ struct _config_rec {
|
|||
|
||||
char *last_error;
|
||||
CONFIG_NODE *mainnode;
|
||||
GHashTable *cache;
|
||||
GHashTable *cache; /* path -> node (for querying) */
|
||||
GHashTable *cache_nodes; /* node -> path (for removing) */
|
||||
|
||||
GScanner *scanner;
|
||||
|
||||
|
|
@ -124,17 +125,15 @@ 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_NODE *parent, const char *key, const char *value);
|
||||
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);
|
||||
|
||||
/* Add/change the value of the `key' */
|
||||
void config_node_set_str(CONFIG_NODE *parent, const char *key, const char *value);
|
||||
/* Remove one node from block/list.
|
||||
..set_str() with value = NULL does the same. */
|
||||
void config_node_remove(CONFIG_NODE *parent, CONFIG_NODE *node);
|
||||
void config_node_remove(CONFIG_REC *rec, CONFIG_NODE *parent, CONFIG_NODE *node);
|
||||
/* Remove n'th node from a list */
|
||||
void config_node_list_remove(CONFIG_NODE *node, int index);
|
||||
void config_node_list_remove(CONFIG_REC *rec, CONFIG_NODE *node, int index);
|
||||
|
||||
/* Clear the entire configuration */
|
||||
void config_nodes_remove_all(CONFIG_REC *rec);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue