diff --git a/configure.ac b/configure.ac index e6c526c..013150b 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ if test "$libxmp_path" != ""; then LIBS="${LIBS} -L${libxmp_path}/lib" fi -AC_CHECK_HEADERS(xmp.h getopt.h termios.h alsa/asoundlib.h) +AC_CHECK_HEADERS(xmp.h getopt.h signal.h termios.h alsa/asoundlib.h) if test "${ac_cv_header_xmp_h}" = "yes"; then AC_CHECK_LIB(xmp,xmp_player_start,, diff --git a/src/common.h b/src/common.h index 09ce572..8f8e20d 100644 --- a/src/common.h +++ b/src/common.h @@ -22,6 +22,19 @@ struct control { int pause; }; + +/* option */ +void get_options(int, char **, struct options *); + +/* terminal */ int set_tty(void); int reset_tty(void); +/* info */ +void info_mod(struct xmp_module_info *); +void info_frame(struct xmp_module_info *, int, int); +void info_pause(struct xmp_module_info *, int); +void info_instruments_compact(struct xmp_module_info *); + +/* commands */ +void read_command(xmp_context, struct control *); diff --git a/src/main.c b/src/main.c index d37b864..4be88f3 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,12 @@ #include #include #include +#ifdef HAVE_SIGNAL_H #include +#endif #include +#include +#include #include #include "sound.h" #include "common.h" @@ -13,6 +17,7 @@ extern struct sound_driver sound_null; struct sound_driver *sound = &sound_alsa; +#ifdef HAVE_SIGNAL_H static void cleanup(int sig) { signal(SIGTERM, SIG_DFL); @@ -27,7 +32,7 @@ static void cleanup(int sig) signal(sig, SIG_DFL); kill(getpid (), sig); } - +#endif static void shuffle(int argc, char **argv) { @@ -80,11 +85,13 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } +#ifdef HAVE_SIGNAL_H signal(SIGTERM, cleanup); signal(SIGINT, cleanup); signal(SIGFPE, cleanup); signal(SIGSEGV, cleanup); signal(SIGQUIT, cleanup); +#endif set_tty(); diff --git a/src/options.c b/src/options.c index acd33c9..50f1aba 100644 --- a/src/options.c +++ b/src/options.c @@ -44,11 +44,6 @@ extern int rt; static void usage(char *s) { - struct xmp_fmt_info *f, *fmt; - struct xmp_drv_info *d, *drv; - char **hlp, buf[80]; - int i; - printf("Usage: %s [options] [modules]\n", s); #if 0 diff --git a/src/sound_null.c b/src/sound_null.c index 257e565..96d2ba1 100644 --- a/src/sound_null.c +++ b/src/sound_null.c @@ -4,6 +4,7 @@ static int init(int sampling_rate, int channels) { + return 0; } static void play(void *b, int i)