src/android: implement config_GetSysPath
authorZhao Zhili <quinkblack@foxmail.com>
Fri, 18 May 2018 06:00:52 +0000 (14:00 +0800)
committerThomas Guillem <thomas@gllm.fr>
Fri, 18 May 2018 11:27:38 +0000 (13:27 +0200)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
src/android/specific.c

index bb45f28..c8a0e67 100644 (file)
@@ -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).
  *