[vlc-devel] [PATCH 1/3] src/android: implement config_GetSysPath

Zhao Zhili quinkblack at foxmail.com
Fri May 18 08:00:52 CEST 2018


---
 src/android/specific.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/android/specific.c b/src/android/specific.c
index bb45f28..c8a0e67 100644
--- a/src/android/specific.c
+++ b/src/android/specific.c
@@ -302,6 +302,29 @@ char *config_GetUserDir (vlc_userdir_t type)
     return NULL;
 }
 
+char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
+{
+    char *dir = NULL;
+
+    switch (type)
+    {
+        case VLC_LIB_DIR:
+            dir = config_GetLibDir();
+            break;
+        default:
+            break;
+    }
+
+    if (filename == NULL || dir == NULL)
+        return dir;
+
+    char *path;
+    if (unlikely(asprintf(&path, "%s/%s", dir, filename) == -1))
+        path = NULL;
+    free(dir);
+    return path;
+}
+
 /**
  * Determines the network proxy server to use (if any).
  *
-- 
2.9.5





More information about the vlc-devel mailing list