VLC  4.0.0-dev
configuration.h File Reference

Go to the source code of this file.

Data Structures

struct  vlc_param


#define config_LoadCmdLine(a, b, c, d)   config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
#define config_LoadConfigFile(a)   config_LoadConfigFile(VLC_OBJECT(a))
#define CONFIG_FILE   "vlcrc"


struct vlc_paramvlc_param_Find (const char *name)
 Looks up a configuration parameter by name. More...
int vlc_param_SetString (struct vlc_param *param, const char *value)
int config_AutoSaveConfigFile (vlc_object_t *)
void config_Free (struct vlc_param *, size_t)
 Destroys an array of configuration items. More...
int config_LoadCmdLine (vlc_object_t *, int, const char *[], int *)
 Parse command line for configuration options. More...
int config_LoadConfigFile (vlc_object_t *)
bool config_PrintHelp (vlc_object_t *)
 Checks for help command line options such as –help or –version. More...
int config_SortConfig (void)
 Index the configuration items by name for faster lookups. More...
void config_UnsortConfig (void)
bool config_IsSafe (const char *)
char * config_GetLibDir (void) VLC_USED VLC_MALLOC
 Gets the arch-specific installation directory. More...


vlc_mutex_t config_lock

Macro Definition Documentation


#define CONFIG_FILE   "vlcrc"

◆ config_LoadCmdLine

#define config_LoadCmdLine (   a,
)    config_LoadCmdLine(VLC_OBJECT(a),b,c,d)

◆ config_LoadConfigFile

#define config_LoadConfigFile (   a)    config_LoadConfigFile(VLC_OBJECT(a))

Function Documentation

◆ config_AutoSaveConfigFile()

int config_AutoSaveConfigFile ( vlc_object_t p_this)

◆ config_Free()

void config_Free ( struct vlc_param tab,
size_t  confsize 

Destroys an array of configuration items.

configstart of array of items
confsizenumber of items in the array

References module_config_t::i_type, IsConfigStringType, vlc_param::item, module_config_t::list, module_config_t::list_count, module_config_t::list_text, module_config_t::psz, vlc_param::str, and vlc_param::value.

Referenced by vlc_plugin_destroy().

◆ config_GetLibDir()

char* config_GetLibDir ( void  )

Gets the arch-specific installation directory.

This function determines the directory containing the architecture-specific installed asset files (such as executable plugins and compiled byte code).

a heap-allocated string (use free() to release it), or NULL on error

Gets the arch-specific installation directory.

a string (always succeeds).

References cached_path, config_GetLibDir(), config_GetLibDirOnce(), config_getLibraryDirReal(), config_GetRealDir(), FromLocaleDup, getenv(), and strdup().

Referenced by config_GetDataDir(), config_GetHomeDir(), config_GetLibDir(), config_GetLibDirRaw(), and config_GetSysPath().

◆ config_IsSafe()

bool config_IsSafe ( const char *  name)

References name, vlc_param::safe, and vlc_param_Find().

Referenced by var_OptionParse().

◆ config_LoadCmdLine()

int config_LoadCmdLine ( vlc_object_t p_this,
int  i_argc,
const char *  ppsz_argv[],
int *  pindex 

Parse command line for configuration options.

Now that the module_bank has been initialized, we can dynamically generate the longopts structure used by getops. We have to do it this way because we don't know (and don't want to know) in advance the configuration options used (ie. exported) by each module.

p_thisobject to write command line options as variables to
i_argcnumber of command line arguments
ppsz_argscommand line arguments [IN/OUT]
pindexindex of the first non-option argument [OUT]
0 on success, -1 on error.

References _, asprintf(), CONFIG_CLASS, config_FindConfig(), CONFIG_ITEM, CONFIG_ITEM_BOOL, CONFIG_ITEM_FLOAT, CONFIG_ITEM_INTEGER, CONFIG_ITEM_STRING, container_of, module_value_t::f, vlc_option::flag, vlc_option::has_arg, module_value_t::i, vlc_param::i, module_config_t::i_type, i_type, vlc_option::is_obsolete, vlc_param::item, module_config_t::max, module_config_t::min, vlc_option::name, name, vlc_param::obsolete, p, module_config_t::psz_name, psz_name, vlc_param::shortname, state, strdup(), strtoll(), TS_GREEN, TS_RED_BOLD, TS_RESET, TS_YELLOW, TS_YELLOW_BOLD, us_atof(), vlc_option::val, var_Change(), var_Create(), var_SetBool(), var_SetFloat(), var_SetInteger(), var_SetString(), vlc_alloc(), vlc_getopt_long(), vlc_jaro_winkler(), vlc_plugins, VLC_VAR_BOOL, VLC_VAR_FLOAT, VLC_VAR_INTEGER, VLC_VAR_SETMINMAX, and VLC_VAR_STRING.

◆ config_LoadConfigFile()

◆ config_PrintHelp()

bool config_PrintHelp ( vlc_object_t obj)

Checks for help command line options such as –help or –version.

If one is found, print the corresponding text.

true if a command line options caused some help message to be printed, false otherwise.

References Help(), ListModules(), var_Create(), var_InheritBool(), var_InheritString(), var_SetBool(), Version(), and VLC_VAR_BOOL.

Referenced by libvlc_InternalInit().

◆ config_SortConfig()

int config_SortConfig ( void  )

Index the configuration items by name for faster lookups.

References confcmp(), config, CONFIG_ITEM, vlc_param::i, module_config_t::i_type, vlc_param::item, p, unlikely, vlc_alloc(), VLC_ENOMEM, vlc_plugins, and VLC_SUCCESS.

Referenced by module_InitBank(), and module_LoadPlugins().

◆ config_UnsortConfig()

void config_UnsortConfig ( void  )

References config.

Referenced by module_EndBank(), and module_LoadPlugins().

◆ vlc_param_Find()

struct vlc_param* vlc_param_Find ( const char *  name)

◆ vlc_param_SetString()

Variable Documentation

◆ config_lock