mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Keep documentation for public api only in headers to avoid duplication.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4755 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
006add0851
commit
75352a5998
@ -38,8 +38,6 @@ CONFIG_NODE *config_node_find(CONFIG_NODE *node, const char *key)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the section from node - if not found create it unless new_type is -1.
|
|
||||||
you can also specify in new_type if it's NODE_TYPE_LIST or NODE_TYPE_BLOCK */
|
|
||||||
CONFIG_NODE *config_node_section(CONFIG_NODE *parent, const char *key, int new_type)
|
CONFIG_NODE *config_node_section(CONFIG_NODE *parent, const char *key, int new_type)
|
||||||
{
|
{
|
||||||
return config_node_section_index(parent, key, -1, new_type);
|
return config_node_section_index(parent, key, -1, new_type);
|
||||||
@ -80,8 +78,6 @@ CONFIG_NODE *config_node_section_index(CONFIG_NODE *parent, const char *key,
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the section with the whole path.
|
|
||||||
create the path if necessary `create' is TRUE. */
|
|
||||||
CONFIG_NODE *config_node_traverse(CONFIG_REC *rec, const char *section, int create)
|
CONFIG_NODE *config_node_traverse(CONFIG_REC *rec, const char *section, int create)
|
||||||
{
|
{
|
||||||
CONFIG_NODE *node;
|
CONFIG_NODE *node;
|
||||||
@ -203,8 +199,6 @@ int config_node_get_bool(CONFIG_NODE *parent, const char *key, int def)
|
|||||||
(i_toupper(*str) == 'O' && i_toupper(str[1]) == 'N');
|
(i_toupper(*str) == 'O' && i_toupper(str[1]) == 'N');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the value of keys `key' and `key_value' and put them to
|
|
||||||
`ret_key' and `ret_value'. Returns -1 if not found. */
|
|
||||||
int config_node_get_keyvalue(CONFIG_NODE *node, const char *key, const char *value_key, char **ret_key, char **ret_value)
|
int config_node_get_keyvalue(CONFIG_NODE *node, const char *key, const char *value_key, char **ret_key, char **ret_value)
|
||||||
{
|
{
|
||||||
CONFIG_NODE *keynode, *valuenode;
|
CONFIG_NODE *keynode, *valuenode;
|
||||||
@ -237,7 +231,6 @@ int config_node_get_keyvalue(CONFIG_NODE *node, const char *key, const char *val
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return all values from from the list `node' in a g_strsplit() array */
|
|
||||||
char **config_node_get_list(CONFIG_NODE *node)
|
char **config_node_get_list(CONFIG_NODE *node)
|
||||||
{
|
{
|
||||||
GString *values;
|
GString *values;
|
||||||
@ -268,7 +261,6 @@ char **config_node_get_list(CONFIG_NODE *node)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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)
|
||||||
{
|
{
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
@ -289,7 +281,6 @@ CONFIG_NODE *config_node_nth(CONFIG_NODE *node, int index)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns index for given key */
|
|
||||||
int config_node_index(CONFIG_NODE *parent, const char *key)
|
int config_node_index(CONFIG_NODE *parent, const char *key)
|
||||||
{
|
{
|
||||||
CONFIG_NODE *node;
|
CONFIG_NODE *node;
|
||||||
@ -317,7 +308,6 @@ int config_node_index(CONFIG_NODE *parent, const char *key)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the first non-comment node in list */
|
|
||||||
GSList *config_node_first(GSList *list)
|
GSList *config_node_first(GSList *list)
|
||||||
{
|
{
|
||||||
while (list != NULL) {
|
while (list != NULL) {
|
||||||
@ -330,7 +320,6 @@ GSList *config_node_first(GSList *list)
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the next non-comment node in list */
|
|
||||||
GSList *config_node_next(GSList *list)
|
GSList *config_node_next(GSList *list)
|
||||||
{
|
{
|
||||||
list = list->next;
|
list = list->next;
|
||||||
|
@ -267,7 +267,6 @@ void config_parse_init(CONFIG_REC *rec, const char *name)
|
|||||||
scanner->msg_handler = (GScannerMsgFunc) config_parse_error_func;
|
scanner->msg_handler = (GScannerMsgFunc) config_parse_error_func;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse configuration file */
|
|
||||||
int config_parse(CONFIG_REC *rec)
|
int config_parse(CONFIG_REC *rec)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(rec != NULL, -1);
|
g_return_val_if_fail(rec != NULL, -1);
|
||||||
@ -288,8 +287,6 @@ int config_parse(CONFIG_REC *rec)
|
|||||||
return rec->last_error == NULL ? 0 : -1;
|
return rec->last_error == NULL ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse configuration found from `data'. `input_name' is specifies the
|
|
||||||
"configuration name" which is displayed in error messages. */
|
|
||||||
int config_parse_data(CONFIG_REC *rec, const char *data, const char *input_name)
|
int config_parse_data(CONFIG_REC *rec, const char *data, const char *input_name)
|
||||||
{
|
{
|
||||||
config_parse_init(rec, input_name);
|
config_parse_init(rec, input_name);
|
||||||
@ -300,9 +297,6 @@ int config_parse_data(CONFIG_REC *rec, const char *data, const char *input_name)
|
|||||||
return rec->last_error == NULL ? 0 : -1;
|
return rec->last_error == NULL ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open configuration. The file is created if it doesn't exist, unless
|
|
||||||
`create_mode' is -1. `fname' can be NULL if you just want to use
|
|
||||||
config_parse_data() */
|
|
||||||
CONFIG_REC *config_open(const char *fname, int create_mode)
|
CONFIG_REC *config_open(const char *fname, int create_mode)
|
||||||
{
|
{
|
||||||
CONFIG_REC *rec;
|
CONFIG_REC *rec;
|
||||||
@ -326,7 +320,6 @@ CONFIG_REC *config_open(const char *fname, int create_mode)
|
|||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release all memory used by configuration */
|
|
||||||
void config_close(CONFIG_REC *rec)
|
void config_close(CONFIG_REC *rec)
|
||||||
{
|
{
|
||||||
g_return_if_fail(rec != NULL);
|
g_return_if_fail(rec != NULL);
|
||||||
@ -343,7 +336,6 @@ void config_close(CONFIG_REC *rec)
|
|||||||
g_free(rec);
|
g_free(rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Change file name of config file */
|
|
||||||
void config_change_file_name(CONFIG_REC *rec, const char *fname, int create_mode)
|
void config_change_file_name(CONFIG_REC *rec, const char *fname, int create_mode)
|
||||||
{
|
{
|
||||||
g_return_if_fail(rec != NULL);
|
g_return_if_fail(rec != NULL);
|
||||||
|
@ -59,7 +59,6 @@ void config_node_remove(CONFIG_REC *rec, CONFIG_NODE *parent, CONFIG_NODE *node)
|
|||||||
g_free(node);
|
g_free(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove n'th node from a list */
|
|
||||||
void config_node_list_remove(CONFIG_REC *rec, CONFIG_NODE *node, int index)
|
void config_node_list_remove(CONFIG_REC *rec, CONFIG_NODE *node, int index)
|
||||||
{
|
{
|
||||||
CONFIG_NODE *child;
|
CONFIG_NODE *child;
|
||||||
@ -71,7 +70,6 @@ void config_node_list_remove(CONFIG_REC *rec, CONFIG_NODE *node, int index)
|
|||||||
if (child != NULL) config_node_remove(rec, node, child);
|
if (child != NULL) config_node_remove(rec, node, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear all data inside node, but leave the node */
|
|
||||||
void config_node_clear(CONFIG_REC *rec, CONFIG_NODE *node)
|
void config_node_clear(CONFIG_REC *rec, CONFIG_NODE *node)
|
||||||
{
|
{
|
||||||
g_return_if_fail(node != NULL);
|
g_return_if_fail(node != NULL);
|
||||||
@ -161,7 +159,6 @@ int config_set_bool(CONFIG_REC *rec, const char *section, const char *key, int v
|
|||||||
return config_set_str(rec, section, key, value ? "yes" : "no");
|
return config_set_str(rec, section, key, value ? "yes" : "no");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add all values in `array' to `node' */
|
|
||||||
void config_node_add_list(CONFIG_REC *rec, CONFIG_NODE *node, char **array)
|
void config_node_add_list(CONFIG_REC *rec, CONFIG_NODE *node, char **array)
|
||||||
{
|
{
|
||||||
char **tmp;
|
char **tmp;
|
||||||
|
@ -308,7 +308,6 @@ static int config_write_block(CONFIG_REC *rec, CONFIG_NODE *node, int list, int
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write configuration file. Write to `fname' if it's not NULL. */
|
|
||||||
int config_write(CONFIG_REC *rec, const char *fname, int create_mode)
|
int config_write(CONFIG_REC *rec, const char *fname, int create_mode)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user