VLC  4.0.0-dev
configuration.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * configuration.h management of the modules configuration
3  *****************************************************************************
4  * Copyright (C) 2007 VLC authors and VideoLAN
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19  *****************************************************************************/
20 
21 #ifndef LIBVLC_CONFIGURATION_H
22 # define LIBVLC_CONFIGURATION_H 1
23 
24 # ifdef __cplusplus
25 extern "C" {
26 # endif
27 
28 /* Internal configuration prototypes and structures */
29 
31 
32 void config_Free (module_config_t *, size_t);
33 
34 int config_LoadCmdLine ( vlc_object_t *, int, const char *[], int * );
36 #define config_LoadCmdLine(a,b,c,d) config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
37 #define config_LoadConfigFile(a) config_LoadConfigFile(VLC_OBJECT(a))
39 
40 int config_SortConfig (void);
41 void config_UnsortConfig (void);
42 
43 #define CONFIG_CLASS(x) ((x) & ~0x1F)
44 
45 #define IsConfigStringType(type) \
46  (((type) & CONFIG_ITEM_STRING) != 0)
47 #define IsConfigIntegerType(type) \
48  (((type) & CONFIG_ITEM_INTEGER) != 0)
49 #define IsConfigFloatType(type) \
50  ((type) == CONFIG_ITEM_FLOAT)
51 
53 extern bool config_dirty;
54 
55 bool config_IsSafe (const char *);
56 
57 /**
58  * Gets the arch-specific installation directory.
59  *
60  * This function determines the directory containing the architecture-specific
61  * installed asset files (such as executable plugins and compiled byte code).
62  *
63  * @return a heap-allocated string (use free() to release it), or NULL on error
64  */
66 
67 /* The configuration file */
68 #define CONFIG_FILE "vlcrc"
69 
70 # ifdef __cplusplus
71 }
72 # endif
73 #endif
module_config_t::psz_name
const char * psz_name
Option name.
Definition: vlc_configuration.h:86
vlc_getopt.h
config_GetLibDir
char * config_GetLibDir(void) VLC_USED VLC_MALLOC
Gets the arch-specific installation directory.
Definition: dirs.m:91
vlc_option::name
const char * name
Definition: vlc_getopt.h:93
var_Create
int() var_Create(vlc_object_t *p_this, const char *psz_name, int i_type)
Creates a VLC object variable.
Definition: variables.c:291
IsEscapeNeeded
static bool IsEscapeNeeded(char c)
Definition: chain.c:44
config_chain_t::p_next
config_chain_t * p_next
Pointer on the next config_chain_t element.
Definition: vlc_configuration.h:335
config_FindConfig
module_config_t * config_FindConfig(const char *name)
Looks up a configuration item.
Definition: core.c:452
psz_name
const char * psz_name
Definition: text_style.c:53
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.
Definition: cmdline.c:57
vlc_getopt_long
int vlc_getopt_long(int argc, char *const *argv, const char *optstring, const struct vlc_option *restrict longopts, int *longind, vlc_getopt_t *restrict state)
Definition: getopt.c:146
unlikely
#define unlikely(p)
Predicted false condition.
Definition: vlc_common.h:227
vlc_common.h
CONFIG_ITEM_FLOAT
#define CONFIG_ITEM_FLOAT
Definition: vlc_plugin.h:120
CONFIG_ITEM_STRING
#define CONFIG_ITEM_STRING
Definition: vlc_plugin.h:124
VLC_VAR_DOINHERIT
#define VLC_VAR_DOINHERIT
Creation flag.
Definition: vlc_variables.h:69
vlc_plugin_t
VLC plugin.
Definition: modules.h:29
vlc_rwlock
Read/write lock.
Definition: vlc_threads.h:532
config_LoadCmdLine
#define config_LoadCmdLine(a, b, c, d)
Definition: configuration.h:36
vlc_charset.h
VLC_VAR_BOOL
#define VLC_VAR_BOOL
Definition: vlc_variables.h:49
config_chain_t::psz_name
char * psz_name
Option name.
Definition: vlc_configuration.h:337
VLC_MALLOC
#define VLC_MALLOC
Heap allocated result function annotation.
Definition: vlc_common.h:167
msg_Dbg
#define msg_Dbg(p_this,...)
Definition: vlc_messages.h:106
vlc_option::has_arg
bool has_arg
Definition: vlc_getopt.h:94
CONFIG_CLASS
#define CONFIG_CLASS(x)
Definition: configuration.h:43
ChainGetEnd
static const char * ChainGetEnd(const char *psz_string)
This function will return a pointer after the end of a string element.
Definition: chain.c:70
VLC_VAR_INTEGER
#define VLC_VAR_INTEGER
Definition: vlc_variables.h:50
VLC_VAR_STRING
#define VLC_VAR_STRING
Definition: vlc_variables.h:51
VLC_VAR_FLOAT
#define VLC_VAR_FLOAT
Definition: vlc_variables.h:52
vlc_option::val
int val
Definition: vlc_getopt.h:96
config_IsSafe
bool config_IsSafe(const char *)
Definition: core.c:73
asprintf
int asprintf(char **, const char *,...)
config_dirty
bool config_dirty
Definition: core.c:41
var_Change
int() var_Change(vlc_object_t *p_this, const char *psz_name, int i_action,...)
Performs a special action on a variable.
Definition: variables.c:423
config_GetType
int config_GetType(const char *psz_name)
Gets a configuration item type.
Definition: core.c:48
vlc_value_t::i_int
int64_t i_int
Definition: vlc_common.h:459
var_Get
int() var_Get(vlc_object_t *p_this, const char *psz_name, vlc_value_t *p_val)
Gets a variable value.
Definition: variables.c:755
strndup
char * strndup(const char *, size_t)
VLC_VAR_SETMINMAX
#define VLC_VAR_SETMINMAX
Definition: vlc_variables.h:102
IsSpace
static bool IsSpace(char c)
Definition: chain.c:54
input_clock_t::i_index
unsigned i_index
Definition: input_clock.c:124
config_ChainDuplicate
config_chain_t * config_ChainDuplicate(const config_chain_t *p_src)
This function will duplicate a linked list of config_chain_t.
Definition: chain.c:435
config_SortConfig
int config_SortConfig(void)
Index the configuration items by name for faster lookups.
Definition: core.c:407
msg_Warn
#define msg_Warn(p_this,...)
Definition: vlc_messages.h:104
vlc_value_t::b_bool
bool b_bool
Definition: vlc_common.h:460
var_SetString
static int var_SetString(vlc_object_t *p_obj, const char *psz_name, const char *psz_string)
Set the value of a string variable.
Definition: vlc_variables.h:345
us_atof
double us_atof(const char *str)
us_atof() has the same prototype as ANSI C atof() but it expects a dot as decimal separator,...
Definition: charset.c:88
config_chain_t
Definition: vlc_configuration.h:331
i_type
int i_type
Definition: httpd.c:1269
vlc_plugins
vlc_plugin_t * vlc_plugins
List of all plug-ins.
Definition: bank.c:102
config_AutoSaveConfigFile
int config_AutoSaveConfigFile(vlc_object_t *)
Definition: file.c:528
module_config_t::max
module_value_t max
Maximum value (for scalars only)
Definition: vlc_configuration.h:93
vlc_value_t::f_float
float f_float
Definition: vlc_common.h:461
config_ChainParse
void config_ChainParse(vlc_object_t *p_this, const char *psz_prefix, const char *const *ppsz_options, const config_chain_t *cfg)
This function will.
Definition: chain.c:270
config_StringEscape
char * config_StringEscape(const char *str)
This function will escape a string that can be unescaped by config_StringUnescape.
Definition: chain.c:473
vlc_interface.h
ChainGetValue
static char * ChainGetValue(const char **ppsz_string)
It will extract an option value (=...
Definition: chain.c:118
SKIPTRAILINGSPACE
#define SKIPTRAILINGSPACE(p, e)
Definition: chain.c:60
config_StringUnescape
char * config_StringUnescape(char *psz_string)
This function will unescape a string in place and will return a pointer on the given string.
Definition: chain.c:455
config_chain_t::psz_value
char * psz_value
Option value.
Definition: vlc_configuration.h:338
vlc_plugin.h
config_Free
void config_Free(module_config_t *, size_t)
Destroys an array of configuration items.
Definition: core.c:467
CONFIG_ITEM_INTEGER
#define CONFIG_ITEM_INTEGER
Definition: vlc_plugin.h:121
var_SetBool
static int var_SetBool(vlc_object_t *p_obj, const char *psz_name, bool b)
Set the value of an boolean variable.
Definition: vlc_variables.h:308
vlc_option
Definition: vlc_getopt.h:91
vlc_value_t::psz_string
char * psz_string
Definition: vlc_common.h:462
modules.h
b_ignore_errors
#define b_ignore_errors
CONFIG_ITEM_BOOL
#define CONFIG_ITEM_BOOL
Definition: vlc_plugin.h:123
config_UnsortConfig
void config_UnsortConfig(void)
Definition: core.c:441
vlc_object_t
VLC object common members.
Definition: vlc_objects.h:43
config_ChainCreate
char * config_ChainCreate(char **ppsz_name, config_chain_t **pp_cfg, const char *psz_chain)
This function will parse a configuration string (psz_string) and.
Definition: chain.c:225
module_config_t
Configuration item.
Definition: vlc_configuration.h:76
module_config_t::b_removed
unsigned b_removed
Obsolete.
Definition: vlc_configuration.h:83
config_ChainDestroy
void config_ChainDestroy(config_chain_t *p_cfg)
This function will release a linked list of config_chain_t (Including the head)
Definition: chain.c:253
var_SetFloat
static int var_SetFloat(vlc_object_t *p_obj, const char *psz_name, float f)
Set the value of a float variable.
Definition: vlc_variables.h:331
strdup
char * strdup(const char *)
module_config_t::min
module_value_t min
Minimum value (for scalars only)
Definition: vlc_configuration.h:92
VLC_USED
#define VLC_USED
Definition: fourcc_gen.c:32
psz_value
char psz_value[8]
Definition: vout_intf.c:99
SKIPSPACE
#define SKIPSPACE(p)
Definition: chain.c:59
name
const char name[16]
Definition: httpd.c:1268
config_PrintHelp
bool config_PrintHelp(vlc_object_t *)
Checks for help command line options such as –help or –version.
Definition: help.c:95
module_value_t::i
int64_t i
Definition: vlc_configuration.h:63
var_SetInteger
static int var_SetInteger(vlc_object_t *p_obj, const char *psz_name, int64_t i)
Set the value of an integer variable.
Definition: vlc_variables.h:293
module_value_t::f
float f
Definition: vlc_configuration.h:64
configuration.h
config_lock
vlc_rwlock_t config_lock
Definition: core.c:40
strtoll
long long int strtoll(const char *, char **, int)
module_config_t::i_type
uint8_t i_type
Configuration type.
Definition: vlc_configuration.h:78
libvlc.h
var_Set
int() var_Set(vlc_object_t *p_this, const char *psz_name, vlc_value_t val)
Sets a variable value.
Definition: variables.c:721
module_config_t::i_short
char i_short
Optional short option name.
Definition: vlc_configuration.h:79
config_ChainParseOptions
const char * config_ChainParseOptions(config_chain_t **pp_cfg, const char *psz_opts)
This function will parse a configuration string (psz_opts) and.
Definition: chain.c:180
vlc_actions.h
IsEscape
static bool IsEscape(const char *psz)
Definition: chain.c:48
vlc_alloc
static void * vlc_alloc(size_t count, size_t size)
Definition: vlc_common.h:1144
state
static thread_local struct @76 state
vlc_getopt_s
Definition: vlc_getopt.h:25
config_LoadConfigFile
#define config_LoadConfigFile(a)
Definition: configuration.h:37
vlc_option::flag
int * flag
Definition: vlc_getopt.h:95
vlc_value_t
VLC value structure.
Definition: vlc_common.h:457
msg_Err
#define msg_Err(p_this,...)
Definition: vlc_messages.h:102
CONFIG_ITEM
#define CONFIG_ITEM(x)
Definition: vlc_plugin.h:136
p
#define p(t)
vlc_modules.h