VLC  3.0.15
Functions | Variables
core.c File Reference
Include dependency graph for core.c:

Functions

static char * strdupnull (const char *src)
 
int config_GetType (const char *psz_name)
 
bool config_IsSafe (const char *name)
 
int64_t config_GetInt (vlc_object_t *p_this, const char *psz_name)
 
float config_GetFloat (vlc_object_t *p_this, const char *psz_name)
 
char * config_GetPsz (vlc_object_t *p_this, const char *psz_name)
 
void config_PutPsz (vlc_object_t *p_this, const char *psz_name, const char *psz_value)
 
void config_PutInt (vlc_object_t *p_this, const char *psz_name, int64_t i_value)
 
void config_PutFloat (vlc_object_t *p_this, const char *psz_name, float f_value)
 
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. More...
 
static ssize_t config_ListModules (const char *cap, char ***restrict values, char ***restrict texts)
 
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. More...
 
static int confcmp (const void *a, const void *b)
 
static int confnamecmp (const void *key, const void *elem)
 
int config_SortConfig (void)
 Index the configuration items by name for faster lookups. More...
 
void config_UnsortConfig (void)
 
module_config_tconfig_FindConfig (const char *name)
 
void config_Free (module_config_t *tab, size_t confsize)
 Destroys an array of configuration items. More...
 
void config_ResetAll (vlc_object_t *p_this)
 

Variables

vlc_rwlock_t config_lock = PTHREAD_RWLOCK_INITIALIZER
 
bool config_dirty = false
 
struct {
   module_config_t **   list
 
   size_t   count
 
config = { NULL, 0 }
 

Function Documentation

◆ confcmp()

static int confcmp ( const void *  a,
const void *  b 
)
static

◆ config_FindConfig()

module_config_t* config_FindConfig ( const char *  name)

◆ config_Free()

void config_Free ( module_config_t tab,
size_t  confsize 
)

Destroys an array of configuration items.

Parameters
configstart of array of items
confsizenumber of items in the array

Referenced by vlc_plugin_destroy().

◆ config_GetFloat()

float config_GetFloat ( vlc_object_t p_this,
const char *  psz_name 
)

◆ config_GetInt()

int64_t config_GetInt ( vlc_object_t p_this,
const char *  psz_name 
)

◆ config_GetIntChoices()

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.

Parameters
valuespointer to a table of integer values [OUT]
textspointer to a table of descriptions strings [OUT]
Returns
number of choices, or -1 on error
Note
the caller is responsible for calling free() on all descriptions and on both tables. In case of error, both pointers are set to NULL.

References config_FindConfig(), count, module_config_t::i, module_config_t::i_cb, module_config_t::list, module_config_t::list_count, module_config_t::list_text, module_Map(), msg_Warn, name, module_config_t::owner, strdup(), unlikely, vlc_alloc(), and vlc_gettext().

◆ config_GetPsz()

char* config_GetPsz ( vlc_object_t p_this,
const char *  psz_name 
)

◆ config_GetPszChoices()

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.

Parameters
valuespointer to a table of value strings [OUT]
textspointer to a table of descriptions strings [OUT]
Returns
number of choices, or -1 on error
Note
the caller is responsible for calling free() on all values, on all descriptions and on both tables. In case of error, both pointers are set to NULL.

References config_FindConfig(), CONFIG_ITEM_MODULE, config_ListModules(), count, module_config_t::i_type, IsConfigStringType, module_config_t::list, module_config_t::list_count, module_config_t::list_text, module_Map(), name, module_config_t::owner, module_config_t::psz, module_config_t::psz_cb, module_config_t::psz_type, xmalloc(), and xstrdup().

◆ config_GetType()

int config_GetType ( const char *  psz_name)

◆ config_IsSafe()

bool config_IsSafe ( const char *  name)

Referenced by var_OptionParse().

◆ config_ListModules()

static ssize_t config_ListModules ( const char *  cap,
char ***restrict  values,
char ***restrict  texts 
)
static

Referenced by config_GetPszChoices().

◆ config_PutFloat()

void config_PutFloat ( vlc_object_t p_this,
const char *  psz_name,
float  f_value 
)

◆ config_PutInt()

void config_PutInt ( vlc_object_t p_this,
const char *  psz_name,
int64_t  i_value 
)

◆ config_PutPsz()

void config_PutPsz ( vlc_object_t p_this,
const char *  psz_name,
const char *  psz_value 
)

◆ config_ResetAll()

void config_ResetAll ( vlc_object_t p_this)

◆ config_SortConfig()

int config_SortConfig ( void  )

Index the configuration items by name for faster lookups.

< Not enough memory

< No error

References count, and list.

Referenced by module_InitBank(), and module_LoadPlugins().

◆ config_UnsortConfig()

void config_UnsortConfig ( void  )

◆ confnamecmp()

static int confnamecmp ( const void *  key,
const void *  elem 
)
static

◆ strdupnull()

static char* strdupnull ( const char *  src)
inlinestatic

References strdup().

Referenced by config_GetPsz().

Variable Documentation

◆ config

struct { ... } config

◆ config_dirty

bool config_dirty = false

◆ config_lock

vlc_rwlock_t config_lock = PTHREAD_RWLOCK_INITIALIZER

◆ count

size_t count

◆ list