Commit a87edce4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

config: remove leading underscores

parent c6a41b08
......@@ -199,22 +199,22 @@ struct module_config_t
* Prototypes - these methods are used to get, set or manipulate configuration
* data.
*****************************************************************************/
VLC_EXPORT( int, __config_GetType, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( int, __config_GetInt, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( void, __config_PutInt, (vlc_object_t *, const char *, int) );
VLC_EXPORT( float, __config_GetFloat, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( void, __config_PutFloat, (vlc_object_t *, const char *, float) );
VLC_EXPORT( char *, __config_GetPsz, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( void, __config_PutPsz, (vlc_object_t *, const char *, const char *) );
#define config_SaveConfigFile(a,b) __config_SaveConfigFile(VLC_OBJECT(a),b)
VLC_EXPORT( int, __config_SaveConfigFile, ( vlc_object_t *, const char * ) );
#define config_ResetAll(a) __config_ResetAll(VLC_OBJECT(a))
VLC_EXPORT( void, __config_ResetAll, ( vlc_object_t * ) );
VLC_EXPORT( int, config_GetType, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( int, config_GetInt, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( void, config_PutInt, (vlc_object_t *, const char *, int) );
VLC_EXPORT( float, config_GetFloat, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( void, config_PutFloat, (vlc_object_t *, const char *, float) );
VLC_EXPORT( char *, config_GetPsz, (vlc_object_t *, const char *) LIBVLC_USED );
VLC_EXPORT( void, config_PutPsz, (vlc_object_t *, const char *, const char *) );
VLC_EXPORT( int, config_SaveConfigFile, ( vlc_object_t *, const char * ) );
#define config_SaveConfigFile(a,b) config_SaveConfigFile(VLC_OBJECT(a),b)
VLC_EXPORT( void, config_ResetAll, ( vlc_object_t * ) );
#define config_ResetAll(a) config_ResetAll(VLC_OBJECT(a))
VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) LIBVLC_USED );
VLC_EXPORT(char *, __config_GetDataDir, ( vlc_object_t * ) LIBVLC_USED);
#define config_GetDataDir(a) __config_GetDataDir(VLC_OBJECT(a))
VLC_EXPORT(char *, config_GetDataDir, ( vlc_object_t * ) LIBVLC_USED);
#define config_GetDataDir(a) config_GetDataDir(VLC_OBJECT(a))
VLC_EXPORT(const char *, config_GetConfDir, ( void ) LIBVLC_USED);
typedef enum vlc_userdir
......@@ -236,21 +236,21 @@ typedef enum vlc_userdir
VLC_EXPORT(char *, config_GetUserDir, ( vlc_userdir_t ) LIBVLC_USED);
VLC_EXPORT( void, __config_AddIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, __config_RemoveIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( bool, __config_ExistIntf, ( vlc_object_t *, const char * ) LIBVLC_USED);
VLC_EXPORT( void, config_AddIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, config_RemoveIntf, ( vlc_object_t *, const char * ) );
VLC_EXPORT( bool, config_ExistIntf, ( vlc_object_t *, const char * ) LIBVLC_USED);
#define config_GetType(a,b) __config_GetType(VLC_OBJECT(a),b)
#define config_GetInt(a,b) __config_GetInt(VLC_OBJECT(a),b)
#define config_PutInt(a,b,c) __config_PutInt(VLC_OBJECT(a),b,c)
#define config_GetFloat(a,b) __config_GetFloat(VLC_OBJECT(a),b)
#define config_PutFloat(a,b,c) __config_PutFloat(VLC_OBJECT(a),b,c)
#define config_GetPsz(a,b) __config_GetPsz(VLC_OBJECT(a),b)
#define config_PutPsz(a,b,c) __config_PutPsz(VLC_OBJECT(a),b,c)
#define config_GetType(a,b) config_GetType(VLC_OBJECT(a),b)
#define config_GetInt(a,b) config_GetInt(VLC_OBJECT(a),b)
#define config_PutInt(a,b,c) config_PutInt(VLC_OBJECT(a),b,c)
#define config_GetFloat(a,b) config_GetFloat(VLC_OBJECT(a),b)
#define config_PutFloat(a,b,c) config_PutFloat(VLC_OBJECT(a),b,c)
#define config_GetPsz(a,b) config_GetPsz(VLC_OBJECT(a),b)
#define config_PutPsz(a,b,c) config_PutPsz(VLC_OBJECT(a),b,c)
#define config_AddIntf(a,b) __config_AddIntf(VLC_OBJECT(a),b)
#define config_RemoveIntf(a,b) __config_RemoveIntf(VLC_OBJECT(a),b)
#define config_ExistIntf(a,b) __config_ExistIntf(VLC_OBJECT(a),b)
#define config_AddIntf(a,b) config_AddIntf(VLC_OBJECT(a),b)
#define config_RemoveIntf(a,b) config_RemoveIntf(VLC_OBJECT(a),b)
#define config_ExistIntf(a,b) config_ExistIntf(VLC_OBJECT(a),b)
/****************************************************************************
* config_chain_t:
......@@ -270,8 +270,8 @@ struct config_chain_t
*
* The option names will be created by adding the psz_prefix prefix.
*/
#define config_ChainParse( a, b, c, d ) __config_ChainParse( VLC_OBJECT(a), b, c, d )
VLC_EXPORT( void, __config_ChainParse, ( vlc_object_t *, const char *psz_prefix, const char *const *ppsz_options, config_chain_t * ) );
VLC_EXPORT( void, config_ChainParse, ( vlc_object_t *, const char *psz_prefix, const char *const *ppsz_options, config_chain_t * ) );
#define config_ChainParse( a, b, c, d ) config_ChainParse( VLC_OBJECT(a), b, c, d )
/**
* This function will parse a configuration string (psz_string) and
......
......@@ -256,8 +256,9 @@ void config_ChainDestroy( config_chain_t *p_cfg )
}
}
void __config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
const char *const *ppsz_options, config_chain_t *cfg )
#undef config_ChainParse
void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
const char *const *ppsz_options, config_chain_t *cfg )
{
if( psz_prefix == NULL ) psz_prefix = "";
size_t plen = 1 + strlen( psz_prefix );
......
......@@ -43,6 +43,7 @@
#include <assert.h>
#undef config_LoadCmdLine
/*****************************************************************************
* config_LoadCmdLine: parse command line
*****************************************************************************
......@@ -52,9 +53,8 @@
* because we don't know (and don't want to know) in advance the configuration
* options used (ie. exported) by each module.
*****************************************************************************/
int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
const char *ppsz_argv[],
bool b_ignore_errors )
int config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
const char *ppsz_argv[], bool b_ignore_errors )
{
int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0;
module_t *p_parser;
......
......@@ -36,11 +36,11 @@ int config_AutoSaveConfigFile( vlc_object_t * );
void config_Free( module_t * );
#define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
#define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b)
int config_LoadCmdLine ( vlc_object_t *, int *, const char *[], bool );
int config_LoadConfigFile( vlc_object_t *, const char * );
#define config_LoadCmdLine(a,b,c,d) config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
#define config_LoadConfigFile(a,b) config_LoadConfigFile(VLC_OBJECT(a),b)
int __config_LoadCmdLine ( vlc_object_t *, int *, const char *[], bool );
int __config_LoadConfigFile( vlc_object_t *, const char * );
int config_SortConfig (void);
void config_UnsortConfig (void);
......
......@@ -68,14 +68,14 @@ int IsConfigIntegerType (int type)
return memchr (config_types, type, sizeof (config_types)) != NULL;
}
#undef config_GetType
/*****************************************************************************
* config_GetType: get the type of a variable (bool, int, float, string)
*****************************************************************************
* This function is used to get the type of a variable from its name.
* Beware, this is quite slow.
*****************************************************************************/
int __config_GetType( vlc_object_t *p_this, const char *psz_name )
int config_GetType( vlc_object_t *p_this, const char *psz_name )
{
module_config_t *p_config;
int i_type;
......@@ -134,6 +134,7 @@ int __config_GetType( vlc_object_t *p_this, const char *psz_name )
return i_type;
}
#undef config_GetInt
/*****************************************************************************
* config_GetInt: get the value of an int variable
*****************************************************************************
......@@ -141,7 +142,7 @@ int __config_GetType( vlc_object_t *p_this, const char *psz_name )
* represented by an integer (CONFIG_ITEM_INTEGER and
* CONFIG_ITEM_BOOL).
*****************************************************************************/
int __config_GetInt( vlc_object_t *p_this, const char *psz_name )
int config_GetInt( vlc_object_t *p_this, const char *psz_name )
{
module_config_t *p_config;
......@@ -168,13 +169,14 @@ int __config_GetInt( vlc_object_t *p_this, const char *psz_name )
return val;
}
#undef config_GetFloat
/*****************************************************************************
* config_GetFloat: get the value of a float variable
*****************************************************************************
* This function is used to get the value of variables which are internally
* represented by a float (CONFIG_ITEM_FLOAT).
*****************************************************************************/
float __config_GetFloat( vlc_object_t *p_this, const char *psz_name )
float config_GetFloat( vlc_object_t *p_this, const char *psz_name )
{
module_config_t *p_config;
......@@ -201,6 +203,7 @@ float __config_GetFloat( vlc_object_t *p_this, const char *psz_name )
return val;
}
#undef config_GetPsz
/*****************************************************************************
* config_GetPsz: get the string value of a string variable
*****************************************************************************
......@@ -212,7 +215,7 @@ float __config_GetFloat( vlc_object_t *p_this, const char *psz_name )
* duplicate of the actual value. It isn't safe to return a pointer to the
* actual value as it can be modified at any time.
*****************************************************************************/
char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name )
char * config_GetPsz( vlc_object_t *p_this, const char *psz_name )
{
module_config_t *p_config;
......@@ -239,6 +242,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name )
return psz_value;
}
#undef config_PutPsz
/*****************************************************************************
* config_PutPsz: set the string value of a string variable
*****************************************************************************
......@@ -246,7 +250,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name )
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
* CONFIG_ITEM_DIRECTORY, CONFIG_ITEM_PASSWORD, and CONFIG_ITEM_MODULE).
*****************************************************************************/
void __config_PutPsz( vlc_object_t *p_this,
void config_PutPsz( vlc_object_t *p_this,
const char *psz_name, const char *psz_value )
{
module_config_t *p_config;
......@@ -294,6 +298,7 @@ void __config_PutPsz( vlc_object_t *p_this,
free( oldval.psz_string );
}
#undef config_PutInt
/*****************************************************************************
* config_PutInt: set the integer value of an int variable
*****************************************************************************
......@@ -301,7 +306,7 @@ void __config_PutPsz( vlc_object_t *p_this,
* represented by an integer (CONFIG_ITEM_INTEGER and
* CONFIG_ITEM_BOOL).
*****************************************************************************/
void __config_PutInt( vlc_object_t *p_this, const char *psz_name, int i_value )
void config_PutInt( vlc_object_t *p_this, const char *psz_name, int i_value )
{
module_config_t *p_config;
vlc_value_t oldval;
......@@ -347,14 +352,15 @@ void __config_PutInt( vlc_object_t *p_this, const char *psz_name, int i_value )
}
}
#undef config_PutFloat
/*****************************************************************************
* config_PutFloat: set the value of a float variable
*****************************************************************************
* This function is used to set the value of variables which are internally
* represented by a float (CONFIG_ITEM_FLOAT).
*****************************************************************************/
void __config_PutFloat( vlc_object_t *p_this,
const char *psz_name, float f_value )
void config_PutFloat( vlc_object_t *p_this,
const char *psz_name, float f_value )
{
module_config_t *p_config;
vlc_value_t oldval;
......@@ -544,10 +550,11 @@ void config_Free( module_t *p_module )
p_module->p_config = NULL;
}
#undef config_ResetAll
/*****************************************************************************
* config_ResetAll: reset the configuration data for all the modules.
*****************************************************************************/
void __config_ResetAll( vlc_object_t *p_this )
void config_ResetAll( vlc_object_t *p_this )
{
VLC_UNUSED(p_this);
module_t *p_module;
......
......@@ -30,12 +30,13 @@
#include "configuration.h"
#undef config_GetDataDir
/**
* Determines the shared data directory
*
* @return a string or NULL. Use free() to release.
*/
char *__config_GetDataDir( vlc_object_t *p_obj )
char *config_GetDataDir( vlc_object_t *p_obj )
{
char *psz_path = var_InheritString( p_obj, "data-path" );
return psz_path ? psz_path : config_GetDataDirDefault();
......
......@@ -152,14 +152,14 @@ static int strtoi (const char *str)
return (int)l;
}
#undef config_LoadConfigFile
/*****************************************************************************
* config_LoadConfigFile: loads the configuration file.
*****************************************************************************
* This function is called to load the config options stored in the config
* file.
*****************************************************************************/
int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
int config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
{
FILE *file;
......@@ -760,7 +760,8 @@ int config_AutoSaveConfigFile( vlc_object_t *p_this )
return ret;
}
int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
#undef config_SaveConfigFile
int config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
{
return SaveConfigFile( p_this, psz_module_name, false );
}
......@@ -29,8 +29,9 @@
#include <assert.h>
#undef config_AddIntf
/* Adds an extra interface to the configuration */
void __config_AddIntf( vlc_object_t *p_this, const char *psz_intf )
void config_AddIntf( vlc_object_t *p_this, const char *psz_intf )
{
assert( psz_intf );
......@@ -78,8 +79,9 @@ void __config_AddIntf( vlc_object_t *p_this, const char *psz_intf )
free( psz_config );
}
#undef config_RemoveIntf
/* Removes an extra interface from the configuration */
void __config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
void config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
{
assert( psz_intf );
......@@ -129,11 +131,12 @@ void __config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
free( psz_config );
}
#undef config_ExistIntf
/*
* Returns true if the specified extra interface is present in the
* configuration, false if not
*/
bool __config_ExistIntf( vlc_object_t *p_this, const char *psz_intf )
bool config_ExistIntf( vlc_object_t *p_this, const char *psz_intf )
{
assert( psz_intf );
......
......@@ -46,26 +46,26 @@ block_heap_Alloc
block_Init
block_mmap_Alloc
block_Realloc
__config_AddIntf
config_AddIntf
config_ChainCreate
config_ChainDestroy
config_ChainDuplicate
__config_ChainParse
__config_ExistIntf
config_ChainParse
config_ExistIntf
config_FindConfig
config_GetConfDir
__config_GetDataDir
__config_GetFloat
config_GetDataDir
config_GetFloat
config_GetUserDir
__config_GetInt
__config_GetPsz
__config_GetType
__config_PutFloat
__config_PutInt
__config_PutPsz
__config_RemoveIntf
__config_ResetAll
__config_SaveConfigFile
config_GetInt
config_GetPsz
config_GetType
config_PutFloat
config_PutInt
config_PutPsz
config_RemoveIntf
config_ResetAll
config_SaveConfigFile
config_StringEscape
config_StringUnescape
convert_xml_special_chars
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment