hl7parse
ini.h
Go to the documentation of this file.
1 
7 #ifndef _INI_H_
8 #define _INI_H_
9 
20 #define ALLOC_NUM_ITEMS 10
21 
26 typedef struct {
28  size_t section_start;
30  size_t section_end;
32  size_t item_start;
34  size_t item_end;
36  size_t item_equal;
38  size_t item_comment;
39 } last_pos_t;
40 
45 typedef struct {
47  int start;
49  int end;
51  char* name;
53  char* value;
54 } ini_item_t;
55 
60 typedef struct {
62  char* name;
64  int length;
66  int size;
70 
75 typedef struct {
77  int length;
79  int size;
83 
93 ini_section_list_t *ini_parse(FILE *fp);
94 
100 void ini_free(ini_section_list_t *ini);
101 
110  const char* section_name);
118 ini_item_t *ini_find_key(ini_section_t *s, const char* key);
119 
131  const char* section, const char* key);
132 
133 #endif // _INI_H_
ini_section_t * ini_find_section(ini_section_list_t *ini, const char *section_name)
find sections and keys in ini structure
Definition: ini.c:302
ini_section_t ** sections
Definition: ini.h:81
int length
Definition: ini.h:64
char * name
Definition: ini.h:62
int end
Definition: ini.h:49
int length
Definition: ini.h:77
size_t item_end
Definition: ini.h:34
int size
Definition: ini.h:79
parser positions This structure holds the last known position of element boundaries ...
Definition: ini.h:26
ini_section_list_t * ini_parse(FILE *fp)
constructor
Definition: ini.c:154
key value pair of an ini file, delimited by = This structure defines a key/value pair of an ini file ...
Definition: ini.h:45
ini_item_t * ini_find_key(ini_section_t *s, const char *key)
search for key in section
Definition: ini.c:312
a section, that contains N ini_item_t this structure holds a section with N items ...
Definition: ini.h:60
int size
Definition: ini.h:66
size_t item_comment
Definition: ini.h:38
size_t section_end
Definition: ini.h:30
ini_item_t ** items
Definition: ini.h:68
size_t item_equal
Definition: ini.h:36
char * value
Definition: ini.h:53
container holding ections Top level strcture, holds N sections.
Definition: ini.h:75
void ini_free(ini_section_list_t *ini)
free memory
Definition: ini.c:284
size_t item_start
Definition: ini.h:32
size_t section_start
Definition: ini.h:28
char * name
Definition: ini.h:51
char * ini_get_value(ini_section_list_t *ini, const char *section, const char *key)
get value of key in section
Definition: ini.c:65
int start
Definition: ini.h:47