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

Data Structures

struct  _token
 

Macros

#define CFG_FILE_NAME   "GPAC.cfg"
 
#define TEST_MODULE   "gm_"
 
#define LOGFILE_HELP   "set output log file"
 
#define LINE_OFFSET_DESCR   30
 

Enumerations

enum  {
  GF_PATH_APP , GF_PATH_CFG , GF_PATH_SHARE , GF_PATH_MODULES ,
  GF_PATH_LIB
}
 
enum  {
  TOK_CODE , TOK_BOLD , TOK_ITALIC , TOK_STRIKE ,
  TOK_OPTLINK , TOK_LINKSTART
}
 

Functions

static Bool mod_enum (void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info)
 
static Bool check_file_exists (char *name, char *path, char *outPath)
 
static Bool get_default_install_path (char *file_path, u32 path_type)
 
const char * gf_get_default_cache_directory_ex (Bool do_create)
 
GF_EXPORT void gf_get_default_font_dir (char szPath[GF_MAX_PATH])
 
static GF_Config * create_default_config (char *file_path, const char *profile)
 
static void check_modules_dir (GF_Config *cfg)
 
static void check_default_cred_file (GF_Config *cfg, char szPath[GF_MAX_PATH])
 
static GF_Config * gf_cfg_init (const char *profile)
 configuration file initialization More...
 
GF_EXPORT Bool gf_opts_default_shared_directory (char *path_buffer)
 
void gf_modules_new (GF_Config *config)
 module manager construtcor More...
 
void gf_modules_del ()
 module manager destructor More...
 
void gf_init_global_config (const char *profile)
 
void gf_uninit_global_config (Bool discard_config)
 
GF_Err gf_cfg_set_key_internal (GF_Config *iniFile, const char *secName, const char *keyName, const char *keyValue, Bool is_restrict)
 
GF_EXPORT const char * gf_opts_get_key (const char *secName, const char *keyName)
 
GF_EXPORT GF_Err gf_opts_set_key (const char *secName, const char *keyName, const char *keyValue)
 
GF_EXPORT void gf_opts_del_section (const char *secName)
 
GF_EXPORT u32 gf_opts_get_section_count ()
 
GF_EXPORT const char * gf_opts_get_section_name (u32 secIndex)
 
GF_EXPORT u32 gf_opts_get_key_count (const char *secName)
 
GF_EXPORT const char * gf_opts_get_key_name (const char *secName, u32 keyIndex)
 
GF_EXPORT const char * gf_opts_get_key_restricted (const char *secName, const char *keyName)
 
GF_EXPORT const char * gf_opts_get_filename ()
 
GF_EXPORT GF_Err gf_opts_discard_changes ()
 
GF_EXPORT GF_Err gf_opts_save ()
 
const GF_Config * gf_sys_get_lang_file ()
 
GF_EXPORT const GF_GPACArggf_sys_get_options ()
 
static const char * gpac_opt_default (const char *argname)
 
GF_EXPORT Bool gf_opts_get_bool (const char *secName, const char *keyName)
 
GF_EXPORT u32 gf_opts_get_int (const char *secName, const char *keyName)
 
GF_EXPORT Bool gf_sys_set_cfg_option (const char *opt_string)
 
void gf_module_reload_dirs ()
 
Bool gf_opts_load_option (const char *arg_name, const char *val, Bool *consumed_next, GF_Err *e)
 
GF_EXPORT u32 gf_sys_is_gpac_arg (const char *arg_name)
 
GF_EXPORT void gf_sys_print_arg (FILE *helpout, GF_SysPrintArgFlags flags, const GF_GPACArg *arg, const char *arg_subsystem)
 
GF_EXPORT void gf_sys_print_core_help (FILE *helpout, GF_SysPrintArgFlags flags, GF_SysArgMode mode, u32 subsystem_flags)
 
void gf_sys_cleanup_help ()
 
GF_EXPORT void gf_sys_format_help (FILE *helpout, GF_SysPrintArgFlags flags, const char *fmt,...)
 
GF_EXPORT Bool gf_strnistr (const char *text, const char *subtext, u32 subtext_len)
 search string without case More...
 
GF_EXPORT Bool gf_sys_word_match (const char *orig, const char *dst)
 

Variables

GF_Config * gpac_global_config = NULL
 
GF_GPACArg GPAC_Args []
 
static char * help_buf = NULL
 
static u32 help_buf_size =0
 
struct _token Tokens []
 
static u32 nb_tokens = sizeof(Tokens) / sizeof(struct _token)
 
static u32 line_pos = 0
 

Data Structure Documentation

◆ _token

struct _token
Data Fields
char * tok
GF_ConsoleCodes cmd_type

Macro Definition Documentation

◆ CFG_FILE_NAME

#define CFG_FILE_NAME   "GPAC.cfg"

◆ TEST_MODULE

#define TEST_MODULE   "gm_"

◆ LOGFILE_HELP

#define LOGFILE_HELP   "set output log file"

◆ LINE_OFFSET_DESCR

#define LINE_OFFSET_DESCR   30

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GF_PATH_APP 
GF_PATH_CFG 
GF_PATH_SHARE 
GF_PATH_MODULES 
GF_PATH_LIB 

◆ anonymous enum

anonymous enum
Enumerator
TOK_CODE 
TOK_BOLD 
TOK_ITALIC 
TOK_STRIKE 
TOK_OPTLINK 
TOK_LINKSTART 

Function Documentation

◆ mod_enum()

static Bool mod_enum ( void *  cbck,
char *  item_name,
char *  item_path,
GF_FileEnumInfo file_info 
)
static
+ Here is the caller graph for this function:

◆ check_file_exists()

static Bool check_file_exists ( char *  name,
char *  path,
char *  outPath 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_default_install_path()

static Bool get_default_install_path ( char *  file_path,
u32  path_type 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_get_default_cache_directory_ex()

const char* gf_get_default_cache_directory_ex ( Bool  do_create)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_get_default_font_dir()

GF_EXPORT void gf_get_default_font_dir ( char  szPath[GF_MAX_PATH])
+ Here is the caller graph for this function:

◆ create_default_config()

static GF_Config* create_default_config ( char *  file_path,
const char *  profile 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_modules_dir()

static void check_modules_dir ( GF_Config *  cfg)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_default_cred_file()

static void check_default_cred_file ( GF_Config *  cfg,
char  szPath[GF_MAX_PATH] 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_cfg_init()

static GF_Config* gf_cfg_init ( const char *  profile)
static

Constructs a configuration file from fileName. If fileName is NULL, the default GPAC configuration file is loaded with the proper module directory, font directory and other default options. If fileName is non-NULL no configuration file is found, a "light" default configuration file is created.

Parameters
profilename or path to existing config file
Returns
the configuration file object, NULL if the file could not be created
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_new()

void gf_modules_new ( GF_Config *  config)

Constructs a module manager object.

Parameters
configGPAC configuration file handle. If this is NULL, the modules won't be able to share the configuration file with the rest of the GPAC framework.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_del()

void gf_modules_del ( )

Destroys the module manager

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

◆ gf_init_global_config()

void gf_init_global_config ( const char *  profile)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_uninit_global_config()

void gf_uninit_global_config ( Bool  discard_config)
+ 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_sys_get_lang_file()

const GF_Config* gf_sys_get_lang_file ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gpac_opt_default()

static const char* gpac_opt_default ( const char *  argname)
static
+ Here is the caller graph for this function:

◆ gf_module_reload_dirs()

void gf_module_reload_dirs ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_opts_load_option()

Bool gf_opts_load_option ( const char *  arg_name,
const char *  val,
Bool consumed_next,
GF_Err e 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sys_cleanup_help()

void gf_sys_cleanup_help ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ gpac_global_config

GF_Config* gpac_global_config = NULL

◆ GPAC_Args

GF_GPACArg GPAC_Args[]

◆ help_buf

char* help_buf = NULL
static

◆ help_buf_size

u32 help_buf_size =0
static

◆ Tokens

struct _token Tokens[]
Initial value:
=
{
{"**", GF_CONSOLE_BOLD},
}
@ GF_CONSOLE_STRIKE
Definition: tools.h:710
@ GF_CONSOLE_ITALIC
Definition: tools.h:706
@ GF_CONSOLE_BOLD
Definition: tools.h:704
@ GF_CONSOLE_YELLOW
Definition: tools.h:689

◆ nb_tokens

u32 nb_tokens = sizeof(Tokens) / sizeof(struct _token)
static

◆ line_pos

u32 line_pos = 0
static