MPD
mapper.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2003-2010 The Music Player Daemon Project
3  * http://www.musicpd.org
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 /*
21  * Maps directory and song objects to file system paths.
22  */
23 
24 #ifndef MPD_MAPPER_H
25 #define MPD_MAPPER_H
26 
27 #include <stdbool.h>
28 
29 #define PLAYLIST_FILE_SUFFIX ".m3u"
30 
31 struct directory;
32 struct song;
33 
34 void mapper_init(const char *_music_dir, const char *_playlist_dir);
35 
36 void mapper_finish(void);
37 
41 bool
43 
49 const char *
50 map_to_relative_path(const char *path_utf8);
51 
57 char *
58 map_uri_fs(const char *uri);
59 
66 char *
67 map_directory_fs(const struct directory *directory);
68 
77 char *
78 map_directory_child_fs(const struct directory *directory, const char *name);
79 
87 char *
88 map_song_fs(const struct song *song);
89 
97 char *
98 map_fs_to_utf8(const char *path_fs);
99 
103 const char *
104 map_spl_path(void);
105 
113 char *
114 map_spl_utf8_to_fs(const char *name);
115 
116 #endif