add_definitions(-Dasm=__asm__ -D_INTL_REDIRECT_MACROS)
add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/locale")
-add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_PREFIX}/etc")
add_definitions(-DPLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/lib/vlc")
add_definitions(-DDATA_PATH="${CMAKE_INSTALL_PREFIX}/share/vlc")
VLC_API module_config_t * config_FindConfig( vlc_object_t *, const char * ) VLC_USED;
VLC_API char * config_GetDataDir(void) VLC_USED VLC_MALLOC;
VLC_API char *config_GetLibDir(void) VLC_USED;
-VLC_API const char * config_GetConfDir( void ) VLC_USED;
typedef enum vlc_userdir
{
AM_CPPFLAGS = $(INCICONV) $(IDN_CFLAGS) \
-DMODULE_STRING=\"main\" \
-DLOCALEDIR=\"$(localedir)\" \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
-DPKGDATADIR=\"$(vlcdatadir)\" \
-DPKGLIBDIR=\"$(vlclibdir)\"
AM_CFLAGS = $(CFLAGS_libvlccore)
config_ChainParseOptions
config_ExistIntf
config_FindConfig
-config_GetConfDir
config_GetDataDir
config_GetLibDir
config_GetFloat
return datadir;
}
-/**
- * Determines the system configuration directory.
- *
- * @return a string (always succeeds).
- */
-const char *config_GetConfDir( void )
-{
-#warning FIXME: memory leak
- return config_GetLibDir ();
-}
-
char *config_GetUserDir (vlc_userdir_t type)
{
switch (type)
# define MAXPATHLEN 1024
#endif
-static char *configdir = NULL;
-
-static pthread_once_t once = PTHREAD_ONCE_INIT;
-
-static void init_dirs( void )
-{
- configdir = config_GetUserDir(VLC_CONFIG_DIR);
-}
-
-const char *config_GetConfDir( void )
-{
- pthread_once(&once, init_dirs);
- return configdir;
-}
-
static char *config_GetLibPath (void)
{
/* Get the full program path and name */
}
#endif
-/**
- * Determines the system configuration directory.
- *
- * @return a string (always succeeds).
- */
-const char *config_GetConfDir( void )
-{
- return SYSCONFDIR;
-}
-
static char *config_GetHomeDir (void)
{
/* 1/ Try $HOME */
return "C:\\Sys\\Bin";
}
-/**
- * Determines the system configuration directory.
- *
- * @return a string (always succeeds).
- */
-const char *config_GetConfDir( void )
-{
- return "C:\\Data\\Others";
-}
-
char *config_GetUserDir (vlc_userdir_t type)
{
switch (type)
return (path != NULL) ? strdup (path) : config_GetLibDir ();
}
-const char *config_GetConfDir (void)
-{
- static char appdir[PATH_MAX] = "";
- wchar_t wdir[MAX_PATH];
-
-#warning FIXME: thread-safety!
- if (*appdir)
- return appdir;
-
- /* Get the "Application Data" folder for all users */
- if( S_OK == SHGetFolderPathW( NULL, CSIDL_COMMON_APPDATA
- | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, wdir ) )
- {
- WideCharToMultiByte (CP_UTF8, 0, wdir, -1,
- appdir, PATH_MAX, NULL, NULL);
- return appdir;
- }
- return NULL;
-}
-
static char *config_GetShellDir (int csidl)
{
wchar_t wdir[MAX_PATH];