Go to the documentation of this file.
23 #define VLC_GETOPT_H 1
99 extern int vlc_getopt_long(
int argc,
char *
const *argv,
const char *shortopts,
100 const struct vlc_option *longopts,
int *longind,
const char * psz_name
Option name.
Definition: vlc_configuration.h:86
const char psz_vlc_changeset[]
size_t vlc_towc(const char *str, uint32_t *restrict pwc)
Decodes a code point from UTF-8.
Definition: unicode.c:113
const char * name
Definition: vlc_getopt.h:93
int vlc_http_res_init(struct vlc_http_resource *restrict res, const struct vlc_http_resource_cbs *cbs, struct vlc_http_mgr *mgr, const char *uri, const char *ua, const char *ref)
Definition: resource.c:168
size_t count
Definition: core.c:401
static void exchange(char **argv, vlc_getopt_t *restrict state)
Definition: getopt.c:41
#define BLUE
Definition: help.c:237
static void print_help_on_full_help(void)
Definition: help.c:159
int() var_Create(vlc_object_t *p_this, const char *psz_name, int i_type)
Creates a VLC object variable.
Definition: variables.c:291
#define PADDING_SPACES
Definition: help.c:243
double atof(const char *)
module_config_t * config_FindConfig(const char *name)
Looks up a configuration item.
Definition: core.c:452
void vlc_rwlock_rdlock(vlc_rwlock_t *lock)
Acquires a read/write lock for reading.
Definition: threads.c:394
static int confnamecmp(const void *key, const void *elem)
Definition: core.c:391
static bool var_InheritBool(vlc_object_t *obj, const char *name)
Definition: vlc_variables.h:675
static int config_CreateDir(vlc_object_t *p_this, char *psz_dirname)
Definition: file.c:270
module_t ** module_list_get(size_t *n)
Gets the flat list of VLC modules.
Definition: bank.c:765
bool vlc_http_file_can_seek(struct vlc_http_resource *res)
Checks seeking support.
Definition: file.c:196
const char * psz_name
Definition: text_style.c:53
#define MAGENTA
Definition: help.c:238
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
struct vlc_http_msg * vlc_http_res_open(struct vlc_http_resource *res, void *opaque)
Definition: resource.c:84
struct vlc_plugin_t::@96 conf
Variables set by the module to store its config options.
int vlc_open(const char *filename, int flags,...)
Opens a system file handle.
Definition: filesystem.c:52
#define unlikely(p)
Predicted false condition.
Definition: vlc_common.h:227
#define LINE_START
Definition: help.c:242
#define CONFIG_ITEM_FLOAT
Definition: vlc_plugin.h:120
const char ** pp_shortcuts
Definition: modules.h:85
#define CONFIG_ITEM_STRING
Definition: vlc_plugin.h:124
const char * psz_text
Short comment on the configuration option.
Definition: vlc_configuration.h:87
static unsigned ConsoleWidth(void)
Returns the console width or a best guess.
Definition: help.c:66
const char * VLC_CompileHost(void)
Definition: version.c:44
const char * module_get_object(const module_t *m)
Gets the internal name of a module.
Definition: modules.c:50
#define DIR_SEP
Definition: vlc_common.h:1221
const char * VLC_CompileBy(void)
Definition: version.c:43
const char ** list_text
Human-readable names for list values.
Definition: vlc_configuration.h:102
static const struct vlc_http_resource_cbs vlc_http_file_callbacks
Definition: file.c:107
const char * module_gettext(const module_t *m, const char *str)
Translates a string using the module's text domain.
Definition: modules.c:82
#define IsConfigIntegerType(type)
Definition: configuration.h:47
int opt
Definition: vlc_getopt.h:68
size_t i_buffer
Payload length.
Definition: vlc_block.h:122
static void print_item(const module_t *m, const module_config_t *item, const module_config_t **section, bool color, bool desc)
Definition: help.c:346
#define msg_Info(p_this,...)
Definition: vlc_messages.h:100
VLC plugin.
Definition: modules.h:29
uint32_t i_value
Definition: text_style.c:54
Read/write lock.
Definition: vlc_threads.h:532
void config_AddIntf(const char *psz_intf)
Definition: intf.c:32
static locale_t uselocale(locale_t loc)
Definition: vlc_fixups.h:359
static int vlc_swidth(const char *str)
Definition: help.c:326
void vlc_http_msg_destroy(struct vlc_http_msg *m)
Destroys an HTTP message.
Definition: message.c:193
const int * i
Table of possible integer choices.
Definition: vlc_configuration.h:100
void * locale_t
Definition: vlc_fixups.h:344
static void print_section(const module_t *m, const module_config_t **sect, bool color, bool desc)
Definition: help.c:245
unsigned i_shortcuts
Shortcuts to the module.
Definition: modules.h:84
static void Usage(vlc_object_t *, const char *)
Definition: help.c:581
ssize_t config_GetPszChoices(const char *name, char ***restrict values, char ***restrict texts)
Definition: core.c:310
module_value_t orig
Default value.
Definition: vlc_configuration.h:91
void module_list_free(module_t **list)
Frees the flat list of VLC modules.
Definition: bank.c:754
struct vlc_http_msg * response
Definition: resource.h:46
#define VLC_VAR_BOOL
Definition: vlc_variables.h:49
bool config_ExistIntf(const char *psz_intf)
Definition: intf.c:135
#define CONFIG_SECTION
Definition: vlc_plugin.h:117
void config_UnsortConfig(void)
Definition: core.c:441
char * psz
Definition: vlc_configuration.h:62
#define msg_Dbg(p_this,...)
Definition: vlc_messages.h:106
uintmax_t vlc_http_file_get_size(struct vlc_http_resource *res)
Gets file size.
Definition: file.c:178
#define _(str)
Definition: vlc_fixups.h:374
int ind
Definition: vlc_getopt.h:64
int vlc_mkdir(const char *dirname, mode_t mode)
Creates a directory.
Definition: filesystem.c:96
static char * var_InheritString(vlc_object_t *obj, const char *name)
Definition: vlc_variables.h:705
bool has_arg
Definition: vlc_getopt.h:94
#define VLC_EGENERIC
Unspecified error.
Definition: vlc_common.h:474
#define IsConfigStringType(type)
Definition: configuration.h:45
const char * VLC_Compiler(void)
Definition: version.c:45
#define CONFIG_CLASS(x)
Definition: configuration.h:43
#define VLC_VAR_INTEGER
Definition: vlc_variables.h:50
#define VLC_VAR_STRING
Definition: vlc_variables.h:51
static char * getenv(const char *name)
Definition: vlc_fixups.h:292
static void freelocale(locale_t loc)
Definition: vlc_fixups.h:346
#define VLC_VAR_FLOAT
Definition: vlc_variables.h:52
int val
Definition: vlc_getopt.h:96
const char * vlc_gettext(const char *msgid)
In-tree plugins share their gettext domain with LibVLC.
Definition: textdomain.c:79
#define VLC_STATIC_MUTEX
Static initializer for (static) mutex.
Definition: vlc_threads.h:249
int vlc_http_msg_add_header(struct vlc_http_msg *m, const char *name, const char *fmt,...)
Definition: message.c:144
int asprintf(char **, const char *,...)
bool config_dirty
Definition: core.c:41
@ VLC_HOME_DIR
Definition: vlc_configuration.h:307
int config_GetType(const char *psz_name)
Gets a configuration item type.
Definition: core.c:48
Mutex.
Definition: vlc_threads.h:225
static char * config_GetConfigFile(vlc_object_t *obj)
Get the user's configuration file.
Definition: file.c:58
char * nextchar
Definition: vlc_getopt.h:77
int last_nonopt
Definition: vlc_getopt.h:86
static int vlc_http_file_resp(const struct vlc_http_resource *res, const struct vlc_http_msg *resp, void *opaque)
Definition: file.c:78
char * arg
Definition: vlc_getopt.h:50
#define RED
Definition: help.c:234
#define msg_Warn(p_this,...)
Definition: vlc_messages.h:104
const char * psz_help
Long help string for "special" modules.
Definition: modules.h:92
void * owner
Origin run-time linker module handle.
Definition: vlc_configuration.h:103
#define vlc_assert_unreachable()
Impossible branch assertion.
Definition: vlc_common.h:253
FILE * vlc_fopen(const char *filename, const char *mode)
Opens a FILE pointer.
Definition: filesystem.c:49
char * config_GetUserDir(vlc_userdir_t type)
Definition: specific.c:273
int i_score
Score for the capability.
Definition: modules.h:95
vlc_plugin_t * vlc_plugins
List of all plug-ins.
Definition: bank.c:102
unsigned b_unsaveable
Not stored in configuration.
Definition: vlc_configuration.h:81
Internal module descriptor.
Definition: modules.h:78
module_value_t max
Maximum value (for scalars only)
Definition: vlc_configuration.h:93
void config_ResetAll(void)
Resets the configuration.
Definition: core.c:486
block_t * vlc_http_file_read(struct vlc_http_resource *res)
Reads data.
Definition: file.c:232
#define PauseConsole()
Definition: help.c:55
double f_value
Definition: vout_intf.c:90
static locale_t newlocale(int mask, const char *locale, locale_t base)
Definition: vlc_fixups.h:350
const char * psz_longname
Module descriptive name.
Definition: modules.h:91
@ VLC_CONFIG_DIR
Definition: vlc_configuration.h:308
const char * vlc_http_msg_get_token(const struct vlc_http_msg *msg, const char *field, const char *token)
Looks up a token in a header field.
Definition: message.c:709
const char * vlc_strerror_c(int errnum)
Definition: error.c:34
static bool plugin_show(const vlc_plugin_t *plugin)
Definition: help.c:566
static int confcmp(const void *a, const void *b)
Definition: core.c:384
vlc_mutex_t lock
Definition: rand.c:50
int vlc_close(int fd)
Closes a file descriptor.
Definition: filesystem.c:91
bool config_IsSafe(const char *name)
Definition: core.c:73
#define CONFIG_ITEM_INTEGER
Definition: vlc_plugin.h:121
static void Help(vlc_object_t *, const char *)
Definition: help.c:199
Definition: resource.h:43
void config_PutPsz(const char *psz_name, const char *psz_value)
Sets a string configuration item's value.
Definition: core.c:139
float config_GetFloat(const char *psz_name)
Gets a floating point configuration item's value.
Definition: core.c:105
static void Version(void)
Definition: help.c:694
uintmax_t offset
Definition: file.c:63
static char * strdupnull(const char *src)
Definition: file.c:50
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
int vlc_getopt_long(int argc, char *const *argv, const char *shortopts, const struct vlc_option *longopts, int *longind, vlc_getopt_t *restrict state)
Definition: vlc_getopt.h:91
static int config_PrepareDir(vlc_object_t *obj)
Definition: file.c:331
size_t size
Total count of all items.
Definition: modules.h:63
#define CYAN
Definition: help.c:239
static int vlc_http_file_req(const struct vlc_http_resource *res, struct vlc_http_msg *req, void *opaque)
Definition: file.c:48
static ssize_t config_ListModules(const char *cap, char ***restrict values, char ***restrict texts)
Definition: core.c:258
struct vlc_http_resource * vlc_http_file_create(struct vlc_http_mgr *mgr, const char *uri, const char *ua, const char *ref)
Creates an HTTP file.
Definition: file.c:113
#define WHITE
Definition: help.c:240
static char * strdupnull(const char *src)
Definition: core.c:43
bool config_dirty
Definition: core.c:41
void *const vlc_http_error
Error pointer value.
Definition: message.c:57
#define VLC_FORMAT(x, y)
String format function annotation.
Definition: vlc_common.h:141
#define CONFIG_ITEM_BOOL
Definition: vlc_plugin.h:123
void vlc_rwlock_unlock(vlc_rwlock_t *lock)
Releases a read/write lock.
Definition: threads.c:420
module_config_t * items
Table of configuration items.
Definition: modules.h:62
#define DIR_SEP_CHAR
Definition: vlc_common.h:1220
int vlc_http_res_get_status(struct vlc_http_resource *res)
Definition: resource.c:131
VLC object common members.
Definition: vlc_objects.h:43
void config_PutInt(const char *psz_name, int64_t i_value)
Sets an integer configuration item's value.
Definition: core.c:162
#define IsConfigFloatType(type)
Definition: configuration.h:49
#define VLC_ENOMEM
Not enough memory.
Definition: vlc_common.h:476
Configuration item.
Definition: vlc_configuration.h:76
unsigned b_removed
Obsolete.
Definition: vlc_configuration.h:83
struct vlc_getopt_s vlc_getopt_t
const char * psz_type
Configuration subtype.
Definition: vlc_configuration.h:85
const char * psz_capability
Capability.
Definition: modules.h:94
#define VLC_SUCCESS
No error.
Definition: vlc_common.h:472
void * vlc_plugin_Symbol(struct vlc_logger *log, vlc_plugin_t *plugin, const char *name)
Definition: bank.c:631
void config_PutFloat(const char *psz_name, float f_value)
Sets a floating point configuration item's value.
Definition: core.c:181
char * strdup(const char *)
module_value_t min
Minimum value (for scalars only)
Definition: vlc_configuration.h:92
const char * module_get_name(const module_t *m, bool long_name)
Gets the human-friendly name of a module.
Definition: modules.c:57
char psz_value[8]
Definition: vout_intf.c:99
int first_nonopt
Definition: vlc_getopt.h:85
#define LC_NUMERIC_MASK
Definition: vlc_fixups.h:341
void vlc_mutex_lock(vlc_mutex_t *mtx)
Acquires a mutex.
Definition: threads.c:158
module_config_t ** list
Definition: core.c:400
const char name[16]
Definition: httpd.c:1268
union module_config_t::@194 list
Possible choices.
static void print_desc(const char *str, unsigned margin, bool color)
Definition: help.c:261
static int64_t vlc_strtoi(const char *str)
Definition: file.c:138
static void ListModules(vlc_object_t *, bool)
Definition: help.c:649
static module_config_t * config_FindConfigChecked(const char *psz_name)
Definition: core.c:79
#define CONFIG_FILE
Definition: configuration.h:68
int64_t i
Definition: vlc_configuration.h:63
#define N_(str)
Definition: vlc_fixups.h:375
module_value_t value
Current value.
Definition: vlc_configuration.h:90
int vlc_unlink(const char *filename)
Removes a file.
Definition: filesystem.c:183
static bool vlc_http_msg_can_seek(const struct vlc_http_msg *resp)
Definition: file.c:169
#define GRAY
Definition: help.c:241
float f
Definition: vlc_configuration.h:64
int64_t config_GetInt(const char *psz_name)
Gets an integer configuration item's value.
Definition: core.c:89
int vlc_rename(const char *oldpath, const char *newpath)
Moves a file atomically.
Definition: filesystem.c:197
vlc_rwlock_t config_lock
Definition: core.c:40
vlc_rwlock_t config_lock
Definition: core.c:40
time_t vlc_http_msg_get_mtime(const struct vlc_http_msg *m)
Gets resource date.
Definition: message.c:877
long long int strtoll(const char *, char **, int)
#define YELLOW
Definition: help.c:236
#define CONFIG_ITEM_MODULE
Definition: vlc_plugin.h:127
uint16_t list_count
Choices count.
Definition: vlc_configuration.h:96
const char * psz_longtext
Long comment on the configuration option.
Definition: vlc_configuration.h:88
uint8_t i_type
Configuration type.
Definition: vlc_configuration.h:78
const char ** psz
Table of possible string choices.
Definition: vlc_configuration.h:99
static bool module_match(const module_t *m, const char *pattern, bool strict)
Definition: help.c:544
struct block_t * vlc_http_res_read(struct vlc_http_resource *res)
Reads data.
Definition: resource.c:310
struct vlc_http_resource resource
Definition: file.c:62
const char * vlc_http_msg_get_header(const struct vlc_http_msg *m, const char *name)
Looks up an header field.
Definition: message.c:156
size_t module_list_cap(module_t *const **restrict list, const char *name)
Definition: bank.c:790
void vlc_rwlock_wrlock(vlc_rwlock_t *lock)
Acquires a read/write lock for writing.
Definition: threads.c:410
int vlc_http_msg_get_status(const struct vlc_http_msg *m)
Gets response status code.
Definition: message.c:168
char i_short
Optional short option name.
Definition: vlc_configuration.h:79
int config_SortConfig(void)
Index the configuration items by name for faster lookups.
Definition: core.c:407
#define CONFIG_HINT_CATEGORY
Definition: vlc_plugin.h:112
bool config_PrintHelp(vlc_object_t *obj)
Checks for help command line options such as –help or –version.
Definition: help.c:95
int config_AutoSaveConfigFile(vlc_object_t *p_this)
Definition: file.c:528
#define VLC_STATIC_RWLOCK
Static initializer for (static) read/write lock.
Definition: vlc_threads.h:542
#define CONFIG_HINT_USAGE
Definition: vlc_plugin.h:113
int config_LoadConfigFile(vlc_object_t *p_this)
Definition: file.c:166
int config_SaveConfigFile(vlc_object_t *p_this)
Saves the in-memory configuration into a file.
Definition: file.c:347
static const char vlc_usage[]
Definition: help.c:165
int vlc_http_msg_add_time(struct vlc_http_msg *m, const char *hname, const time_t *t)
Adds a timestamp header field.
Definition: message.c:811
#define ShowConsole()
Definition: help.c:54
#define LICENSE_MSG
Definition: vlc_common.h:1226
static void * vlc_alloc(size_t count, size_t size)
Definition: vlc_common.h:1144
static int config_Write(FILE *file, const char *desc, const char *type, bool comment, const char *name, const char *fmt,...)
Definition: file.c:306
void config_RemoveIntf(const char *psz_intf)
Definition: intf.c:81
static thread_local struct @76 state
Definition: resource.h:35
uintmax_t vlc_http_msg_get_size(const struct vlc_http_msg *m)
Gets HTTP payload length.
Definition: message.c:905
void config_Free(module_config_t *tab, size_t confsize)
Destroys an array of configuration items.
Definition: core.c:467
Definition: vlc_getopt.h:25
static uintmax_t vlc_http_msg_get_file_size(const struct vlc_http_msg *resp)
Definition: file.c:132
int * flag
Definition: vlc_getopt.h:95
#define GREEN
Definition: help.c:235
void vlc_mutex_unlock(vlc_mutex_t *mtx)
Releases a mutex.
Definition: threads.c:209
static FILE * config_OpenConfigFile(vlc_object_t *p_obj)
Definition: file.c:72
Definition: vlc_block.h:117
int utf8_fprintf(FILE *stream, const char *fmt,...)
Formats an UTF-8 string as fprintf(), then print it, with appropriate conversion to local encoding.
Definition: unicode.c:102
ssize_t config_GetIntChoices(const char *name, int64_t **restrict values, char ***restrict texts)
Definition: core.c:203
int vlc_http_file_seek(struct vlc_http_resource *res, uintmax_t offset)
Sets the read offset.
Definition: file.c:204
#define msg_Err(p_this,...)
Definition: vlc_messages.h:102
char * config_GetPsz(const char *psz_name)
Gets a string configuration item's value.
Definition: core.c:123
#define CONFIG_ITEM(x)
Definition: vlc_plugin.h:136
ssize_t getline(char **, size_t *, FILE *)
unsigned b_safe
Safe for web plugins and playlist files.
Definition: vlc_configuration.h:82