From ec883e1901cb14c1719345b47e8e2ba4a0f925b4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 2 Oct 2013 12:14:07 +0200 Subject: Stats: rename stats.h to Stats.hxx --- src/DatabaseGlue.cxx | 7 ++----- src/Main.cxx | 5 +---- src/OtherCommands.cxx | 6 +----- src/Stats.cxx | 6 +----- src/Stats.hxx | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/UpdateGlue.cxx | 6 +----- src/stats.h | 55 --------------------------------------------------- 7 files changed, 61 insertions(+), 79 deletions(-) create mode 100644 src/Stats.hxx delete mode 100644 src/stats.h (limited to 'src') diff --git a/src/DatabaseGlue.cxx b/src/DatabaseGlue.cxx index 10d936eac..d47108f71 100644 --- a/src/DatabaseGlue.cxx +++ b/src/DatabaseGlue.cxx @@ -26,11 +26,7 @@ #include "Directory.hxx" #include "util/Error.hxx" #include "ConfigData.hxx" - -extern "C" { -#include "stats.h" -} - +#include "Stats.hxx" #include "DatabasePlugin.hxx" #include "db/SimpleDatabasePlugin.hxx" @@ -43,6 +39,7 @@ extern "C" { #include #include + static Database *db; static bool db_is_open; static bool is_simple; diff --git a/src/Main.cxx b/src/Main.cxx index 360204155..6857970cf 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -62,10 +62,7 @@ #include "ConfigData.hxx" #include "ConfigDefaults.hxx" #include "ConfigOption.hxx" - -extern "C" { -#include "stats.h" -} +#include "Stats.hxx" #ifdef ENABLE_INOTIFY #include "InotifyUpdate.hxx" diff --git a/src/OtherCommands.cxx b/src/OtherCommands.cxx index 04ccf6d54..e22c8d093 100644 --- a/src/OtherCommands.cxx +++ b/src/OtherCommands.cxx @@ -36,11 +36,7 @@ #include "util/UriUtil.hxx" #include "util/Error.hxx" #include "fs/Path.hxx" - -extern "C" { -#include "stats.h" -} - +#include "Stats.hxx" #include "Permission.hxx" #include "PlaylistFile.hxx" #include "ClientFile.hxx" diff --git a/src/Stats.cxx b/src/Stats.cxx index de7091ddc..6de3714fb 100644 --- a/src/Stats.cxx +++ b/src/Stats.cxx @@ -18,11 +18,7 @@ */ #include "config.h" - -extern "C" { -#include "stats.h" -} - +#include "Stats.hxx" #include "PlayerControl.hxx" #include "ClientInternal.hxx" #include "DatabaseSelection.hxx" diff --git a/src/Stats.hxx b/src/Stats.hxx new file mode 100644 index 000000000..384179242 --- /dev/null +++ b/src/Stats.hxx @@ -0,0 +1,55 @@ +/* + * 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 + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPD_STATS_HXX +#define MPD_STATS_HXX + +#include + +class Client; + +struct stats { + GTimer *timer; + + /** number of song files in the music directory */ + unsigned song_count; + + /** sum of all song durations in the music directory (in + seconds) */ + unsigned long song_duration; + + /** number of distinct artist names in the music directory */ + unsigned artist_count; + + /** number of distinct album names in the music directory */ + unsigned album_count; +}; + +extern struct stats stats; + +void stats_global_init(void); + +void stats_global_finish(void); + +void stats_update(void); + +void +stats_print(Client *client); + +#endif diff --git a/src/UpdateGlue.cxx b/src/UpdateGlue.cxx index a4a47d468..50af6271d 100644 --- a/src/UpdateGlue.cxx +++ b/src/UpdateGlue.cxx @@ -29,11 +29,7 @@ #include "GlobalEvents.hxx" #include "util/Error.hxx" #include "Log.hxx" - -extern "C" { -#include "stats.h" -} - +#include "Stats.hxx" #include "Main.hxx" #include "Instance.hxx" #include "system/FatalError.hxx" diff --git a/src/stats.h b/src/stats.h deleted file mode 100644 index eb723bcf3..000000000 --- a/src/stats.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2003-2011 The Music Player Daemon Project - * http://www.musicpd.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPD_STATS_H -#define MPD_STATS_H - -#include - -class Client; - -struct stats { - GTimer *timer; - - /** number of song files in the music directory */ - unsigned song_count; - - /** sum of all song durations in the music directory (in - seconds) */ - unsigned long song_duration; - - /** number of distinct artist names in the music directory */ - unsigned artist_count; - - /** number of distinct album names in the music directory */ - unsigned album_count; -}; - -extern struct stats stats; - -void stats_global_init(void); - -void stats_global_finish(void); - -void stats_update(void); - -void -stats_print(Client *client); - -#endif -- cgit v1.2.3