libgpac
Documentation of the core library of GPAC
configfile.c File Reference
#include <gpac/config_file.h>
#include <gpac/list.h>
+ Include dependency graph for configfile.c:

Data Structures

struct  IniKey
 
struct  IniSection
 
struct  GF_Config
 

Macros

#define MAX_INI_LINE   2046
 
#define FLUSH_EMPTY_LINES
 

Functions

static void DelSection (IniSection *ptr)
 
static void gf_cfg_clear (GF_Config *iniFile)
 Clear the structure. More...
 
GF_Err gf_cfg_parse_config_file (GF_Config *tmp, const char *filePath, const char *file_name)
 Parses the config file if any and clears the existing structure. More...
 
GF_EXPORT GF_Config * gf_cfg_force_new (const char *filePath, const char *file_name)
 alternative configuration file constructor More...
 
GF_EXPORT GF_Config * gf_cfg_new (const char *filePath, const char *file_name)
 configuration file constructor More...
 
GF_EXPORT const char * gf_cfg_get_filename (GF_Config *iniFile)
 
GF_EXPORT GF_Err gf_cfg_save (GF_Config *iniFile)
 configuration saving More...
 
GF_EXPORT GF_Err gf_cfg_discard_changes (GF_Config *iniFile)
 
GF_EXPORT void gf_cfg_del (GF_Config *iniFile)
 configuration file destructor More...
 
const char * gf_cfg_get_key_internal (GF_Config *iniFile, const char *secName, const char *keyName, Bool restricted_only)
 
GF_EXPORT const char * gf_cfg_get_key (GF_Config *iniFile, const char *secName, const char *keyName)
 key value query More...
 
GF_Err gf_cfg_set_key_internal (GF_Config *iniFile, const char *secName, const char *keyName, const char *keyValue, Bool is_restrict)
 
GF_EXPORT GF_Err gf_cfg_set_key (GF_Config *iniFile, const char *secName, const char *keyName, const char *keyValue)
 key value update More...
 
GF_EXPORT u32 gf_cfg_get_section_count (GF_Config *iniFile)
 section count query More...
 
GF_EXPORT const char * gf_cfg_get_section_name (GF_Config *iniFile, u32 secIndex)
 section name query More...
 
GF_EXPORT u32 gf_cfg_get_key_count (GF_Config *iniFile, const char *secName)
 key count query More...
 
GF_EXPORT const char * gf_cfg_get_key_name (GF_Config *iniFile, const char *secName, u32 keyIndex)
 key count query More...
 
GF_EXPORT void gf_cfg_del_section (GF_Config *iniFile, const char *secName)
 section destrouction More...
 
GF_Err gf_cfg_set_filename (GF_Config *iniFile, const char *fileName)
 

Data Structure Documentation

◆ IniKey

struct IniKey
Data Fields
Bool do_restrict
char * name
char * value

◆ IniSection

struct IniSection
Data Fields
char * section_name
GF_List * keys

◆ __tag_config

struct __tag_config

configuration file object

Data Fields
char * fileName
GF_List * sections
Bool hasChanged
Bool skip_changes

Macro Definition Documentation

◆ MAX_INI_LINE

#define MAX_INI_LINE   2046

◆ FLUSH_EMPTY_LINES

#define FLUSH_EMPTY_LINES
Value:
if (k&& nb_empty_lines) {\
u32 klen = (u32) strlen(k->value)+1+nb_empty_lines;\
k->value = gf_realloc(k->value, sizeof(char)*klen);\
while (nb_empty_lines) {\
nb_empty_lines--;\
strcat(k->value, "\n");\
}\
k=NULL;\
}\
nb_empty_lines=0;\
void * gf_realloc(void *ptr, size_t size)
Definition: alloc.c:158
uint32_t u32
Definition: setup.h:326

Function Documentation

◆ DelSection()

static void DelSection ( IniSection ptr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_cfg_clear()

static void gf_cfg_clear ( GF_Config *  iniFile)
static
Parameters
iniFileThe structure to clear
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_cfg_parse_config_file()

GF_Err gf_cfg_parse_config_file ( GF_Config *  tmp,
const char *  filePath,
const char *  file_name 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_cfg_get_key_internal()

const char* gf_cfg_get_key_internal ( GF_Config *  iniFile,
const char *  secName,
const char *  keyName,
Bool  restricted_only 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_cfg_set_key_internal()

GF_Err gf_cfg_set_key_internal ( GF_Config *  iniFile,
const char *  secName,
const char *  keyName,
const char *  keyValue,
Bool  is_restrict 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_cfg_set_filename()

GF_Err gf_cfg_set_filename ( GF_Config *  iniFile,
const char *  fileName 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: