00001 /* 00002 * Copyright (C) 2003-2009 The Music Player Daemon Project 00003 * http://www.musicpd.org 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00020 /* 00021 * Maps directory and song objects to file system paths. 00022 */ 00023 00024 #ifndef MPD_MAPPER_H 00025 #define MPD_MAPPER_H 00026 00027 #include <stdbool.h> 00028 00029 #define PLAYLIST_FILE_SUFFIX ".m3u" 00030 00031 struct directory; 00032 struct song; 00033 00034 void mapper_init(void); 00035 00036 void mapper_finish(void); 00037 00041 bool 00042 mapper_has_music_directory(void); 00043 00049 char * 00050 map_uri_fs(const char *uri); 00051 00058 char * 00059 map_directory_fs(const struct directory *directory); 00060 00069 char * 00070 map_directory_child_fs(const struct directory *directory, const char *name); 00071 00079 char * 00080 map_song_fs(const struct song *song); 00081 00089 char * 00090 map_fs_to_utf8(const char *path_fs); 00091 00095 const char * 00096 map_spl_path(void); 00097 00103 char * 00104 map_spl_utf8_to_fs(const char *name); 00105 00106 #endif