diff options
Diffstat (limited to 'src')
45 files changed, 86 insertions, 73 deletions
diff --git a/src/ClientGlobal.cxx b/src/ClientGlobal.cxx index 10c78f1f1..e6d438b8d 100644 --- a/src/ClientGlobal.cxx +++ b/src/ClientGlobal.cxx @@ -19,10 +19,7 @@ #include "config.h" #include "ClientInternal.hxx" - -extern "C" { #include "conf.h" -} #include <assert.h> diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx index 4d9d2ca9d..670995214 100644 --- a/src/CommandLine.cxx +++ b/src/CommandLine.cxx @@ -24,9 +24,9 @@ extern "C" { #include "log.h" -#include "conf.h" } +#include "conf.h" #include "decoder_list.h" #include "decoder_plugin.h" #include "OutputList.hxx" diff --git a/src/DatabaseGlue.cxx b/src/DatabaseGlue.cxx index 283ef9943..853e67b07 100644 --- a/src/DatabaseGlue.cxx +++ b/src/DatabaseGlue.cxx @@ -23,11 +23,11 @@ #include "DatabaseRegistry.hxx" #include "DatabaseSave.hxx" #include "Directory.hxx" +#include "conf.h" extern "C" { #include "db_error.h" #include "stats.h" -#include "conf.h" #include "glib_compat.h" } diff --git a/src/DatabasePrint.cxx b/src/DatabasePrint.cxx index 2c3fcc9f8..2384d5c14 100644 --- a/src/DatabasePrint.cxx +++ b/src/DatabasePrint.cxx @@ -26,10 +26,10 @@ #include "TimePrint.hxx" #include "Directory.hxx" #include "Client.hxx" +#include "tag.h" extern "C" { #include "song.h" -#include "tag.h" } #include "DatabaseGlue.hxx" diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx index 6e0460a8c..49ebacd49 100644 --- a/src/DecoderAPI.cxx +++ b/src/DecoderAPI.cxx @@ -18,13 +18,13 @@ */ #include "config.h" +#include "decoder_api.h" extern "C" { -#include "decoder_api.h" #include "audio_config.h" -#include "replay_gain_config.h" } +#include "replay_gain_config.h" #include "MusicChunk.hxx" #include "MusicBuffer.hxx" #include "MusicPipe.hxx" diff --git a/src/DecoderInternal.cxx b/src/DecoderInternal.cxx index c5884d357..6970a220f 100644 --- a/src/DecoderInternal.cxx +++ b/src/DecoderInternal.cxx @@ -23,11 +23,7 @@ #include "MusicPipe.hxx" #include "MusicBuffer.hxx" #include "MusicChunk.hxx" - -extern "C" { #include "tag.h" -} - #include "input_stream.h" #include <assert.h> diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx index 18228f381..8ab157582 100644 --- a/src/DecoderThread.cxx +++ b/src/DecoderThread.cxx @@ -26,13 +26,13 @@ #include "song.h" #include "mpd_error.h" #include "Mapper.hxx" +#include "decoder_api.h" +#include "tag.h" +#include "input_stream.h" extern "C" { #include "decoder_list.h" -#include "decoder_api.h" #include "replay_gain_ape.h" -#include "input_stream.h" -#include "tag.h" #include "uri.h" } diff --git a/src/Listen.cxx b/src/Listen.cxx index 3ea9bae9a..3b439f8f4 100644 --- a/src/Listen.cxx +++ b/src/Listen.cxx @@ -22,10 +22,10 @@ #include "Main.hxx" #include "Partition.hxx" #include "Client.hxx" +#include "conf.h" extern "C" { #include "server_socket.h" -#include "conf.h" } #include <string.h> diff --git a/src/Main.cxx b/src/Main.cxx index 808a445f0..7ff19538d 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -36,23 +36,23 @@ #include "Partition.hxx" #include "Volume.hxx" #include "OutputAll.hxx" +#include "tag.h" +#include "conf.h" +#include "replay_gain_config.h" extern "C" { #include "daemon.h" #include "io_thread.h" #include "idle.h" -#include "conf.h" #include "path.h" #include "stats.h" #include "sig_handlers.h" #include "audio_config.h" #include "log.h" #include "pcm_resample.h" -#include "replay_gain_config.h" #include "decoder_list.h" #include "input_init.h" #include "playlist_list.h" -#include "tag.h" #include "zeroconf.h" #include "event_pipe.h" } diff --git a/src/MusicChunk.cxx b/src/MusicChunk.cxx index e79cc3ee9..eefda24b5 100644 --- a/src/MusicChunk.cxx +++ b/src/MusicChunk.cxx @@ -20,10 +20,7 @@ #include "config.h" #include "MusicChunk.hxx" #include "audio_format.h" - -extern "C" { #include "tag.h" -} #include <assert.h> diff --git a/src/OutputAll.cxx b/src/OutputAll.cxx index 37f2e1ee9..f83f51c0c 100644 --- a/src/OutputAll.cxx +++ b/src/OutputAll.cxx @@ -31,9 +31,9 @@ extern "C" { #include "MusicPipe.hxx" #include "MusicChunk.hxx" #include "mpd_error.h" +#include "conf.h" extern "C" { -#include "conf.h" #include "notify.h" } diff --git a/src/Permission.cxx b/src/Permission.cxx index 0b76e3364..e6cf5cfb8 100644 --- a/src/Permission.cxx +++ b/src/Permission.cxx @@ -20,10 +20,7 @@ #include "config.h" #include "Permission.hxx" #include "mpd_error.h" - -extern "C" { #include "conf.h" -} #include <map> #include <string> diff --git a/src/PlayerCommands.cxx b/src/PlayerCommands.cxx index c272ae354..536ee85b1 100644 --- a/src/PlayerCommands.cxx +++ b/src/PlayerCommands.cxx @@ -31,9 +31,9 @@ extern "C" { #include "audio_format.h" -#include "replay_gain_config.h" } +#include "replay_gain_config.h" #include "PlayerControl.hxx" #include <errno.h> diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx index cba6c0fcd..6b05dd97c 100644 --- a/src/PlayerThread.cxx +++ b/src/PlayerThread.cxx @@ -30,10 +30,10 @@ #include "CrossFade.hxx" #include "PlayerControl.hxx" #include "OutputAll.hxx" +#include "tag.h" extern "C" { #include "event_pipe.h" -#include "tag.h" #include "idle.h" } diff --git a/src/PlaylistAny.cxx b/src/PlaylistAny.cxx index efa975a1f..f62634c96 100644 --- a/src/PlaylistAny.cxx +++ b/src/PlaylistAny.cxx @@ -20,11 +20,11 @@ #include "config.h" #include "PlaylistAny.hxx" #include "PlaylistMapper.hxx" +#include "input_stream.h" extern "C" { #include "playlist_list.h" #include "uri.h" -#include "input_stream.h" } #include <assert.h> diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index de12518d9..a048c02ce 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -28,12 +28,12 @@ #include "io_error.h" #include "Mapper.hxx" #include "TextFile.hxx" +#include "conf.h" extern "C" { #include "path.h" #include "uri.h" #include "idle.h" -#include "conf.h" } #include "glib_compat.h" diff --git a/src/PlaylistPrint.cxx b/src/PlaylistPrint.cxx index 7df7a9c39..e12fc8c8b 100644 --- a/src/PlaylistPrint.cxx +++ b/src/PlaylistPrint.cxx @@ -28,12 +28,12 @@ #include "DatabaseGlue.hxx" #include "DatabasePlugin.hxx" #include "Client.hxx" +#include "input_stream.h" extern "C" { #include "playlist_list.h" #include "playlist_plugin.h" #include "song.h" -#include "input_stream.h" } void diff --git a/src/PlaylistQueue.cxx b/src/PlaylistQueue.cxx index e75720315..da9f2c370 100644 --- a/src/PlaylistQueue.cxx +++ b/src/PlaylistQueue.cxx @@ -23,10 +23,10 @@ #include "PlaylistAny.hxx" #include "PlaylistSong.hxx" #include "Playlist.hxx" +#include "input_stream.h" extern "C" { #include "song.h" -#include "input_stream.h" } enum playlist_result diff --git a/src/PlaylistSong.cxx b/src/PlaylistSong.cxx index 4bfcc5969..cfd01b130 100644 --- a/src/PlaylistSong.cxx +++ b/src/PlaylistSong.cxx @@ -23,12 +23,12 @@ #include "DatabasePlugin.hxx" #include "DatabaseGlue.hxx" #include "ls.hxx" +#include "tag.h" extern "C" { #include "song.h" #include "uri.h" #include "path.h" -#include "tag.h" } #include <assert.h> diff --git a/src/PlaylistState.cxx b/src/PlaylistState.cxx index 7e93e7803..40f503e22 100644 --- a/src/PlaylistState.cxx +++ b/src/PlaylistState.cxx @@ -28,10 +28,7 @@ #include "QueueSave.hxx" #include "TextFile.hxx" #include "PlayerControl.hxx" - -extern "C" { #include "conf.h" -} #include <string.h> #include <stdlib.h> diff --git a/src/ReplayGainConfig.cxx b/src/ReplayGainConfig.cxx index d3af332ce..df07e43c5 100644 --- a/src/ReplayGainConfig.cxx +++ b/src/ReplayGainConfig.cxx @@ -18,13 +18,13 @@ */ #include "config.h" +#include "replay_gain_config.h" extern "C" { -#include "replay_gain_config.h" -#include "conf.h" #include "idle.h" } +#include "conf.h" #include "Playlist.hxx" #include "mpd_error.h" diff --git a/src/ReplayGainInfo.cxx b/src/ReplayGainInfo.cxx index 5e5e4ab4b..b9d1b82c6 100644 --- a/src/ReplayGainInfo.cxx +++ b/src/ReplayGainInfo.cxx @@ -18,10 +18,7 @@ */ #include "config.h" - -extern "C" { #include "replay_gain_info.h" -} float replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, float missing_preamp, bool peak_limit) diff --git a/src/Song.cxx b/src/Song.cxx index c845384ae..4c820c3f8 100644 --- a/src/Song.cxx +++ b/src/Song.cxx @@ -20,10 +20,7 @@ #include "config.h" #include "song.h" #include "Directory.hxx" - -extern "C" { #include "tag.h" -} #include <glib.h> diff --git a/src/SongFilter.cxx b/src/SongFilter.cxx index 6803b453e..6d6841675 100644 --- a/src/SongFilter.cxx +++ b/src/SongFilter.cxx @@ -21,10 +21,7 @@ #include "SongFilter.hxx" #include "path.h" #include "song.h" - -extern "C" { #include "tag.h" -} #include <glib.h> diff --git a/src/SongSave.cxx b/src/SongSave.cxx index a32b7fecc..2b74d9354 100644 --- a/src/SongSave.cxx +++ b/src/SongSave.cxx @@ -23,9 +23,9 @@ #include "TagSave.hxx" #include "Directory.hxx" #include "TextFile.hxx" +#include "tag.h" extern "C" { -#include "tag.h" #include "string_util.h" } diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index 2d22f27c4..b96c7c43e 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -26,15 +26,15 @@ extern "C" { #include "Directory.hxx" #include "Mapper.hxx" +#include "tag.h" +#include "input_stream.h" extern "C" { #include "decoder_list.h" #include "decoder_plugin.h" #include "tag_ape.h" #include "tag_id3.h" -#include "tag.h" #include "tag_handler.h" -#include "input_stream.h" } #include <glib.h> diff --git a/src/UpdateContainer.cxx b/src/UpdateContainer.cxx index 07bf0cee1..daa7f1ec4 100644 --- a/src/UpdateContainer.cxx +++ b/src/UpdateContainer.cxx @@ -28,7 +28,6 @@ #include "Mapper.hxx" extern "C" { -#include "tag.h" #include "tag_handler.h" } diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx index 30e2ca989..208e6290a 100644 --- a/src/UpdateWalk.cxx +++ b/src/UpdateWalk.cxx @@ -30,12 +30,12 @@ #include "PlaylistVector.hxx" #include "Mapper.hxx" #include "ExcludeList.hxx" +#include "conf.h" extern "C" { #include "uri.h" #include "path.h" #include "playlist_list.h" -#include "conf.h" } #include <glib.h> diff --git a/src/audio_format.h b/src/audio_format.h index d86ade5ee..f9b176bc1 100644 --- a/src/audio_format.h +++ b/src/audio_format.h @@ -220,6 +220,10 @@ static inline bool audio_format_equals(const struct audio_format *a, a->channels == b->channels; } +#ifdef __cplusplus +extern "C" { +#endif + void audio_format_mask_apply(struct audio_format *af, const struct audio_format *mask); @@ -305,4 +309,8 @@ const char * audio_format_to_string(const struct audio_format *af, struct audio_format_string *s); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/conf.h b/src/conf.h index 815c739b1..d20dc78bc 100644 --- a/src/conf.h +++ b/src/conf.h @@ -118,6 +118,8 @@ config_quark(void) return g_quark_from_static_string("config"); } +G_BEGIN_DECLS + void config_global_init(void); void config_global_finish(void); @@ -224,4 +226,6 @@ void config_add_block_param(struct config_param * param, const char *name, const char *value, int line); +G_END_DECLS + #endif diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx index e41ee8819..fcdbae9f0 100644 --- a/src/db/ProxyDatabasePlugin.cxx +++ b/src/db/ProxyDatabasePlugin.cxx @@ -24,12 +24,11 @@ #include "PlaylistVector.hxx" #include "Directory.hxx" #include "gcc.h" +#include "conf.h" extern "C" { #include "db_error.h" -#include "conf.h" #include "song.h" -#include "tag.h" } #undef MPD_DIRECTORY_H diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx index 84e4e7cee..8eea81e30 100644 --- a/src/db/SimpleDatabasePlugin.cxx +++ b/src/db/SimpleDatabasePlugin.cxx @@ -27,10 +27,7 @@ #include "DatabaseLock.hxx" #include "db_error.h" #include "TextFile.hxx" - -extern "C" { #include "conf.h" -} #include <sys/types.h> #include <sys/stat.h> diff --git a/src/decoder/AdPlugDecoderPlugin.cxx b/src/decoder/AdPlugDecoderPlugin.cxx index b3b7f1d73..6d08fab56 100644 --- a/src/decoder/AdPlugDecoderPlugin.cxx +++ b/src/decoder/AdPlugDecoderPlugin.cxx @@ -20,9 +20,9 @@ #include "config.h" #include "AdPlugDecoderPlugin.h" #include "tag_handler.h" +#include "decoder_api.h" extern "C" { -#include "decoder_api.h" #include "audio_check.h" } diff --git a/src/decoder/FLACCommon.hxx b/src/decoder/FLACCommon.hxx index e9b45976d..b80372bbf 100644 --- a/src/decoder/FLACCommon.hxx +++ b/src/decoder/FLACCommon.hxx @@ -25,9 +25,9 @@ #define MPD_FLAC_COMMON_HXX #include "FLACInput.hxx" +#include "decoder_api.h" extern "C" { -#include "decoder_api.h" #include "pcm_buffer.h" } diff --git a/src/decoder/FLACIOHandle.hxx b/src/decoder/FLACIOHandle.hxx index 193a15ef5..0c2c24770 100644 --- a/src/decoder/FLACIOHandle.hxx +++ b/src/decoder/FLACIOHandle.hxx @@ -21,10 +21,7 @@ #define MPD_FLAC_IO_HANDLE_HXX #include "gcc.h" - -extern "C" { #include "input_stream.h" -} #include <FLAC/callback.h> diff --git a/src/decoder/FLACInput.cxx b/src/decoder/FLACInput.cxx index 0383ac4ff..99f321cdd 100644 --- a/src/decoder/FLACInput.cxx +++ b/src/decoder/FLACInput.cxx @@ -19,12 +19,9 @@ #include "config.h" #include "FLACInput.hxx" +#include "decoder_api.h" #include "gcc.h" - -extern "C" { #include "input_stream.h" -#include "decoder_api.h" -} FLAC__StreamDecoderReadStatus FLACInput::Read(FLAC__byte buffer[], size_t *bytes) diff --git a/src/decoder/FLACMetaData.cxx b/src/decoder/FLACMetaData.cxx index 561c1591f..8273a230b 100644 --- a/src/decoder/FLACMetaData.cxx +++ b/src/decoder/FLACMetaData.cxx @@ -22,12 +22,12 @@ extern "C" { #include "XiphTags.h" -#include "replay_gain_info.h" -#include "tag.h" } +#include "tag.h" #include "tag_handler.h" #include "tag_table.h" +#include "replay_gain_info.h" #include <glib.h> diff --git a/src/decoder/OggUtil.cxx b/src/decoder/OggUtil.cxx index 99f73d48e..00dae2887 100644 --- a/src/decoder/OggUtil.cxx +++ b/src/decoder/OggUtil.cxx @@ -19,10 +19,7 @@ #include "config.h" #include "OggUtil.hxx" - -extern "C" { #include "decoder_api.h" -} bool OggFeed(ogg_sync_state &oy, struct decoder *decoder, diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx index 35e368ca9..c87e60a16 100644 --- a/src/decoder/OpusDecoderPlugin.cxx +++ b/src/decoder/OpusDecoderPlugin.cxx @@ -22,10 +22,10 @@ #include "OpusHead.hxx" #include "OpusTags.hxx" #include "OggUtil.hxx" +#include "decoder_api.h" extern "C" { #include "ogg_codec.h" -#include "decoder_api.h" } #include "audio_check.h" diff --git a/src/decoder/sidplay_decoder_plugin.cxx b/src/decoder/sidplay_decoder_plugin.cxx index de2e599e9..175d2ee7c 100644 --- a/src/decoder/sidplay_decoder_plugin.cxx +++ b/src/decoder/sidplay_decoder_plugin.cxx @@ -18,9 +18,9 @@ */ #include "config.h" +#include "../decoder_api.h" extern "C" { -#include "../decoder_api.h" #include "tag_handler.h" } diff --git a/src/decoder_api.h b/src/decoder_api.h index 76cf03920..3f84ca8bc 100644 --- a/src/decoder_api.h +++ b/src/decoder_api.h @@ -38,6 +38,10 @@ #include <stdbool.h> +#ifdef __cplusplus +extern "C" { +#endif + /** * Notify the player thread that it has finished initialization and * that it has read the song's meta data. @@ -168,4 +172,8 @@ void decoder_mixramp(struct decoder *decoder, char *mixramp_start, char *mixramp_end); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/input_stream.h b/src/input_stream.h index 10ad97161..3a29625af 100644 --- a/src/input_stream.h +++ b/src/input_stream.h @@ -88,6 +88,10 @@ struct input_stream { char *mime; }; +#ifdef __cplusplus +extern "C" { +#endif + /** * Opens a new input stream. You may not access it until the "ready" * flag is set. @@ -264,4 +268,8 @@ size_t input_stream_lock_read(struct input_stream *is, void *ptr, size_t size, GError **error_r); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/replay_gain_config.h b/src/replay_gain_config.h index 2bf4f32f2..4b59334c0 100644 --- a/src/replay_gain_config.h +++ b/src/replay_gain_config.h @@ -30,6 +30,10 @@ extern float replay_gain_preamp; extern float replay_gain_missing_preamp; extern bool replay_gain_limit; +#ifdef __cplusplus +extern "C" { +#endif + void replay_gain_global_init(void); /** @@ -52,4 +56,8 @@ replay_gain_set_mode_string(const char *p); enum replay_gain_mode replay_gain_get_real_mode(bool random_mode); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/replay_gain_info.h b/src/replay_gain_info.h index 9097c3e02..53e2451a3 100644 --- a/src/replay_gain_info.h +++ b/src/replay_gain_info.h @@ -61,6 +61,10 @@ replay_gain_tuple_defined(const struct replay_gain_tuple *tuple) return !isinf(tuple->gain); } +#ifdef __cplusplus +extern "C" { +#endif + float replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, float missing_preamp, bool peak_limit); @@ -71,4 +75,8 @@ replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, flo void replay_gain_info_complete(struct replay_gain_info *info); +#ifdef __cplusplus +} +#endif + #endif @@ -101,6 +101,10 @@ struct tag { unsigned num_items; }; +#ifdef __cplusplus +extern "C" { +#endif + /** * Parse the string, and convert it into a #tag_type. Returns * #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized. @@ -236,4 +240,8 @@ bool tag_has_type(const struct tag *tag, enum tag_type type); */ bool tag_equal(const struct tag *tag1, const struct tag *tag2); +#ifdef __cplusplus +} +#endif + #endif |