]> git.sesse.net Git - vlc/commitdiff
Add config_GetConfDir
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 5 May 2008 20:53:12 +0000 (23:53 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 5 May 2008 20:53:12 +0000 (23:53 +0300)
include/vlc_configuration.h
src/Makefile.am
src/config/core.c
src/libvlc.sym

index 076d02cff88c71b07fdcdf538bb1b188ae490309..0d94ad9ea9bc5aea92c47289a109838c72c17be1 100644 (file)
@@ -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(const char *, config_GetDataDir, ( void ));
+VLC_EXPORT(const char *, config_GetConfDir, ( void ) );
 VLC_EXPORT(char *, config_GetUserConfDir, ( void ) );
 VLC_EXPORT(char *, config_GetUserDataDir, ( void ) );
 VLC_EXPORT(char *, config_GetCacheDir, ( void ) );
index 5c548227e1572f967989356f2c1769c02b043d1f..ac8d47baf66090d3ca1563c2217935ade68cb3f5 100644 (file)
@@ -172,6 +172,7 @@ libvlc_la_SOURCES = $(SOURCES_libvlc)
 nodist_libvlc_la_SOURCES = misc/revision.c
 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` \
        -DLOCALEDIR=\"$(localedir)\" \
+       -DSYSCONFDIR=\"$(sysconfdir)\" \
        -DDATA_PATH=\"$(pkgdatadir)\" \
        -DPLUGIN_PATH=\"$(pkglibdir)\"
 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
index 7a81888950120c2902c12a6cae8345c1f5822d95..7df48ae73ae634707262dc5c7310668c67d04e1b 100644 (file)
@@ -621,6 +621,30 @@ const char *config_GetDataDir( void )
 #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 )
 {
     const char *psz_localhome = NULL;
index 964f2432567fa47ab96b33c7a05d56d5ee0d3555..ac448a9c19588bc13007ea38f6452b9e86d01fa6 100644 (file)
@@ -51,6 +51,7 @@ __config_ChainParse
 __config_ExistIntf
 config_FindConfig
 config_GetCacheDir
+config_GetConfDir
 config_GetDataDir
 __config_GetFloat
 __config_GetInt