Commit f8c596db authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

posix: add VLC_SYSDATA_DIR for datadir

parent 2d062f70
......@@ -278,6 +278,11 @@ typedef enum vlc_system_dir
data directory (e.g. /usr/local/data/vlc). */
VLC_PKG_LIB_DIR, /**< Package-specific architecture-dependent read-only
data directory (e.g. /usr/local/lib/vlc). */
VLC_PKG_LIBEXEC_DIR_RESERVED,
VLC_PKG_INCLUDE_DIR_RESERVED,
VLC_SYSDATA_DIR, /**< Global architecture-independent read-only
data directory (e.g. /usr/local/data).
Available only on some platforms. */
} vlc_sysdir_t;
/**
......
......@@ -169,6 +169,7 @@ lib_LTLIBRARIES = libvlccore.la
AM_CPPFLAGS = $(INCICONV) $(IDN_CFLAGS) \
-DMODULE_STRING=\"core\" \
-DSYSDATADIR=\"$(datadir)\" \
-DLIBDIR=\"$(libdir)\" \
-DLOCALEDIR=\"$(localedir)\" \
-DPKGDATADIR=\"$(pkgdatadir)\" \
......
......@@ -110,7 +110,7 @@ static char *config_GetDataDir(void)
char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
{
char *dir;
char *dir = NULL;
switch (type)
{
......@@ -120,6 +120,8 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
case VLC_PKG_LIB_DIR:
dir = config_GetLibDir();
break;
case VLC_SYSDATA_DIR:
break;
default:
vlc_assert_unreachable();
}
......
......@@ -66,7 +66,7 @@ static char *config_GetDataDir(void)
char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
{
char *dir;
char *dir = NULL;
switch (type)
{
......@@ -76,6 +76,8 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
case VLC_PKG_LIB_DIR:
dir = config_GetLibDir();
break;
case VLC_SYSDATA_DIR:
break;
default:
vlc_assert_unreachable();
}
......
......@@ -68,10 +68,12 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
static const char *const dirs[] = {
[VLC_PKG_LIB_DIR] = PKGLIBDIR,
[VLC_PKG_DATA_DIR] = PKGDATADIR,
[VLC_SYSDATA_DIR] = SYSDATADIR,
};
assert(type < ARRAY_SIZE(dirs));
const char *dir_static = dirs[type];
assert(*dir_static != '\0');
/* Look for common static prefix. */
size_t prefix_len = 0;
while (prefix_len < strlen(LIBDIR)
......
......@@ -214,7 +214,7 @@ static char *config_GetDataDir(void)
char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
{
char *dir;
char *dir = NULL;
switch (type)
{
......@@ -224,6 +224,8 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
case VLC_PKG_LIB_DIR:
dir = config_GetLibDir();
break;
case VLC_SYSDATA_DIR:
break;
default:
vlc_assert_unreachable();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment