Commit d65ad1bf authored by Max Kellermann's avatar Max Kellermann

mapper: convert to C++

parent 43cbbe11
......@@ -130,7 +130,6 @@ mpd_headers = \
src/pipe.h \
src/chunk.h \
src/path.h \
src/mapper.h \
src/open.h \
src/output/httpd_client.h \
src/output/httpd_internal.h \
......@@ -283,7 +282,7 @@ src_mpd_SOURCES = \
src/pipe.c \
src/chunk.c \
src/path.c \
src/mapper.c \
src/Mapper.cxx src/Mapper.hxx \
src/page.c \
src/permission.c \
src/PlayerThread.cxx src/PlayerThread.hxx \
......
......@@ -23,6 +23,7 @@
#include "decoder_plugin.h"
#include "song.h"
#include "mpd_error.h"
#include "Mapper.hxx"
extern "C" {
#include "decoder_control.h"
......@@ -32,7 +33,6 @@ extern "C" {
#include "replay_gain_ape.h"
#include "input_stream.h"
#include "tag.h"
#include "mapper.h"
#include "uri.h"
}
......
......@@ -22,9 +22,9 @@
#include "InotifySource.hxx"
#include "InotifyQueue.hxx"
#include "database.h"
#include "Mapper.hxx"
extern "C" {
#include "mapper.h"
#include "path.h"
}
......
......@@ -24,6 +24,7 @@
#include "chunk.h"
#include "StateFile.hxx"
#include "PlayerThread.hxx"
#include "Mapper.hxx"
extern "C" {
#include "daemon.h"
......@@ -38,7 +39,6 @@ extern "C" {
#include "cmdline.h"
#include "conf.h"
#include "path.h"
#include "mapper.h"
#include "player_control.h"
#include "stats.h"
#include "sig_handlers.h"
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -22,10 +22,13 @@
*/
#include "config.h"
#include "mapper.h"
#include "Mapper.hxx"
#include "directory.h"
#include "song.h"
extern "C" {
#include "path.h"
}
#include <glib.h>
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,15 +21,12 @@
* Maps directory and song objects to file system paths.
*/
#ifndef MPD_MAPPER_H
#define MPD_MAPPER_H
#ifndef MPD_MAPPER_HXX
#define MPD_MAPPER_HXX
#include "gcc.h"
#include "gerror.h"
#include <stdbool.h>
#include <stddef.h>
#define PLAYLIST_FILE_SUFFIX ".m3u"
struct directory;
......@@ -61,7 +58,7 @@ gcc_const
static inline bool
mapper_has_music_directory(void)
{
return mapper_get_music_directory_utf8() != NULL;
return mapper_get_music_directory_utf8() != nullptr;
}
/**
......@@ -86,7 +83,7 @@ map_uri_fs(const char *uri);
* Determines the file system path of a directory object.
*
* @param directory the directory object
* @return the path in file system encoding, or NULL if mapping failed
* @return the path in file system encoding, or nullptr if mapping failed
*/
gcc_malloc
char *
......@@ -98,7 +95,7 @@ map_directory_fs(const struct directory *directory);
*
* @param directory the parent directory object
* @param name the child's name in UTF-8
* @return the path in file system encoding, or NULL if mapping failed
* @return the path in file system encoding, or nullptr if mapping failed
*/
gcc_malloc
char *
......@@ -109,7 +106,7 @@ map_directory_child_fs(const struct directory *directory, const char *name);
* remote song.
*
* @param song the song object
* @return the path in file system encoding, or NULL if mapping failed
* @return the path in file system encoding, or nullptr if mapping failed
*/
gcc_malloc
char *
......@@ -120,7 +117,7 @@ map_song_fs(const struct song *song);
* absolute) to a relative path in UTF-8 encoding.
*
* @param path_fs a path in file system encoding
* @return the relative path in UTF-8, or NULL if mapping failed
* @return the relative path in UTF-8, or nullptr if mapping failed
*/
gcc_malloc
char *
......@@ -138,7 +135,7 @@ map_spl_path(void);
* path. The return value is allocated on the heap and must be freed
* with g_free().
*
* @return the path in file system encoding, or NULL if mapping failed
* @return the path in file system encoding, or nullptr if mapping failed
*/
gcc_pure
char *
......
......@@ -27,6 +27,7 @@
#include "SongPrint.hxx"
#include "TagPrint.hxx"
#include "TimePrint.hxx"
#include "Mapper.hxx"
extern "C" {
#include "protocol/argparser.h"
......@@ -46,7 +47,6 @@ extern "C" {
#include "client_idle.h"
#include "client_file.h"
#include "idle.h"
#include "mapper.h"
}
#ifdef ENABLE_SQLITE
......
......@@ -22,10 +22,10 @@
#include "PlaylistSave.hxx"
#include "song.h"
#include "io_error.h"
#include "Mapper.hxx"
extern "C" {
#include "text_file.h"
#include "mapper.h"
#include "path.h"
#include "uri.h"
#include "database.h"
......
......@@ -20,10 +20,10 @@
#include "config.h"
#include "PlaylistMapper.hxx"
#include "PlaylistFile.hxx"
#include "Mapper.hxx"
extern "C" {
#include "playlist_list.h"
#include "mapper.h"
#include "uri.h"
}
......
......@@ -21,10 +21,10 @@
#include "PlaylistSave.hxx"
#include "PlaylistFile.hxx"
#include "song.h"
#include "Mapper.hxx"
extern "C" {
#include "playlist.h"
#include "mapper.h"
#include "path.h"
#include "uri.h"
#include "idle.h"
......
......@@ -19,10 +19,10 @@
#include "config.h"
#include "PlaylistSong.hxx"
#include "Mapper.hxx"
extern "C" {
#include "database.h"
#include "mapper.h"
#include "song.h"
#include "uri.h"
#include "path.h"
......
......@@ -21,12 +21,12 @@
#include "QueuePrint.hxx"
#include "SongFilter.hxx"
#include "SongPrint.hxx"
#include "Mapper.hxx"
extern "C" {
#include "queue.h"
#include "song.h"
#include "client.h"
#include "mapper.h"
}
/**
......
......@@ -23,11 +23,11 @@
#include "directory.h"
#include "TimePrint.hxx"
#include "TagPrint.hxx"
#include "Mapper.hxx"
extern "C" {
#include "client.h"
#include "uri.h"
#include "mapper.h"
}
void
......
......@@ -25,9 +25,9 @@ extern "C" {
}
#include "directory.h"
#include "Mapper.hxx"
extern "C" {
#include "mapper.h"
#include "decoder_list.h"
#include "decoder_plugin.h"
#include "tag_ape.h"
......
......@@ -23,9 +23,9 @@
#include "DatabaseLock.hxx"
#include "directory.h"
#include "song.h"
#include "Mapper.hxx"
extern "C" {
#include "mapper.h"
#include "archive_list.h"
#include "archive_plugin.h"
}
......
......@@ -25,9 +25,9 @@
#include "directory.h"
#include "song.h"
#include "decoder_plugin.h"
#include "Mapper.hxx"
extern "C" {
#include "mapper.h"
#include "tag.h"
#include "tag_handler.h"
}
......
......@@ -22,10 +22,10 @@
#include "UpdateQueue.hxx"
#include "UpdateWalk.hxx"
#include "UpdateRemove.hxx"
#include "Mapper.hxx"
extern "C" {
#include "database.h"
#include "mapper.h"
#include "playlist.h"
#include "event_pipe.h"
#include "idle.h"
......
......@@ -20,12 +20,9 @@
#include "config.h" /* must be first for large file support */
#include "UpdateIO.hxx"
#include "directory.h"
#include "Mapper.hxx"
#include "glib_compat.h"
extern "C" {
#include "mapper.h"
}
#include <glib.h>
#include <errno.h>
......
......@@ -27,12 +27,12 @@
#include "directory.h"
#include "song.h"
#include "PlaylistVector.hxx"
#include "Mapper.hxx"
extern "C" {
#include "exclude.h"
#include "database.h"
#include "uri.h"
#include "mapper.h"
#include "path.h"
#include "playlist_list.h"
#include "conf.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment