liblcf
ini.h File Reference
#include <stdio.h>
+ Include dependency graph for ini.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INI_HANDLER_LINENO   0
 
#define INI_ALLOW_MULTILINE   1
 
#define INI_ALLOW_BOM   1
 
#define INI_START_COMMENT_PREFIXES   ";#"
 
#define INI_ALLOW_INLINE_COMMENTS   1
 
#define INI_INLINE_COMMENT_PREFIXES   ";"
 
#define INI_USE_STACK   1
 
#define INI_MAX_LINE   200
 
#define INI_ALLOW_REALLOC   0
 
#define INI_INITIAL_ALLOC   200
 
#define INI_STOP_ON_FIRST_ERROR   0
 

Typedefs

typedef int(* ini_handler) (void *user, const char *section, const char *name, const char *value)
 
typedef char *(* ini_reader) (char *str, int num, void *stream)
 

Functions

int ini_parse (const char *filename, ini_handler handler, void *user)
 
int ini_parse_file (FILE *file, ini_handler handler, void *user)
 
int ini_parse_stream (ini_reader reader, void *stream, ini_handler handler, void *user)
 
int ini_parse_string (const char *string, ini_handler handler, void *user)
 

Macro Definition Documentation

◆ INI_ALLOW_BOM

#define INI_ALLOW_BOM   1

Definition at line 102 of file ini.h.

◆ INI_ALLOW_INLINE_COMMENTS

#define INI_ALLOW_INLINE_COMMENTS   1

Definition at line 115 of file ini.h.

◆ INI_ALLOW_MULTILINE

#define INI_ALLOW_MULTILINE   1

Definition at line 96 of file ini.h.

◆ INI_ALLOW_REALLOC

#define INI_ALLOW_REALLOC   0

Definition at line 136 of file ini.h.

◆ INI_HANDLER_LINENO

#define INI_HANDLER_LINENO   0

Definition at line 46 of file ini.h.

◆ INI_INITIAL_ALLOC

#define INI_INITIAL_ALLOC   200

Definition at line 142 of file ini.h.

◆ INI_INLINE_COMMENT_PREFIXES

#define INI_INLINE_COMMENT_PREFIXES   ";"

Definition at line 118 of file ini.h.

◆ INI_MAX_LINE

#define INI_MAX_LINE   200

Definition at line 129 of file ini.h.

◆ INI_START_COMMENT_PREFIXES

#define INI_START_COMMENT_PREFIXES   ";#"

Definition at line 108 of file ini.h.

◆ INI_STOP_ON_FIRST_ERROR

#define INI_STOP_ON_FIRST_ERROR   0

Definition at line 147 of file ini.h.

◆ INI_USE_STACK

#define INI_USE_STACK   1

Definition at line 123 of file ini.h.

Typedef Documentation

◆ ini_handler

typedef int(* ini_handler) (void *user, const char *section, const char *name, const char *value)

Definition at line 55 of file ini.h.

◆ ini_reader

typedef char*(* ini_reader) (char *str, int num, void *stream)

Definition at line 60 of file ini.h.

Function Documentation

◆ ini_parse()

int ini_parse ( const char *  filename,
ini_handler  handler,
void *  user 
)

Definition at line 245 of file ini.cpp.

References ini_parse_file().

Referenced by INIReader::INIReader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ini_parse_file()

int ini_parse_file ( FILE *  file,
ini_handler  handler,
void *  user 
)

Definition at line 239 of file ini.cpp.

References ini_parse_stream().

Referenced by ini_parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ini_parse_stream()

int ini_parse_stream ( ini_reader  reader,
void *  stream,
ini_handler  handler,
void *  user 
)

Definition at line 103 of file ini.cpp.

References find_chars_or_comment(), HANDLER, INI_INITIAL_ALLOC, INI_MAX_LINE, INI_START_COMMENT_PREFIXES, lskip(), MAX_NAME, MAX_SECTION, rstrip(), and strncpy0().

Referenced by ini_parse_file(), ini_parse_string(), and INIReader::INIReader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ini_parse_string()

int ini_parse_string ( const char *  string,
ini_handler  handler,
void *  user 
)

Definition at line 286 of file ini.cpp.

References ini_parse_stream(), ini_reader_string(), ini_parse_string_ctx::num_left, and ini_parse_string_ctx::ptr.

+ Here is the call graph for this function: