dirs.c is too simple to grant a file of its own, I think.
config/intf.c \
config/keys.c \
config/cmdline.c \
- config/dirs.c \
config/getopt.c \
config/vlc_getopt.h \
misc/events.c \
int config_SortConfig (void);
void config_UnsortConfig (void);
-char *config_GetDataDirDefault( void );
-
#define CONFIG_CLASS(x) ((x) & ~0x1F)
static inline bool IsConfigStringType(unsigned type)
+++ /dev/null
-/*****************************************************************************
- * dirs.c: crossplatform directories configuration
- *****************************************************************************
- * Copyright (C) 2009 VLC authors and VideoLAN
- *
- * Authors: Antoine Cellerier <dionoea at videolan dot org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser 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 "configuration.h"
-
-/**
- * Determines the shared architecture-independent data directory
- *
- * @return a string or NULL. Use free() to release.
- */
-char *config_GetDataDir(void)
-{
- const char *path = getenv ("VLC_DATA_PATH");
- if (path)
- return strdup (path);
- return config_GetDataDirDefault();
-}
-
#ifdef ENABLE_NLS
# include <libintl.h>
# if defined (__APPLE__) || defined (WIN32) || defined(__OS2__)
-# include "config/configuration.h"
# include <vlc_charset.h>
# endif
#endif
return -1;
}
# else
- char *datadir = config_GetDataDirDefault();
+ char *datadir = config_GetDataDir();
if (unlikely(datadir == NULL))
return -1;
*
* @return a nul-terminated string or NULL. Use free() to release it.
*/
-char *config_GetDataDirDefault (void)
+char *config_GetDataDir (void)
{
- char *datadir = config_GetLibDir();
+ const char *path = getenv ("VLC_DATA_PATH");
+ if (path)
+ return strdup (path);
+ char *datadir = config_GetLibDir();
if (datadir)
/* replace last lib\vlc with share */
strcpy ( datadir + strlen (datadir) - 7, "share");
-
return datadir;
}
abort ();
}
-char *config_GetDataDirDefault (void)
+char *config_GetDataDir (void)
{
+ const char *path = getenv ("VLC_DATA_PATH");
+ if (path)
+ return strdup (path);
+
char *vlcpath = config_GetLibDir ();
char *datadir;
*
* @return a nul-terminated string or NULL. Use free() to release it.
*/
-char *config_GetDataDirDefault (void)
+char *config_GetDataDir (void)
{
- return strdup (PKGDATADIR);
+ const char *path = getenv ("VLC_DATA_PATH");
+ return strdup ((path != NULL) ? path : PKGDATADIR);
}
/**
return (path != NULL) ? path : strdup (PKGLIBDIR);
}
-char *config_GetDataDirDefault (void)
+char *config_GetDataDir (void)
{
char *libdir = config_GetLibDir ();
if (libdir == NULL)
*
* @return a null-terminated string or NULL. Use free() to release it.
*/
-char *config_GetDataDirDefault (void)
+char *config_GetDataDir (void)
{
return GetConstPrivatePath();
}
abort ();
}
-char *config_GetDataDirDefault( void )
+char *config_GetDataDir (void)
{
- return config_GetLibDir ();
+ const char *path = getenv ("VLC_DATA_PATH");
+ return (path != NULL) ? strdup (path) : config_GetLibDir ();
}
const char *config_GetConfDir (void)