aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 22:52:08 +0100
committerMax Kellermann <max@duempel.org>2013-01-02 22:52:08 +0100
commit0c245bc2712f5d38507b8d421cdc0a7e002a3398 (patch)
treee69818281103ba2602613d5820fef62d58d296a9
parentd65ad1bf151383722802d4bb13b12a33b97480e4 (diff)
Directory: make the header C++ only
-rw-r--r--Makefile.am11
-rw-r--r--src/DatabaseGlue.cxx3
-rw-r--r--src/DatabasePrint.cxx3
-rw-r--r--src/DatabaseSave.cxx2
-rw-r--r--src/Directory.cxx2
-rw-r--r--src/Directory.hxx (renamed from src/directory.h)18
-rw-r--r--src/DirectorySave.cxx2
-rw-r--r--src/Mapper.cxx2
-rw-r--r--src/OtherCommands.cxx2
-rw-r--r--src/Song.cxx2
-rw-r--r--src/SongPrint.cxx2
-rw-r--r--src/SongSave.cxx2
-rw-r--r--src/SongSticker.cxx2
-rw-r--r--src/SongUpdate.cxx2
-rw-r--r--src/UpdateArchive.cxx2
-rw-r--r--src/UpdateContainer.cxx2
-rw-r--r--src/UpdateDatabase.cxx2
-rw-r--r--src/UpdateIO.cxx2
-rw-r--r--src/UpdateSong.cxx2
-rw-r--r--src/UpdateWalk.cxx2
-rw-r--r--src/db/ProxyDatabasePlugin.cxx3
-rw-r--r--src/db/SimpleDatabasePlugin.cxx3
-rw-r--r--test/DumpDatabase.cxx2
-rw-r--r--test/TestQueuePriority.cxx (renamed from test/test_queue_priority.c)11
24 files changed, 33 insertions, 53 deletions
diff --git a/Makefile.am b/Makefile.am
index 67734ab8..0f6271aa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -79,7 +79,6 @@ mpd_headers = \
src/decoder_api.h \
src/decoder_plugin.h \
src/decoder_internal.h \
- src/directory.h \
src/database.h \
src/encoder_plugin.h \
src/encoder_list.h \
@@ -223,7 +222,7 @@ src_mpd_SOURCES = \
src/decoder_api.c \
src/decoder_internal.c \
src/decoder_print.c \
- src/Directory.cxx \
+ src/Directory.cxx src/Directory.hxx \
src/DirectorySave.cxx src/DirectorySave.hxx \
src/DatabaseGlue.cxx \
src/DatabasePrint.cxx src/DatabasePrint.hxx \
@@ -1021,7 +1020,7 @@ if ENABLE_TEST
C_TESTS = \
test/test_byte_reverse \
test/test_pcm \
- test/test_queue_priority
+ test/TestQueuePriority
TESTS = $(C_TESTS)
@@ -1357,10 +1356,10 @@ test_test_pcm_LDADD = \
libutil.a \
$(GLIB_LIBS)
-test_test_queue_priority_SOURCES = \
+test_TestQueuePriority_SOURCES = \
src/queue.c \
- test/test_queue_priority.c
-test_test_queue_priority_LDADD = \
+ test/TestQueuePriority.c
+test_TestQueuePriority_LDADD = \
$(GLIB_LIBS)
noinst_PROGRAMS += src/dsd2pcm/dsd2pcm
diff --git a/src/DatabaseGlue.cxx b/src/DatabaseGlue.cxx
index 88791879..59b58287 100644
--- a/src/DatabaseGlue.cxx
+++ b/src/DatabaseGlue.cxx
@@ -21,6 +21,7 @@
#include "DatabaseGlue.hxx"
#include "DatabaseRegistry.hxx"
#include "DatabaseSave.hxx"
+#include "Directory.hxx"
extern "C" {
#include "database.h"
@@ -30,8 +31,6 @@ extern "C" {
#include "glib_compat.h"
}
-#include "directory.h"
-
#include "DatabasePlugin.hxx"
#include "db/SimpleDatabasePlugin.hxx"
diff --git a/src/DatabasePrint.cxx b/src/DatabasePrint.cxx
index 1e284209..193b126c 100644
--- a/src/DatabasePrint.cxx
+++ b/src/DatabasePrint.cxx
@@ -24,6 +24,7 @@
#include "PlaylistVector.hxx"
#include "SongPrint.hxx"
#include "TimePrint.hxx"
+#include "Directory.hxx"
extern "C" {
#include "database.h"
@@ -32,8 +33,6 @@ extern "C" {
#include "tag.h"
}
-#include "directory.h"
-
#include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx"
diff --git a/src/DatabaseSave.cxx b/src/DatabaseSave.cxx
index 77169984..32ae7441 100644
--- a/src/DatabaseSave.cxx
+++ b/src/DatabaseSave.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "DatabaseSave.hxx"
#include "DatabaseLock.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "DirectorySave.hxx"
#include "song.h"
diff --git a/src/Directory.cxx b/src/Directory.cxx
index 84545e54..f30eef72 100644
--- a/src/Directory.cxx
+++ b/src/Directory.cxx
@@ -18,7 +18,7 @@
*/
#include "config.h"
-#include "directory.h"
+#include "Directory.hxx"
#include "SongFilter.hxx"
#include "PlaylistVector.hxx"
#include "DatabaseLock.hxx"
diff --git a/src/directory.h b/src/Directory.hxx
index 607e812c..c1bb1ec3 100644
--- a/src/directory.h
+++ b/src/Directory.hxx
@@ -1,5 +1,5 @@
/*
- * 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
@@ -17,16 +17,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_DIRECTORY_H
-#define MPD_DIRECTORY_H
+#ifndef MPD_DIRECTORY_HXX
+#define MPD_DIRECTORY_HXX
#include "check.h"
#include "util/list.h"
#include "gcc.h"
-
-#ifdef __cplusplus
#include "DatabaseVisitor.hxx"
-#endif
#include <glib.h>
#include <stdbool.h>
@@ -55,10 +52,7 @@
struct song;
struct db_visitor;
-
-#ifdef __cplusplus
class SongFilter;
-#endif
struct directory {
/**
@@ -96,7 +90,6 @@ struct directory {
bool have_stat; /* not needed if ino_t == dev_t == 0 is impossible */
char path[sizeof(long)];
-#ifdef __cplusplus
/**
* Caller must lock #db_mutex.
*/
@@ -104,11 +97,8 @@ struct directory {
VisitDirectory visit_directory, VisitSong visit_song,
VisitPlaylist visit_playlist,
GError **error_r) const;
-#endif
};
-G_BEGIN_DECLS
-
static inline bool
isRootDirectory(const char *name)
{
@@ -272,6 +262,4 @@ directory_lookup_song(struct directory *directory, const char *uri);
void
directory_sort(struct directory *directory);
-G_END_DECLS
-
#endif
diff --git a/src/DirectorySave.cxx b/src/DirectorySave.cxx
index 83a1ffd5..8e677e7d 100644
--- a/src/DirectorySave.cxx
+++ b/src/DirectorySave.cxx
@@ -19,7 +19,7 @@
#include "config.h"
#include "DirectorySave.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "SongSave.hxx"
#include "PlaylistDatabase.hxx"
diff --git a/src/Mapper.cxx b/src/Mapper.cxx
index 1dc91ed1..eda9c0b3 100644
--- a/src/Mapper.cxx
+++ b/src/Mapper.cxx
@@ -23,7 +23,7 @@
#include "config.h"
#include "Mapper.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
extern "C" {
diff --git a/src/OtherCommands.cxx b/src/OtherCommands.cxx
index 01f9b71a..a7a26249 100644
--- a/src/OtherCommands.cxx
+++ b/src/OtherCommands.cxx
@@ -22,7 +22,7 @@
#include "DatabaseCommands.hxx"
#include "CommandError.hxx"
#include "UpdateGlue.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "SongPrint.hxx"
#include "TagPrint.hxx"
diff --git a/src/Song.cxx b/src/Song.cxx
index eb4c2e53..deefe3c2 100644
--- a/src/Song.cxx
+++ b/src/Song.cxx
@@ -19,7 +19,7 @@
#include "config.h"
#include "song.h"
-#include "directory.h"
+#include "Directory.hxx"
extern "C" {
#include "tag.h"
diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx
index 07cf9c3e..957db76a 100644
--- a/src/SongPrint.cxx
+++ b/src/SongPrint.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "SongPrint.hxx"
#include "song.h"
-#include "directory.h"
+#include "Directory.hxx"
#include "TimePrint.hxx"
#include "TagPrint.hxx"
#include "Mapper.hxx"
diff --git a/src/SongSave.cxx b/src/SongSave.cxx
index 21d073b8..d78eb3f7 100644
--- a/src/SongSave.cxx
+++ b/src/SongSave.cxx
@@ -21,7 +21,7 @@
#include "SongSave.hxx"
#include "song.h"
#include "TagSave.hxx"
-#include "directory.h"
+#include "Directory.hxx"
extern "C" {
#include "tag.h"
diff --git a/src/SongSticker.cxx b/src/SongSticker.cxx
index b32ef9d4..2c311bfb 100644
--- a/src/SongSticker.cxx
+++ b/src/SongSticker.cxx
@@ -21,7 +21,7 @@
#include "SongSticker.hxx"
#include "StickerDatabase.hxx"
#include "song.h"
-#include "directory.h"
+#include "Directory.hxx"
#include <glib.h>
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx
index c5258f02..83937b99 100644
--- a/src/SongUpdate.cxx
+++ b/src/SongUpdate.cxx
@@ -24,7 +24,7 @@ extern "C" {
#include "uri.h"
}
-#include "directory.h"
+#include "Directory.hxx"
#include "Mapper.hxx"
extern "C" {
diff --git a/src/UpdateArchive.cxx b/src/UpdateArchive.cxx
index 36f5cdc2..4a45f375 100644
--- a/src/UpdateArchive.cxx
+++ b/src/UpdateArchive.cxx
@@ -21,7 +21,7 @@
#include "UpdateArchive.hxx"
#include "UpdateInternal.hxx"
#include "DatabaseLock.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "Mapper.hxx"
diff --git a/src/UpdateContainer.cxx b/src/UpdateContainer.cxx
index 909295d9..d0e35299 100644
--- a/src/UpdateContainer.cxx
+++ b/src/UpdateContainer.cxx
@@ -22,7 +22,7 @@
#include "UpdateInternal.hxx"
#include "UpdateDatabase.hxx"
#include "DatabaseLock.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "decoder_plugin.h"
#include "Mapper.hxx"
diff --git a/src/UpdateDatabase.cxx b/src/UpdateDatabase.cxx
index 6ef6e342..4de18345 100644
--- a/src/UpdateDatabase.cxx
+++ b/src/UpdateDatabase.cxx
@@ -21,7 +21,7 @@
#include "UpdateDatabase.hxx"
#include "UpdateRemove.hxx"
#include "PlaylistVector.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "DatabaseLock.hxx"
diff --git a/src/UpdateIO.cxx b/src/UpdateIO.cxx
index 77ec3041..200a6136 100644
--- a/src/UpdateIO.cxx
+++ b/src/UpdateIO.cxx
@@ -19,7 +19,7 @@
#include "config.h" /* must be first for large file support */
#include "UpdateIO.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "Mapper.hxx"
#include "glib_compat.h"
diff --git a/src/UpdateSong.cxx b/src/UpdateSong.cxx
index 48357b9c..96c5eefb 100644
--- a/src/UpdateSong.cxx
+++ b/src/UpdateSong.cxx
@@ -24,7 +24,7 @@
#include "UpdateDatabase.hxx"
#include "UpdateContainer.hxx"
#include "DatabaseLock.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "decoder_plugin.h"
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index b277f047..91526fb6 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -24,7 +24,7 @@
#include "UpdateSong.hxx"
#include "UpdateArchive.hxx"
#include "DatabaseLock.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "PlaylistVector.hxx"
#include "Mapper.hxx"
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx
index 01b36a6e..95aefc14 100644
--- a/src/db/ProxyDatabasePlugin.cxx
+++ b/src/db/ProxyDatabasePlugin.cxx
@@ -22,6 +22,7 @@
#include "DatabasePlugin.hxx"
#include "DatabaseSelection.hxx"
#include "PlaylistVector.hxx"
+#include "Directory.hxx"
#include "gcc.h"
extern "C" {
@@ -31,8 +32,6 @@ extern "C" {
#include "tag.h"
}
-#include "directory.h"
-
#undef MPD_DIRECTORY_H
#undef MPD_SONG_H
#include <mpd/client.h>
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx
index 85d707f5..06a92604 100644
--- a/src/db/SimpleDatabasePlugin.cxx
+++ b/src/db/SimpleDatabasePlugin.cxx
@@ -21,6 +21,7 @@
#include "SimpleDatabasePlugin.hxx"
#include "DatabaseSelection.hxx"
#include "DatabaseHelpers.hxx"
+#include "Directory.hxx"
#include "SongFilter.hxx"
#include "DatabaseSave.hxx"
#include "DatabaseLock.hxx"
@@ -30,8 +31,6 @@ extern "C" {
#include "conf.h"
}
-#include "directory.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index fc42ba14..3a4e980b 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -21,7 +21,7 @@
#include "DatabaseRegistry.hxx"
#include "DatabasePlugin.hxx"
#include "DatabaseSelection.hxx"
-#include "directory.h"
+#include "Directory.hxx"
#include "song.h"
#include "PlaylistVector.hxx"
diff --git a/test/test_queue_priority.c b/test/TestQueuePriority.cxx
index b4a7366e..a046df52 100644
--- a/test/test_queue_priority.c
+++ b/test/TestQueuePriority.cxx
@@ -1,19 +1,16 @@
#include "config.h"
+extern "C" {
#include "queue.h"
+}
#include "song.h"
-#include "directory.h"
+#include "Directory.hxx"
struct directory detached_root;
struct song *
song_dup_detached(const struct song *src)
{
- union {
- const struct song *in;
- struct song *out;
- } u = { .in = src };
-
- return u.out;
+ return const_cast<song *>(src);
}
void