diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 10:49:29 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-08 10:49:29 +0200 |
commit | 71351160b1b6fd4203f27f9159ae39a476483e1a (patch) | |
tree | 03d42cd94df49372c3ac05034eb6e1e0f91d3077 /src | |
parent | ca68b1c80a29cb4862c6b732b339a5cbcfcecf51 (diff) | |
download | mpd-71351160b1b6fd4203f27f9159ae39a476483e1a.tar.gz mpd-71351160b1b6fd4203f27f9159ae39a476483e1a.tar.xz mpd-71351160b1b6fd4203f27f9159ae39a476483e1a.zip |
don't include os_compat.h
When there are standardized headers, use these instead of the bloated
os_compat.h.
Diffstat (limited to 'src')
62 files changed, 143 insertions, 38 deletions
diff --git a/src/audio.h b/src/audio.h index 3ffa2dc55..f5e89d245 100644 --- a/src/audio.h +++ b/src/audio.h @@ -19,7 +19,7 @@ #ifndef AUDIO_H #define AUDIO_H -#include "os_compat.h" +#include <stdio.h> #define AUDIO_AO_DRIVER_DEFAULT "default" diff --git a/src/audioOutput.h b/src/audioOutput.h index cdb3c73eb..cb4c11733 100644 --- a/src/audioOutput.h +++ b/src/audioOutput.h @@ -19,7 +19,7 @@ #ifndef AUDIO_OUTPUT_H #define AUDIO_OUTPUT_H -#include "os_compat.h" +#include <stdio.h> void printAllOutputPluginTypes(FILE * fp); diff --git a/src/audioOutputs/audioOutput_fifo.c b/src/audioOutputs/audioOutput_fifo.c index 62257f6cb..d7eb91ff6 100644 --- a/src/audioOutputs/audioOutput_fifo.c +++ b/src/audioOutputs/audioOutput_fifo.c @@ -24,6 +24,10 @@ #include "../utils.h" #include "../timer.h" +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + #define FIFO_BUFFER_SIZE 65536 /* pipe capacity on Linux >= 2.6.11 */ typedef struct _FifoData { diff --git a/src/audioOutputs/audioOutput_jack.c b/src/audioOutputs/audioOutput_jack.c index a0e39506c..f26dfcf7a 100644 --- a/src/audioOutputs/audioOutput_jack.c +++ b/src/audioOutputs/audioOutput_jack.c @@ -22,6 +22,8 @@ #include "../utils.h" #include "../log.h" +#include <assert.h> + #include <jack/jack.h> #include <jack/types.h> #include <jack/ringbuffer.h> diff --git a/src/audioOutputs/audioOutput_oss.c b/src/audioOutputs/audioOutput_oss.c index 39763edcb..487e9a75d 100644 --- a/src/audioOutputs/audioOutput_oss.c +++ b/src/audioOutputs/audioOutput_oss.c @@ -26,6 +26,10 @@ #include "../utils.h" #include "../log.h" +#include <sys/stat.h> +#include <sys/ioctl.h> +#include <fcntl.h> + #if defined(__OpenBSD__) || defined(__NetBSD__) # include <soundcard.h> #else /* !(defined(__OpenBSD__) || defined(__NetBSD__) */ diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c index 6b59044d8..181091d59 100644 --- a/src/audioOutputs/audioOutput_shout.c +++ b/src/audioOutputs/audioOutput_shout.c @@ -22,6 +22,8 @@ #include "../utils.h" +#include <assert.h> + #define CONN_ATTEMPT_INTERVAL 60 #define DEFAULT_CONN_TIMEOUT 2 diff --git a/src/client.c b/src/client.c index 052fdb6a8..e8f93b556 100644 --- a/src/client.c +++ b/src/client.c @@ -25,12 +25,18 @@ #include "sllist.h" #include "utils.h" #include "ioops.h" -#include "os_compat.h" #include "main_notify.h" #include "dlist.h" #include "../config.h" +#include <assert.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <unistd.h> +#include <string.h> + #define GREETING "OK MPD " PROTOCOL_VERSION "\n" #define CLIENT_MAX_BUFFER_LENGTH (40960) diff --git a/src/client.h b/src/client.h index 9fc6b3b76..0d9f2e76a 100644 --- a/src/client.h +++ b/src/client.h @@ -19,9 +19,12 @@ #ifndef INTERFACE_H #define INTERFACE_H -#include "os_compat.h" #include "gcc.h" +#include <stddef.h> +#include <stdarg.h> +#include <sys/socket.h> + struct client; void client_manager_init(void); diff --git a/src/command.h b/src/command.h index 13ec7df63..57b83fa5f 100644 --- a/src/command.h +++ b/src/command.h @@ -20,7 +20,6 @@ #define COMMAND_H #include "gcc.h" -#include "os_compat.h" #include "sllist.h" #define COMMAND_RETURN_KILL 10 diff --git a/src/condition.c b/src/condition.c index e71dcdd88..c1fe8ed18 100644 --- a/src/condition.c +++ b/src/condition.c @@ -21,6 +21,9 @@ #include "utils.h" #include "log.h" +#include <sys/time.h> +#include <string.h> + void cond_init(struct condition *cond) { xpthread_mutex_init(&cond->mutex, NULL); diff --git a/src/condition.h b/src/condition.h index 576ff9dc3..2909f698d 100644 --- a/src/condition.h +++ b/src/condition.h @@ -20,7 +20,7 @@ #ifndef CONDITION_H #define CONDITION_H -#include "os_compat.h" +#include <pthread.h> struct condition { pthread_mutex_t mutex; diff --git a/src/crossfade.c b/src/crossfade.c index c4a26fa6b..cb780db3b 100644 --- a/src/crossfade.c +++ b/src/crossfade.c @@ -21,6 +21,9 @@ #include "audio.h" #include "pcm_utils.h" +#include <assert.h> +#include <string.h> + unsigned cross_fade_calc(float duration, float total_time, const struct audio_format *af, unsigned max_chunks) diff --git a/src/decoder_api.c b/src/decoder_api.c index fdce30c20..8c2d64da1 100644 --- a/src/decoder_api.c +++ b/src/decoder_api.c @@ -29,6 +29,8 @@ #include "outputBuffer.h" #include "gcc.h" +#include <assert.h> + void decoder_plugin_register(struct decoder_plugin *plugin) { decoder_plugin_load(plugin); diff --git a/src/decoder_control.c b/src/decoder_control.c index 82c8672c8..1b9b3029d 100644 --- a/src/decoder_control.c +++ b/src/decoder_control.c @@ -18,6 +18,8 @@ #include "decoder_control.h" +#include <assert.h> + struct decoder_control dc; void dc_init(void) diff --git a/src/decoder_list.h b/src/decoder_list.h index dc7c7c590..b17e5caab 100644 --- a/src/decoder_list.h +++ b/src/decoder_list.h @@ -19,7 +19,7 @@ #ifndef INPUT_PLUGIN_H #define INPUT_PLUGIN_H -#include "os_compat.h" +#include <stdio.h> struct decoder_plugin; diff --git a/src/directory.h b/src/directory.h index c9601b91a..c1ff1828b 100644 --- a/src/directory.h +++ b/src/directory.h @@ -23,6 +23,7 @@ #include "list.h" #include <stdbool.h> +#include <sys/stat.h> struct client; diff --git a/src/dirvec.c b/src/dirvec.c index 9226fca74..589e8d0fe 100644 --- a/src/dirvec.c +++ b/src/dirvec.c @@ -1,8 +1,9 @@ #include "dirvec.h" #include "directory.h" -#include "os_compat.h" #include "utils.h" +#include <string.h> + static size_t dv_size(struct dirvec *dv) { return dv->nr * sizeof(struct directory *); diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c index faa1e0473..a96623e1b 100644 --- a/src/inputPlugins/aac_plugin.c +++ b/src/inputPlugins/aac_plugin.c @@ -25,6 +25,7 @@ #include "../utils.h" #include "../log.h" +#include <assert.h> #include <faad.h> /* all code here is either based on or copied from FAAD2's frontend code */ diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c index 4335be03d..421cdf354 100644 --- a/src/inputPlugins/audiofile_plugin.c +++ b/src/inputPlugins/audiofile_plugin.c @@ -24,6 +24,7 @@ #include "../log.h" +#include <sys/stat.h> #include <audiofile.h> /* pick 1020 since its devisible for 8,16,24, and 32-bit audio */ diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c index 5058ebd98..0b4fbf27e 100644 --- a/src/inputPlugins/flac_plugin.c +++ b/src/inputPlugins/flac_plugin.c @@ -23,6 +23,8 @@ #include "../utils.h" #include "../log.h" +#include <assert.h> + /* this code was based on flac123, from flac-tools */ static flac_read_status flacRead(mpd_unused const flac_decoder * flacDec, diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c index c4a3c2d22..1a4c495d6 100644 --- a/src/inputPlugins/mp4_plugin.c +++ b/src/inputPlugins/mp4_plugin.c @@ -25,6 +25,7 @@ #include "../mp4ff/mp4ff.h" +#include <limits.h> #include <faad.h> /* all code here is either based on or copied from FAAD2's frontend code */ diff --git a/src/inputStream.c b/src/inputStream.c index 7686fed48..3ea62fb0a 100644 --- a/src/inputStream.c +++ b/src/inputStream.c @@ -21,7 +21,7 @@ #include "inputStream_file.h" #include "inputStream_http.h" -#include "os_compat.h" +#include <stdlib.h> void initInputStream(void) { diff --git a/src/inputStream.h b/src/inputStream.h index 2e32c2a13..08a72b3d6 100644 --- a/src/inputStream.h +++ b/src/inputStream.h @@ -19,7 +19,7 @@ #ifndef INPUT_STREAM_H #define INPUT_STREAM_H -#include "os_compat.h" +#include <stddef.h> typedef struct _InputStream InputStream; diff --git a/src/inputStream_http_auth.h b/src/inputStream_http_auth.h index 2caf3a09d..6aed1f36e 100644 --- a/src/inputStream_http_auth.h +++ b/src/inputStream_http_auth.h @@ -20,9 +20,10 @@ #ifndef INPUT_STREAM_HTTP_AUTH_H #define INPUT_STREAM_HTTP_AUTH_H -#include "os_compat.h" #include "utils.h" +#include <string.h> + /* base64 code taken from xmms */ #define BASE64_LENGTH(len) (4 * (((len) + 2) / 3)) diff --git a/src/ioops.c b/src/ioops.c index 725d2ea92..8c3ff9fba 100644 --- a/src/ioops.c +++ b/src/ioops.c @@ -18,6 +18,9 @@ #include "ioops.h" +#include <assert.h> +#include <stddef.h> + /* Eventually the listener protocol will use this, too */ /* diff --git a/src/ioops.h b/src/ioops.h index 0df30646b..1187ceb50 100644 --- a/src/ioops.h +++ b/src/ioops.h @@ -19,8 +19,7 @@ #ifndef IOOPS_H #define IOOPS_H -#include "../config.h" -#include "os_compat.h" +#include <sys/select.h> struct ioOps { struct ioOps *prev, *next; diff --git a/src/list.c b/src/list.c index 01da7bdab..e6c91c0c2 100644 --- a/src/list.c +++ b/src/list.c @@ -19,6 +19,9 @@ #include "list.h" #include "utils.h" +#include <assert.h> +#include <string.h> + static void makeListNodesArray(List * list) { ListNode *node = list->firstNode; diff --git a/src/list.h b/src/list.h index 014ebf7c1..de2bdc931 100644 --- a/src/list.h +++ b/src/list.h @@ -19,8 +19,6 @@ #ifndef LIST_H #define LIST_H -#include "os_compat.h" - /* used to make a list where free() will be used to free data in list */ #define DEFAULT_FREE_DATA_FUNC free diff --git a/src/listen.h b/src/listen.h index f459cc53c..73f248bb3 100644 --- a/src/listen.h +++ b/src/listen.h @@ -19,7 +19,7 @@ #ifndef LISTEN_H #define LISTEN_H -#include "os_compat.h" +#include <sys/select.h> extern int boundPort; @@ -20,7 +20,13 @@ #include "conf.h" #include "utils.h" -#include "os_compat.h" + +#include <assert.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <string.h> +#include <stdarg.h> +#include <fcntl.h> #define LOG_DATE_BUF_SIZE 16 #define LOG_DATE_LEN (LOG_DATE_BUF_SIZE - 1) @@ -21,6 +21,9 @@ #include "decoder_list.h" +#include <sys/time.h> + +struct stat; struct client; int lsPlaylists(struct client *client, const char *utf8path); diff --git a/src/main_notify.c b/src/main_notify.c index 8924d1921..e86c911dc 100644 --- a/src/main_notify.c +++ b/src/main_notify.c @@ -25,6 +25,9 @@ #include "gcc.h" #include "log.h" +#include <assert.h> +#include <string.h> + static struct ioOps main_notify_IO; static int main_pipe[2]; pthread_t main_task; diff --git a/src/notify.h b/src/notify.h index d2a7df027..91140d356 100644 --- a/src/notify.h +++ b/src/notify.h @@ -19,7 +19,7 @@ #ifndef NOTIFY_H #define NOTIFY_H -#include "os_compat.h" +#include <pthread.h> struct notify { pthread_mutex_t mutex; diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 14ec6804e..d89dcb308 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -20,6 +20,9 @@ #include "notify.h" #include "utils.h" +#include <assert.h> +#include <string.h> + struct output_buffer ob; void diff --git a/src/output_api.c b/src/output_api.c index e9216a2ef..3d3230376 100644 --- a/src/output_api.c +++ b/src/output_api.c @@ -19,6 +19,8 @@ #include "output_api.h" #include "output_internal.h" +#include <assert.h> + const char *audio_output_get_name(const struct audio_output *ao) { return ao->name; diff --git a/src/output_api.h b/src/output_api.h index 1cad66e60..11d4620f6 100644 --- a/src/output_api.h +++ b/src/output_api.h @@ -25,7 +25,6 @@ #include "tag.h" #include "conf.h" #include "log.h" -#include "os_compat.h" #include <stdbool.h> diff --git a/src/output_control.c b/src/output_control.c index 4724aeeea..15b4eb19c 100644 --- a/src/output_control.c +++ b/src/output_control.c @@ -23,6 +23,8 @@ #include "pcm_utils.h" #include <pthread.h> +#include <assert.h> +#include <stdlib.h> struct notify audio_output_client_notify = NOTIFY_INITIALIZER; diff --git a/src/output_control.h b/src/output_control.h index 7a31bb68f..275e58aa9 100644 --- a/src/output_control.h +++ b/src/output_control.h @@ -20,7 +20,8 @@ #define OUTPUT_CONTROL_H #include "conf.h" -#include "os_compat.h" + +#include <stddef.h> struct audio_output; struct audio_output_plugin; diff --git a/src/output_thread.c b/src/output_thread.c index c2f4f6d3c..565708299 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -21,6 +21,8 @@ #include "output_internal.h" #include "utils.h" +#include <assert.h> + static void ao_command_finished(struct audio_output *ao) { assert(ao->command != AO_COMMAND_NONE); diff --git a/src/pcm_utils.c b/src/pcm_utils.c index 6c0da8817..17449f7d2 100644 --- a/src/pcm_utils.c +++ b/src/pcm_utils.c @@ -21,7 +21,10 @@ #include "utils.h" #include "conf.h" #include "audio_format.h" -#include "os_compat.h" + +#include <assert.h> +#include <string.h> +#include <math.h> static inline int pcm_dither(void) diff --git a/src/player_control.h b/src/player_control.h index 46b03a9ac..372c445db 100644 --- a/src/player_control.h +++ b/src/player_control.h @@ -20,7 +20,8 @@ #define PLAYER_H #include "notify.h" -#include "os_compat.h" + +#include <stdint.h> enum player_state { PLAYER_STATE_STOP = 0, diff --git a/src/ringbuf.c b/src/ringbuf.c index 20a09b326..e99f26fc6 100644 --- a/src/ringbuf.c +++ b/src/ringbuf.c @@ -25,6 +25,8 @@ #include "ringbuf.h" #include "utils.h" +#include <string.h> + #define advance_ptr(ptr,cnt,mask) ptr = (ptr + cnt) & mask /* diff --git a/src/ringbuf.h b/src/ringbuf.h index f666f0bbe..ebcd2d8ef 100644 --- a/src/ringbuf.h +++ b/src/ringbuf.h @@ -22,7 +22,8 @@ #ifndef RINGBUF_H #define RINGBUF_H -#include "os_compat.h" +#include <stddef.h> +#include <sys/uio.h> /** @file ringbuf.h * diff --git a/src/sig_handlers.c b/src/sig_handlers.c index 854188c51..57b216e8a 100644 --- a/src/sig_handlers.c +++ b/src/sig_handlers.c @@ -25,6 +25,10 @@ #include "signal_check.h" #include "log.h" +#include <sys/signal.h> +#include <sys/wait.h> +#include <errno.h> + int handlePendingSignals(void) { if (signal_is_pending(SIGINT) || signal_is_pending(SIGTERM)) { diff --git a/src/sllist.c b/src/sllist.c index 0f4529fd3..b5239dc2a 100644 --- a/src/sllist.c +++ b/src/sllist.c @@ -21,6 +21,8 @@ #include "sllist.h" #include "utils.h" +#include <string.h> + static void init_strnode(struct strnode *x, char *s) { x->data = s; diff --git a/src/sllist.h b/src/sllist.h index e8cb8805d..5f9704a6a 100644 --- a/src/sllist.h +++ b/src/sllist.h @@ -21,7 +21,7 @@ #ifndef SLLIST_H #define SLLIST_H -#include "os_compat.h" +#include <stddef.h> /* just free the entire structure if it's free-able, the 'data' member * should _NEVER_ be explicitly freed diff --git a/src/song.c b/src/song.c index c09a49cf0..3219e7c48 100644 --- a/src/song.c +++ b/src/song.c @@ -26,8 +26,6 @@ #include "decoder_list.h" #include "decoder_api.h" -#include "os_compat.h" - struct song * song_alloc(const char *url, struct directory *parent) { diff --git a/src/song.h b/src/song.h index 72262eeec..142ea52f4 100644 --- a/src/song.h +++ b/src/song.h @@ -19,7 +19,7 @@ #ifndef SONG_H #define SONG_H -#include "os_compat.h" +#include <sys/time.h> #define SONG_BEGIN "songList begin" #define SONG_END "songList end" @@ -31,7 +31,7 @@ struct song { struct tag *tag; struct directory *parentDir; time_t mtime; - char url[sizeof(size_t)]; + char url[sizeof(int)]; }; struct song * diff --git a/src/songvec.c b/src/songvec.c index 7181dd67e..46c81a82a 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -2,6 +2,9 @@ #include "song.h" #include "utils.h" +#include <assert.h> +#include <string.h> + static pthread_mutex_t nr_lock = PTHREAD_MUTEX_INITIALIZER; /* Only used for sorting/searchin a songvec, not general purpose compares */ diff --git a/src/songvec.h b/src/songvec.h index 14e08d773..a59874e93 100644 --- a/src/songvec.h +++ b/src/songvec.h @@ -1,7 +1,7 @@ #ifndef SONGVEC_H #define SONGVEC_H -#include "os_compat.h" +#include <stddef.h> struct songvec { struct song **base; diff --git a/src/state_file.c b/src/state_file.c index 2ce5e66b4..1130d62c0 100644 --- a/src/state_file.c +++ b/src/state_file.c @@ -25,7 +25,9 @@ #include "playlist.h" #include "utils.h" #include "volume.h" -#include "os_compat.h" + +#include <string.h> +#include <sys/stat.h> static struct _sf_cb { void (*reader)(FILE *); @@ -25,6 +25,8 @@ #include "conf.h" #include "song.h" +#include <assert.h> + /** * Maximum number of items managed in the bulk list; if it is * exceeded, we switch back to "normal" reallocation. @@ -19,9 +19,12 @@ #ifndef TAG_H #define TAG_H -#include "os_compat.h" #include "gcc.h" +#include <stdint.h> +#include <stddef.h> +#include <string.h> + enum tag_type { TAG_ITEM_ARTIST, TAG_ITEM_ALBUM, diff --git a/src/tag_pool.c b/src/tag_pool.c index d227a2988..257458795 100644 --- a/src/tag_pool.c +++ b/src/tag_pool.c @@ -19,6 +19,8 @@ #include "tag_pool.h" #include "utils.h" +#include <assert.h> + pthread_mutex_t tag_pool_lock = PTHREAD_MUTEX_INITIALIZER; #define NUM_SLOTS 4096 diff --git a/src/tag_pool.h b/src/tag_pool.h index d837d4446..52765527e 100644 --- a/src/tag_pool.h +++ b/src/tag_pool.h @@ -20,7 +20,8 @@ #define TAG_POOL_H #include "tag.h" -#include "os_compat.h" + +#include <pthread.h> extern pthread_mutex_t tag_pool_lock; diff --git a/src/tag_save.h b/src/tag_save.h index 648f5975f..8b88bd16b 100644 --- a/src/tag_save.h +++ b/src/tag_save.h @@ -19,7 +19,7 @@ #ifndef TAG_SAVE_H #define TAG_SAVE_H -#include "os_compat.h" +#include <stdio.h> struct tag; diff --git a/src/timer.c b/src/timer.c index f917cda73..f8bbacdc4 100644 --- a/src/timer.c +++ b/src/timer.c @@ -19,7 +19,10 @@ #include "timer.h" #include "utils.h" #include "audio_format.h" -#include "os_compat.h" + +#include <assert.h> +#include <limits.h> +#include <sys/time.h> static uint64_t now(void) { diff --git a/src/timer.h b/src/timer.h index 31977f799..b3051c132 100644 --- a/src/timer.h +++ b/src/timer.h @@ -19,7 +19,7 @@ #ifndef MPD_TIMER_H #define MPD_TIMER_H -#include "os_compat.h" +#include <stdint.h> struct audio_format; diff --git a/src/utf8.h b/src/utf8.h index 6203aa611..7e0252a0a 100644 --- a/src/utf8.h +++ b/src/utf8.h @@ -19,7 +19,7 @@ #ifndef UTF_8_H #define UTF_8_H -#include <os_compat.h> +#include <stddef.h> char *latin1StrToUtf8Dup(const char *latin1); diff --git a/src/utils.c b/src/utils.c index f23f8c1fa..9cd2190ed 100644 --- a/src/utils.c +++ b/src/utils.c @@ -22,6 +22,17 @@ #include "../config.h" +#include <assert.h> +#include <string.h> +#include <ctype.h> +#include <sys/types.h> +#include <pwd.h> +#include <fcntl.h> + +#ifdef HAVE_IPV6 +#include <sys/socket.h> +#endif + char *myFgets(char *buffer, int bufferSize, FILE * fp) { char *ret = fgets(buffer, bufferSize, fp); diff --git a/src/utils.h b/src/utils.h index a6e26d191..9a83b6f52 100644 --- a/src/utils.h +++ b/src/utils.h @@ -20,7 +20,12 @@ #define UTILS_H #include "gcc.h" -#include "os_compat.h" + +#include <unistd.h> +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> +#include <pthread.h> #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) diff --git a/src/volume.h b/src/volume.h index a92cdd8bb..37111b7ff 100644 --- a/src/volume.h +++ b/src/volume.h @@ -19,7 +19,7 @@ #ifndef VOLUME_H #define VOLUME_H -#include "os_compat.h" +#include <stdio.h> #define VOLUME_MIXER_OSS "oss" #define VOLUME_MIXER_ALSA "alsa" |