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 /* Internal configuration prototypes and structures */
25 
26 struct vlc_plugin_t;
27 
28 struct vlc_param {
29  union {
30  _Atomic int64_t i; /**< Current value (if integer or boolean) */
31  _Atomic float f; /**< Current value (if floating point) */
32  char *_Atomic str; /**< Current value (if character string) */
33  } value;
34 
36  unsigned char shortname; /**< Optional short option name */
37  unsigned internal:1; /**< Hidden from preferences and help */
38  unsigned unsaved:1; /**< Not stored in persistent configuration */
39  unsigned safe:1; /**< Safe for untrusted provisioning (playlists) */
40  unsigned obsolete:1; /**< Ignored for backward compatibility */
41  struct module_config_t item;
42 };
43 
44 /**
45  * Looks up a configuration parameter by name.
46  *
47  * \return the configuration parameter, or NULL if not found
48  */
49 struct vlc_param *vlc_param_Find(const char *name);
50 
51 int vlc_param_SetString(struct vlc_param *param, const char *value);
52 
54 
55 void config_Free(struct vlc_param *, size_t);
56 
57 #ifdef HAVE_DYNAMIC_PLUGINS
58 void config_CmdLineEarlyScan( vlc_object_t *, int, const char *[] );
59 #define config_CmdLineEarlyScan(a,b,c) config_CmdLineEarlyScan(VLC_OBJECT(a),b,c)
60 #endif
61 
62 int config_LoadCmdLine ( vlc_object_t *, int, const char *[], int * );
64 #define config_LoadCmdLine(a,b,c,d) config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
65 #define config_LoadConfigFile(a) config_LoadConfigFile(VLC_OBJECT(a))
67 
68 int config_SortConfig (void);
69 void config_UnsortConfig (void);
70 
72 
73 bool config_IsSafe (const char *);
74 
75 /**
76  * Gets the arch-specific installation directory.
77  *
78  * This function determines the directory containing the architecture-specific
79  * installed asset files (such as executable plugins and compiled byte code).
80  *
81  * @return a heap-allocated string (use free() to release it), or NULL on error
82  */
83 char *config_GetLibDir(void) VLC_USED VLC_MALLOC;
84 
85 /* The configuration file */
86 #define CONFIG_FILE "vlcrc"
87 
88 #endif
vlc_mutex_t config_lock
Definition: core.c:42
#define config_LoadConfigFile(a)
Definition: configuration.h:65
char * config_GetLibDir(void) VLC_USED VLC_MALLOC
Gets the arch-specific installation directory.
Definition: dirs.m:92
void config_Free(struct vlc_param *, size_t)
Destroys an array of configuration items.
Definition: core.c:467
bool config_PrintHelp(vlc_object_t *)
Checks for help command line options such as –help or –version.
Definition: help.c:94
void config_UnsortConfig(void)
Definition: core.c:432
struct vlc_param * vlc_param_Find(const char *name)
Looks up a configuration parameter by name.
Definition: core.c:443
int config_SortConfig(void)
Index the configuration items by name for faster lookups.
Definition: core.c:398
int config_AutoSaveConfigFile(vlc_object_t *)
Definition: core.c:521
int vlc_param_SetString(struct vlc_param *param, const char *value)
Definition: core.c:114
#define config_LoadCmdLine(a, b, c, d)
Definition: configuration.h:64
bool config_IsSafe(const char *)
Definition: core.c:67
#define VLC_USED
Definition: fourcc_gen.c:32
const char name[16]
Definition: httpd.c:1267
Configuration item.
Definition: vlc_configuration.h:70
Mutex.
Definition: vlc_threads.h:193
VLC object common members.
Definition: vlc_objects.h:45
Definition: configuration.h:28
union vlc_param::@9 value
struct vlc_plugin_t * owner
Definition: configuration.h:35
_Atomic int64_t i
Current value (if integer or boolean)
Definition: configuration.h:30
char *_Atomic str
Current value (if character string)
Definition: configuration.h:32
unsigned obsolete
Ignored for backward compatibility.
Definition: configuration.h:40
unsigned char shortname
Optional short option name.
Definition: configuration.h:36
struct module_config_t item
Definition: configuration.h:41
_Atomic float f
Current value (if floating point)
Definition: configuration.h:31
unsigned unsaved
Not stored in persistent configuration.
Definition: configuration.h:38
unsigned safe
Safe for untrusted provisioning (playlists)
Definition: configuration.h:39
VLC plugin.
Definition: modules.h:32