aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-29 17:28:32 +0100
committerMax Kellermann <max@duempel.org>2008-12-29 17:28:32 +0100
commit95b3430f5277cf36bc9acc989e301ae302747a98 (patch)
tree8080eae01aa2d58873fa3de47a1eae8543f024b4
parent041b8f697bb31ce443de0e6f9e4eee892f9e2ac8 (diff)
downloadmpd-95b3430f5277cf36bc9acc989e301ae302747a98.tar.gz
mpd-95b3430f5277cf36bc9acc989e301ae302747a98.tar.xz
mpd-95b3430f5277cf36bc9acc989e301ae302747a98.zip
removed os_compat.h
Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
Diffstat (limited to '')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/audio.c3
-rw-r--r--src/cmdline.c1
-rw-r--r--src/command.c4
-rw-r--r--src/compress.c4
-rw-r--r--src/conf.c3
-rw-r--r--src/database.c7
-rw-r--r--src/decoder/wavpack_plugin.c2
-rw-r--r--src/directory_save.c3
-rw-r--r--src/dirvec.c4
-rw-r--r--src/listen.c12
-rw-r--r--src/ls.c3
-rw-r--r--src/main.c9
-rw-r--r--src/mapper.c6
-rw-r--r--src/os_compat.h70
-rw-r--r--src/output_list.c1
-rw-r--r--src/path.c3
-rw-r--r--src/path.h3
-rw-r--r--src/permission.c4
-rw-r--r--src/player_control.c4
-rw-r--r--src/playlist.c7
-rw-r--r--src/signal_check.c5
-rw-r--r--src/song.c5
-rw-r--r--src/stats.c2
-rw-r--r--src/stored_playlist.c8
-rw-r--r--src/strset.c4
-rw-r--r--src/update.c7
-rw-r--r--src/volume.c10
-rw-r--r--src/zeroconf.c5
-rw-r--r--src/zeroconf.h2
30 files changed, 99 insertions, 103 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 58f1bf02d..9f6c8ea35 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,7 +46,6 @@ mpd_headers = \
main_notify.h \
normalize.h \
compress.h \
- os_compat.h \
pipe.h \
path.h \
mapper.h \
diff --git a/src/audio.c b/src/audio.c
index 1fba0ace0..89752e305 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -25,10 +25,11 @@
#include "client.h"
#include "idle.h"
#include "utils.h"
-#include "os_compat.h"
#include <glib.h>
+#include <assert.h>
+
#define AUDIO_DEVICE_STATE "audio_device_state:"
#define AUDIO_BUFFER_SIZE 2*MPD_PATH_MAX
diff --git a/src/cmdline.c b/src/cmdline.c
index feba99a3b..f1d3bcc7d 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -30,6 +30,7 @@
#include <glib.h>
#include <stdio.h>
+#include <stdlib.h>
#define SYSTEM_CONFIG_FILE_LOCATION "/etc/mpd.conf"
#define USER_CONFIG_FILE_LOCATION ".mpdconf"
diff --git a/src/command.c b/src/command.c
index 326a0499d..c9b2fcbd2 100644
--- a/src/command.c
+++ b/src/command.c
@@ -38,9 +38,11 @@
#include "client.h"
#include "tag_print.h"
#include "path.h"
-#include "os_compat.h"
#include "idle.h"
+#include <assert.h>
+#include <time.h>
+
#define COMMAND_STATUS_VOLUME "volume"
#define COMMAND_STATUS_STATE "state"
#define COMMAND_STATUS_REPEAT "repeat"
diff --git a/src/compress.c b/src/compress.c
index 3d8b913b4..b561cb045 100644
--- a/src/compress.c
+++ b/src/compress.c
@@ -20,10 +20,12 @@
*
*/
-#include "os_compat.h"
#include "compress.h"
#include "utils.h"
+#include <stdint.h>
+#include <string.h>
+
#ifdef USE_X
#include <X11/Xlib.h>
#include <X11/Xutil.h>
diff --git a/src/conf.c b/src/conf.c
index e11936db6..583980cc1 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -21,10 +21,11 @@
#include "buffer2array.h"
#include "list.h"
#include "path.h"
-#include "os_compat.h"
#include <glib.h>
+#include <string.h>
+
#define MAX_STRING_SIZE MPD_PATH_MAX+80
#define CONF_COMMENT '#'
diff --git a/src/database.c b/src/database.c
index a90c22a98..ebfc9091a 100644
--- a/src/database.c
+++ b/src/database.c
@@ -30,10 +30,15 @@
#include "dbUtils.h"
#include "update.h"
#include "main_notify.h"
+#include "config.h"
+#include <glib.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <assert.h>
#include <string.h>
-#include <glib.h>
static struct directory *music_root;
diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c
index 70a02f284..b96de361e 100644
--- a/src/decoder/wavpack_plugin.c
+++ b/src/decoder/wavpack_plugin.c
@@ -24,6 +24,8 @@
#include <wavpack/wavpack.h>
#include <glib.h>
+
+#include <assert.h>
#include <unistd.h>
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
diff --git a/src/directory_save.c b/src/directory_save.c
index 289f6df3b..748b3addd 100644
--- a/src/directory_save.c
+++ b/src/directory_save.c
@@ -26,6 +26,9 @@
#include <glib.h>
+#include <assert.h>
+#include <string.h>
+
/* TODO error checking */
int
directory_save(FILE *fp, struct directory *directory)
diff --git a/src/dirvec.c b/src/dirvec.c
index cf65fe659..6e921a75b 100644
--- a/src/dirvec.c
+++ b/src/dirvec.c
@@ -3,9 +3,11 @@
#include "utils.h"
#include "path.h"
-#include <string.h>
#include <glib.h>
+#include <assert.h>
+#include <string.h>
+
static GMutex *nr_lock = NULL;
static size_t dv_size(const struct dirvec *dv)
diff --git a/src/listen.c b/src/listen.c
index 5a2b8d3da..c0c514f2d 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -21,9 +21,15 @@
#include "conf.h"
#include "log.h"
#include "utils.h"
-#include "os_compat.h"
-
-#include "../config.h"
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <netinet/in.h>
+#include <sys/un.h>
+#include <netdb.h>
#define MAXHOSTNAME 1024
diff --git a/src/ls.c b/src/ls.c
index 22b2fc9fc..30eb3fd70 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -23,7 +23,8 @@
#include "log.h"
#include "list.h"
#include "stored_playlist.h"
-#include "os_compat.h"
+
+#include <string.h>
static const char *remoteUrlPrefixes[] = {
#ifdef HAVE_CURL
diff --git a/src/main.c b/src/main.c
index babb17c25..0f8ff30e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,7 +49,6 @@
#include "normalize.h"
#include "zeroconf.h"
#include "main_notify.h"
-#include "os_compat.h"
#include "dirvec.h"
#include "songvec.h"
#include "tag_pool.h"
@@ -60,6 +59,14 @@
#include <glib.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <errno.h>
+#include <string.h>
+#include <pwd.h>
+#include <grp.h>
+
#ifdef HAVE_LOCALE
#include <locale.h>
#endif
diff --git a/src/mapper.c b/src/mapper.c
index b3f86da00..e9364f878 100644
--- a/src/mapper.c
+++ b/src/mapper.c
@@ -26,10 +26,14 @@
#include "path.h"
#include "conf.h"
+#include <glib.h>
+
+#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <glib.h>
+#include <string.h>
+#include <errno.h>
static char *music_dir;
static size_t music_dir_length;
diff --git a/src/os_compat.h b/src/os_compat.h
deleted file mode 100644
index 0a9673bc0..000000000
--- a/src/os_compat.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* the Music Player Daemon (MPD)
- * Copyright (C) 2003-2007 by Warren Dukes (warren.dukes@gmail.com)
- * This project's homepage is: 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef MPD_OS_COMPAT_H
-#define MPD_OS_COMPAT_H
-
-#include "../config.h"
-
-/*
- * This includes OS-wide headers that can be expected to be available
- * on any machine that mpd can be compiled on for any UNIX-like OS.
- *
- * This does not include headers for optional dependencies such as
- * those for:
- * 1) input/output plugins
- * 2) optional features in core (libsamplerate, avahi, ...)
- */
-
-#include <fcntl.h>
-
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <dirent.h>
-#include <math.h>
-#include <sys/select.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <pwd.h>
-#include <grp.h>
-#include <limits.h>
-#include <stddef.h> /* needed? this defines NULL + offsetof() */
-#include <resolv.h>
-
-#ifdef HAVE_UN
-#include <sys/un.h>
-#endif
-
-#endif /* OS_COMPAT_H */
diff --git a/src/output_list.c b/src/output_list.c
index 7068703f0..c1af80917 100644
--- a/src/output_list.c
+++ b/src/output_list.c
@@ -18,7 +18,6 @@
#include "output_list.h"
#include "output_api.h"
-#include "os_compat.h"
extern const struct audio_output_plugin shoutPlugin;
extern const struct audio_output_plugin nullPlugin;
diff --git a/src/path.c b/src/path.c
index 3baa96bb2..1d1c3314d 100644
--- a/src/path.c
+++ b/src/path.c
@@ -21,10 +21,11 @@
#include "conf.h"
#include "utils.h"
#include "playlist.h"
-#include "os_compat.h"
#include <glib.h>
+#include <string.h>
+
static char *fs_charset;
char *fs_charset_to_utf8(char *dst, const char *str)
diff --git a/src/path.h b/src/path.h
index 16ddb9ed4..e99c02f05 100644
--- a/src/path.h
+++ b/src/path.h
@@ -19,7 +19,8 @@
#ifndef MPD_PATH_H
#define MPD_PATH_H
-#include "os_compat.h"
+#include <limits.h>
+#include <stddef.h>
#if !defined(MPD_PATH_MAX)
# if defined(MAXPATHLEN)
diff --git a/src/permission.c b/src/permission.c
index 15e2382b5..e65561ec5 100644
--- a/src/permission.c
+++ b/src/permission.c
@@ -17,14 +17,14 @@
*/
#include "permission.h"
-
#include "conf.h"
#include "log.h"
#include "utils.h"
-#include "os_compat.h"
#include <glib.h>
+
#include <stdbool.h>
+#include <string.h>
#define PERMISSION_PASSWORD_CHAR "@"
#define PERMISSION_SEPERATOR ","
diff --git a/src/player_control.c b/src/player_control.c
index b8e9499f6..049207ae7 100644
--- a/src/player_control.c
+++ b/src/player_control.c
@@ -23,9 +23,11 @@
#include "song.h"
#include "idle.h"
#include "pcm_utils.h"
-#include "os_compat.h"
#include "main_notify.h"
+#include <assert.h>
+#include <stdio.h>
+
struct player_control pc;
void pc_init(unsigned int buffered_before_play)
diff --git a/src/playlist.c b/src/playlist.c
index 18068b77c..64bd4270a 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -36,10 +36,15 @@
#include "ack.h"
#include "idle.h"
#include "list.h"
-#include "os_compat.h"
#include <glib.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdlib.h>
+
#define PLAYLIST_STATE_STOP 0
#define PLAYLIST_STATE_PLAY 1
diff --git a/src/signal_check.c b/src/signal_check.c
index 5cf16e987..e759759e2 100644
--- a/src/signal_check.c
+++ b/src/signal_check.c
@@ -18,7 +18,10 @@
*/
#include "signal_check.h"
-#include "os_compat.h"
+
+#include <signal.h>
+#include <stddef.h>
+#include <errno.h>
static volatile sig_atomic_t caught_signals[NSIG];
diff --git a/src/song.c b/src/song.c
index 56ece8eaf..b7a8d2f8a 100644
--- a/src/song.c
+++ b/src/song.c
@@ -27,6 +27,11 @@
#include "decoder_list.h"
#include "decoder_api.h"
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
static struct song *
song_alloc(const char *url, struct directory *parent)
{
diff --git a/src/stats.c b/src/stats.c
index fe842a789..53c785614 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -18,14 +18,12 @@
*/
#include "stats.h"
-
#include "database.h"
#include "tag.h"
#include "song.h"
#include "client.h"
#include "player_control.h"
#include "strset.h"
-#include "os_compat.h"
Stats stats;
diff --git a/src/stored_playlist.c b/src/stored_playlist.c
index 034dfccb6..545ecc158 100644
--- a/src/stored_playlist.c
+++ b/src/stored_playlist.c
@@ -25,7 +25,13 @@
#include "ls.h"
#include "database.h"
#include "idle.h"
-#include "os_compat.h"
+
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <string.h>
static struct stored_playlist_info *
load_playlist_info(const char *parent_path_fs, const char *name_fs)
diff --git a/src/strset.c b/src/strset.c
index eee5b2901..8462736df 100644
--- a/src/strset.c
+++ b/src/strset.c
@@ -18,7 +18,9 @@
#include "strset.h"
#include "utils.h"
-#include "os_compat.h"
+
+#include <assert.h>
+#include <string.h>
#define NUM_SLOTS 16384
diff --git a/src/update.c b/src/update.c
index 776fa050b..e0c418fed 100644
--- a/src/update.c
+++ b/src/update.c
@@ -35,6 +35,13 @@
#include <glib.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <string.h>
+
static enum update_progress {
UPDATE_PROGRESS_IDLE = 0,
UPDATE_PROGRESS_RUNNING = 1,
diff --git a/src/volume.c b/src/volume.c
index 2603aeede..9c7114e16 100644
--- a/src/volume.c
+++ b/src/volume.c
@@ -15,21 +15,23 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "volume.h"
+#include "volume.h"
#include "conf.h"
#include "log.h"
#include "player_control.h"
#include "utils.h"
#include "idle.h"
#include "pcm_utils.h"
-#include "os_compat.h"
-
-#include "../config.h"
+#include "config.h"
#include <glib.h>
+#include <math.h>
+#include <string.h>
+
#ifdef HAVE_OSS
+#include <sys/ioctl.h>
#include <sys/soundcard.h>
#endif
#ifdef HAVE_ALSA
diff --git a/src/zeroconf.c b/src/zeroconf.c
index 74351256c..d4757418a 100644
--- a/src/zeroconf.c
+++ b/src/zeroconf.c
@@ -16,10 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "../config.h"
-
#include "zeroconf.h"
-#include "os_compat.h"
#include "conf.h"
#include "log.h"
#include "listen.h"
@@ -28,6 +25,8 @@
#include <glib.h>
+#include <string.h>
+
/* The dns-sd service type qualifier to publish */
#define SERVICE_TYPE "_mpd._tcp"
diff --git a/src/zeroconf.h b/src/zeroconf.h
index a18c23f8c..4ebe9e22a 100644
--- a/src/zeroconf.h
+++ b/src/zeroconf.h
@@ -19,7 +19,7 @@
#ifndef MPD_ZEROCONF_H
#define MPD_ZEROCONF_H
-#include "../config.h"
+#include "config.h"
#ifdef HAVE_ZEROCONF