squareball 0.2.0.28-7bb8 A general-purpose library for C99

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

All Data Structures Files Functions Variables Typedefs
sb-configparser.h
Go to the documentation of this file.
1 /*
2 * squareball: A general-purpose library for C99.
3 * Copyright (C) 2014-2018 Rafael G. Martins <rafael@rafaelmartins.eng.br>
4 *
5 * This program can be distributed under the terms of the BSD License.
6 * See the file LICENSE.
7 */
8
9 #ifndef _SQUAREBALL_CONFIGPARSER_H
10 #define _SQUAREBALL_CONFIGPARSER_H
11
12 #include <stdlib.h>
13 #include "sb-error.h"
14 #include "sb-slist.h"
15 #include "sb-trie.h"
16
27 typedef struct _sb_config_t sb_config_t;
28
39 sb_config_t* sb_config_parse(const char *src, size_t src_len,
40 const char *list_sections[], sb_error_t **err);
41
49 char** sb_config_list_sections(sb_config_t *config);
50
60 char** sb_config_list_keys(sb_config_t *config, const char *section);
61
71 const char* sb_config_get(sb_config_t *config, const char *section,
72 const char *key);
73
86 const char* sb_config_get_with_default(sb_config_t *config, const char *section,
87 const char *key, const char *default_);
88
100 char** sb_config_get_list(sb_config_t *config, const char *section);
101
107 void sb_config_free(sb_config_t *config);
108
111 #endif /* _SQUAREBALL_CONFIGPARSER_H */
sb_config_parse
sb_config_t * sb_config_parse(const char *src, size_t src_len, const char *list_sections[], sb_error_t **err)
sb-slist.h
Singly-linked list implementation.
sb_config_list_keys
char ** sb_config_list_keys(sb_config_t *config, const char *section)
sb_config_list_sections
char ** sb_config_list_sections(sb_config_t *config)
sb_config_get_list
char ** sb_config_get_list(sb_config_t *config, const char *section)
sb-trie.h
Implementation of a trie data structure.
sb-error.h
Error reporting infrastructure.
sb_config_get_with_default
const char * sb_config_get_with_default(sb_config_t *config, const char *section, const char *key, const char *default_)
sb_config_free
void sb_config_free(sb_config_t *config)
sb_config_get
const char * sb_config_get(sb_config_t *config, const char *section, const char *key)
sb_config_t
struct _sb_config_t sb_config_t
Definition: sb-configparser.h:27
sb_error_t
Definition: sb-error.h:30