move report() from main.c to util.c

master
Ozkan Sezer 4 years ago committed by Ozkan Sezer
parent 3fc1e2b4cd
commit ecfb993938
  1. 3
      src/common.h
  2. 12
      src/main.c
  3. 15
      src/util.c

@ -79,8 +79,6 @@ struct control {
extern struct player_mode pmode[]; extern struct player_mode pmode[];
int report(const char *, ...);
void delay_ms(unsigned int); void delay_ms(unsigned int);
#ifdef XMP_AMIGA #ifdef XMP_AMIGA
void amiga_inittimer(void); void amiga_inittimer(void);
@ -89,6 +87,7 @@ void amiga_getsystime(void *);
char *xmp_strdup(const char *); char *xmp_strdup(const char *);
int xmp_strcasecmp(const char *, const char *); /* locale-insensitive */ int xmp_strcasecmp(const char *, const char *); /* locale-insensitive */
int report(const char *, ...);
/* option */ /* option */
void get_options(int, char **, struct options *); void get_options(int, char **, struct options *);

@ -49,18 +49,6 @@ static struct sound_driver *sound;
static unsigned int foreground_in, foreground_out; static unsigned int foreground_in, foreground_out;
static int refresh_status; static int refresh_status;
int report(const char *fmt, ...)
{
va_list a;
int n;
va_start(a, fmt);
n = vfprintf(stderr, fmt, a);
va_end(a);
return n;
}
#ifdef HAVE_SIGNAL_H #ifdef HAVE_SIGNAL_H
static void cleanup(int sig) static void cleanup(int sig)
{ {

@ -7,8 +7,10 @@
*/ */
#include <stddef.h> #include <stddef.h>
#include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h>
#include "common.h" #include "common.h"
@ -49,3 +51,16 @@ int xmp_strcasecmp(const char *s1, const char *s2)
return (int)(c1 - c2); return (int)(c1 - c2);
} }
int report(const char *fmt, ...)
{
va_list a;
int n;
va_start(a, fmt);
n = vfprintf(stderr, fmt, a);
va_end(a);
return n;
}

Loading…
Cancel
Save