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
Definition: vlc_configuration.h:71
const char psz_vlc_changeset[]
Definition: vlc_configuration.h:121
const char * name
Definition: vlc_getopt.h:92
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:179
size_t count
Definition: core.c:461
static void exchange(char **argv, vlc_getopt_t *restrict state)
Definition: getopt.c:40
#define BLUE
Definition: help.c:236
static void print_help_on_full_help(void)
Definition: help.c:159
FILE * vlc_fopen(const char *filename, const char *mode)
Opens a FILE pointer.
Definition: filesystem.c:46
#define PADDING_SPACES
Definition: help.c:242
uint32_t i_value
Definition: vlc_text_style.h:215
double atof(const char *)
static int confnamecmp(const void *key, const void *elem)
Definition: core.c:451
#define var_SetBool(a, b, c)
Definition: vlc_variables.h:257
module_t ** module_list_get(size_t *n)
Gets the flat list of VLC modules.
Definition: bank.c:699
bool vlc_http_file_can_seek(struct vlc_http_resource *res)
Checks seeking support.
Definition: file.c:195
#define MAGENTA
Definition: help.c:237
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:145
struct vlc_http_msg * vlc_http_res_open(struct vlc_http_resource *res, void *opaque)
Definition: resource.c:83
#define LINE_START
Definition: help.c:241
#define CONFIG_ITEM_FLOAT
Definition: vlc_plugin.h:120
const char ** pp_shortcuts
Definition: modules.h:86
#define var_CreateGetNonEmptyString(a, b)
Definition: vlc_variables.h:496
#define CONFIG_ITEM_STRING
Definition: vlc_plugin.h:124
const char * psz_text
Definition: vlc_configuration.h:72
static unsigned ConsoleWidth(void)
Returns the console width or a best guess.
Definition: help.c:65
const char * VLC_CompileHost(void)
Definition: version.c:42
const char * module_get_object(const module_t *m)
Get the internal name of a module.
Definition: modules.c:63
#define DIR_SEP
Definition: vlc_common.h:1023
const char * VLC_CompileBy(void)
Definition: version.c:41
const char ** list_text
Definition: vlc_configuration.h:89
static const struct vlc_http_resource_cbs vlc_http_file_callbacks
Definition: file.c:106
const char * module_gettext(const module_t *m, const char *str)
Translate a string using the module's text domain.
Definition: modules.c:127
#define IsConfigIntegerType(type)
Definition: configuration.h:47
int opt
Definition: vlc_getopt.h:66
size_t i_buffer
Payload length.
Definition: vlc_block.h:116
#define msg_Info(p_this,...)
Definition: vlc_messages.h:80
VLC plugin.
Definition: modules.h:32
static locale_t uselocale(locale_t loc)
Definition: vlc_fixups.h:356
static int vlc_swidth(const char *str)
Definition: help.c:325
void vlc_http_msg_destroy(struct vlc_http_msg *m)
Destroys an HTTP message.
Definition: message.c:191
int config_GetType(const char *psz_name)
Definition: core.c:52
const int * i
Definition: vlc_configuration.h:85
void * locale_t
Definition: vlc_fixups.h:341
static void print_section(const module_t *m, const module_config_t **sect, bool color, bool desc)
Definition: help.c:244
unsigned i_shortcuts
Shortcuts to the module.
Definition: modules.h:85
static void Usage(vlc_object_t *, const char *)
Definition: help.c:582
module_value_t orig
Definition: vlc_configuration.h:76
void module_list_free(module_t **list)
Frees the flat list of VLC modules.
Definition: bank.c:688
int vlc_mkdir(const char *dirname, mode_t mode)
Creates a directory.
Definition: filesystem.c:93
struct vlc_http_msg * response
Definition: resource.h:45
#define var_InheritBool(o, n)
Definition: vlc_variables.h:601
#define VLC_VAR_BOOL
Definition: vlc_variables.h:49
#define CONFIG_SECTION
Definition: vlc_plugin.h:117
void config_UnsortConfig(void)
Definition: core.c:501
char * psz
Definition: vlc_configuration.h:50
libvlc_int_t * libvlc
LibVLC instance.
Definition: vlc_common.h:441
int64_t config_GetInt(vlc_object_t *p_this, const char *psz_name)
Definition: core.c:90
#define msg_Dbg(p_this,...)
Definition: vlc_messages.h:86
static char * xstrdup(const char *str)
Definition: vlc_common.h:994
uintmax_t vlc_http_file_get_size(struct vlc_http_resource *res)
Gets file size.
Definition: file.c:177
char * config_GetPsz(vlc_object_t *p_this, const char *psz_name)
Definition: core.c:151
#define _(str)
Definition: vlc_fixups.h:371
int ind
Definition: vlc_getopt.h:62
bool has_arg
Definition: vlc_getopt.h:93
#define VLC_EGENERIC
Unspecified error.
Definition: vlc_common.h:350
#define IsConfigStringType(type)
Definition: configuration.h:45
vlc_integer_list_cb i_cb
Definition: vlc_configuration.h:87
module_config_t * config_FindConfig(const char *name)
Definition: core.c:514
size_t vlc_towc(const char *str, uint32_t *restrict pwc)
Decodes a code point from UTF-8.
Definition: unicode.c:111
const char * VLC_Compiler(void)
Definition: version.c:43
#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:293
static void freelocale(locale_t loc)
Definition: vlc_fixups.h:343
#define VLC_VAR_FLOAT
Definition: vlc_variables.h:52
int val
Definition: vlc_getopt.h:95
#define config_GetPsz(a, b)
Definition: vlc_configuration.h:146
#define var_InheritString(o, n)
Definition: vlc_variables.h:639
void vlc_rwlock_unlock(vlc_rwlock_t *lock)
Releases a read/write lock.
Definition: thread.c:393
int vlc_http_msg_add_header(struct vlc_http_msg *m, const char *name, const char *fmt,...)
Definition: message.c:142
char * vlc_gettext(const char *msgid)
In-tree plugins share their gettext domain with LibVLC.
Definition: textdomain.c:89
int asprintf(char **, const char *,...)
bool config_dirty
Definition: core.c:41
void config_RemoveIntf(vlc_object_t *p_this, const char *psz_intf)
Definition: intf.c:85
#define var_Create(a, b, c)
Definition: vlc_variables.h:121
static char * config_GetConfigFile(vlc_object_t *obj)
Get the user's configuration file.
Definition: file.c:58
char * nextchar
Definition: vlc_getopt.h:75
int last_nonopt
Definition: vlc_getopt.h:84
static int vlc_http_file_resp(const struct vlc_http_resource *res, const struct vlc_http_msg *resp, void *opaque)
Definition: file.c:77
char * arg
Definition: vlc_getopt.h:48
Definition: vlc_configuration.h:122
static vlc_mutex_t lock
Definition: interface.c:62
char * vlc_ngettext(const char *msgid, const char *plural, unsigned long n)
Definition: textdomain.c:98
#define RED
Definition: help.c:233
#define msg_Warn(p_this,...)
Definition: vlc_messages.h:84
const char * psz_help
Long help string for "special" modules.
Definition: modules.h:93
void * owner
Definition: vlc_configuration.h:91
vlc_string_list_cb psz_cb
Definition: vlc_configuration.h:86
int vlc_close(int fd)
Closes a file descriptor.
Definition: filesystem.c:88
int module_Map(vlc_object_t *obj, vlc_plugin_t *plugin)
Definition: bank.c:559
int i_score
Score for the capability.
Definition: modules.h:96
int vlc_rename(const char *oldpath, const char *newpath)
Moves a file atomically.
Definition: filesystem.c:194
void vlc_rwlock_wrlock(vlc_rwlock_t *lock)
Acquires a read/write lock for writing.
Definition: thread.c:387
int vlc_unlink(const char *filename)
Removes a file.
Definition: filesystem.c:180
vlc_plugin_t * vlc_plugins
List of all plug-ins.
Definition: bank.c:101
unsigned b_unsaveable
Definition: vlc_configuration.h:66
Internal module descriptor.
Definition: modules.h:79
module_value_t max
Definition: vlc_configuration.h:78
block_t * vlc_http_file_read(struct vlc_http_resource *res)
Reads data.
Definition: file.c:231
#define PauseConsole()
Definition: help.c:54
int vlc_open(const char *filename, int flags,...)
Opens a system file handle.
Definition: filesystem.c:49
double f_value
Definition: vout_intf.c:81
static locale_t newlocale(int mask, const char *locale, locale_t base)
Definition: vlc_fixups.h:347
const char * psz_longname
Module descriptive name.
Definition: modules.h:92
static bool plugin_show(const vlc_plugin_t *plugin, bool advanced)
Definition: help.c:565
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:662
#define var_Destroy(a, b)
Definition: vlc_variables.h:124
ssize_t config_GetPszChoices(vlc_object_t *obj, const char *name, char ***restrict values, char ***restrict texts)
Determines a list of suggested values for a string configuration item.
Definition: core.c:389
static int confcmp(const void *a, const void *b)
Definition: core.c:444
void config_PutPsz(vlc_object_t *p_this, const char *psz_name, const char *psz_value)
Definition: core.c:181
bool config_IsSafe(const char *name)
Definition: core.c:77
#define CONFIG_ITEM_INTEGER
Definition: vlc_plugin.h:121
static void Help(vlc_object_t *, const char *)
Definition: help.c:199
Definition: resource.h:42
const char * psz_name
Definition: vlc_codecs.h:315
static void Version(void)
Definition: help.c:713
uintmax_t offset
Definition: file.c:61
static char * strdupnull(const char *src)
Definition: file.c:50
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:90
static int config_PrepareDir(vlc_object_t *obj)
Definition: file.c:325
size_t size
Size of items table.
Definition: modules.h:46
#define CYAN
Definition: help.c:238
static int vlc_http_file_req(const struct vlc_http_resource *res, struct vlc_http_msg *req, void *opaque)
Definition: file.c:47
static ssize_t config_ListModules(const char *cap, char ***restrict values, char ***restrict texts)
Definition: core.c:347
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:112
#define WHITE
Definition: help.c:239
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:55
int config_CreateDir(vlc_object_t *p_this, const char *psz_dirname)
Definition: file.c:263
ssize_t module_list_cap(module_t ***restrict list, const char *name)
Builds a sorted list of all VLC modules with a given capability.
Definition: bank.c:732
#define CONFIG_ITEM_BOOL
Definition: vlc_plugin.h:123
static void * xmalloc(size_t len)
Definition: vlc_common.h:970
module_config_t * items
Table of configuration parameters.
Definition: modules.h:45
#define DIR_SEP_CHAR
Definition: vlc_common.h:1022
void config_ResetAll(vlc_object_t *p_this)
Definition: core.c:551
int vlc_http_res_get_status(struct vlc_http_resource *res)
Definition: resource.c:130
The main vlc_object_t structure.
Definition: vlc_objects.h:39
#define IsConfigFloatType(type)
Definition: configuration.h:49
#define VLC_ENOMEM
Not enough memory.
Definition: vlc_common.h:351
Definition: vlc_configuration.h:60
unsigned b_removed
Definition: vlc_configuration.h:68
#define VLC_UNUSED(x)
Definition: vlc_common.h:912
const char * psz_type
Definition: vlc_configuration.h:70
const char * psz_capability
Capability.
Definition: modules.h:95
pthread_mutex_t vlc_mutex_t
Mutex.
Definition: vlc_threads.h:267
#define VLC_SUCCESS
No error.
Definition: vlc_common.h:349
float config_GetFloat(vlc_object_t *p_this, const char *psz_name)
Definition: core.c:117
int config_SaveConfigFile(vlc_object_t *p_this)
Saves the in-memory configuration into a file.
Definition: file.c:341
char * strdup(const char *)
module_value_t min
Definition: vlc_configuration.h:77
const char * module_get_name(const module_t *m, bool long_name)
Get the human-friendly name of a module.
Definition: modules.c:77
char psz_value[8]
Definition: vout_intf.c:91
union module_config_t::@147 list
int first_nonopt
Definition: vlc_getopt.h:83
#define LC_NUMERIC_MASK
Definition: vlc_fixups.h:338
module_config_t ** list
Definition: core.c:460
const char name[16]
Definition: httpd.c:1249
static void print_desc(const char *str, unsigned margin, bool color)
Definition: help.c:260
static int64_t vlc_strtoi(const char *str)
Definition: file.c:140
char * config_GetUserDir(vlc_userdir_t type)
Definition: specific.c:272
static void ListModules(vlc_object_t *, bool)
Definition: help.c:669
pthread_rwlock_t vlc_rwlock_t
Read/write lock.
Definition: vlc_threads.h:304
void config_PutInt(vlc_object_t *p_this, const char *psz_name, int64_t i_value)
Definition: core.c:218
#define CONFIG_FILE
Definition: configuration.h:58
unsigned b_advanced
Definition: vlc_configuration.h:64
int64_t i
Definition: vlc_configuration.h:51
#define N_(str)
Definition: vlc_fixups.h:372
module_value_t value
Definition: vlc_configuration.h:75
static bool vlc_http_msg_can_seek(const struct vlc_http_msg *resp)
Definition: file.c:168
#define GRAY
Definition: help.c:240
float f
Definition: vlc_configuration.h:52
ssize_t config_GetIntChoices(vlc_object_t *obj, const char *name, int64_t **restrict values, char ***restrict texts)
Determines a list of suggested values for an integer configuration item.
Definition: core.c:285
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:830
long long int strtoll(const char *, char **, int)
#define YELLOW
Definition: help.c:235
void vlc_mutex_unlock(vlc_mutex_t *p_mutex)
Releases a mutex.
Definition: thread.c:138
#define CONFIG_ITEM_MODULE
Definition: vlc_plugin.h:127
#define unlikely(p)
Definition: vlc_common.h:114
uint16_t list_count
Definition: vlc_configuration.h:81
const char * psz_longtext
Definition: vlc_configuration.h:73
uint8_t i_type
Definition: vlc_configuration.h:62
const char ** psz
Definition: vlc_configuration.h:84
struct vlc_getopt_s vlc_getopt_t
static bool module_match(const module_t *m, const char *pattern, bool strict)
Definition: help.c:543
const char * vlc_strerror_c(int errnum)
Definition: error.c:34
struct block_t * vlc_http_res_read(struct vlc_http_resource *res)
Reads data.
Definition: resource.c:321
struct vlc_http_resource resource
Definition: file.c:60
void config_PutFloat(vlc_object_t *p_this, const char *psz_name, float f_value)
Definition: core.c:249
const char * vlc_http_msg_get_header(const struct vlc_http_msg *m, const char *name)
Looks up an header field.
Definition: message.c:154
#define config_PutPsz(a, b, c)
Definition: vlc_configuration.h:147
#define vlc_assert_unreachable()
Definition: vlc_common.h:118
void vlc_rwlock_rdlock(vlc_rwlock_t *lock)
Acquires a read/write lock for reading.
Definition: thread.c:381
int vlc_http_msg_get_status(const struct vlc_http_msg *m)
Gets response status code.
Definition: message.c:166
char i_short
Definition: vlc_configuration.h:63
int config_SortConfig(void)
Index the configuration items by name for faster lookups.
Definition: core.c:467
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:100
#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:94
int config_AutoSaveConfigFile(vlc_object_t *p_this)
Definition: file.c:522
#define CONFIG_HINT_USAGE
Definition: vlc_plugin.h:113
int config_LoadConfigFile(vlc_object_t *p_this)
Definition: file.c:167
static void print_item(const vlc_object_t *p_this, const module_t *m, const module_config_t *item, const module_config_t **section, bool color, bool desc)
Definition: help.c:345
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:764
#define VLC_OBJECT(x)
Type-safe vlc_object_t cast.
Definition: vlc_common.h:464
#define ShowConsole()
Definition: help.c:53
#define LICENSE_MSG
Definition: vlc_common.h:1028
static void * vlc_alloc(size_t count, size_t size)
Definition: vlc_common.h:948
static int config_Write(FILE *file, const char *desc, const char *type, bool comment, const char *name, const char *fmt,...)
Definition: file.c:300
Definition: resource.h:34
uintmax_t vlc_http_msg_get_size(const struct vlc_http_msg *m)
Gets HTTP payload length.
Definition: message.c:858
void config_Free(module_config_t *tab, size_t confsize)
Destroys an array of configuration items.
Definition: core.c:529
#define VLC_STATIC_MUTEX
Static initializer for (static) mutex.
Definition: vlc_threads.h:272
Definition: vlc_getopt.h:24
static uintmax_t vlc_http_msg_get_file_size(const struct vlc_http_msg *resp)
Definition: file.c:131
int * flag
Definition: vlc_getopt.h:94
#define GREEN
Definition: help.c:234
void vlc_mutex_lock(vlc_mutex_t *p_mutex)
Acquires a mutex.
Definition: thread.c:123
static FILE * config_OpenConfigFile(vlc_object_t *p_obj)
Definition: file.c:73
Definition: vlc_block.h:111
struct vlc_plugin_t::@70 conf
Variables set by the module to store its config options.
#define VLC_STATIC_RWLOCK
Static initializer for (static) read/write lock.
Definition: vlc_threads.h:309
int vlc_http_file_seek(struct vlc_http_resource *res, uintmax_t offset)
Sets the read offset.
Definition: file.c:203
#define msg_Err(p_this,...)
Definition: vlc_messages.h:82
struct vlc_common_members obj
Definition: vlc_objects.h:42
bool config_ExistIntf(vlc_object_t *p_this, const char *psz_intf)
Definition: intf.c:142
#define CONFIG_ITEM(x)
Definition: vlc_plugin.h:136
ssize_t getline(char **, size_t *, FILE *)
void config_AddIntf(vlc_object_t *p_this, const char *psz_intf)
Definition: intf.c:33
unsigned b_safe
Definition: vlc_configuration.h:67