]> git.sesse.net Git - vlc/blob - src/os2/dirs.c
LGPL
[vlc] / src / os2 / dirs.c
1 /*****************************************************************************
2  * dirs.c: OS/2 directories configuration
3  *****************************************************************************
4  * Copyright (C) 2010 VLC authors and VideoLAN
5  *
6  * Authors: KO Myung-Hun <komh@chollian.net>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22
23 #ifdef HAVE_CONFIG_H
24 # include "config.h"
25 #endif
26
27 #include <vlc_common.h>
28
29 #include "../libvlc.h"
30 #include <vlc_charset.h>
31 #include "config/configuration.h"
32
33 static char *config_GetVlcDir (void)
34 {
35     return FromLocaleDup (psz_vlcpath);
36 }
37
38 /**
39  * Determines the shared data directory
40  *
41  * @return a nul-terminated string or NULL. Use free() to release it.
42  */
43 char *config_GetDataDirDefault (void)
44 {
45     char *datadir = config_GetVlcDir();
46
47     if (datadir)
48         /* replace last lib\vlc with share */
49         strcpy ( datadir + strlen (datadir) - 7, "share");
50
51     return datadir;
52 }
53
54 /**
55  * Determines the architecture-dependent data directory
56  *
57  * @return a string (always succeeds).
58  */
59 const char *config_GetLibDir (void)
60 {
61     abort ();
62 }
63
64 /**
65  * Determines the system configuration directory.
66  *
67  * @return a string (always succeeds).
68  */
69 const char *config_GetConfDir( void )
70 {
71     return config_GetVlcDir ();
72 }
73
74 char *config_GetUserDir (vlc_userdir_t type)
75 {
76     switch (type)
77     {
78         case VLC_HOME_DIR:
79         case VLC_CONFIG_DIR:
80         case VLC_DATA_DIR:
81         case VLC_CACHE_DIR:
82         case VLC_DESKTOP_DIR:
83         case VLC_DOWNLOAD_DIR:
84         case VLC_TEMPLATES_DIR:
85         case VLC_PUBLICSHARE_DIR:
86         case VLC_DOCUMENTS_DIR:
87         case VLC_MUSIC_DIR:
88         case VLC_PICTURES_DIR:
89         case VLC_VIDEOS_DIR:
90             break;
91     }
92     return config_GetVlcDir ();
93 }