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#include <vlc_configuration.h>
25
26/* Internal configuration prototypes and structures */
27
28struct vlc_plugin_t;
29
30struct vlc_param {
31 union {
32 _Atomic int64_t i; /**< Current value (if integer or boolean) */
33 _Atomic float f; /**< Current value (if floating point) */
34 char *_Atomic str; /**< Current value (if character string) */
36
38 unsigned char shortname; /**< Optional short option name */
39 unsigned internal:1; /**< Hidden from preferences and help */
40 unsigned unsaved:1; /**< Not stored in persistent configuration */
41 unsigned safe:1; /**< Safe for untrusted provisioning (playlists) */
42 unsigned obsolete:1; /**< Ignored for backward compatibility */
44};
45
46/**
47 * Looks up a configuration parameter by name.
48 *
49 * \return the configuration parameter, or NULL if not found
50 */
51struct vlc_param *vlc_param_Find(const char *name);
52
53int vlc_param_SetString(struct vlc_param *param, const char *value);
54
56
57void config_Free(struct vlc_param *, size_t);
58
59void config_CmdLineEarlyScan( libvlc_int_t *, int, const char *[] );
60
61int config_LoadCmdLine ( libvlc_int_t *, int, const char *[], int * );
64void config_Lock(void);
65void config_Unlock(void);
66
67int config_SortConfig (void);
68void config_UnsortConfig (void);
69
70bool config_IsSafe (const char *);
71
72/**
73 * Gets the arch-specific installation directory.
74 *
75 * This function determines the directory containing the architecture-specific
76 * installed asset files (such as executable plugins and compiled byte code).
77 *
78 * @return a heap-allocated string (use free() to release it), or NULL on error
79 */
81
82/* The configuration file */
83#define CONFIG_FILE "vlcrc"
84
85#endif
struct vlc_param * vlc_param_Find(const char *name)
Looks up a configuration parameter by name.
Definition: core.c:454
char * config_GetLibDir(void)
Gets the arch-specific installation directory.
Definition: dirs.m:93
void config_Unlock(void)
Definition: core.c:51
int config_LoadCmdLine(libvlc_int_t *, int, const char *[], int *)
Parse command line for configuration options.
Definition: cmdline.c:165
void config_Free(struct vlc_param *, size_t)
Destroys an array of configuration items.
Definition: core.c:478
void config_Lock(void)
Definition: core.c:46
void config_UnsortConfig(void)
Definition: core.c:443
int config_AutoSaveConfigFile(libvlc_int_t *)
Definition: core.c:532
int config_SortConfig(void)
Index the configuration items by name for faster lookups.
Definition: core.c:409
int config_LoadConfigFile(libvlc_int_t *)
Definition: file.c:164
bool config_PrintHelp(libvlc_int_t *)
Checks for help command line options such as –help or –version.
Definition: help.c:101
int vlc_param_SetString(struct vlc_param *param, const char *value)
Definition: core.c:125
void config_CmdLineEarlyScan(libvlc_int_t *, int, const char *[])
Perform early scan of arguments for a small subset of simple options.
Definition: cmdline.c:98
bool config_IsSafe(const char *)
Definition: core.c:78
#define VLC_USED
Definition: fourcc_gen.c:32
#define VLC_MALLOC
Definition: vlc_common.h:164
const char name[16]
Definition: httpd.c:1281
Definition: vlc_objects.h:91
Configuration item.
Definition: vlc_configuration.h:70
Definition: configuration.h:30
struct vlc_plugin_t * owner
Definition: configuration.h:37
unsigned internal
Hidden from preferences and help.
Definition: configuration.h:39
_Atomic int64_t i
Current value (if integer or boolean)
Definition: configuration.h:32
char *_Atomic str
Current value (if character string)
Definition: configuration.h:34
unsigned obsolete
Ignored for backward compatibility.
Definition: configuration.h:42
union vlc_param::@10 value
unsigned char shortname
Optional short option name.
Definition: configuration.h:38
struct module_config_t item
Definition: configuration.h:43
_Atomic float f
Current value (if floating point)
Definition: configuration.h:33
unsigned unsaved
Not stored in persistent configuration.
Definition: configuration.h:40
unsigned safe
Safe for untrusted provisioning (playlists)
Definition: configuration.h:41
VLC plugin.
Definition: modules.h:33
This file describes the programming interface for the configuration module.