libconfini
Yet another INI parser
confini.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */
2 
16 #ifndef _LIBCONFINI_HEADER_
17 #define _LIBCONFINI_HEADER_
18 
19 
20 
21 #include <stdio.h>
22 #include <stdbool.h>
23 #include <stdint.h>
24 
25 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
32 
33 /* PRIVATE (HEADER-SCOPED) MACROS */
34 
35 
36 #ifdef _LIBCONFINI_NOCCWARN_
37 #define _LIBCONFINI_DO_PRAGMA_(PBODY)
38 #define _LIBCONFINI_WARNING_(MSG)
39 #elif defined(_MSC_VER)
40 #define _LIBCONFINI_DO_PRAGMA_(PBODY) __pragma(PBODY)
41 #define _LIBCONFINI_WARNING_(MSG) _LIBCONFINI_DO_PRAGMA_(message("*WARNING*: " MSG))
42 #else
43 #define _LIBCONFINI_DO_PRAGMA_(PBODY) _Pragma(#PBODY)
44 #define _LIBCONFINI_WARNING_(MSG) _LIBCONFINI_DO_PRAGMA_(GCC warning #MSG)
45 #endif
46 
47 #define __INIFORMAT_TABLE_CB_FIELDS__(NAME, OFFSET, SIZE, DEFVAL) \
48  unsigned char NAME:SIZE;
49 #define __INIFORMAT_TABLE_CB_DEFAULT__(NAME, OFFSET, SIZE, DEFVAL) DEFVAL,
50 #define __INIFORMAT_TABLE_CB_ZERO__(NAME, OFFSET, SIZE, DEFVAL) 0,
51 #define _LIBCONFINI_INIFORMAT_TYPE_ \
52  struct IniFormat { INIFORMAT_TABLE_AS(__INIFORMAT_TABLE_CB_FIELDS__) }
53 #define _LIBCONFINI_DEFAULT_FORMAT_ \
54  { INIFORMAT_TABLE_AS(__INIFORMAT_TABLE_CB_DEFAULT__) }
55 #define _LIBCONFINI_UNIXLIKE_FORMAT_ \
56  { INIFORMAT_TABLE_AS(__INIFORMAT_TABLE_CB_ZERO__) }
57 
58 
59 
60 /* PUBLIC MACROS */
61 
62 
67 /*
68  NOTE: The following table and the order of its rows **define** (and link
69  together) both the #IniFormat and #IniFormatNum data types declared in this
70  header
71 */
72 #define INIFORMAT_TABLE_AS(_____) /* IniFormat table *\
73 
74  NAME BIT SIZE DEFAULT
75  */\
76 _____( delimiter_symbol, 0, 7, INI_EQUALS ) \
77 _____( case_sensitive, 7, 1, false )/*
78  */\
79 _____( semicolon_marker, 8, 2, INI_DISABLED_OR_COMMENT ) \
80 _____( hash_marker, 10, 2, INI_DISABLED_OR_COMMENT ) \
81 _____( section_paths, 12, 2, INI_ABSOLUTE_AND_RELATIVE ) \
82 _____( multiline_nodes, 14, 2, INI_MULTILINE_EVERYWHERE )/*
83  */\
84 _____( no_single_quotes, 16, 1, false ) \
85 _____( no_double_quotes, 17, 1, false ) \
86 _____( no_spaces_in_names, 18, 1, false ) \
87 _____( implicit_is_not_empty, 19, 1, false ) \
88 _____( do_not_collapse_values, 20, 1, false ) \
89 _____( preserve_empty_quotes, 21, 1, false ) \
90 _____( disabled_after_space, 22, 1, false ) \
91 _____( disabled_can_be_implicit, 23, 1, false )
92 
93 
94 
98 #define INIFORMAT_HAS_NO_ESC(FORMAT) \
99  (FORMAT.multiline_nodes == INI_NO_MULTILINE && \
100  FORMAT.no_double_quotes && FORMAT.no_single_quotes)
101 
102 
103 
108 #define INI_IS_IMPLICIT_SUBSTR(CHAR_PTR) \
109  (CHAR_PTR >= INI_GLOBAL_IMPLICIT_VALUE && CHAR_PTR <= \
110  INI_GLOBAL_IMPLICIT_VALUE + INI_GLOBAL_IMPLICIT_V_LEN)
111 
112 
113 
114 /* PUBLIC TYPEDEFS */
115 
116 
121 typedef _LIBCONFINI_INIFORMAT_TYPE_ IniFormat;
122 
123 
127 typedef struct IniStatistics {
128  const IniFormat format;
129  const size_t bytes;
130  const size_t members;
131 } IniStatistics;
132 
133 
137 typedef struct IniDispatch {
139  uint_least8_t type;
140  char * data;
141  char * value;
142  const char * append_to;
143  size_t d_len;
144  size_t v_len;
145  size_t at_len;
146  size_t dispatch_id;
147 } IniDispatch;
148 
149 
153 typedef uint_least32_t IniFormatNum;
154 
155 
159 typedef int (* IniStatsHandler) (
160  IniStatistics * statistics,
161  void * user_data
162 );
163 
164 
168 typedef int (* IniDispHandler) (
169  IniDispatch * dispatch,
170  void * user_data
171 );
172 
173 
178 typedef int (* IniStrHandler) (
179  char * ini_string,
180  size_t string_length,
181  size_t string_num,
182  IniFormat format,
183  void * user_data
184 );
185 
186 
190 typedef int (* IniSubstrHandler) (
191  const char * ini_string,
192  size_t fragm_offset,
193  size_t fragm_length,
194  size_t fragm_num,
195  IniFormat format,
196  void * user_data
197 );
198 
199 
200 
201 /* PUBLIC FUNCTIONS */
202 
203 
204 extern int strip_ini_cache (
205  register char * const ini_source,
206  const size_t ini_length,
207  const IniFormat format,
208  const IniStatsHandler f_init,
209  const IniDispHandler f_foreach,
210  void * const user_data
211 );
212 
213 
214 extern int load_ini_file (
215  FILE * const ini_file,
216  const IniFormat format,
217  const IniStatsHandler f_init,
218  const IniDispHandler f_foreach,
219  void * const user_data
220 );
221 
222 
223 extern int load_ini_path (
224  const char * const path,
225  const IniFormat format,
226  const IniStatsHandler f_init,
227  const IniDispHandler f_foreach,
228  void * const user_data
229 );
230 
231 
232 extern bool ini_string_match_ss (
233  const char * const simple_string_a,
234  const char * const simple_string_b,
235  const IniFormat format
236 );
237 
238 
239 extern bool ini_string_match_si (
240  const char * const simple_string,
241  const char * const ini_string,
242  const IniFormat format
243 );
244 
245 
246 extern bool ini_string_match_ii (
247  const char * const ini_string_a,
248  const char * const ini_string_b,
249  const IniFormat format
250 );
251 
252 
253 extern bool ini_array_match (
254  const char * const ini_string_a,
255  const char * const ini_string_b,
256  const char delimiter,
257  const IniFormat format
258 );
259 
260 
261 extern size_t ini_unquote (
262  char * const ini_string,
263  const IniFormat format
264 );
265 
266 
267 extern size_t ini_string_parse (
268  char * const ini_string,
269  const IniFormat format
270 );
271 
272 
273 extern size_t ini_array_get_length (
274  const char * const ini_string,
275  const char delimiter,
276  const IniFormat format
277 );
278 
279 
280 extern int ini_array_foreach (
281  const char * const ini_string,
282  const char delimiter,
283  const IniFormat format,
284  const IniSubstrHandler f_foreach,
285  void * const user_data
286 );
287 
288 
289 extern size_t ini_array_shift (
290  const char ** const ini_strptr,
291  const char delimiter,
292  const IniFormat format
293 );
294 
295 
296 extern size_t ini_array_collapse (
297  char * const ini_string,
298  const char delimiter,
299  const IniFormat format
300 );
301 
302 
303 extern char * ini_array_break (
304  char * const ini_string,
305  const char delimiter,
306  const IniFormat format
307 );
308 
309 
310 extern char * ini_array_release (
311  char ** const ini_strptr,
312  const char delimiter,
313  const IniFormat format
314 );
315 
316 
317 extern int ini_array_split (
318  char * const ini_string,
319  const char delimiter,
320  const IniFormat format,
321  const IniStrHandler f_foreach,
322  void * const user_data
323 );
324 
325 
326 extern void ini_global_set_lowercase_mode (
327  const bool lowercase
328 );
329 #define __ini_global_set_lowercase_mode \
330  _LIBCONFINI_WARNING_("deprecated function `ini_global_set_lowercase_mode()`") \
331  ini_global_set_lowercase_mode
332 
333 
334 extern void ini_global_set_implicit_value (
335  char * const implicit_value,
336  const size_t implicit_v_len
337 );
338 
339 
340 extern IniFormatNum ini_fton (
341  const IniFormat format
342 );
343 
344 
345 extern IniFormat ini_ntof (
346  const IniFormatNum format_id
347 );
348 
349 
350 extern int ini_get_bool (
351  const char * const simple_string,
352  const int when_fail
353 );
354 
355 
356 extern int ini_get_bool_i (
357  const char * const ini_string,
358  const int when_fail,
359  const IniFormat format
360 );
361 
362 
363 
364 /* PUBLIC LINKS */
365 
366 
367 extern int (* const ini_get_int) (
368  const char * ini_string
369 );
370 
371 
372 extern long int (* const ini_get_lint) (
373  const char * ini_string
374 );
375 
376 
377 extern long long int (* const ini_get_llint) (
378  const char * ini_string
379 );
380 
381 
382 extern double (* const ini_get_double) (
383  const char * ini_string
384 );
385 
386 
387 /*
388  Legacy support -- please **do not use these functions**!
389 */
390 extern double (* const ini_get_float) (const char * ini_string);
391 
392 #define __ini_get_float \
393  _LIBCONFINI_WARNING_("function `ini_get_float()` is deprecated for parsing a `double` data type; use `ini_get_double()` instead") \
394  ini_get_double
395 
396 
397 
398 /* PUBLIC CONSTANTS AND VARIABLES */
399 
400 
404 #define CONFINI_ERROR 252
405 
406 
410 enum ConfiniInterruptNo {
415  CONFINI_FEINTR = 2,
417  CONFINI_ENOENT = 4,
420  CONFINI_EOOR = 7,
422  CONFINI_EBADF = 8,
424  CONFINI_EFBIG = 9,
425  CONFINI_EROADDR = 10
426 };
427 
428 
433 #define INI_DISABLED_FLAG 4
434 
435 
441 enum IniNodeType {
444  INI_VALUE = 1,
448  INI_KEY = 2,
449  INI_SECTION = 3,
451  INI_INLINE_COMMENT = 5,
452  INI_DISABLED_KEY = 6,
455 };
456 
457 
466  INI_EQUALS = '=',
467  INI_COLON = ':',
468  INI_DOT = '.',
469  INI_COMMA = ','
470 };
471 
472 
478 enum IniCommentMarker {
481  INI_ONLY_COMMENT = 1,
487 };
488 
489 
493 enum IniSectionPaths {
500  INI_ONE_LEVEL_ONLY = 2,
503  INI_NO_SECTIONS = 3
506 };
507 
508 
512 enum IniMultiline {
522  INI_NO_MULTILINE = 3
524 };
525 
526 
530 static const IniFormat INI_DEFAULT_FORMAT = { INI_EQUALS, false, INI_DISABLED_OR_COMMENT, INI_DISABLED_OR_COMMENT, INI_ABSOLUTE_AND_RELATIVE, INI_MULTILINE_EVERYWHERE, false, false, false, false, false, false, false, false };
531 
532 
537 /* All fields are set to `0` here. */
538 static const IniFormat INI_UNIXLIKE_FORMAT = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
539 
540 
549 extern bool INI_GLOBAL_LOWERCASE_MODE;
550 #define __INI_GLOBAL_LOWERCASE_MODE \
551  _LIBCONFINI_WARNING_("global variable `INI_GLOBAL_LOWERCASE_MODE` is deprecated") \
552  INI_GLOBAL_LOWERCASE_MODE
553 
554 
558 extern char * INI_GLOBAL_IMPLICIT_VALUE;
559 
560 
564 extern size_t INI_GLOBAL_IMPLICIT_V_LEN;
565 
566 
567 
568 /* CLEAN THE PRIVATE ENVIRONMENT */
569 
570 
571 #undef _LIBCONFINI_UNIXLIKE_FORMAT_
572 #undef _LIBCONFINI_DEFAULT_FORMAT_
573 #undef _LIBCONFINI_INIFORMAT_TYPE_
574 #undef __INIFORMAT_TABLE_CB_ZERO__
575 #undef __INIFORMAT_TABLE_CB_DEFAULT__
576 #undef __INIFORMAT_TABLE_CB_FIELDS__
577 
578 
579 
580 /* END OF `_LIBCONFINI_HEADER_` */
581 
582 
583 #ifdef __cplusplus
584 }
585 #endif
586 
587 
588 #endif
589 
590 
591 /* EOF */
592 
INI_NO_SECTIONS
@ INI_NO_SECTIONS
Definition: confini.h:498
ini_array_split
int ini_array_split(char *const ini_string, const char delimiter, const IniFormat format, const IniStrHandler f_foreach, void *const user_data)
Split a stringified INI array into NUL-separated members and call a custom function for each member.
Definition: confini.c:4997
INI_DOT
@ INI_DOT
Definition: confini.h:463
INI_MULTILINE_EVERYWHERE
@ INI_MULTILINE_EVERYWHERE
Definition: confini.h:508
ini_string_match_ss
bool ini_string_match_ss(const char *const simple_string_a, const char *const simple_string_b, const IniFormat format)
Compare two simple strings and check whether they match.
Definition: confini.c:3170
INI_UNKNOWN
@ INI_UNKNOWN
Definition: confini.h:437
INI_BUT_DISABLED_AND_COMMENTS
@ INI_BUT_DISABLED_AND_COMMENTS
Definition: confini.h:514
ini_get_lint
long int(*const ini_get_lint)(const char *ini_string)
Pointer to atol()
Definition: confini.c:5489
CONFINI_EOOR
@ CONFINI_EOOR
Definition: confini.h:415
ini_get_bool
int ini_get_bool(const char *const simple_string, const int when_fail)
Check whether a simple string matches one of the booleans listed in the private constant INI_BOOLEANS...
Definition: confini.c:5243
INI_DISABLED_SECTION
@ INI_DISABLED_SECTION
Definition: confini.h:448
IniDispatch::format
const IniFormat format
Definition: confini.h:133
IniDispatch::v_len
size_t v_len
Definition: confini.h:139
IniDispatch::data
char * data
Definition: confini.h:135
INI_COMMA
@ INI_COMMA
Definition: confini.h:464
ConfiniInterruptNo
ConfiniInterruptNo
Error codes.
Definition: confini.h:405
IniFormat
24-bit bitfield representing the format of an INI file (INI dialect)
Definition: confini.h:116
ini_unquote
size_t ini_unquote(char *const ini_string, const IniFormat format)
Unescape \', \", and \\ and remove all unescaped quotes (when single/double quotes are considered met...
Definition: confini.c:3906
ini_string_match_ii
bool ini_string_match_ii(const char *const ini_string_a, const char *const ini_string_b, const IniFormat format)
Compare two INI strings and check whether they match.
Definition: confini.c:3454
IniSubstrHandler
int(* IniSubstrHandler)(const char *ini_string, size_t fragm_offset, size_t fragm_length, size_t fragm_num, IniFormat format, void *user_data)
Callback function for handling a selected fragment of an INI string.
Definition: confini.h:185
CONFINI_EROADDR
@ CONFINI_EROADDR
Definition: confini.h:420
INI_ABSOLUTE_AND_RELATIVE
@ INI_ABSOLUTE_AND_RELATIVE
Definition: confini.h:489
INI_ANY_SPACE
@ INI_ANY_SPACE
Definition: confini.h:458
ini_array_break
char * ini_array_break(char *const ini_string, const char delimiter, const IniFormat format)
Replace the first delimiter found (together with the spaces that surround it) with \0
Definition: confini.c:4838
ini_fton
IniFormatNum ini_fton(const IniFormat format)
Calculate the IniFormatNum of an IniFormat.
Definition: confini.c:5180
CONFINI_ENOENT
@ CONFINI_ENOENT
Definition: confini.h:412
IniStatistics
Global statistics about an INI file.
Definition: confini.h:122
CONFINI_FEINTR
@ CONFINI_FEINTR
Definition: confini.h:410
ini_array_shift
size_t ini_array_shift(const char **const ini_strptr, const char delimiter, const IniFormat format)
Shift the location pointed by ini_strptr to the next member of the INI array (without modifying the c...
Definition: confini.c:4518
CONFINI_EIO
@ CONFINI_EIO
Definition: confini.h:414
CONFINI_EBADF
@ CONFINI_EBADF
Definition: confini.h:417
IniDelimiters
IniDelimiters
Common array and key-value delimiters (but a delimiter may also be any other ASCII character not pres...
Definition: confini.h:457
CONFINI_ENOMEM
@ CONFINI_ENOMEM
Definition: confini.h:413
ini_get_llint
long long int(*const ini_get_llint)(const char *ini_string)
Pointer to atoll()
Definition: confini.c:5491
IniDispatch
struct IniDispatch IniDispatch
Dispatch of a single INI node.
INI_ABSOLUTE_ONLY
@ INI_ABSOLUTE_ONLY
Definition: confini.h:492
INI_BUT_COMMENTS
@ INI_BUT_COMMENTS
Definition: confini.h:511
ini_global_set_lowercase_mode
void ini_global_set_lowercase_mode(const bool lowercase)
Set the value of the global variable INI_GLOBAL_LOWERCASE_MODE.
Definition: confini.c:5134
load_ini_file
int load_ini_file(FILE *const ini_file, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parse an INI file and dispatch its content to a custom callback using a FILE structure as argument.
Definition: confini.c:2989
ini_array_collapse
size_t ini_array_collapse(char *const ini_string, const char delimiter, const IniFormat format)
Compress the distribution of the data in a stringified INI array by removing all the white spaces tha...
Definition: confini.c:4616
IniDispatch
Dispatch of a single INI node.
Definition: confini.h:132
IniStatistics::members
const size_t members
Definition: confini.h:125
INI_IGNORE
@ INI_IGNORE
Definition: confini.h:477
INI_SECTION
@ INI_SECTION
Definition: confini.h:444
IniDispatch::dispatch_id
size_t dispatch_id
Definition: confini.h:141
INI_GLOBAL_IMPLICIT_V_LEN
size_t INI_GLOBAL_IMPLICIT_V_LEN
Length of the value assigned to implicit keys (default value: 0)
Definition: confini.c:5520
strip_ini_cache
int strip_ini_cache(register char *const ini_source, const size_t ini_length, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.
Definition: confini.c:2419
ini_string_parse
size_t ini_string_parse(char *const ini_string, const IniFormat format)
Unescape \', \", and \\ and remove all unescaped quotes (when single/double quotes are considered met...
Definition: confini.c:4047
ini_get_double
double(*const ini_get_double)(const char *ini_string)
Pointer to atof()
Definition: confini.c:5493
ini_get_int
int(*const ini_get_int)(const char *ini_string)
Pointer to atoi()
Definition: confini.c:5487
INI_ONE_LEVEL_ONLY
@ INI_ONE_LEVEL_ONLY
Definition: confini.h:495
IniStatistics::format
const IniFormat format
Definition: confini.h:123
IniFormatNum
uint_least32_t IniFormatNum
The unique ID of an INI format (24-bit maximum)
Definition: confini.h:148
IniDispatch::value
char * value
Definition: confini.h:136
CONFINI_EFBIG
@ CONFINI_EFBIG
Definition: confini.h:419
CONFINI_SUCCESS
@ CONFINI_SUCCESS
Definition: confini.h:406
INI_INLINE_COMMENT
@ INI_INLINE_COMMENT
Definition: confini.h:446
INI_DISABLED_OR_COMMENT
@ INI_DISABLED_OR_COMMENT
Definition: confini.h:474
ini_array_get_length
size_t ini_array_get_length(const char *const ini_string, const char delimiter, const IniFormat format)
Get the length of a stringified INI array in number of members.
Definition: confini.c:4255
ini_array_match
bool ini_array_match(const char *const ini_string_a, const char *const ini_string_b, const char delimiter, const IniFormat format)
Compare two INI arrays and check whether they match.
Definition: confini.c:3662
ini_string_match_si
bool ini_string_match_si(const char *const simple_string, const char *const ini_string, const IniFormat format)
Compare a simple string and an INI string and and check whether they match.
Definition: confini.c:3271
ini_get_bool_i
int ini_get_bool_i(const char *const ini_string, const int when_fail, const IniFormat format)
Check whether an INI string matches one of the booleans listed in the private constant INI_BOOLEANS (...
Definition: confini.c:5309
IniStatistics
struct IniStatistics IniStatistics
Global statistics about an INI file.
IniDispatch::append_to
const char * append_to
Definition: confini.h:137
INI_IS_NOT_A_MARKER
@ INI_IS_NOT_A_MARKER
Definition: confini.h:480
INI_NO_MULTILINE
@ INI_NO_MULTILINE
Definition: confini.h:517
IniDispHandler
int(* IniDispHandler)(IniDispatch *dispatch, void *user_data)
Callback function for handling an IniDispatch structure.
Definition: confini.h:163
IniSectionPaths
IniSectionPaths
Possible values of IniFormat::section_paths.
Definition: confini.h:488
ini_get_float
double(*const ini_get_float)(const char *ini_string)
Legacy support for parsing a double data type – please do not use this function: use ini_get_double()...
Definition: confini.c:5509
INI_ONLY_COMMENT
@ INI_ONLY_COMMENT
Definition: confini.h:476
INI_UNIXLIKE_FORMAT
static const IniFormat INI_UNIXLIKE_FORMAT
A model format for Unix-like .conf files (where space characters are delimiters between keys and valu...
Definition: confini.h:533
IniNodeType
IniNodeType
INI node types and possible values of IniDispatch::type.
Definition: confini.h:436
INI_GLOBAL_LOWERCASE_MODE
bool INI_GLOBAL_LOWERCASE_MODE
If set to true, key and section names in case-insensitive INI formats will be dispatched lowercase,...
Definition: confini.c:5516
INI_KEY
@ INI_KEY
Definition: confini.h:443
INI_COMMENT
@ INI_COMMENT
Definition: confini.h:445
IniStrHandler
int(* IniStrHandler)(char *ini_string, size_t string_length, size_t string_num, IniFormat format, void *user_data)
Callback function for handling an INI string belonging to a sequence of INI strings.
Definition: confini.h:173
IniMultiline
IniMultiline
Possible values of IniFormat::multiline_nodes.
Definition: confini.h:507
ini_ntof
IniFormat ini_ntof(const IniFormatNum format_id)
Construct a new IniFormat according to an IniFormatNum.
Definition: confini.c:5201
IniStatistics::bytes
const size_t bytes
Definition: confini.h:124
CONFINI_IINTR
@ CONFINI_IINTR
Definition: confini.h:408
IniDispatch::type
uint_least8_t type
Definition: confini.h:134
INI_COLON
@ INI_COLON
Definition: confini.h:462
INI_DISABLED_KEY
@ INI_DISABLED_KEY
Definition: confini.h:447
INI_GLOBAL_IMPLICIT_VALUE
char * INI_GLOBAL_IMPLICIT_VALUE
Value to be assigned to implicit keys (default value: NULL)
Definition: confini.c:5518
INI_EQUALS
@ INI_EQUALS
Definition: confini.h:461
IniDispatch::at_len
size_t at_len
Definition: confini.h:140
IniDispatch::d_len
size_t d_len
Definition: confini.h:138
load_ini_path
int load_ini_path(const char *const path, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parse an INI file and dispatch its content to a custom callback using a path as argument.
Definition: confini.c:3083
ini_global_set_implicit_value
void ini_global_set_implicit_value(char *const implicit_value, const size_t implicit_v_len)
Set the value to be to be assigned to implicit keys.
Definition: confini.c:5161
INI_DEFAULT_FORMAT
static const IniFormat INI_DEFAULT_FORMAT
A model format for standard INI files.
Definition: confini.h:525
ini_array_foreach
int ini_array_foreach(const char *const ini_string, const char delimiter, const IniFormat format, const IniSubstrHandler f_foreach, void *const user_data)
Call a custom function for each member of a stringified INI array, without modifying the content of t...
Definition: confini.c:4374
ini_array_release
char * ini_array_release(char **const ini_strptr, const char delimiter, const IniFormat format)
Replace the first delimiter found (together with the spaces that surround it) with \0,...
Definition: confini.c:4917
IniStatsHandler
int(* IniStatsHandler)(IniStatistics *statistics, void *user_data)
Callback function for handling an IniStatistics structure.
Definition: confini.h:154
INI_VALUE
@ INI_VALUE
Definition: confini.h:439
IniCommentMarker
IniCommentMarker
Possible values of IniFormat::semicolon_marker and IniFormat::hash_marker (i.e., meaning of /\s+;/ an...
Definition: confini.h:473