This file describes the programming interface for the configuration module. More...
Go to the source code of this file.
Data Structures | |
| struct | config_category_t |
| union | module_value_t |
| struct | module_config_t |
| struct | config_chain_t |
Defines | |
| #define | CONFIG_HINT_CATEGORY 0x02 |
| #define | CONFIG_HINT_SUBCATEGORY 0x03 |
| #define | CONFIG_HINT_SUBCATEGORY_END 0x04 |
| #define | CONFIG_HINT_USAGE 0x05 |
| #define | CONFIG_CATEGORY 0x06 |
| #define | CONFIG_SUBCATEGORY 0x07 |
| #define | CONFIG_SECTION 0x08 |
| #define | CONFIG_ITEM_FLOAT 0x20 |
| #define | CONFIG_ITEM_INTEGER 0x40 |
| #define | CONFIG_ITEM_RGB 0x41 |
| #define | CONFIG_ITEM_BOOL 0x60 |
| #define | CONFIG_ITEM_STRING 0x80 |
| #define | CONFIG_ITEM_PASSWORD 0x81 |
| #define | CONFIG_ITEM_KEY 0x82 |
| #define | CONFIG_ITEM_MODULE 0x84 |
| #define | CONFIG_ITEM_MODULE_CAT 0x85 |
| #define | CONFIG_ITEM_MODULE_LIST 0x86 |
| #define | CONFIG_ITEM_MODULE_LIST_CAT 0x87 |
| #define | CONFIG_ITEM_LOADFILE 0x8C |
| #define | CONFIG_ITEM_SAVEFILE 0x8D |
| #define | CONFIG_ITEM_DIRECTORY 0x8E |
| #define | CONFIG_ITEM_FONT 0x8F |
| #define | CONFIG_ITEM(x) (((x) & ~0xF) != 0) |
| #define | CAT_INTERFACE 1 |
| #define | SUBCAT_INTERFACE_GENERAL 101 |
| #define | SUBCAT_INTERFACE_MAIN 102 |
| #define | SUBCAT_INTERFACE_CONTROL 103 |
| #define | SUBCAT_INTERFACE_HOTKEYS 104 |
| #define | CAT_AUDIO 2 |
| #define | SUBCAT_AUDIO_GENERAL 201 |
| #define | SUBCAT_AUDIO_AOUT 202 |
| #define | SUBCAT_AUDIO_AFILTER 203 |
| #define | SUBCAT_AUDIO_VISUAL 204 |
| #define | SUBCAT_AUDIO_MISC 205 |
| #define | CAT_VIDEO 3 |
| #define | SUBCAT_VIDEO_GENERAL 301 |
| #define | SUBCAT_VIDEO_VOUT 302 |
| #define | SUBCAT_VIDEO_VFILTER 303 |
| #define | SUBCAT_VIDEO_TEXT 304 |
| #define | SUBCAT_VIDEO_SUBPIC 305 |
| #define | SUBCAT_VIDEO_VFILTER2 306 |
| #define | CAT_INPUT 4 |
| #define | SUBCAT_INPUT_GENERAL 401 |
| #define | SUBCAT_INPUT_ACCESS 402 |
| #define | SUBCAT_INPUT_DEMUX 403 |
| #define | SUBCAT_INPUT_VCODEC 404 |
| #define | SUBCAT_INPUT_ACODEC 405 |
| #define | SUBCAT_INPUT_SCODEC 406 |
| #define | SUBCAT_INPUT_STREAM_FILTER 407 |
| #define | CAT_SOUT 5 |
| #define | SUBCAT_SOUT_GENERAL 501 |
| #define | SUBCAT_SOUT_STREAM 502 |
| #define | SUBCAT_SOUT_MUX 503 |
| #define | SUBCAT_SOUT_ACO 504 |
| #define | SUBCAT_SOUT_PACKETIZER 505 |
| #define | SUBCAT_SOUT_SAP 506 |
| #define | SUBCAT_SOUT_VOD 507 |
| #define | CAT_ADVANCED 6 |
| #define | SUBCAT_ADVANCED_CPU 601 |
| #define | SUBCAT_ADVANCED_MISC 602 |
| #define | SUBCAT_ADVANCED_NETWORK 603 |
| #define | SUBCAT_ADVANCED_XML 604 |
| #define | CAT_PLAYLIST 7 |
| #define | SUBCAT_PLAYLIST_GENERAL 701 |
| #define | SUBCAT_PLAYLIST_SD 702 |
| #define | SUBCAT_PLAYLIST_EXPORT 703 |
| #define | CAT_OSD 8 |
| #define | SUBCAT_OSD_IMPORT 801 |
| #define | config_SaveConfigFile(a) config_SaveConfigFile(VLC_OBJECT(a)) |
| #define | config_ResetAll(a) config_ResetAll(VLC_OBJECT(a)) |
| #define | config_GetDataDir(a) config_GetDataDir(VLC_OBJECT(a)) |
| #define | config_GetType(a, b) config_GetType(VLC_OBJECT(a),b) |
| #define | config_GetInt(a, b) config_GetInt(VLC_OBJECT(a),b) |
| #define | config_PutInt(a, b, c) config_PutInt(VLC_OBJECT(a),b,c) |
| #define | config_GetFloat(a, b) config_GetFloat(VLC_OBJECT(a),b) |
| #define | config_PutFloat(a, b, c) config_PutFloat(VLC_OBJECT(a),b,c) |
| #define | config_GetPsz(a, b) config_GetPsz(VLC_OBJECT(a),b) |
| #define | config_PutPsz(a, b, c) config_PutPsz(VLC_OBJECT(a),b,c) |
| #define | config_AddIntf(a, b) config_AddIntf(VLC_OBJECT(a),b) |
| #define | config_RemoveIntf(a, b) config_RemoveIntf(VLC_OBJECT(a),b) |
| #define | config_ExistIntf(a, b) config_ExistIntf(VLC_OBJECT(a),b) |
| #define | config_ChainParse(a, b, c, d) config_ChainParse( VLC_OBJECT(a), b, c, d ) |
Typedefs | |
| typedef enum vlc_userdir | vlc_userdir_t |
Enumerations | |
| enum | vlc_userdir { VLC_HOME_DIR, VLC_CONFIG_DIR, VLC_DATA_DIR, VLC_CACHE_DIR, VLC_DESKTOP_DIR = 0x80, VLC_DOWNLOAD_DIR, VLC_TEMPLATES_DIR, VLC_PUBLICSHARE_DIR, VLC_DOCUMENTS_DIR, VLC_MUSIC_DIR, VLC_PICTURES_DIR, VLC_VIDEOS_DIR } |
Functions | |
| VLC_API int | config_GetType (vlc_object_t *, const char *) VLC_USED |
| VLC_API int64_t | config_GetInt (vlc_object_t *, const char *) VLC_USED |
| VLC_API void | config_PutInt (vlc_object_t *, const char *, int64_t) |
| VLC_API float | config_GetFloat (vlc_object_t *, const char *) VLC_USED |
| VLC_API void | config_PutFloat (vlc_object_t *, const char *, float) |
| VLC_API char * | config_GetPsz (vlc_object_t *, const char *) VLC_USED VLC_MALLOC |
| VLC_API void | config_PutPsz (vlc_object_t *, const char *, const char *) |
| VLC_API int | config_SaveConfigFile (vlc_object_t *) |
| VLC_API void | config_ResetAll (vlc_object_t *) |
| VLC_API module_config_t * | config_FindConfig (vlc_object_t *, const char *) VLC_USED |
| VLC_API char * | config_GetDataDir (vlc_object_t *) VLC_USED VLC_MALLOC |
| Determines the shared architecture-independent data directory. | |
| VLC_API char * | config_GetLibDir (void) VLC_USED |
| Determines the architecture-dependent data directory. | |
| VLC_API const char * | config_GetConfDir (void) VLC_USED |
| Determines the system configuration directory. | |
| VLC_API char * | config_GetUserDir (vlc_userdir_t) VLC_USED VLC_MALLOC |
| VLC_API void | config_AddIntf (vlc_object_t *, const char *) |
| VLC_API void | config_RemoveIntf (vlc_object_t *, const char *) |
| VLC_API bool | config_ExistIntf (vlc_object_t *, const char *) VLC_USED |
| VLC_API void | config_ChainParse (vlc_object_t *, const char *psz_prefix, const char *const *ppsz_options, config_chain_t *) |
This function will
| |
| VLC_API char * | config_ChainCreate (char **ppsz_name, config_chain_t **pp_cfg, const char *psz_string) VLC_USED VLC_MALLOC |
This function will parse a configuration string (psz_string) and
| |
| VLC_API void | config_ChainDestroy (config_chain_t *) |
| This function will release a linked list of config_chain_t (Including the head). | |
| VLC_API config_chain_t * | config_ChainDuplicate (const config_chain_t *) VLC_USED VLC_MALLOC |
| This function will duplicate a linked list of config_chain_t. | |
| VLC_API char * | config_StringUnescape (char *psz_string) |
| This function will unescape a string in place and will return a pointer on the given string. | |
| VLC_API char * | config_StringEscape (const char *psz_string) VLC_USED VLC_MALLOC |
| This function will escape a string that can be unescaped by config_StringUnescape. | |
This file describes the programming interface for the configuration module.
It includes functions allowing to declare, get or set configuration options.
| #define CAT_ADVANCED 6 |
| #define CAT_AUDIO 2 |
| #define CAT_INPUT 4 |
| #define CAT_INTERFACE 1 |
| #define CAT_OSD 8 |
| #define CAT_PLAYLIST 7 |
| #define CAT_SOUT 5 |
| #define CAT_VIDEO 3 |
| #define config_AddIntf | ( | a, | ||
| b | ||||
| ) | config_AddIntf(VLC_OBJECT(a),b) |
| #define CONFIG_CATEGORY 0x06 |
| #define config_ChainParse | ( | a, | ||
| b, | ||||
| c, | ||||
| d | ||||
| ) | config_ChainParse( VLC_OBJECT(a), b, c, d ) |
| #define config_ExistIntf | ( | a, | ||
| b | ||||
| ) | config_ExistIntf(VLC_OBJECT(a),b) |
| #define config_GetDataDir | ( | a | ) | config_GetDataDir(VLC_OBJECT(a)) |
| #define config_GetFloat | ( | a, | ||
| b | ||||
| ) | config_GetFloat(VLC_OBJECT(a),b) |
Referenced by var_Inherit().
| #define config_GetInt | ( | a, | ||
| b | ||||
| ) | config_GetInt(VLC_OBJECT(a),b) |
Referenced by osd_MenuCreate(), osd_Volume(), osd_VolumeStep(), and var_Inherit().
| #define config_GetPsz | ( | a, | ||
| b | ||||
| ) | config_GetPsz(VLC_OBJECT(a),b) |
Referenced by config_AddIntf(), config_ExistIntf(), config_RemoveIntf(), and var_Inherit().
| #define config_GetType | ( | a, | ||
| b | ||||
| ) | config_GetType(VLC_OBJECT(a),b) |
Referenced by config_ChainParse(), and var_OptionParse().
| #define CONFIG_HINT_CATEGORY 0x02 |
Referenced by Usage().
| #define CONFIG_HINT_SUBCATEGORY 0x03 |
Referenced by Usage().
| #define CONFIG_HINT_SUBCATEGORY_END 0x04 |
| #define CONFIG_HINT_USAGE 0x05 |
Referenced by Usage().
| #define CONFIG_ITEM | ( | x | ) | (((x) & ~0xF) != 0) |
Referenced by config_LoadCmdLine(), config_SortConfig(), SaveConfigFile(), Usage(), vlc_config_create(), and vlc_plugin_setter().
| #define CONFIG_ITEM_BOOL 0x60 |
Referenced by config_GetType(), config_LoadCmdLine(), config_LoadConfigFile(), SaveConfigFile(), Usage(), and vlc_config_create().
| #define CONFIG_ITEM_DIRECTORY 0x8E |
| #define CONFIG_ITEM_FLOAT 0x20 |
Referenced by config_GetType(), config_LoadCmdLine(), config_LoadConfigFile(), and Usage().
| #define CONFIG_ITEM_FONT 0x8F |
| #define CONFIG_ITEM_INTEGER 0x40 |
Referenced by config_GetType(), config_LoadCmdLine(), config_LoadConfigFile(), IsConfigIntegerType(), and Usage().
| #define CONFIG_ITEM_KEY 0x82 |
| #define CONFIG_ITEM_LOADFILE 0x8C |
| #define CONFIG_ITEM_MODULE 0x84 |
| #define CONFIG_ITEM_MODULE_CAT 0x85 |
| #define CONFIG_ITEM_MODULE_LIST 0x86 |
| #define CONFIG_ITEM_MODULE_LIST_CAT 0x87 |
| #define CONFIG_ITEM_PASSWORD 0x81 |
| #define CONFIG_ITEM_RGB 0x41 |
| #define CONFIG_ITEM_SAVEFILE 0x8D |
| #define CONFIG_ITEM_STRING 0x80 |
Referenced by config_GetType(), config_LoadCmdLine(), IsConfigStringType(), and Usage().
| #define config_PutFloat | ( | a, | ||
| b, | ||||
| c | ||||
| ) | config_PutFloat(VLC_OBJECT(a),b,c) |
| #define config_PutInt | ( | a, | ||
| b, | ||||
| c | ||||
| ) | config_PutInt(VLC_OBJECT(a),b,c) |
| #define config_PutPsz | ( | a, | ||
| b, | ||||
| c | ||||
| ) | config_PutPsz(VLC_OBJECT(a),b,c) |
Referenced by aout_ChangeFilterString(), config_AddIntf(), config_RemoveIntf(), and vout_EnableFilter().
| #define config_RemoveIntf | ( | a, | ||
| b | ||||
| ) | config_RemoveIntf(VLC_OBJECT(a),b) |
| #define config_ResetAll | ( | a | ) | config_ResetAll(VLC_OBJECT(a)) |
| #define config_SaveConfigFile | ( | a | ) | config_SaveConfigFile(VLC_OBJECT(a)) |
Referenced by libvlc_InternalInit().
| #define CONFIG_SECTION 0x08 |
Referenced by Usage().
| #define CONFIG_SUBCATEGORY 0x07 |
| #define SUBCAT_ADVANCED_CPU 601 |
| #define SUBCAT_ADVANCED_MISC 602 |
| #define SUBCAT_ADVANCED_NETWORK 603 |
| #define SUBCAT_ADVANCED_XML 604 |
| #define SUBCAT_AUDIO_AFILTER 203 |
| #define SUBCAT_AUDIO_AOUT 202 |
| #define SUBCAT_AUDIO_GENERAL 201 |
| #define SUBCAT_AUDIO_MISC 205 |
| #define SUBCAT_AUDIO_VISUAL 204 |
| #define SUBCAT_INPUT_ACCESS 402 |
| #define SUBCAT_INPUT_ACODEC 405 |
| #define SUBCAT_INPUT_DEMUX 403 |
| #define SUBCAT_INPUT_GENERAL 401 |
| #define SUBCAT_INPUT_SCODEC 406 |
| #define SUBCAT_INPUT_STREAM_FILTER 407 |
| #define SUBCAT_INPUT_VCODEC 404 |
| #define SUBCAT_INTERFACE_CONTROL 103 |
| #define SUBCAT_INTERFACE_GENERAL 101 |
| #define SUBCAT_INTERFACE_HOTKEYS 104 |
| #define SUBCAT_INTERFACE_MAIN 102 |
| #define SUBCAT_OSD_IMPORT 801 |
| #define SUBCAT_PLAYLIST_EXPORT 703 |
| #define SUBCAT_PLAYLIST_GENERAL 701 |
| #define SUBCAT_PLAYLIST_SD 702 |
| #define SUBCAT_SOUT_ACO 504 |
| #define SUBCAT_SOUT_GENERAL 501 |
| #define SUBCAT_SOUT_MUX 503 |
| #define SUBCAT_SOUT_PACKETIZER 505 |
| #define SUBCAT_SOUT_SAP 506 |
| #define SUBCAT_SOUT_STREAM 502 |
| #define SUBCAT_SOUT_VOD 507 |
| #define SUBCAT_VIDEO_GENERAL 301 |
| #define SUBCAT_VIDEO_SUBPIC 305 |
| #define SUBCAT_VIDEO_TEXT 304 |
| #define SUBCAT_VIDEO_VFILTER 303 |
| #define SUBCAT_VIDEO_VFILTER2 306 |
| #define SUBCAT_VIDEO_VOUT 302 |
| typedef enum vlc_userdir vlc_userdir_t |
| enum vlc_userdir |
| VLC_API void config_AddIntf | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
References asprintf(), config_GetPsz, and config_PutPsz.
| VLC_API char* config_ChainCreate | ( | char ** | ppsz_name, | |
| config_chain_t ** | pp_cfg, | |||
| const char * | psz_string | |||
| ) |
This function will parse a configuration string (psz_string) and
The string format is module{option=*,option=*}[:modulenext{option=*,...}]
The options values are unescaped using config_StringUnescape.
References ChainGetValue(), config_chain_t::p_next, config_chain_t::psz_name, config_chain_t::psz_value, SKIPSPACE, strdup(), and strndup().
Referenced by filter_chain_AppendFromStringInternal(), intf_Create(), sout_AccessOutNew(), sout_MuxNew(), sout_StreamChainNew(), ThreadChangeFilters(), and vlc_sd_Create().
| VLC_API void config_ChainDestroy | ( | config_chain_t * | ) |
This function will release a linked list of config_chain_t (Including the head).
References FREENULL, config_chain_t::p_next, config_chain_t::psz_name, and config_chain_t::psz_value.
Referenced by intf_Create(), intf_DestroyAll(), sout_AccessOutDelete(), sout_MuxDelete(), sout_StreamChainNew(), sout_StreamDelete(), ThreadChangeFilters(), and vlc_sd_Destroy().
| VLC_API config_chain_t* config_ChainDuplicate | ( | const config_chain_t * | ) |
This function will duplicate a linked list of config_chain_t.
References config_chain_t::p_next, config_chain_t::psz_name, config_chain_t::psz_value, and strdup().
| VLC_API void config_ChainParse | ( | vlc_object_t * | , | |
| const char * | psz_prefix, | |||
| const char *const * | ppsz_options, | |||
| config_chain_t * | ||||
| ) |
This function will
The option names will be created by adding the psz_prefix prefix.
References vlc_value_t::b_bool, module_config_t::b_removed, config_FindConfig(), config_GetType, vlc_value_t::f_float, vlc_value_t::i_int, i_type, msg_Dbg, msg_Err, msg_Warn, name, config_chain_t::p_next, psz_name, config_chain_t::psz_name, vlc_value_t::psz_string, config_chain_t::psz_value, us_atof(), var_Create, var_Get, var_Set, VLC_VAR_BOOL, VLC_VAR_DOINHERIT, VLC_VAR_FLOAT, VLC_VAR_INTEGER, and VLC_VAR_STRING.
| VLC_API bool config_ExistIntf | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
References config_GetPsz.
| VLC_API module_config_t* config_FindConfig | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
References config, confnamecmp(), unlikely, and VLC_UNUSED.
Referenced by aout_New(), config_ChainParse(), config_GetFloat(), config_GetInt(), config_GetPsz(), config_GetType(), config_IsSafe(), config_LoadCmdLine(), config_LoadConfigFile(), config_PutFloat(), config_PutInt(), config_PutPsz(), and vout_InitInterlacingSupport().
| VLC_API const char* config_GetConfDir | ( | void | ) |
Determines the system configuration directory.
References config_GetLibDir(), configdir, init_dirs(), and once.
| VLC_API char* config_GetDataDir | ( | vlc_object_t * | p_obj | ) |
Determines the shared architecture-independent data directory.
References config_GetDataDirDefault(), and var_InheritString.
| VLC_API float config_GetFloat | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
| VLC_API int64_t config_GetInt | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
| VLC_API char* config_GetLibDir | ( | void | ) |
Determines the architecture-dependent data directory.
References asprintf(), config_GetLibDir(), config_GetLibPath(), FromLocaleDup(), getline(), PACKAGE, strdup(), and system_Init().
Referenced by config_GetConfDir(), config_GetDataDirDefault(), config_GetLibDir(), and config_GetUserDir().
| VLC_API char* config_GetPsz | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
| VLC_API int config_GetType | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
| VLC_API char* config_GetUserDir | ( | vlc_userdir_t | ) |
References asprintf(), config_GetAppDir(), config_GetHomeDir(), config_GetLibDir(), config_GetShellDir(), config_GetTypeDir(), config_GetUserDir(), getAppDependentDir(), GetConstPrivatePath(), strdup(), VLC_CACHE_DIR, VLC_CONFIG_DIR, VLC_DATA_DIR, VLC_DESKTOP_DIR, VLC_DOCUMENTS_DIR, VLC_DOWNLOAD_DIR, VLC_HOME_DIR, VLC_MUSIC_DIR, VLC_PICTURES_DIR, VLC_PUBLICSHARE_DIR, VLC_TEMPLATES_DIR, and VLC_VIDEOS_DIR.
Referenced by ArtCacheGetDirPath(), config_GetConfigFile(), config_GetUserDir(), config_OpenConfigFile(), config_PrepareDir(), EsOutSetRecord(), init_dirs(), playlist_MLDump(), playlist_MLLoad(), and vout_snapshot_GetDirectory().
| VLC_API void config_PutFloat | ( | vlc_object_t * | , | |
| const char * | , | |||
| float | ||||
| ) |
| VLC_API void config_PutInt | ( | vlc_object_t * | , | |
| const char * | , | |||
| int64_t | ||||
| ) |
| VLC_API void config_PutPsz | ( | vlc_object_t * | , | |
| const char * | , | |||
| const char * | ||||
| ) |
| VLC_API void config_RemoveIntf | ( | vlc_object_t * | , | |
| const char * | ||||
| ) |
References asprintf(), config_GetPsz, and config_PutPsz.
| VLC_API void config_ResetAll | ( | vlc_object_t * | ) |
References config_lock, module_t::confsize, module_value_t::f, module_value_t::i, module_config_t::i_type, IsConfigFloatType(), IsConfigIntegerType(), IsConfigStringType(), list, module_list_free(), module_list_get(), module_config_t::orig, module_t::p_config, module_value_t::psz, strdupnull(), module_config_t::value, vlc_rwlock_unlock(), vlc_rwlock_wrlock(), and VLC_UNUSED.
| VLC_API int config_SaveConfigFile | ( | vlc_object_t * | ) |
References SaveConfigFile().
| VLC_API char* config_StringEscape | ( | const char * | psz_string | ) |
This function will escape a string that can be unescaped by config_StringUnescape.
The returned value is allocated by it. You have to free it once you do not need it anymore (unlike config_StringUnescape). If NULL is given as parameter nothing will be done (NULL will be returned).
The escaped characters are ' " and \
References IsEscapeNeeded(), and xmalloc().
| VLC_API char* config_StringUnescape | ( | char * | psz_string | ) |
This function will unescape a string in place and will return a pointer on the given string.
No memory is allocated by it (unlike config_StringEscape). If NULL is given as parameter nothing will be done (NULL will be returned).
The following sequences will be unescaped (only one time): \ \' and "
References IsEscape().
Referenced by ChainGetValue().
1.7.1