hl7parse
|
ini file parser More...
Go to the source code of this file.
Classes | |
struct | last_pos_t |
parser positions This structure holds the last known position of element boundaries More... | |
struct | ini_item_t |
key value pair of an ini file, delimited by = This structure defines a key/value pair of an ini file More... | |
struct | ini_section_t |
a section, that contains N ini_item_t this structure holds a section with N items More... | |
struct | ini_section_list_t |
container holding ections Top level strcture, holds N sections. More... | |
Macros | |
#define | ALLOC_NUM_ITEMS 10 |
pre-allocate items More... | |
Functions | |
ini_section_list_t * | ini_parse (FILE *fp) |
constructor More... | |
void | ini_free (ini_section_list_t *ini) |
free memory More... | |
ini_section_t * | ini_find_section (ini_section_list_t *ini, const char *section_name) |
find sections and keys in ini structure More... | |
ini_item_t * | ini_find_key (ini_section_t *s, const char *key) |
search for key in section More... | |
char * | ini_get_value (ini_section_list_t *ini, const char *section, const char *key) |
get value of key in section More... | |
ini file parser
2020, Simon Wunderlin
#define ALLOC_NUM_ITEMS 10 |
pre-allocate items
we are dynamically pre-allocating child items so we don't have to call realloc() on every item added. If you have large structures with many items settin this to a higher value might benefit performance (less realloc calls).
default: 10
ini_item_t* ini_find_key | ( | ini_section_t * | s, |
const char * | key | ||
) |
search for key in section
s | section to search in |
key | name of the key to search for |
ini_section_t* ini_find_section | ( | ini_section_list_t * | ini, |
const char * | section_name | ||
) |
find sections and keys in ini structure
ini | structure to search in |
section_name | section to search for |
void ini_free | ( | ini_section_list_t * | ini | ) |
free memory
ini | parsed structure |
char* ini_get_value | ( | ini_section_list_t * | ini, |
const char * | section, | ||
const char * | key | ||
) |
get value of key in section
get a value for a specific item in a section. returns NULL if not found
ini | section list to search in |
section | name of the section to search in |
key | key to search for in section |
NULL
ini_section_list_t* ini_parse | ( | FILE * | fp | ) |
constructor
PArses an ini file. make sure fp
points to the beginning of the file before invoking.
fp | file pointer |