aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 19:52:57 +0100
committerMax Kellermann <max@duempel.org>2013-01-02 20:22:59 +0100
commitb715e522cff7109c370e66d29ba22340c9259c52 (patch)
treeabda37d8d414592c59f8f875a3b1b439c5d81725 /src
parent4b0b8315a918be5ad92d5aeb0c7df6d28966b951 (diff)
db_save, state_file: convert to C++
Diffstat (limited to 'src')
-rw-r--r--src/DatabaseGlue.cxx2
-rw-r--r--src/DatabaseSave.cxx (renamed from src/db_save.c)7
-rw-r--r--src/DatabaseSave.hxx (renamed from src/db_save.h)7
-rw-r--r--src/DirectorySave.cxx (renamed from src/directory_save.c)13
-rw-r--r--src/DirectorySave.hxx (renamed from src/directory_save.h)7
-rw-r--r--src/Main.cxx2
-rw-r--r--src/OutputState.cxx (renamed from src/output_state.c)7
-rw-r--r--src/OutputState.hxx (renamed from src/output_state.h)7
-rw-r--r--src/PlaylistDatabase.cxx (renamed from src/playlist_database.c)13
-rw-r--r--src/PlaylistDatabase.hxx (renamed from src/playlist_database.h)7
-rw-r--r--src/PlaylistSave.hxx1
-rw-r--r--src/PlaylistState.cxx (renamed from src/playlist_state.c)8
-rw-r--r--src/PlaylistState.hxx (renamed from src/playlist_state.h)7
-rw-r--r--src/QueueSave.cxx (renamed from src/queue_save.c)11
-rw-r--r--src/QueueSave.hxx (renamed from src/queue_save.h)6
-rw-r--r--src/SongSave.cxx (renamed from src/song_save.c)9
-rw-r--r--src/SongSave.hxx (renamed from src/song_save.h)6
-rw-r--r--src/StateFile.cxx (renamed from src/state_file.c)13
-rw-r--r--src/StateFile.hxx (renamed from src/state_file.h)6
-rw-r--r--src/TagSave.cxx (renamed from src/tag_save.c)4
-rw-r--r--src/TagSave.hxx (renamed from src/tag_save.h)6
-rw-r--r--src/db/SimpleDatabasePlugin.cxx2
-rw-r--r--src/playlist_global.c1
23 files changed, 84 insertions, 68 deletions
diff --git a/src/DatabaseGlue.cxx b/src/DatabaseGlue.cxx
index 03a717cb..88791879 100644
--- a/src/DatabaseGlue.cxx
+++ b/src/DatabaseGlue.cxx
@@ -20,11 +20,11 @@
#include "config.h"
#include "DatabaseGlue.hxx"
#include "DatabaseRegistry.hxx"
+#include "DatabaseSave.hxx"
extern "C" {
#include "database.h"
#include "db_error.h"
-#include "db_save.h"
#include "stats.h"
#include "conf.h"
#include "glib_compat.h"
diff --git a/src/db_save.c b/src/DatabaseSave.cxx
index 4af9d58b..711d5b2f 100644
--- a/src/db_save.c
+++ b/src/DatabaseSave.cxx
@@ -18,15 +18,18 @@
*/
#include "config.h"
-#include "db_save.h"
+#include "DatabaseSave.hxx"
#include "db_lock.h"
#include "directory.h"
-#include "directory_save.h"
+#include "DirectorySave.hxx"
#include "song.h"
+
+extern "C" {
#include "path.h"
#include "text_file.h"
#include "tag.h"
#include "tag_internal.h"
+}
#include <glib.h>
diff --git a/src/db_save.h b/src/DatabaseSave.hxx
index d232d733..f96bf5e2 100644
--- a/src/db_save.h
+++ b/src/DatabaseSave.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,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_DB_SAVE_H
-#define MPD_DB_SAVE_H
+#ifndef MPD_DATABASE_SAVE_HXX
+#define MPD_DATABASE_SAVE_HXX
#include "gerror.h"
-#include <stdbool.h>
#include <stdio.h>
struct directory;
diff --git a/src/directory_save.c b/src/DirectorySave.cxx
index de1df050..83a1ffd5 100644
--- a/src/directory_save.c
+++ b/src/DirectorySave.cxx
@@ -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
@@ -18,12 +18,15 @@
*/
#include "config.h"
-#include "directory_save.h"
+#include "DirectorySave.hxx"
#include "directory.h"
#include "song.h"
+#include "SongSave.hxx"
+#include "PlaylistDatabase.hxx"
+
+extern "C" {
#include "text_file.h"
-#include "song_save.h"
-#include "playlist_database.h"
+}
#include <assert.h>
#include <string.h>
@@ -152,7 +155,7 @@ directory_load(FILE *fp, struct directory *directory,
if (directory_get_song(directory, name) != NULL) {
g_set_error(error, directory_quark(), 0,
"Duplicate song '%s'", name);
- return NULL;
+ return false;
}
song = song_load(fp, directory, name,
diff --git a/src/directory_save.h b/src/DirectorySave.hxx
index 2d005683..18c3bf64 100644
--- a/src/directory_save.h
+++ b/src/DirectorySave.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,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_DIRECTORY_SAVE_H
-#define MPD_DIRECTORY_SAVE_H
+#ifndef MPD_DIRECTORY_SAVE_HXX
+#define MPD_DIRECTORY_SAVE_HXX
#include <glib.h>
-#include <stdbool.h>
#include <stdio.h>
struct directory;
diff --git a/src/Main.cxx b/src/Main.cxx
index 44042d8c..9a5fa1cd 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -22,6 +22,7 @@
#include "PlaylistFile.hxx"
#include "UpdateGlue.hxx"
#include "chunk.h"
+#include "StateFile.hxx"
extern "C" {
#include "daemon.h"
@@ -51,7 +52,6 @@ extern "C" {
#include "decoder_list.h"
#include "input_init.h"
#include "playlist_list.h"
-#include "state_file.h"
#include "tag.h"
#include "zeroconf.h"
#include "event_pipe.h"
diff --git a/src/output_state.c b/src/OutputState.cxx
index 7bcafb36..95aeacbc 100644
--- a/src/output_state.c
+++ b/src/OutputState.cxx
@@ -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
@@ -23,9 +23,12 @@
*/
#include "config.h"
-#include "output_state.h"
+#include "OutputState.hxx"
#include "output_internal.h"
+
+extern "C" {
#include "output_all.h"
+}
#include <glib.h>
diff --git a/src/output_state.h b/src/OutputState.hxx
index 320a3520..5ab765ba 100644
--- a/src/output_state.h
+++ b/src/OutputState.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
@@ -22,10 +22,9 @@
*
*/
-#ifndef OUTPUT_STATE_H
-#define OUTPUT_STATE_H
+#ifndef MPD_OUTPUT_STATE_HXX
+#define MPD_OUTPUT_STATE_HXX
-#include <stdbool.h>
#include <stdio.h>
bool
diff --git a/src/playlist_database.c b/src/PlaylistDatabase.cxx
index 6b9d8715..b88ebbd6 100644
--- a/src/playlist_database.c
+++ b/src/PlaylistDatabase.cxx
@@ -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
@@ -18,10 +18,13 @@
*/
#include "config.h"
-#include "playlist_database.h"
+#include "PlaylistDatabase.hxx"
+
+extern "C" {
#include "playlist_vector.h"
#include "text_file.h"
#include "string_util.h"
+}
#include <string.h>
#include <stdlib.h>
@@ -47,9 +50,9 @@ bool
playlist_metadata_load(FILE *fp, struct list_head *pv, const char *name,
GString *buffer, GError **error_r)
{
- struct playlist_metadata pm = {
- .mtime = 0,
- };
+ struct playlist_metadata pm;
+ pm.mtime = 0;
+
char *line, *colon;
const char *value;
diff --git a/src/playlist_database.h b/src/PlaylistDatabase.hxx
index 3238fa06..0b4cd3f3 100644
--- a/src/playlist_database.h
+++ b/src/PlaylistDatabase.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,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_PLAYLIST_DATABASE_H
-#define MPD_PLAYLIST_DATABASE_H
+#ifndef MPD_PLAYLIST_DATABASE_HXX
+#define MPD_PLAYLIST_DATABASE_HXX
#include "check.h"
-#include <stdbool.h>
#include <stdio.h>
#include <glib.h>
diff --git a/src/PlaylistSave.hxx b/src/PlaylistSave.hxx
index 20b2ca42..ff5f0c49 100644
--- a/src/PlaylistSave.hxx
+++ b/src/PlaylistSave.hxx
@@ -22,7 +22,6 @@
#include "playlist_error.h"
-#include <stdbool.h>
#include <stdio.h>
struct song;
diff --git a/src/playlist_state.c b/src/PlaylistState.cxx
index 4aa2c2c9..0cfd3272 100644
--- a/src/playlist_state.c
+++ b/src/PlaylistState.cxx
@@ -23,13 +23,15 @@
*/
#include "config.h"
-#include "playlist_state.h"
+#include "PlaylistState.hxx"
+#include "QueueSave.hxx"
+
+extern "C" {
#include "playlist.h"
#include "player_control.h"
-#include "queue_save.h"
-#include "path.h"
#include "text_file.h"
#include "conf.h"
+}
#include <string.h>
#include <stdlib.h>
diff --git a/src/playlist_state.h b/src/PlaylistState.hxx
index f67d01d2..d38fe9d1 100644
--- a/src/playlist_state.h
+++ b/src/PlaylistState.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
@@ -22,11 +22,10 @@
*
*/
-#ifndef PLAYLIST_STATE_H
-#define PLAYLIST_STATE_H
+#ifndef MPD_PLAYLIST_STATE_HXX
+#define MPD_PLAYLIST_STATE_HXX
#include <glib.h>
-#include <stdbool.h>
#include <stdio.h>
struct playlist;
diff --git a/src/queue_save.c b/src/QueueSave.cxx
index 00b5ecbb..96713c70 100644
--- a/src/queue_save.c
+++ b/src/QueueSave.cxx
@@ -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
@@ -18,13 +18,16 @@
*/
#include "config.h"
-#include "queue_save.h"
-#include "queue.h"
+#include "QueueSave.hxx"
#include "song.h"
+#include "SongSave.hxx"
+
+extern "C" {
+#include "queue.h"
#include "uri.h"
#include "database.h"
-#include "song_save.h"
#include "text_file.h"
+}
#include <stdlib.h>
diff --git a/src/queue_save.h b/src/QueueSave.hxx
index 5526d615..d6b09329 100644
--- a/src/queue_save.h
+++ b/src/QueueSave.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
@@ -22,8 +22,8 @@
* back into memory.
*/
-#ifndef QUEUE_SAVE_H
-#define QUEUE_SAVE_H
+#ifndef MPD_QUEUE_SAVE_HXX
+#define MPD_QUEUE_SAVE_HXX
#include <glib.h>
#include <stdio.h>
diff --git a/src/song_save.c b/src/SongSave.cxx
index 4fcb46e2..21d073b8 100644
--- a/src/song_save.c
+++ b/src/SongSave.cxx
@@ -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
@@ -18,13 +18,16 @@
*/
#include "config.h"
-#include "song_save.h"
+#include "SongSave.hxx"
#include "song.h"
-#include "tag_save.h"
+#include "TagSave.hxx"
#include "directory.h"
+
+extern "C" {
#include "tag.h"
#include "text_file.h"
#include "string_util.h"
+}
#include <glib.h>
diff --git a/src/song_save.h b/src/SongSave.hxx
index f6ecbbfe..d8805acd 100644
--- a/src/song_save.h
+++ b/src/SongSave.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,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_SONG_SAVE_H
-#define MPD_SONG_SAVE_H
+#ifndef MPD_SONG_SAVE_HXX
+#define MPD_SONG_SAVE_HXX
#include <glib.h>
diff --git a/src/state_file.c b/src/StateFile.cxx
index de0e7053..6635d9f9 100644
--- a/src/state_file.c
+++ b/src/StateFile.cxx
@@ -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
@@ -18,12 +18,15 @@
*/
#include "config.h"
-#include "state_file.h"
-#include "output_state.h"
+#include "StateFile.hxx"
+#include "OutputState.hxx"
#include "playlist.h"
-#include "playlist_state.h"
+#include "PlaylistState.hxx"
+
+extern "C" {
#include "volume.h"
#include "text_file.h"
+}
#include <glib.h>
#include <assert.h>
@@ -117,7 +120,7 @@ state_file_read(struct player_control *pc)
static gboolean
timer_save_state_file(gpointer data)
{
- struct player_control *pc = data;
+ struct player_control *pc = (struct player_control *)data;
if (prev_volume_version == sw_volume_state_get_hash() &&
prev_output_version == audio_output_state_get_version() &&
diff --git a/src/state_file.h b/src/StateFile.hxx
index 4c4f881c..77629aba 100644
--- a/src/state_file.h
+++ b/src/StateFile.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,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_STATE_FILE_H
-#define MPD_STATE_FILE_H
+#ifndef MPD_STATE_FILE_HXX
+#define MPD_STATE_FILE_HXX
struct player_control;
diff --git a/src/tag_save.c b/src/TagSave.cxx
index 2fdaef56..639dc2d9 100644
--- a/src/tag_save.c
+++ b/src/TagSave.cxx
@@ -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
@@ -18,7 +18,7 @@
*/
#include "config.h"
-#include "tag_save.h"
+#include "TagSave.hxx"
#include "tag.h"
#include "tag_internal.h"
#include "song.h"
diff --git a/src/tag_save.h b/src/TagSave.hxx
index 9f6a580c..a7ccfa61 100644
--- a/src/tag_save.h
+++ b/src/TagSave.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,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_TAG_SAVE_H
-#define MPD_TAG_SAVE_H
+#ifndef MPD_TAG_SAVE_HXX
+#define MPD_TAG_SAVE_HXX
#include <stdio.h>
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx
index d83c1ca7..4b92da6c 100644
--- a/src/db/SimpleDatabasePlugin.cxx
+++ b/src/db/SimpleDatabasePlugin.cxx
@@ -22,10 +22,10 @@
#include "DatabaseSelection.hxx"
#include "DatabaseHelpers.hxx"
#include "SongFilter.hxx"
+#include "DatabaseSave.hxx"
extern "C" {
#include "db_error.h"
-#include "db_save.h"
#include "db_lock.h"
#include "conf.h"
}
diff --git a/src/playlist_global.c b/src/playlist_global.c
index 43bf2675..e66febce 100644
--- a/src/playlist_global.c
+++ b/src/playlist_global.c
@@ -24,7 +24,6 @@
#include "config.h"
#include "playlist.h"
-#include "playlist_state.h"
#include "event_pipe.h"
#include "Main.hxx"