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.
This commit is contained in:
Max Kellermann 2008-12-29 17:28:32 +01:00
parent 041b8f697b
commit 95b3430f52
30 changed files with 98 additions and 102 deletions

View File

@ -46,7 +46,6 @@ mpd_headers = \
main_notify.h \
normalize.h \
compress.h \
os_compat.h \
pipe.h \
path.h \
mapper.h \

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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>

View File

@ -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 '#'

View File

@ -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;

View File

@ -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 */

View File

@ -26,6 +26,9 @@
#include <glib.h>
#include <assert.h>
#include <string.h>
/* TODO error checking */
int
directory_save(FILE *fp, struct directory *directory)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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 ","

View File

@ -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)

View File

@ -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

View File

@ -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];

View File

@ -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)
{

View File

@ -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;

View File

@ -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)

View File

@ -18,7 +18,9 @@
#include "strset.h"
#include "utils.h"
#include "os_compat.h"
#include <assert.h>
#include <string.h>
#define NUM_SLOTS 16384

View File

@ -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,

View File

@ -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

View File

@ -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"

View File

@ -19,7 +19,7 @@
#ifndef MPD_ZEROCONF_H
#define MPD_ZEROCONF_H
#include "../config.h"
#include "config.h"
#ifdef HAVE_ZEROCONF