[vlc-commits] Implement OS/2 directories configuration

KO Myung-Hun git at videolan.org
Sat Oct 15 09:38:48 CEST 2011


vlc | branch: master | KO Myung-Hun <komh at chollian.net> | Mon Oct 10 20:44:02 2011 +0900| [db9e83d700d1beff5b6b3388e1b69973e7ec625f] | committer: Rémi Denis-Courmont

Implement OS/2 directories configuration

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 src/Makefile.am |    2 +-
 src/os2/dirs.c  |   93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+), 1 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 6c939ce..9cd6649 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -277,7 +277,7 @@ SOURCES_libvlc_symbian = \
 	$(NULL)
 
 SOURCES_libvlc_os2 = \
-	posix/dirs.c \
+	os2/dirs.c \
 	misc/atomic.c \
 	posix/filesystem.c \
 	os2/thread.c \
diff --git a/src/os2/dirs.c b/src/os2/dirs.c
new file mode 100644
index 0000000..598e1c4
--- /dev/null
+++ b/src/os2/dirs.c
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * dirs.c: OS/2 directories configuration
+ *****************************************************************************
+ * Copyright (C) 2010 the VideoLAN team
+ *
+ * Authors: KO Myung-Hun <komh at chollian.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+
+#include "../libvlc.h"
+#include <vlc_charset.h>
+#include "config/configuration.h"
+
+static char *config_GetVlcDir (void)
+{
+    return FromLocaleDup (psz_vlcpath);
+}
+
+/**
+ * Determines the shared data directory
+ *
+ * @return a nul-terminated string or NULL. Use free() to release it.
+ */
+char *config_GetDataDirDefault (void)
+{
+    char *datadir = config_GetVlcDir();
+
+    if (datadir)
+        /* replace last lib\vlc with share */
+        strcpy ( datadir + strlen (datadir) - 7, "share");
+
+    return datadir;
+}
+
+/**
+ * Determines the architecture-dependent data directory
+ *
+ * @return a string (always succeeds).
+ */
+const char *config_GetLibDir (void)
+{
+    abort ();
+}
+
+/**
+ * Determines the system configuration directory.
+ *
+ * @return a string (always succeeds).
+ */
+const char *config_GetConfDir( void )
+{
+    return config_GetVlcDir ();
+}
+
+char *config_GetUserDir (vlc_userdir_t type)
+{
+    switch (type)
+    {
+        case VLC_HOME_DIR:
+        case VLC_CONFIG_DIR:
+        case VLC_DATA_DIR:
+        case VLC_CACHE_DIR:
+        case VLC_DESKTOP_DIR:
+        case VLC_DOWNLOAD_DIR:
+        case VLC_TEMPLATES_DIR:
+        case VLC_PUBLICSHARE_DIR:
+        case VLC_DOCUMENTS_DIR:
+        case VLC_MUSIC_DIR:
+        case VLC_PICTURES_DIR:
+        case VLC_VIDEOS_DIR:
+            break;
+    }
+    return config_GetVlcDir ();
+}



More information about the vlc-commits mailing list