move xmp_strdup() into a new util.c source module.

master
Ozkan Sezer 4 years ago committed by Ozkan Sezer
parent bc7fa57fcc
commit 2a155268c2
  1. 3
      src/Makefile.am
  2. 10
      src/main.c
  3. 24
      src/util.c
  4. 4
      vc/xmp.vcproj
  5. 2
      watcom.mif

@ -9,7 +9,7 @@ bin_PROGRAMS = xmp
xmp_SOURCES = \
commands.c common.h delay.c getopt_long.h list.h getopt_long.c info.c \
main.c options.c read_config.c sound.c sound.h sound_file.c sound_null.c \
sound_wav.c sound_aiff.c terminal.c xmp_version.h
sound_wav.c sound_aiff.c terminal.c util.c xmp_version.h
xmp_LDADD = ${LIBXMP_LIBS}
xmp_LDFLAGS = ${XMP_DARWIN_LDFLAGS}
@ -90,7 +90,6 @@ endif
if SOUND_OS2DART
xmp_SOURCES += sound_dart.c
# for mciSendCommand()
xmp_LDADD += -lmmpm2
endif

@ -44,16 +44,6 @@ static struct sound_driver *sound;
static unsigned int foreground_in, foreground_out;
static int refresh_status;
char *xmp_strdup(const char *in)
{
size_t len = strlen(in) + 1;
char *out = (char *) malloc(len);
if (out) {
memcpy(out, in, len);
}
return out;
}
int report(const char *fmt, ...)
{
va_list a;

@ -0,0 +1,24 @@
/* Extended Module Player
* Copyright (C) 1996-2022 Claudio Matsuoka and Hipolito Carraro Jr
*
* This file is part of the Extended Module Player and is distributed
* under the terms of the GNU General Public License. See the COPYING
* file for more information.
*/
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <xmp.h>
#include "common.h"
char *xmp_strdup(const char *in)
{
size_t len = strlen(in) + 1;
char *out = (char *) malloc(len);
if (out) {
memcpy(out, in, len);
}
return out;
}

@ -163,6 +163,10 @@
RelativePath="..\src\terminal.c"
>
</File>
<File
RelativePath="..\src\util.c"
>
</File>
</Filter>
</Files>
<Globals>

@ -16,7 +16,7 @@ LIBS+= $(LIBXMP)
AOUT=xmp.exe
COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES)
OBJ = commands.obj delay.obj getopt_long.obj info.obj main.obj options.obj read_config.obj sound.obj sound_aiff.obj sound_file.obj sound_null.obj sound_wav.obj terminal.obj
OBJ = commands.obj delay.obj getopt_long.obj info.obj main.obj options.obj read_config.obj sound.obj sound_aiff.obj sound_file.obj sound_null.obj sound_wav.obj terminal.obj util.obj
all: $(AOUT)

Loading…
Cancel
Save