[vlc-commits] Remove unused config_GetConfDir

Rafaël Carré git at videolan.org
Thu Oct 4 19:29:26 CEST 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Thu Oct  4 19:11:15 2012 +0200| [3902c186fb1370395c4255980669e7f50616b4e3] | committer: Rafaël Carré

Remove unused config_GetConfDir

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3902c186fb1370395c4255980669e7f50616b4e3
---

 .../cmake/CMakeLists/src_CMakeLists.txt            |    1 -
 include/vlc_configuration.h                        |    1 -
 src/Makefile.am                                    |    1 -
 src/libvlccore.sym                                 |    1 -
 src/os2/dirs.c                                     |   11 -----------
 src/posix/darwin_dirs.c                            |   15 ---------------
 src/posix/dirs.c                                   |   10 ----------
 src/symbian/dirs.c                                 |   10 ----------
 src/win32/dirs.c                                   |   20 --------------------
 9 files changed, 70 deletions(-)

diff --git a/extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt b/extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
index b178b81..ac7b06e 100644
--- a/extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
+++ b/extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
@@ -1,7 +1,6 @@
 
 add_definitions(-Dasm=__asm__ -D_INTL_REDIRECT_MACROS)
 add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/locale")
-add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_PREFIX}/etc")
 add_definitions(-DPLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/lib/vlc")
 add_definitions(-DDATA_PATH="${CMAKE_INSTALL_PREFIX}/share/vlc")
 
diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index c3df097..acd1f41 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -120,7 +120,6 @@ VLC_API void config_ResetAll( vlc_object_t * );
 VLC_API module_config_t * config_FindConfig( vlc_object_t *, const char * ) VLC_USED;
 VLC_API char * config_GetDataDir(void) VLC_USED VLC_MALLOC;
 VLC_API char *config_GetLibDir(void) VLC_USED;
-VLC_API const char * config_GetConfDir( void ) VLC_USED;
 
 typedef enum vlc_userdir
 {
diff --git a/src/Makefile.am b/src/Makefile.am
index 9ac25d3..96923f9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -167,7 +167,6 @@ lib_LTLIBRARIES = libvlccore.la
 AM_CPPFLAGS = $(INCICONV) $(IDN_CFLAGS) \
 	-DMODULE_STRING=\"main\" \
 	-DLOCALEDIR=\"$(localedir)\" \
-	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-DPKGDATADIR=\"$(vlcdatadir)\" \
 	-DPKGLIBDIR=\"$(vlclibdir)\"
 AM_CFLAGS = $(CFLAGS_libvlccore)
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 0c36f01..01d4260 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -39,7 +39,6 @@ config_ChainParse
 config_ChainParseOptions
 config_ExistIntf
 config_FindConfig
-config_GetConfDir
 config_GetDataDir
 config_GetLibDir
 config_GetFloat
diff --git a/src/os2/dirs.c b/src/os2/dirs.c
index d4a7669..39a9262 100644
--- a/src/os2/dirs.c
+++ b/src/os2/dirs.c
@@ -64,17 +64,6 @@ char *config_GetDataDir (void)
     return datadir;
 }
 
-/**
- * Determines the system configuration directory.
- *
- * @return a string (always succeeds).
- */
-const char *config_GetConfDir( void )
-{
-#warning FIXME: memory leak
-    return config_GetLibDir ();
-}
-
 char *config_GetUserDir (vlc_userdir_t type)
 {
     switch (type)
diff --git a/src/posix/darwin_dirs.c b/src/posix/darwin_dirs.c
index 0216ab6..1c753de 100644
--- a/src/posix/darwin_dirs.c
+++ b/src/posix/darwin_dirs.c
@@ -42,21 +42,6 @@
 # define MAXPATHLEN 1024
 #endif
 
-static char *configdir = NULL;
-
-static pthread_once_t once = PTHREAD_ONCE_INIT;
-
-static void init_dirs( void )
-{
-    configdir = config_GetUserDir(VLC_CONFIG_DIR);
-}
-
-const char *config_GetConfDir( void )
-{
-    pthread_once(&once, init_dirs);
-    return configdir;
-}
-
 static char *config_GetLibPath (void)
 {
     /* Get the full program path and name */
diff --git a/src/posix/dirs.c b/src/posix/dirs.c
index 0fd5991..10b5ac4 100644
--- a/src/posix/dirs.c
+++ b/src/posix/dirs.c
@@ -58,16 +58,6 @@ char *config_GetLibDir (void)
 }
 #endif
 
-/**
- * Determines the system configuration directory.
- *
- * @return a string (always succeeds).
- */
-const char *config_GetConfDir( void )
-{
-    return SYSCONFDIR;
-}
-
 static char *config_GetHomeDir (void)
 {
     /* 1/ Try $HOME  */
diff --git a/src/symbian/dirs.c b/src/symbian/dirs.c
index 8413015..2fd2e6f 100644
--- a/src/symbian/dirs.c
+++ b/src/symbian/dirs.c
@@ -55,16 +55,6 @@ const char *config_GetLibDir (void)
     return "C:\\Sys\\Bin";
 }
 
-/**
- * Determines the system configuration directory.
- *
- * @return a string (always succeeds).
- */
-const char *config_GetConfDir( void )
-{
-    return "C:\\Data\\Others";
-}
-
 char *config_GetUserDir (vlc_userdir_t type)
 {
     switch (type)
diff --git a/src/win32/dirs.c b/src/win32/dirs.c
index b49b0e0..90b48ba 100644
--- a/src/win32/dirs.c
+++ b/src/win32/dirs.c
@@ -67,26 +67,6 @@ char *config_GetDataDir (void)
     return (path != NULL) ? strdup (path) : config_GetLibDir ();
 }
 
-const char *config_GetConfDir (void)
-{
-    static char appdir[PATH_MAX] = "";
-    wchar_t wdir[MAX_PATH];
-
-#warning FIXME: thread-safety!
-    if (*appdir)
-        return appdir;
-
-    /* Get the "Application Data" folder for all users */
-    if( S_OK == SHGetFolderPathW( NULL, CSIDL_COMMON_APPDATA
-              | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, wdir ) )
-    {
-        WideCharToMultiByte (CP_UTF8, 0, wdir, -1,
-                             appdir, PATH_MAX, NULL, NULL);
-        return appdir;
-    }
-    return NULL;
-}
-
 static char *config_GetShellDir (int csidl)
 {
     wchar_t wdir[MAX_PATH];



More information about the vlc-commits mailing list