5 * This includes OS-wide headers that can be expected to be available
6 * on any machine that mmq can be compiled on for any POSIX-compliant OS
8 * This does not include headers for optional dependencies such as
9 * those for input/output modules.
11 #define _XOPEN_SOURCE 600
13 /* #define _FILE_OFFSET_BITS 64 */ /* off by default */
15 #include "compat/cc.h"
18 #include <sys/types.h>
35 extern void emit(const char *err
, ...) PRINTF
;
36 extern void warn(const char *err
, ...) PRINTF
;
37 extern NORETURN
void die(const char *err
, ...) PRINTF
;
44 extern enum player_state g_state
;
45 extern long g_seek_msec
;
46 extern unsigned long g_sample_size
;
54 extern struct afmt g_next_afmt
;
56 void audio_close(int graceful
);
58 typedef long (*conv_fn
)(void *dst
, void *src
, long samples
, long offset
);
59 int audio_inject(void *buf
, long samples
, conv_fn conv_i
);
60 long audio_copy(void *dst
, void *src
, long samples
, long offset
);
62 int input_open(const char *path
);
63 off_t
input_seek(off_t offset
, int whence
);
64 off_t
input_size(void);
65 ssize_t
input_read(void *buf
, size_t count
);
66 void *input_mmap(size_t *size
);
67 void input_close(void);
73 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
75 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
82 # define restrict __restrict