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

Add config_GetConfDir

parent cb47bc07
...@@ -215,6 +215,7 @@ VLC_EXPORT( void, __config_ResetAll, ( vlc_object_t * ) ); ...@@ -215,6 +215,7 @@ VLC_EXPORT( void, __config_ResetAll, ( vlc_object_t * ) );
VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) ); VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) );
VLC_EXPORT(const char *, config_GetDataDir, ( void )); VLC_EXPORT(const char *, config_GetDataDir, ( void ));
VLC_EXPORT(const char *, config_GetConfDir, ( void ) );
VLC_EXPORT(char *, config_GetUserConfDir, ( void ) ); VLC_EXPORT(char *, config_GetUserConfDir, ( void ) );
VLC_EXPORT(char *, config_GetUserDataDir, ( void ) ); VLC_EXPORT(char *, config_GetUserDataDir, ( void ) );
VLC_EXPORT(char *, config_GetCacheDir, ( void ) ); VLC_EXPORT(char *, config_GetCacheDir, ( void ) );
......
...@@ -172,6 +172,7 @@ libvlc_la_SOURCES = $(SOURCES_libvlc) ...@@ -172,6 +172,7 @@ libvlc_la_SOURCES = $(SOURCES_libvlc)
nodist_libvlc_la_SOURCES = misc/revision.c nodist_libvlc_la_SOURCES = misc/revision.c
libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` \ libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` \
-DLOCALEDIR=\"$(localedir)\" \ -DLOCALEDIR=\"$(localedir)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DDATA_PATH=\"$(pkgdatadir)\" \ -DDATA_PATH=\"$(pkgdatadir)\" \
-DPLUGIN_PATH=\"$(pkglibdir)\" -DPLUGIN_PATH=\"$(pkglibdir)\"
libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc` libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
......
...@@ -621,6 +621,30 @@ const char *config_GetDataDir( void ) ...@@ -621,6 +621,30 @@ const char *config_GetDataDir( void )
#endif #endif
} }
/**
* Determines the system configuration directory.
*
* @return a string (always succeeds).
*/
const char *config_GetConfDir( void )
{
#if defined (WIN32) || defined (UNDER_CE)
return vlc_global()->psz_vlcpath;
#elif defined(__APPLE__) || defined (SYS_BEOS)
static char path[PATH_MAX] = "";
if( *path == '\0' )
{
snprintf( path, sizeof( path ), "%s/share", /* FIXME: Duh? */
vlc_global()->psz_vlcpath );
path[sizeof( path ) - 1] = '\0';
}
return path;
#else
return SYSCONFDIR;
#endif
}
static char *GetDir( bool b_appdata ) static char *GetDir( bool b_appdata )
{ {
const char *psz_localhome = NULL; const char *psz_localhome = NULL;
......
...@@ -51,6 +51,7 @@ __config_ChainParse ...@@ -51,6 +51,7 @@ __config_ChainParse
__config_ExistIntf __config_ExistIntf
config_FindConfig config_FindConfig
config_GetCacheDir config_GetCacheDir
config_GetConfDir
config_GetDataDir config_GetDataDir
__config_GetFloat __config_GetFloat
__config_GetInt __config_GetInt
......
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