mikmod-3.2.1/0040755001161100116100000000000007740670715012462 5ustar raphtechnolabmikmod-3.2.1/os2/0040755001161100116100000000000007740670715013165 5ustar raphtechnolabmikmod-3.2.1/os2/Makefile.tmpl0100644001161100116100000000472307740670667015611 0ustar raphtechnolab# Makefile for use under OS/2 CC=@CC@ CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ COMPILE=$(CC) $(CFLAGS) # Watcom specific : change this to match your compiler installation or setup # environment variables LIBPATH=%TOOLKIT%\LIB;%WATCOM%\LIB386;%WATCOM%\LIB386\OS2 .SUFFIXES: .SUFFIXES: .o .c AOUT=mikmod OBJ = display.o marchive.o mconfedit.o mconfig.o mdialog.o mikmod.o mlist.o \ mmenu.o mutilities.o mwidget.o mwindow.o LINKOBJ=display.o,marchive.o,mconfedit.o,mconfig.o,mdialog.o,mikmod.o,mlist.o,mmenu.o,mutilities.o,mwidget.o,mwindow.o EXTRA_OBJ=@EXTRA_OBJ@ LINKEXTRA_OBJ=getopt.o,getopt1.o,fnmatch.o all: $(AOUT) clean: FORCE FOR %F IN ( $(AOUT).exe $(AOUT) $(OBJ) $(EXTRA_OBJ) ) DO IF EXIST %F ERASE %F distclean: clean ERASE Makefile $(AOUT): $(OBJ) $(EXTRA_OBJ) @LINK@ display.o: ../src/display.c ../src/display.h ../src/player.h \ ../src/mutilities.h ../src/mwindow.h ../src/mmenu.h \ ../src/mdialog.h ../src/mconfedit.h $(COMPILE) @ORULE@ ../src/display.c marchive.o: ../src/marchive.c ../src/player.h ../src/mutilities.h $(COMPILE) @ORULE@ ../src/marchive.c mconfedit.o: ../src/mconfedit.c ../src/player.h ../src/mmenu.h \ ../src/mconfedit.h $(COMPILE) @ORULE@ ../src/mconfedit.c mconfig.o: ../src/mconfig.c ../src/player.h ../src/mutilities.h $(COMPILE) @ORULE@ ../src/mconfig.c mdialog.o: ../src/mdialog.c ../src/mdialog.h ../src/mwidget.h $(COMPILE) @ORULE@ ../src/mdialog.c mikmod.o: ../src/mikmod.c ../src/player.h ../src/mdialog.h ../src/mwindow.h $(COMPILE) @ORULE@ ../src/mikmod.c mlist.o: ../src/mlist.c ../src/player.h ../src/mutilities.h $(COMPILE) @ORULE@ ../src/mlist.c mmenu.o: ../src/mmenu.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mmenu.h ../src/mdialog.h $(COMPILE) @ORULE@ ../src/mmenu.c mutilities.o: ../src/mutilities.c ../src/player.h ../src/mutilities.h $(COMPILE) @ORULE@ ../src/mutilities.c mwidget.o: ../src/mwidget.c ../src/display.h ../src/player.h \ ../src/mwidget.h ../src/mwindow.h $(COMPILE) @ORULE@ ../src/mwidget.c mwindow.o: ../src/mwindow.c ../src/display.h ../src/player.h ../src/mwindow.h $(COMPILE) @ORULE@ ../src/mwindow.c getopt.o: ../src/getopt.c ../src/getopt.h $(COMPILE) @ORULE@ ../src/getopt.c getopt1.o: ../src/getopt1.c ../src/getopt.h $(COMPILE) @ORULE@ ../src/getopt1.c fnmatch.o: ../src/fnmatch.c ../src/fnmatch.h $(COMPILE) @ORULE@ ../src/fnmatch.c usleep.o: ../src/usleep.c $(COMPILE) @ORULE@ ../src/usleep.c FORCE: mikmod-3.2.1/os2/README0100644001161100116100000001234207740670667014052 0ustar raphtechnolab Hello folks ! This is MikMod, version 3.1.6, a module player for OS/2. As usual with each new version, there's a lot of bugfixes and improvements. Check out the file 'NEWS' for more information. >> BUILDING MIKMOD ------------------ This MikMod version can build with either libmikmod 3.1.7 (shared library version 2), or an older version, but all the configuration functions are not available for older versions. - If you're not building libmikmod for OS/2, then you're lost in the sources. Go up one directory, and read the main README file. So you're on a good old OS/2 system, aren't you ? With a customized Object Desktop or some equivalent tool collection ? I hope you've installed REXX support during the system installation. If you didn't, you lose. Run 'selective install' from the system setup folder, install REXX support, check it works, and come back here. The first thing you need is to get and compile the libmikmod sound library, which is not bundled with MikMod anymore ! If you don't know where to get libmikmod, look at the "contact and download info" section later in this document. Oh, I almost forgot : you need long filenames to compile MikMod, so you'll have to compile it on an HPFS drive, or an ext2fs drive, or a network drive where you can use decent-size filenames. Currently, MikMod can be build under OS/2 only with the emx compiler or the Watcom compiler. In this directory, run configure The configure script will ask you which compiler to use. After the configuration has finished and the Makefiles are created, just run make and you'll get your MikMod binary in the src directory. Just copy the file ``..\src\mikmod.exe'' somewhere in your PATH, and enjoy ! If the build fails, I'd like to hear from you to correct the problem. >> USING MIKMOD --------------- Run MikMod with the ``--help'' parameter to get the available options. Program documentation is available as an Unix man page (..\src\mikmod.1) which you can read if you've got a port of the 'man' tool. Also, after you've run MikMod for the first time, you might want to customize your mikmod.cfg file, either from the configuration panel or by editing the file yourself, so you won't need to supply the same options to MikMod all the time. This file will be created in the directory pointed to by the HOME environment variable. If you don't have the HOME environment variable, the file will be created in C:\, which is probably not what you want and should encourage you to have the HOME environment variable set. Once you're in the player, if you haven't choosed terse mode (a la MikMod 2), pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. Note that if you're using the DART driver, there will be a small delay before commands are processed. If you used the playlist features of the previous MikMod versions, your old playlist won't work anymore since the playlist format has changed. Now the playlist files must have an .mpl extension. To convert your old playlists into the new format, get an OS/2 port of the Unix 'awk' command (several exist, including an official IBM version found on DevCon...) and use the 'convert_playlist' awk script : ./convert_playlist < my_old_playlist > my_new_playlist.mpl I know I'm getting lazy and could have written a REXX script for this, but it's kinda like reinventing the wheel and I prefer work on the real code. Hope you won't mind (-: Besides, I only know of a few MikMod/2 users, so if you want to see more OS/2 interest from my side, let me know you're running MikMod/2 ! >> THANKS --------- I would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- * email : Please send all your MikMod related e-mail to me, at : miodrag@mikmod.darkorb.net * chat : People wanting to have a ``live talk'' with me can reach me on IRC (IRCnet and sometimes Undernet) under the nick 'effetaipa'. * web : MikMod and libmikmod home page is located at : http://mikmod.darkorb.net The European mirror is at: http://www.multimania.com/miodrag/mikmod * ftp : Latest releases of libmikmod can be found: - on the official ftp site ftp://mikmod.darkorb.net - on metalab (formerly known as sunsite) and its mirrors ftp://metalab.unc.edu/pub/Linux/apps/sound/libs for libmikmod, and ftp://metalab.unc.edu/pub/Linux/apps/sound/players for MikMod - on hobbes, in source and OS/2 binary forms ftp://hobbes.nmsu.edu/pub/os2/mmedia >> LAST NOTES ------------- I hope you'll enjoy using this version of MikMod as well as I enjoyed debugging and improving it. -- Miodrag ("Miod") Vallat, 07/05/1999 miodrag@mikmod.darkorb.net mikmod-3.2.1/os2/configure.cmd0100644001161100116100000001217207740670667015641 0ustar raphtechnolab/* REXX */ /* MikMod example player (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: configure.cmd,v 1.1.1.1 2003/09/19 13:16:02 raph Exp $ Configuration script for MikMod under OS/2 ==============================================================================*/ ECHO OFF CALL main ECHO ON EXIT /* *========== Helper functions */ yesno: ans='' DO WHILE ans='' SAY message" [y/n] " PULL ans ans=SUBSTR(ans,1,1) IF \((ans='N')|(ans='Y')) THEN DO SAY "Invalid answer. Please answer Y or N" ans='' END END RETURN ans EXIT sed: IF LINES(fileout) THEN DO CALL LINEOUT fileout ERASE fileout END CALL LINEOUT fileout,,1 linecount=0 DO WHILE LINES(filein) line=LINEIN(filein) IF linecount\=0 THEN DO arro1=LASTPOS('@',line) arro2=0 IF (arro1\=0) THEN arro2=LASTPOS('@',line,arro1-1) IF (arro2\=0) THEN DO keyword=SUBSTR(line,arro2+1,arro1-arro2-1) SELECT WHEN keyword='CC' THEN keyword=cc WHEN keyword='CFLAGS' THEN keyword=cflags WHEN keyword='LDFLAGS' THEN keyword=ldflags WHEN keyword='AR' THEN keyword=ar WHEN keyword='ARFLAGS' THEN keyword=arflags WHEN keyword='ORULE' THEN keyword=orule WHEN keyword='LINK' THEN keyword=link WHEN keyword='EXTRA_OBJ' THEN keyword=extra_obj WHEN keyword='MAKE' THEN keyword=make OTHERWISE NOP END line=SUBSTR(line,1,arro2-1)""keyword""SUBSTR(line,arro1+1,LENGTH(line)-arro1) END /* convert forward slashes to backslashes for Watcom */ IF cc="wcc386" THEN DO arro1=1 DO WHILE arro1\=0 arro1=LASTPOS('/',line) IF (arro1\=0) THEN line=SUBSTR(line,1,arro1-1)"\"SUBSTR(line,arro1+1,LENGTH(line)-arro1) END END END linecount=1 CALL LINEOUT fileout, line END CALL LINEOUT fileout CALL LINEOUT filein RETURN main: /* *========== 1. Check the system and the compiler */ SAY "MikMod/2 version 3.1.6 configuration" SAY /* OS/2 * - no GNU getopt * - usleep is not used * - emx has fnmatch(3), watcom doesn't */ /* Don't check for fnmatch() and usleep() */ SAY "Checking for libmikmod version..." SAY "This MikMod version can be compiled with libmikmod 3.1.7 (MIKMOD2.LIB), or" SAY "older versions (MIKMOD.LIB)." message="Do you have libmikmod 3.1.7 installed (MIKMOD2.LIB) ?" CALL yesno IF RESULT='Y' THEN DO upmikmod="MIKMOD2.LIB" lomikmod="-lmikmod2" END ELSE DO upmikmod="MIKMOD.LIB" lomikmod="-lmikmod" END SAY SAY "Checking for compiler..." SAY "You can compile MikMod either with emx or with Watcom C. However, due to" SAY "the Unix nature of the program, emx is recommended." message="Do you want to use the emx compiler (recommended) ?" CALL yesno IF RESULT='Y' THEN DO SAY "Configuring for emx..." cc="gcc" cflags="-O2 -Zomf -Zmt -funroll-loops -ffast-math -fno-strength-reduce -Wall" ldflags="-s -Zomf" ar="emxomfar" arflags="cr" make="make" orule="-o $@ -c" link="$(CC) $(LDFLAGS) -o $(AOUT) $(OBJ) $(EXTRA_OBJ) -Zmt -Zexe -Zcrtdll "lomikmod" -lmmpm2" END ELSE DO SAY "Configuring for Watcom C..." cc="wcc386" cflags="-5r -bt=os2 -fp5 -fpi87 -mf -oeatxh -w4 -zp8" ldflags="" ar="wlib" arflags="-b -c -n" make="wmake -ms" orule="-fo=$^@" link="wlink N $(AOUT) SYS OS2V2 LIBP $(LIBPATH) LIBF "upmikmod" LIBF MMPM2.LIB F $(LINKOBJ) F $(LINKEXTRA_OBJ) " END /* "Checking" for include files */ cflags=cflags" -DHAVE_FCNTL_H -DHAVE_LIMITS_H -DHAVE_UNISTD_H -DHAVE_SYS_IOCTL_H -DHAVE_SYS_TIME_H" extra_obj="getopt.o getopt1.o" IF cc="gcc" THEN cflags=cflags" -DHAVE_FNMATCH_H -DHAVE_FNMATCH" ELSE IF cc="wcc386" THEN extra_obj=extra_obj" fnmatch.o" /* *========== 2. Generate Makefiles */ SAY filein ="Makefile.tmpl" fileout="..\src\Makefile" CALL sed filein="Makefile.os2" fileout="Make.cmd" CALL sed /* *========== 4. Last notes */ SAY SAY "Configuration is complete. MikMod is ready to compile." IF cc="wcc386" THEN DO SAY "If you choose to compile with Watcom C, you may have to edit" SAY "..\src\Makefile to adjust path to Watcom runtime libraries." SAY "Then, just enter 'make' at the command prompt..." END ELSE SAY "Just enter 'make' at the command prompt..." SAY RETURN mikmod-3.2.1/os2/Makefile.am0100644001161100116100000000007507740670667015226 0ustar raphtechnolabEXTRA_DIST = Makefile.os2 Makefile.tmpl configure.cmd README mikmod-3.2.1/os2/Makefile.in0100644001161100116100000001056107740670667015240 0ustar raphtechnolab# Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ CPP = @CPP@ EXTRA_OBJ = @EXTRA_OBJ@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PLAYER_LIB = @PLAYER_LIB@ VERSION = @VERSION@ EXTRA_DIST = Makefile.os2 Makefile.tmpl configure.cmd README mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = DIST_COMMON = README Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps os2/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = os2 distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mikmod-3.2.1/os2/Makefile.os20100644001161100116100000000034407740670667015333 0ustar raphtechnolab@ECHO OFF IF EXIST ..\src\Makefile GOTO BEGIN CALL configure.cmd :BEGIN CD ..\src @MAKE@ %1 IF ERRORLEVEL 1 GOTO ERROR CD ..\os2 ECHO Compilation finished. GOTO END :ERROR CD ..\os2 ECHO Compilation aborted ! :END mikmod-3.2.1/src/0040755001161100116100000000000007740670715013251 5ustar raphtechnolabmikmod-3.2.1/src/marchive.c0100644001161100116100000004074707740670667015232 0ustar raphtechnolab/* MikMod example player (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: marchive.c,v 1.4 2003/09/25 16:38:42 raph Exp $ Archive support These routines are used to detect different archive/compression formats and decompress/de-archive the mods from them if necessary. ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_FNMATCH_H #include "fnmatch.h" #else #include #endif #include #include #include #include #include #include #include #if !defined(__OS2__)&&!defined(__EMX__) #ifdef HAVE_FCNTL_H #include #endif #include #include #endif #include #include "player.h" #include "mutilities.h" /*========== Archives */ /* The following table describes how MikMod should deal with archives. The first two fields are for identification. The code will consider that a given file is a recognized archive if a signature is found at a fixed location in the file. The first field is the offset into the archive of the signature, and the second field points to the signature to check (an 8-bit string). The third field contains the name of the program to invoke to list and extract the archive. The fourth and fifth fields are the first two arguments which will be given to the program when it is invoked to extract a file from the archive. The command which will be invoked is : archiver_command extract_arg1 extract_arg2 archive_file file_to_extract If only one argument is needed, set extract_arg2 to NULL. The sixth and seventh fields are the first two arguments which will be given to the program when it is invoked to list the contents of the archive. The command which will be invoked is : archiver_command list_arg1 list_arg2 archive_file If only one argument is needed, set list_arg2 to NULL. For the special case of mono-file archives (gzip and bzip2 compressed files, for example), set *both* arguments to NULL. In this case, the code will determine the contents of the file without having to invoke the list function of the archiver. This is necessary since bzip2 has no list function, and the only way to get the archive contents is to test it, which can be a really slow process. The last field is the column, in the archive listing output, where the filenames begin (starting from zero for the leftmost column). A good archiver will put them last on line, so they can embed spaces and be as long as necessary. The constant MAXCOLUMN later should be set to the highest column number found in the table. When adding new entries to the table, be sure to compile a debug version, it will check at runtime if your MAXCOLUMN value is correct. The OS/2 variant of the table is shorter, since there is no need to make the two extract and list arguments separate, so only one string is needed in both cases, and for mono-file archives, the listing arguments string is set to NULL. */ typedef struct { int location; /* <0 -> file extensions are checked */ char *marker; char *command; #if !defined(__OS2__)&&!defined(__EMX__) char *extrargs,*extrargs2; char *listargs,*listargs2; #else char *extrargs; char *listargs; #endif unsigned int nameoffset; } ARCHIVE; /* use similar signature idea to "file" to see what format we have... */ static char pksignature[]={'P','K',0x03,0x04,0}; static char zoosignature[]={0xdc,0xa7,0xc4,0xfd,0}; static char rarsignature[]={'R','a','r','!',0}; static char gzsignature[]={0x1f,0x8b,0}; static char bzip2signature[]={'B','Z','h',0}; static char tarsignature[]={'u','s','t','a','r',0}; #if !defined(__OS2__)&&!defined(__EMX__) static char lhsignature[]={'-','l','h',0}; static char lzsignature[]={'-','l','z',0}; #endif /* interesting file extensions */ #if !defined(__OS2__)&&!defined(__EMX__) static char targzextension[]=".TAR.GZ .TAZ .TGZ"; static char tarbzip2extension[]=".TAR.BZ2 .TBZ .TBZ2"; #endif static ARCHIVE MA_archiver[]={ /* location, marker, command, extract and view args, filenames column */ #if !defined(__OS2__)&&!defined(__EMX__) /* PKzip archive */ { 0, pksignature, "unzip", "-pqq", NULL, "-vqq", NULL, 58}, /* zoo */ { 20, zoosignature, "zoo", "xpq", NULL, "lfq", NULL, 0}, /* rar */ { 0, rarsignature, "unrar", "p", "-inul", "v", "-c-", 1}, /* lharc */ { 2, lhsignature, "lha", "pq", NULL, "vvq", NULL, 0}, { 2, lzsignature, "lha", "pq", NULL, "vvq", NULL, 0}, /* tar */ { 257,tarsignature, "tar", "-xOf", NULL, "-tf", NULL, 0}, /* tar.gz */ { -1, targzextension, "tar", "-xOzf", NULL, "-tzf", NULL, 0}, /* tar.bz2 */ { -1, tarbzip2extension, "tar", "--use-compress-program=bzip2", "-xOf", "--use-compress-program=bzip2", "-tf", 0}, /* gzip */ { 0, gzsignature, "gzip", "-dqc", NULL, NULL, NULL, 0}, /* bzip2 */ { 0, bzip2signature, "bzip2", "-dc", NULL, NULL, NULL, 0}, /* needed to end the array... */ { 0, NULL, NULL, NULL, NULL, NULL, NULL, 0} #else /* PKzip archive */ { 0, pksignature, "unzip", "-pqq", "-lqq", 41}, /* zoo */ { 20, zoosignature, "zoo", "xpq", "lq", 47}, { 0, rarsignature, "unrar", "p -inul", "v -c-", 1}, /* tar */ { 257,tarsignature, "tar", "-xOf", "-tRf", 16}, /* gzip */ { 0, gzsignature, "gzip", "-dqc", NULL, 27}, /* bzip2 */ { 0, bzip2signature, "bzip2", "-dc", NULL, 0}, /* needed to end the array... */ { 0, NULL, NULL, NULL, NULL, 0} #endif }; /* rightmost column position */ #if defined(__OS2__)||defined(__EMX__) #define MAXCOLUMN 47 #else #define MAXCOLUMN 58 #endif /* largest signature length */ #define MAXSIGNATURE 16 /* module filenames patterns */ static CHAR* modulepatterns[]={ "*.669", "*.[Aa][Mm][Ff]", "*.[Aa][Pp][Uu][Nn]", "*.[Dd][Ss][Mm]", "*.[Ff][Aa][Rr]", "*.[Gg][Dd][Mm]", "*.[Ii][Mm][Ff]", "*.[Ii][Tt]", "*.[Mm][Ee][Dd]", "*.[Mm][Oo][Dd]", "*.[Mm][Tt][Mm]", "*.[Nn][Ss][Tt]", /* noisetracker */ "*.[Ss]3[Mm]", "*.[Ss][Tt][Mm]", "*.[Ss][Tt][Xx]", "*.[Uu][Ll][Tt]", "*.[Uu][Nn][Ii]", "*.[Xx][Mm]", NULL }; /* On the Amiga (Aminet) the module type seems often to be used as prefix */ static CHAR* prefixmodulepatterns[]={ "669.*", "[Aa][Mm][Ff].*", "[Aa][Pp][Uu][Nn].*", "[Dd][Ss][Mm].*", "[Ff][Aa][Rr].*", "[Gg][Dd][Mm].*", "[Ii][Mm][Ff].*", "[Ii][Tt].*", "[Mm][Ee][Dd].*", "[Mm][Oo][Dd].*", "[Mm][Tt][Mm].*", "[Nn][Ss][Tt].*", "[Ss]3[Mm].*", "[Ss][Tt][Mm].*", "[Ss][Tt][Xx].*", "[Uu][Ll][Tt].*", "[Uu][Nn][Ii].*", "[Xx][Mm].*", NULL }; #if !defined(__OS2__)&&!defined(__EMX__) /* Drop all root privileges we might have */ BOOL DropPrivileges(void) { if (!geteuid()) { if (getuid()) { /* we are setuid root -> drop setuid to become the real user */ if (setuid(getuid())) return 1; } else { /* we are run as root -> drop all and become user 'nobody' */ struct passwd *nobody; int uid; if (!(nobody=getpwnam("nobody"))) return 1; /* no such user ? */ uid=nobody->pw_uid; if (!uid) /* user 'nobody' has root privileges ? weird... */ return 1; if (setuid(uid)) return 1; } } return 0; } #endif /* Determines if a filename matches a module filename pattern */ static BOOL MA_isModuleFilename(CHAR* filename) { int t; for (t=0;modulepatterns[t];t++) if (!fnmatch(modulepatterns[t],filename,FNM_NOESCAPE)) return 1; return 0; } /* The same, but also checks for prefix names */ static BOOL MA_isModuleFilename2(CHAR* filename) { int t; /* a filename may not start with '-' since this could be abused to feed another option to the archiver */ if (filename[0]=='-') return 0; for (t=0;modulepatterns[t];t++) if (!fnmatch(modulepatterns[t],filename,FNM_NOESCAPE)) return 1; for (t=0;prefixmodulepatterns[t];t++) if (!fnmatch(prefixmodulepatterns[t],filename,FNM_NOESCAPE)) return 1; return 0; } /* Determines if a filename extension matches an archive filename extension pattern */ static BOOL MA_MatchExtension(CHAR *archive,CHAR *ends) { CHAR *pos=ends; int nr,arch_nr; do { while ((*pos)&&(*pos!=' ')) pos++; nr=pos-ends; arch_nr=strlen(archive); while ((nr>0)&&(arch_nr>0)&& (toupper((int)archive[arch_nr-1])==*(ends+nr-1))) nr--,arch_nr--; if (nr<=0) return 1; pos++; ends=pos; } while (*(pos-1)); return 0; } /* Tests if 'filename' has the signature 'header-string' at offset 'header_location' */ static int MA_identify(CHAR* filename,int header_location,CHAR* header_string) { FILE *fp; CHAR id[MAXSIGNATURE+1]; if (header_location<0) { /* check extension of file rather than signature */ return MA_MatchExtension(filename,header_string); } else { /* check in-file signature */ #ifdef MIKMOD_DEBUG if (strlen(header_string)>MAXSIGNATURE) { fputs("Error: wrong constant MAXSIGNATURE in MikMod source\n",stderr); return 0; } #endif if (!(fp=fopen(filename,"rb"))) return 0; fseek(fp,header_location,SEEK_SET); if (!fread(id,strlen(header_string),1,fp)) { fclose(fp); return 0; } if (!memcmp(id,(CHAR*)header_string,strlen(header_string))) { fclose(fp); return 1; } fclose(fp); return 0; } } /* Extracts the file 'file' from the archive 'arc' */ CHAR* MA_dearchive(CHAR* arc,CHAR* file) { int t; CHAR *tmp_file; /* not an archive file... */ if ((!arc)||(!arc[0])) return strdup(file); tmp_file=get_tmp_name(); for (t=0;MA_archiver[t].command;t++) if (MA_identify(arc,MA_archiver[t].location,MA_archiver[t].marker)) { /* display "extracting" message, as this may take some time... */ display_extractbanner(); #if defined(__OS2__)||defined(__EMX__) /* extracting, the non-Unix way */ { CHAR command_buff[PATH_MAX<<1]; if (MA_archiver[t].listargs) /* multi-file archive : need to give filename to extract */ #ifdef HAVE_SNPRINTF snprintf(command_buff,PATH_MAX<<1,"%s %s \"%s\" \"%s\" >\"%s\"", MA_archiver[t].command,MA_archiver[t].extrargs, arc,file,tmp_file); #else sprintf(command_buff,"%s %s \"%s\" \"%s\" >\"%s\"", MA_archiver[t].command,MA_archiver[t].extrargs, arc,file,tmp_file); #endif else /* single-file archive */ #ifdef HAVE_SNPRINTF snprintf(command_buff,PATH_MAX<<1,"%s %s \"%s\" >\"%s\"", MA_archiver[t].command,MA_archiver[t].extrargs, arc,tmp_file); #else sprintf(command_buff,"%s %s \"%s\" >\"%s\"", MA_archiver[t].command,MA_archiver[t].extrargs, arc,tmp_file); #endif system(command_buff); } #else /* extracting, the Unix way */ { pid_t pid; int status,fd; switch (pid=fork()) { case -1: /* fork failed */ return NULL; break; case 0: /* fork succeeded, child process code */ /* if we have root privileges, drop them */ if (DropPrivileges()) exit(0); fd=open(tmp_file,O_WRONLY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE); if (fd!=-1) { char *argv[6]; int index=2; close(0);close(1);close(2); dup2(fd,1); signal(SIGINT,SIG_DFL);signal(SIGQUIT,SIG_DFL); argv[0]=MA_archiver[t].command; argv[1]=MA_archiver[t].extrargs; if (MA_archiver[t].extrargs2) argv[index++]=MA_archiver[t].extrargs2; argv[index++]=arc; if (MA_archiver[t].listargs) argv[index++]=file; argv[index++]=NULL; execvp(MA_archiver[t].command,argv); close(fd); unlink(tmp_file); } exit(0); break; default: /* fork succeeded, main process code */ waitpid(pid,&status,0); if (!WIFEXITED(status)) { unlink(tmp_file); return NULL; } break; } } #endif break; } return tmp_file; } /* Examines file 'filename' to add modules to the playlist 'pl' */ void MA_FindFiles(PLAYLIST* pl,CHAR* filename) { int t; int archive=0; CHAR string[PATH_MAX+(MAXCOLUMN+1)+1]; struct stat statbuf; #ifdef MIKMOD_DEBUG for (t=0;MA_archiver[t].command;t++) if (MA_archiver[t].nameoffset>MAXCOLUMN) { fputs("Error: wrong constant MAXCOLUMN in MikMod source\n",stderr); return; } #endif if (stat(filename,&statbuf)) return; /* File does not exist or not enough access rights */ if ((S_ISDIR(statbuf.st_mode))||(S_ISCHR(statbuf.st_mode)) #ifndef __EMX__ ||(S_ISBLK(statbuf.st_mode)) #endif ) return; /* Directories and devices can't be modules... */ /* if filename looks like a playlist, load as a playlist */ if (PL_isPlaylistFilename(filename)) if (PL_Load(pl,filename)) return; /* if filename looks like a module and not like an archive, don't try to unzip the file...*/ if (MA_isModuleFilename(filename)) { PL_Add(pl,filename,NULL,0,0); return; } for (t=0;MA_archiver[t].command;t++) if (MA_identify(filename,MA_archiver[t].location,MA_archiver[t].marker)) { archive=t+1; break; } if (archive--) { if (MA_archiver[t].listargs) { /* multi-file archive, need to invoke list function */ #if defined(__OS2__)||defined(__EMX__) /* Archive display, the non-Unix way */ FILE *file; #ifdef HAVE_SNPRINTF sprintf(string,PATH_MAX+(MAXCOLUMN+1)+1,"%s %s \"%s\"",MA_archiver[archive].command, MA_archiver[archive].listargs,filename); #else sprintf(string,"%s %s \"%s\"",MA_archiver[archive].command, MA_archiver[archive].listargs,filename); #endif #ifdef __WATCOMC__ file=_popen(string,"r"); #else file=popen(string,"r"); #endif fgets(string,PATH_MAX+MAXCOLUMN+1,file); while (!feof(file)) { string[strlen(string)-1]=0; if (!MA_archiver[archive].nameoffset) { for (t=0;string[t]!=' ';t++); string[t]=0; } if (MA_isModuleFilename2(string+MA_archiver[archive].nameoffset)) PL_Add(pl,(string+MA_archiver[archive].nameoffset),filename,0,0); fgets(string,PATH_MAX,file); } #ifdef __WATCOMC__ _pclose(file); #else pclose(file); #endif #else /* Archive display, the Unix way */ int fd[2]; if (!pipe(fd)) { pid_t pid; FILE *file; int status,s; switch (pid=fork()) { case -1: /* fork failed */ break; case 0: /* fork succeeded, child process code */ { char *argv[5]; int index=2; /* if we have root privileges, drop them */ if (DropPrivileges()) exit(0); close(0);close(1);close(2); dup2(fd[1],1);dup2(fd[1],2); signal(SIGINT,SIG_DFL);signal(SIGQUIT,SIG_DFL); argv[0]=MA_archiver[archive].command; argv[1]=MA_archiver[archive].listargs; if (MA_archiver[archive].listargs2) argv[index++]=MA_archiver[archive].listargs2; argv[index++]=filename; argv[index++]=NULL; execvp(MA_archiver[t].command,argv); close(fd[1]); exit(0); } break; default: /* fork succeeded, main process code */ close(fd[1]); if (!(file=fdopen(fd[0],"r"))) { close(fd[1]); waitpid(pid,&status,0); break; } /* read from the pipe */ while (fgets(string,PATH_MAX+MAXCOLUMN+1,file)) { s=strlen(string)-1; if (string[s]=='\n') string[s]='\0'; /* remove trailing whitespace from the filename */ for (s=0,t=0;string[t++];) if (string[t]!=' ') s=t; string[s]='\0'; if (MA_isModuleFilename2(string+MA_archiver[archive].nameoffset)) PL_Add(pl,(string+MA_archiver[archive].nameoffset),filename,0,0); } fclose(file); waitpid(pid,&status,0); break; } } #endif } else { /* single-file archive, guess the name */ CHAR *dot,*slash,*spare; dot=strrchr(filename,'.'); slash=strrchr(filename,PATH_SEP); if (!slash) slash=filename; else slash++; if (!dot) for (dot=slash;*dot;dot++); spare=malloc((1+dot-slash)*sizeof(CHAR)); if (spare) { strncpy(spare,slash,dot-slash);spare[dot-slash]=0; if (MA_isModuleFilename2(spare)) PL_Add(pl,spare,filename,0,0); free(spare); } } } else PL_Add(pl,filename,NULL,0,0); } /* ex:set ts=4: */ mikmod-3.2.1/src/mwidget.c0100644001161100116100000003256607740670667015074 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwidget.c,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Widget and Dialog creation functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "display.h" #include #include "player.h" #include "mwindow.h" #include "mwidget.h" static void label_free(WID_LABEL *w) { free(w->msg); free(w); } static void label_paint(DIALOG *d,WID_LABEL *w) { char *start,*pos; int y=w->w.y; win_attrset(A_REVERSE); start=w->msg; for (pos=w->msg;*pos;pos++) { if (*pos=='\n') { *pos='\0'; win_print(w->w.x,y,start); *pos='\n'; start=pos+1; y++; } } win_print(w->w.x,y,start); win_attrset(A_NORMAL); } static int label_handle_event(DIALOG *d,WID_LABEL *w,WID_EVENT event,int ch) { return 0; } static void label_get_size(WID_LABEL *w,int *width,int *height) { char *pos; int x=0; *width=0; *height=0; for (pos=w->msg;*pos;pos++) { if (*pos=='\n') { (*height)++; if (x>*width) *width=x; x=-1; } x++; } if (x>*width) *width=x; (*height)++; } static void str_free(WID_STR *w) { free(w->input); free(w); } static void str_paint(DIALOG *d,WID_STR *w) { char hl[2]=" ",ch=' ',*pos=&w->input[w->start]; int dx=0,len; if (w->w.has_focus) { hl[0]=ch=w->input[w->cur_pos]; if (!hl[0]) hl[0]=' '; w->input[w->cur_pos]='\0'; if (*pos) win_print(w->w.x,w->w.y,pos); dx=strlen(pos); win_attrset(A_REVERSE); win_print(w->w.x+dx,w->w.y,hl); win_attrset(A_NORMAL); pos+=dx; dx++; *pos=ch; if (*pos) pos++; } len=strlen(pos); if (len+dx>w->width) { ch=w->input[w->width+w->start]; w->input[w->width+w->start]='\0'; } win_print(w->w.x+dx,w->w.y,pos); if (len+dx>w->width) w->input[w->width+w->start]=ch; else if (len+dxwidth) { dx+=len; for (len=0;lenwidth-dx;len++) storage[len]=' '; storage[len]='\0'; win_print(w->w.x+dx,w->w.y,storage); } } static int check_input(DIALOG *d,WID_INT *w,int ret) { if (ret &&(ret!=EVENT_HANDLED)&& w->w.handle_focus) { return w->w.handle_focus(d,(WIDGET*)w,ret); } else { if (ret==FOCUS_ACTIVATE) ret=FOCUS_NEXT; return ret; } } static int input_handle_event(DIALOG *d,WID_STR *w,WID_EVENT event,int ch,BOOL int_input) { char *pos; int i; if (event==WID_HOTKEY) return 0; if (event==WID_GET_FOCUS) return EVENT_HANDLED; if ((event==WID_KEY) && w->w.handle_key) { i=w->w.handle_key(d,(WIDGET*)w,ch); if (i) return i; } switch (ch) { case KEY_UP: return check_input(d,(WID_INT*)w,FOCUS_PREV); case '\t': case KEY_DOWN: return check_input(d,(WID_INT*)w,FOCUS_NEXT); case KEY_LEFT: case CTRL_B: if (w->cur_pos>0) w->cur_pos--; break; case KEY_RIGHT: case CTRL_F: if (w->cur_posinput)) w->cur_pos++; break; case KEY_PPAGE: case CTRL_A: w->cur_pos=0; break; case KEY_NPAGE: case CTRL_E: w->cur_pos=strlen(w->input); break; case CTRL_K: w->input[w->cur_pos]='\0'; break; case CTRL_U: w->cur_pos=0; w->input[w->cur_pos]='\0'; break; case KEY_DC: case CTRL_D: #if !defined(__OS2__)&&!defined(__EMX__) case KEY_ASCII_DEL: #endif if (w->cur_pos < strlen(w->input)) for (pos=&w->input[w->cur_pos];*pos;pos++) *pos=*(pos+1); break; case KEY_BACKSPACE: #if !defined(__OS2__)&&!defined(__EMX__) case '\b': #endif if (w->cur_pos>0) { for (pos=&w->input[w->cur_pos-1];*pos;pos++) *pos=*(pos+1); w->cur_pos--; } break; case KEY_ENTER: case '\r': return check_input(d,(WID_INT*)w,FOCUS_ACTIVATE); default: if (ch>=256 || !isprint(ch)) return 0; if ((int_input && isdigit(ch)) || (!int_input && isprint(ch))) { i=strlen(w->input); if (ilength) { for (;i>=w->cur_pos;i--) w->input[i+1]=w->input[i]; w->input[w->cur_pos]=ch; w->cur_pos++; } } } if (w->cur_posstart) w->start=w->cur_pos; if (w->cur_pos>=w->start+w->width) w->start=w->cur_pos-w->width+1; str_paint(d,w); return EVENT_HANDLED; } static int str_handle_event(DIALOG *d,WID_STR *w,WID_EVENT event,int ch) { return input_handle_event(d,w,event,ch,0); } static void str_get_size(WID_STR *w,int *width,int *height) { *width=w->width; *height=1; } static void int_free(WID_INT *w) { free(w->input); free(w); } static void int_paint(DIALOG *d,WID_INT *w) { str_paint(d,(WID_STR*)w); } static BOOL int_handle_event(DIALOG *d,WID_INT *w,WID_EVENT event,int ch) { return input_handle_event(d,(WID_STR*)w,event,ch,1); } static void int_get_size(WID_INT *w,int *width,int *height) { *width=w->width; *height=1; } static void button_free(WID_BUTTON *w) { free(w->button); free(w); } static void button_paint(DIALOG *d,WID_BUTTON *w) { int cur,x,cnt_hl=0; char *pos,*hl_pos,*start,hl[2]; BOOL end; for (pos=w->button;*pos;pos++) if (*pos=='&') cnt_hl++; x=(d->win->width-1-w->w.x-(strlen(w->button)+5*w->cnt-1-cnt_hl))/2; cur=0; hl_pos=NULL;hl[1]='\0'; start=w->button; end=0; for (pos=w->button;!end;pos++) { end=!(*pos); if ((*pos == '|')||(*pos=='\0')) { *pos='\0'; if ((w->active!=cur)||(!w->w.has_focus)) win_attrset(A_REVERSE); win_print(w->w.x+x,w->w.y,"[ "); win_print(w->w.x+x+2,w->w.y,start); x+=strlen(start)+2; if (hl_pos) { if ((w->active!=cur)||(!w->w.has_focus)) win_attrset(A_NORMAL); else win_attrset(A_REVERSE); win_print(w->w.x+x,w->w.y,hl); if ((w->active!=cur)||(!w->w.has_focus)) win_attrset(A_REVERSE); else win_attrset(A_NORMAL); win_print(w->w.x+x+1,w->w.y,hl_pos); *(hl_pos-2)='&'; x+=strlen(hl_pos)+1; hl_pos=NULL; } win_print(w->w.x+x,w->w.y," ]"); if ((w->active!=cur)||(!w->w.has_focus)) win_attrset(A_NORMAL); x+=4; *pos='|'; start=pos+1; cur++; } if (*pos=='&') { *pos='\0'; pos++; hl_pos=pos+1; hl[0]=*pos; } } *(pos-1)='\0'; } static int focus_button(DIALOG *d,WID_BUTTON *w,int ret) { if (ret &&(ret!=EVENT_HANDLED) && w->w.handle_focus) { return w->w.handle_focus(d,(WIDGET*)w,ret); } else { if (ret==FOCUS_ACTIVATE) { dialog_close(d); return EVENT_HANDLED; } return ret; } } static BOOL button_handle_event(DIALOG *d,WID_BUTTON *w,WID_EVENT event,int ch) { int cur; char *pos; if (event==WID_GET_FOCUS) { if (ch<0) w->active=w->cnt-1; else w->active=0; return EVENT_HANDLED; } if ((event==WID_KEY)&&(w->w.handle_key)) { cur=w->w.handle_key(d,(WIDGET*)w,ch); if (cur) return cur; } if ((ch<256) &&(isalpha(ch))) ch=toupper(ch); switch (ch) { case KEY_UP: case KEY_LEFT: if (event==WID_KEY) { w->active--; if (w->active<0) return focus_button(d,w,FOCUS_PREV); button_paint(d,w); } break; case KEY_DOWN: case KEY_RIGHT: case '\t': if (event==WID_KEY) { w->active++; if (w->active>=w->cnt) return focus_button(d,w,FOCUS_NEXT); button_paint(d,w); } break; case KEY_ENTER: case '\r': if (event==WID_KEY) return focus_button(d,w,FOCUS_ACTIVATE); break; default: cur=0; for (pos=w->button; *pos; pos++) { if (*pos=='|') cur++; if (*pos=='&' && (*(pos+1)==ch)) { w->active=cur; button_paint(d,w); return focus_button(d,w,FOCUS_ACTIVATE); } } return 0; } return EVENT_HANDLED; } static void button_get_size(WID_BUTTON *w,int *width,int *height) { char *pos; int hl_cnt=0; w->cnt=1; for (pos=w->button;*pos;pos++) { if (*pos=='&') hl_cnt++; if (*pos=='|') w->cnt++; } *width=strlen(w->button)+5*w->cnt-1-hl_cnt; *height=1; } static void dialog_add(DIALOG *d,WIDGET *w) { d->widget=realloc(d->widget,(d->cnt+1)*sizeof(WIDGET*)); d->widget[d->cnt]=w; d->cnt++; } static void widget_init(WIDGET *w,BOOL focus,int spacing) { w->x=1; w->y=spacing; w->can_focus=focus; w->has_focus=0; w->handle_key=w->handle_focus=NULL; w->data=NULL; } WIDGET* wid_label_add(DIALOG *d,int spacing,char *msg) { WID_LABEL *w=malloc(sizeof(WID_LABEL)); widget_init((WIDGET*)w,0,spacing); w->w.type=TYPE_LABEL; w->w.w_free=(freeFunc)label_free; w->w.w_paint=(paintFunc)label_paint; w->w.w_handle_event=(handleEventFunc)label_handle_event; w->w.w_get_size=(getSizeFunc)label_get_size; w->msg=strdup(msg); dialog_add(d,(WIDGET*)w); return(WIDGET*)w; } #define STR_WIDTH 60 WIDGET* wid_str_add(DIALOG *d,int spacing,char *input,int length) { int i; WID_STR *w=malloc(sizeof(WID_STR)); widget_init((WIDGET*)w,1,spacing); w->w.type=TYPE_STR; w->w.w_free=(freeFunc)str_free; w->w.w_paint=(paintFunc)str_paint; w->w.w_handle_event=(handleEventFunc)str_handle_event; w->w.w_get_size=(getSizeFunc)str_get_size; w->width=STR_WIDTH; w->length=length; if (w->width>w->length) w->width=w->length+1; if (w->width<10) w->width=10; w->input=malloc(length+1); i=MIN(strlen(input),length); strncpy(w->input,input,i); w->input[i]='\0'; w->cur_pos=strlen(w->input); w->start=w->cur_pos-w->width+1; if (w->start<0) w->start=0; dialog_add(d,(WIDGET*)w); return(WIDGET*)w; } #define INT_WIDTH 11 WIDGET* wid_int_add(DIALOG *d,int spacing,int value,int length) { WID_INT *w=malloc(sizeof(WID_INT)); widget_init((WIDGET*)w,1,spacing); w->w.type=TYPE_INT; w->w.w_free=(freeFunc)int_free; w->w.w_paint=(paintFunc)int_paint; w->w.w_handle_event=(handleEventFunc)int_handle_event; w->w.w_get_size=(getSizeFunc)int_get_size; w->width=INT_WIDTH; w->start=0; w->length=length; w->input=malloc(w->length+1); sprintf(w->input,"%d",value); w->cur_pos=strlen(w->input); dialog_add(d,(WIDGET*)w); return(WIDGET*)w; } WIDGET* wid_button_add(DIALOG *d,int spacing,char *button,int active) { WID_BUTTON *w=malloc(sizeof(WID_BUTTON)); widget_init((WIDGET*)w,1,spacing); w->w.type=TYPE_BUTTON; w->w.w_free=(freeFunc)button_free; w->w.w_paint=(paintFunc)button_paint; w->w.w_handle_event=(handleEventFunc)button_handle_event; w->w.w_get_size=(getSizeFunc)button_get_size; w->button=strdup(button); w->active=active; dialog_add(d,(WIDGET*)w); return(WIDGET*)w; } void wid_set_func(WIDGET *w,handleKeyFunc key,handleFocusFunc focus,void *data) { w->handle_key=key; w->handle_focus=focus; w->data=data; } BOOL dialog_repaint(MWINDOW *win) { DIALOG *d=win->data; int i=0; win_attrset(A_REVERSE); win_clear(); win_attrset(A_NORMAL); for (i=0;icnt;i++) d->widget[i]->w_paint(d,d->widget[i]); return 1; } void dialog_close(DIALOG *d) { int i; for (i=0;icnt;i++) d->widget[i]->w_free(d->widget[i]); if (d->cnt) free(d->widget); win_close_win(d->win); free(d); } static BOOL dialog_handle_key(MWINDOW *win,int ch) { DIALOG *d=win->data; int ret,i; ret=d->widget[d->active]->w_handle_event(d,d->widget[d->active],WID_KEY,ch); if (!ret) { for (i=0;icnt && !ret;i++) { ret=d->widget[i]->w_handle_event(d,d->widget[i],WID_HOTKEY,ch); if (ret == FOCUS_ACTIVATE) { d->widget[d->active]->has_focus=0; d->widget[i]->has_focus=1; d->active=i; d->widget[d->active]->w_handle_event(d,d->widget[d->active], WID_GET_FOCUS,ret); dialog_repaint(win); } } } else if (retwidget[d->active]->has_focus=0; do { d->active+=ret; if (d->active<0) d->active=d->cnt-1; else if (d->active>=d->cnt) d->active=0; } while (!d->widget[d->active]->can_focus); d->widget[d->active]->has_focus=1; d->widget[d->active]->w_handle_event(d,d->widget[d->active], WID_GET_FOCUS,ret); dialog_repaint(win); } return !!ret; } void dialog_open(DIALOG *d,char *title) { int m_y,m_width=0,m_height=0,i,x,y,width=0,height=0; BOOL focus=1; i=0; while (icnt) { /* Init all widgets(position and focus) */ m_height+=d->widget[i]->y; width=1; height=0; do { /* widgets in one row */ d->widget[i]->w_get_size(d->widget[i],&x,&y); d->widget[i]->x=width; d->widget[i]->y=m_height; width += x+1; if (y>height) height=y; if (d->widget[i]->can_focus) { d->widget[i]->has_focus=focus; if (focus) d->active=i; focus=0; } else d->widget[i]->has_focus=0; i++; } while ((icnt) &&(d->widget[i]->y==-1)); if (width>m_width) m_width=width; m_height+=height; } width=m_width; height=m_height; win_get_size_max(&m_y,&m_width,&m_height); x=(m_width-width)/2; if (x<0) x=0; y=(m_height-height)/2+m_y; if (ywin=win_get_window(); dialog_repaint(d->win); } DIALOG* dialog_new(void) { DIALOG *d=malloc(sizeof(DIALOG)); d->active=0; d->cnt=0; d->win=NULL; d->widget=NULL; return d; } /* ex:set ts=4: */ mikmod-3.2.1/src/mwidget.h0100644001161100116100000001071207740670667015066 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwidget.h,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Widget and Dialog creation functions ==============================================================================*/ #ifndef MWIDGET_H #define MWIDGET_H #include "mwindow.h" #define EVENT_HANDLED 100 #define FOCUS_NEXT (1) /* next widget gets focus */ #define FOCUS_PREV (-1) /* prev widget gets focus */ #define FOCUS_ACTIVATE (EVENT_HANDLED+1) /* button select, return in input field */ typedef enum { WID_GET_FOCUS, WID_HOTKEY, WID_KEY } WID_EVENT; typedef enum { TYPE_LABEL, TYPE_STR, TYPE_INT, TYPE_BUTTON } WID_TYPE; typedef struct { int active; /* active widget */ int cnt; /* Nuber of widgets */ MWINDOW *win; struct WIDGET **widget; /* the widgets */ } DIALOG; typedef struct WIDGET { WID_TYPE type; BOOL can_focus; /* can the widget have the focus */ BOOL has_focus; /* has this widget the focus */ int x; /* x-pos of widget(is calculated) */ int y; /* Before dialog_open(): spacing(-1: Widget on the right side of last widget) After dialog_open(): y-pos of widget */ void(*w_free)(struct WIDGET*); void(*w_paint)(DIALOG*,struct WIDGET*); int(*w_handle_event)(DIALOG*,struct WIDGET*,WID_EVENT,int); void(*w_get_size)(struct WIDGET*,int*,int*); int(*handle_key)(DIALOG*,struct WIDGET*,int); int(*handle_focus)(DIALOG*,struct WIDGET*,int); void *data; /* not used by menu functions */ } WIDGET; typedef int(*handleKeyFunc)(DIALOG*,struct WIDGET*,int); typedef int(*handleFocusFunc)(DIALOG*,struct WIDGET*,int); /* Free substructs of w and w itself */ typedef void(*freeFunc)(WIDGET*); /* Display widget w */ typedef void(*paintFunc)(DIALOG*,WIDGET*); /* GET_FOCUS: Widget w gets the focus ch: -1: Last active widget was behind the new one 1: Last active widget was before the new one HOTKEY: ch: The Key which was pressed back: FOCUS_ACTIVATE: Widget w gets the focus EVENT_HANDLED : Focus is not changed, Key is not processed any more, e.g. necessary if function closes the dialog KEY: Key ch was pressed back: +/-n : Widget n entries before/behind Widget w gets the focus EVENT_HANDLED: Key is not processed any more 0 : event HOTKEY is send to the widgets */ typedef int(*handleEventFunc)(DIALOG*,WIDGET*,WID_EVENT,int); /* Return the size of widget w */ typedef void(*getSizeFunc)(WIDGET*,int*,int*); typedef struct { WIDGET w; char *msg; } WID_LABEL; typedef struct { WIDGET w; char *input; int width; /* width of input field */ int cur_pos; /* cursor position */ int start; /* first visible char */ int length; /* max length of input */ } WID_STR; typedef struct { WIDGET w; char *input; int width; /* width of input field */ int cur_pos; /* cursor position */ int start; /* first visible char */ int length; /* max length of input */ } WID_INT; typedef struct { WIDGET w; char *button; /* &but1|but2|... */ int cnt; /* Number of buttons */ int active; /* active button */ } WID_BUTTON; /* spacing: -1 : Widget on the right side of last widget >=0: Number of free lines to last widget */ WIDGET* wid_label_add(DIALOG*,int,char*); WIDGET* wid_str_add(DIALOG*,int,char*,int); WIDGET* wid_int_add(DIALOG*,int,int,int); WIDGET* wid_button_add(DIALOG*,int,char*,int); void wid_set_func(WIDGET*,handleKeyFunc,handleFocusFunc,void*); DIALOG* dialog_new(void); void dialog_open(DIALOG*,char*); BOOL dialog_repaint(MWINDOW*); void dialog_close(DIALOG*); #endif /* MWIDGET_H */ mikmod-3.2.1/src/mutilities.c0100644001161100116100000000544607740670667015621 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mutilities.c,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Some utility functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #if !defined(__OS2__) && !defined(__EMX__) #include #endif #include #include #include #include "player.h" #include "mutilities.h" /* allocate memory for a formated string and do a sprintf */ char *str_sprintf2(char *fmt,char *arg1,char *arg2) { char *msg=malloc(strlen(fmt)+strlen(arg1)+strlen(arg2)+1); if (msg) sprintf(msg,fmt,arg1,arg2); return msg; } /* allocate memory for a formated string and do a sprintf */ char *str_sprintf(char *fmt,char *arg) { return str_sprintf2(fmt,arg,""); } BOOL file_exist(char *file) { struct stat sb; return (stat(file,&sb)==-1)?0:1; } /* determines if a given path is absolute or relative */ BOOL path_relative(char *path) { if (!path) return 1; #if defined(__OS2__)||defined(__EMX__) if (*path && (path[1]==':')) return 0; #endif return (*path!=PATH_SEP); } /* allocate and return a name for a temporary file */ char *get_tmp_name(void) { #if defined(__OS2__) && defined(__WATCOMC__) return str_sprintf2("%s" PATH_SEP_STR "%s",getenv("TEMP"),"!MikMod.tmp"); #else CHAR *tmp_file; if (!(tmp_file=tempnam(NULL,".mod"))) if (!(tmp_file=tempnam(getenv("HOME"),".mod"))) return NULL; return tmp_file; #endif } /* allocate and return a filename including the path for a config file 'name': filename without the path */ char* get_cfg_name(char *name) { char *home=getenv("HOME"); if (!home) { #if defined(__OS2__)||defined(__EMX__) home="C:"; #else struct passwd *pw=getpwuid(getuid()); if (pw) home=pw->pw_dir; else return NULL; #endif } return str_sprintf2("%s" PATH_SEP_STR "%s",home,name); } /* ex:set ts=4: */ mikmod-3.2.1/src/mutilities.h0100644001161100116100000000306207740670667015616 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mutilities.h,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Some utility functions ==============================================================================*/ #ifndef MUTILITIES_H #define MUTILITIES_H /* allocate memory for a formated string and do a sprintf */ char *str_sprintf2(char*,char*,char*); char *str_sprintf(char*,char*); /* allocate and return a name for a temporary file */ char *get_tmp_name(void); BOOL file_exist(char*); /* determines if a given path is absolute or relative */ BOOL path_relative(char*); /* allocate and return a filename including the path for a config file 'name': filename without the path */ char* get_cfg_name(char*); #endif /* MUTILITIES_H */ mikmod-3.2.1/src/display.c0100644001161100116100000011136707740670667015076 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat -- see file AUTHORS for complete list. (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: display.c,v 1.12 2003/10/08 02:08:48 raph Exp $ Display routines for the different panels and the playlist menu ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #if !defined(__OS2__)&&!defined(__EMX__) #ifdef HAVE_SYS_IOCTL_H #include #endif #ifndef GWINSZ_IN_SYS_IOCTL #include #endif #endif #include "display.h" #include #include "player.h" #include "mutilities.h" #include "mwindow.h" #include "mmenu.h" #include "mdialog.h" #include "mconfedit.h" #include "attr.h" /*========== Display layout */ /* minimum width of one column */ #define MINWIDTH (20) /* minimum width of second column */ #define MINVISIBLE (10) /* half width */ int halfwidth; /* format used for message/banner lines : like "%-80.80s" */ char fmt_fullwidth[20]; /* format used for sample/instrument lines - like "%3i %-36.36s" (the number being halfwidth-4) */ char fmt_halfwidth[20]; /* start of information panels */ #define PANEL_Y 7 typedef struct { MMENU *menu; int *actLine; } MENU_DATA; /*========== Variables */ extern BOOL quiet,semiquiet; extern MODULE *mf; static int cur_display=DISPLAY_SAMPLE,old_display=DISPLAY_SAMPLE; /* first line of displayed information in the panels */ static int first_help=0,first_sample=0,first_inst=0,first_comment=0,first_list=0; static BOOL remove_msg=0; static time_t start_time; static char old_message[121]; /* ================ Prototypes */ void set_term_title(char *songname); /* computes printf templates when screen size changes, so that two-column display fills the screen */ static void setup_printf(void) { int maxx,winy; win_get_size_root(&maxx,&winy); if (maxx>MAXWIDTH) maxx=MAXWIDTH; halfwidth=maxx>>1; if (halfwidth120) len=120; strncpy(old_message,str,len); old_message[len]='\0'; win_attrset(A_REVERSE); win_print_root(strlen(mikversion)+1,0,str); win_attrset(A_NORMAL); remove_msg=1; start_time=time(NULL); } /* changes the warning message */ static void update_message(void) { if ((remove_msg)&&(old_message[0])) { win_attrset(A_REVERSE); win_print_root(strlen(mikversion)+1,0,old_message); win_attrset(A_NORMAL); } } /* removes the warning message */ static void remove_message(void) { if (remove_msg) { time_t end_time=time(NULL); if (end_time-start_time>=6) { win_clrtoeol_root(strlen(mikversion)+1,0); remove_msg=0; } } } /* display a banner/message from line skip, at position origin returns updated skip value if it is out of bounds and would prevent the message from being seen. */ static int display_banner(char* banner,BOOL root,int origin,int skip,BOOL wrap) { char *buf=banner,str[MAXWIDTH+1]; int i,n,t,winx,winy; if (root) win_get_size_root(&winx,&winy); else win_get_size(&winx,&winy); if (winx<5) return skip; /* count message lines */ for (t=0;*buf;t++) { n=0; while ((((nt) skip=t-winy+origin; if (skip<0) skip=0; if (t-skip+origin>winy) t=winy-origin+skip; /* skip first lines */ buf=banner; for (i=0;iName,(md_mode&DMODE_16BITS)?16:8, (md_mode&DMODE_INTERP)? (md_mode&DMODE_SURROUND?"interp. surround":"interpolated"): (md_mode&DMODE_SURROUND?"surround":"normal"), (md_mode&DMODE_STEREO)?"stereo":"mono",md_mixfreq,reverb); attr_driver2(); win_print_root(res,1,storage); attr_normal(); } /* third line : filename */ static void display_file(void) { PLAYENTRY *entry; int pos; if (quiet) return; if ((entry=PL_GetCurrent(&playlist))) { CHAR *archive=entry->archive,*file; if (archive && !config.fullpaths) { archive=strrchr(entry->archive,PATH_SEP); if (archive) archive++; else archive=entry->archive; } file=strrchr(entry->file,PATH_SEP); if (file && !config.fullpaths) file++; else file=entry->file; attr_file1(); win_print_root(0,2,"File: "); attr_normal(); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,"%.70s\n",file); #else sprintf(storage,"%.70s\n",file); #endif attr_file2(); win_print_root(6,2,storage); attr_normal(); pos = 6 + strlen(storage); // calculate where the archive name should start /* If the file is part of an archive, append the name inside () */ if ((archive)&&(strlen(file)MAXWIDTH-10) { archive+=strlen(archive)-(MAXWIDTH-13-strlen(file)); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,"(...%s)\n",archive); #else sprintf(storage,"(...%s)\n",archive); #endif } else #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,"(%s)\n",archive); #else sprintf(storage,"(%s)\n",archive); #endif attr_file3(); win_print_root(pos,2,storage); attr_normal(); } } } /* fourth and fifth lines : module name and format */ static void display_name(void) { int pos=0; if ((quiet)||(!mf)) return; set_term_title(mf->songname); attr_song_name1(); win_print_root(0,3,"Name: "); attr_normal(); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,"%.70s\n",mf->songname); #else sprintf(storage,"%.70s\n",mf->songname); #endif attr_song_name2(); win_print_root(6,3,storage); attr_normal(); /* Type label */ attr_type1(); win_print_root(0,4,"Type: "); pos += 6; attr_normal(); /* The type field */ attr_type2(); win_print_root(pos, 4, mf->modtype); pos += strlen(mf->modtype); win_print_root(pos, 4, ", "); pos += 2; attr_normal(); /* Period label */ attr_type3(); win_print_root(pos, 4, "Periods: "); pos += strlen("Periods: "); attr_normal(); /* The Period field */ attr_type4(); if (mf->flags&UF_XMPERIODS) { win_print_root(pos, 4, "XM type, "); pos += strlen("XM type, "); } else { win_print_root(pos, 4, "mod type, "); pos += strlen("mod type, "); } attr_normal(); /* The linear/log field */ attr_type5(); if (mf->flags&UF_LINEAR) { win_print_root(pos, 4, "linear"); pos += strlen("linear"); } else { win_print_root(pos, 4, "log"); pos += 3; } attr_normal(); #if 0 #ifdef HAVE_SNPRINTF snprintf #else sprintf #endif (storage, #ifdef HAVE_SNPRINTF STORAGELEN, #endif "Type: %s, Periods: %s, %s\n", mf->modtype, (mf->flags&UF_XMPERIODS)?"XM type":"mod type", (mf->flags&UF_LINEAR)?"linear":"log"); win_print_root(0,4,storage); #endif } /* sixth line : player status */ void display_status(void) { int pos; if (quiet) return; if (win_check_resize()) { setup_printf(); win_panel_repaint(); } remove_message(); if ((!mf)||Player_Paused()) return; if (mf->sngposnumpos) { PLAYENTRY *cur=PL_GetCurrent(&playlist); char time[7]=""; char channels[17]=""; /* Build time string */ if (cur && cur->time>0) { #ifdef HAVE_SNPRINTF snprintf(time,7,"/%2d:%02d", (int)((cur->time/60)%60),(int)(cur->time%60)); #else sprintf(time,"/%2d:%02d", (int)((cur->time/60)%60),(int)(cur->time%60)); #endif } /* Build Channels string */ #if LIBMIKMOD_VERSION >= 0x030107 if (mf->flags&UF_NNA) { #ifdef HAVE_SNPRINTF snprintf(channels,17,"%2d/%d+%d->%d", mf->realchn,mf->numchn,mf->totalchn-mf->realchn,mf->totalchn); #else sprintf(channels,"%2d/%d+%d->%d", mf->realchn,mf->numchn,mf->totalchn-mf->realchn,mf->totalchn); #endif } else #endif { #ifdef HAVE_SNPRINTF snprintf(channels,17,"%2d/%d ",mf->realchn,mf->numchn); #else sprintf(channels,"%2d/%d ",mf->realchn,mf->numchn); #endif } /* Print stuff to screen */ pos = 0; /* pattern label */ attr_status_line1(); win_print_root(pos, 5, "pat:"); pos += 4; /* pattern field */ #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%03d/%03d ",mf->sngpos,mf->numpos-1); #else sprintf(storage, "%03d/%03d ",mf->sngpos,mf->numpos-1); #endif attr_status_line2(); win_print_root(pos, 5, storage); pos += strlen(storage); /* pos label */ attr_status_line3(); win_print_root(pos, 5, "pos:"); pos += 4; /* pos field */ #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%02.2X ",mf->patpos); #else sprintf(storage, "%02.2X ",mf->patpos); #endif attr_status_line4(); win_print_root(pos, 5, storage); pos += strlen(storage); /* spd label */ attr_status_line5(); win_print_root(pos, 5, "spd:"); pos += 4; /* spd field */ #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%2d/%3d ",mf->sngspd,mf->bpm); #else sprintf(storage, "%2d/%3d ",mf->sngspd,mf->bpm); #endif attr_status_line6(); win_print_root(pos, 5, storage); pos += strlen(storage); /* vol label */ attr_status_line7(); win_print_root(pos, 5, "vol:"); pos += 4; /* vol field */ #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%3d%%/%3d%% ", (mf->volume*100+64)>>7, (md_volume*100+64)>>7); #else sprintf(storage, "%3d%%/%3d%% ", (mf->volume*100+64)>>7, (md_volume*100+64)>>7); #endif attr_status_line8(); win_print_root(pos, 5, storage); pos += strlen(storage); /* time label */ attr_status_line9(); win_print_root(pos, 5, "time:"); pos += 5; /* time field */ #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%2d:%02d%s ", (int)(((mf->sngtime>>10)/60)%60), (int)((mf->sngtime>>10)%60), time); #else sprintf(storage, "%2d:%02d%s ", (int)(((mf->sngtime>>10)/60)%60), (int)((mf->sngtime>>10)%60), time); #endif attr_status_line10(); win_print_root(pos, 5, storage); pos += strlen(storage); /* chn label */ attr_status_line11(); win_print_root(pos, 5, "chn:"); pos += 4; /* chn field */ #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%s \n", channels); #else sprintf(storage, STORAGELEN, "%s \n", channels); #endif attr_status_line12(); win_print_root(pos, 5, storage); pos += strlen(storage); attr_normal(); #if 0 #ifdef HAVE_SNPRINTF snprintf #else sprintf #endif (storage, #ifdef HAVE_SNPRINTF STORAGELEN, #endif "pat:%03d/%03d pos:%02.2X spd:%2d/%3d " "vol:%3d%%/%3d%% time:%2d:%02d%s chn:%s \n", mf->sngpos,mf->numpos-1,mf->patpos,mf->sngspd,mf->bpm, (mf->volume*100+64)>>7,(md_volume*100+64)>>7, (int)(((mf->sngtime>>10)/60)%60),(int)((mf->sngtime>>10)%60), time,channels); win_print_root(0,5,storage); #endif } } /* help panel */ static void display_help(int diff) { static char helptext[]= "\n" #if !defined(__OS2__)&&!defined(__EMX__) "Keys help (depending on your terminal and your curses library, \n" "========= some of these keys might not be recognized) \n" #else "Keys help\n" "=========\n" #endif "\n" "H/F1 show help panel () decrease/increase tempo \n" "S/F2 show samples panel {} decrease/increase bpm \n" "I/F3 show instrument panel :/; toggle interpolation \n" "M/F4 show message panel U toggle surround sound \n" "L/F5 show list panel 1..0 volume 10%..100% \n" "C/F6 show config panel <> decrease/increase volume \n" "ENTER in list panel, activate menu P switch to previous module\n" "Left/- previous pattern N switch to next module \n" "Right/+ next pattern R restart module \n" "Up/Down scroll panel Space toggle pause \n" "PgUp/PgDn scroll panel (faster) ^L refresh screen \n" "Home/End start/end of panel Q exit MikMod \n"; first_help+=diff; first_help=display_banner(helptext,0,0,first_help,0); } static void convert_string(char *str) { for (;str&&*str;str++) if (*str<' ') *str=' '; } /* sample panel */ static void display_sample(int diff) { int count,semicount,t,x,winx; char smp_name[20], smp_num[10]; first_sample+=diff; win_get_size(&winx,&semicount); if (winx=mf->numsmp-count) first_sample=mf->numsmp-count; if (first_sample<0) first_sample=0; if ((mf->numsmp>semicount)&&(mf->numsmpnumsmp+1)>>1; if (winxnumsmp&&t<(count+first_sample);t++) { x=((t-first_sample)samples[t].samplename?mf->samples[t].samplename:""); convert_string(storage); snprintf(smp_num, 10, "%3i ", t); attr_sample_num(); win_print(x,(t-first_sample)%semicount,smp_num); attr_sample_name(); win_print(x+4,(t-first_sample)%semicount,storage); attr_normal(); } } } /* instrument panel */ static void display_inst(int diff) { int count,semicount,t,x,winx; char inst_name[20], inst_num[10]; first_inst+=diff; win_get_size(&winx,&semicount); if (winx=mf->numins-count) first_inst=mf->numins-count; if (first_inst<0) first_inst=0; if (mf->numins>semicount&&mf->numinsnumins+1)>>1; if (winxnumins&&t<(count+first_inst);t++) { x=((t-first_inst)instruments[t].insname ? mf->instruments[t].insname:""); convert_string(storage); snprintf(inst_num, 10, "%3i ", t); attr_inst_num(); win_print(x,(t-first_sample)%semicount,inst_num); attr_inst_name(); win_print(x+4,(t-first_inst)%semicount,storage); } } attr_normal(); } /* comment panel */ static void display_comment(int diff) { first_comment+=diff; win_clear(); first_comment=display_banner(mf->comment,0,0,first_comment,1); } /* remove an entry from the playlist */ static void remove_entry(int entry) { int cur=PL_GetCurrentPos(&playlist); if (cur==entry) { if (cur==PL_GetLength(&playlist)-1) Player_SetNextMod(0); else Player_SetNextMod(entry); } PL_DelEntry(&playlist,entry); } /* remove an entry from the playlist and delete the associated module */ static void cb_delete_entry(int button,void *input,void *entry) { if (!button) { PLAYENTRY *cur=PL_GetEntry(&playlist,(long)entry); if (cur->archive) { if (unlink(cur->archive)==-1) dlg_error_show("Error deleting file!\n(%s)"); } else { if (unlink(cur->file)==-1) dlg_error_show("Error deleting file!\n(%s)"); } remove_entry((long)entry); } } /* split a filename into the name and the last extension */ static void split_name(char *file,char **name,char **ext) { *name=strrchr(file,PATH_SEP); if (!*name) *name=file; *ext=strrchr(*name,'.'); if (!*ext) *ext=&(*name[strlen(*name)]); } static BOOL sort_rev=0; static enum {SORT_NAME,SORT_EXT,SORT_PATH,SORT_TIME} sort_mode=SORT_NAME; static int cb_cmp_sort(PLAYENTRY *small,PLAYENTRY *big) { char ch_s=' ',ch_b=' ',*ext_s,*ext_b,*name_s,*name_b; int ret=0; switch (sort_mode) { case SORT_NAME: split_name(small->file,&name_s,&ext_s); split_name(big->file,&name_b,&ext_b); ch_s=*ext_s;ch_b=*ext_b; *ext_s='\0';*ext_b='\0'; ret=strcasecmp(name_s,name_b); *ext_s=ch_s;*ext_b=ch_b; break; case SORT_EXT: split_name(small->file,&name_s,&ext_s); split_name(big->file,&name_b,&ext_b); ret=strcasecmp(ext_s,ext_b); break; case SORT_PATH: ext_s=small->archive; if (!ext_s) ext_s=small->file; name_s=strrchr(ext_s,PATH_SEP); if (name_s) { ch_s=*name_s;*name_s='\0'; } ext_b=big->archive; if (!ext_b) ext_b=big->file; name_b=strrchr(ext_b,PATH_SEP); if (name_b) { ch_b=*name_b;*name_b='\0'; } ret=strcasecmp(ext_s,ext_b); if (name_s) *name_s=ch_s; if (name_b) *name_b=ch_b; break; case SORT_TIME: ret=(small->time==big->time?0: (small->timetime?-1:1)); break; } return (sort_rev)?-ret:ret; } /* overwrites an existdng playlist */ static void cb_overwrite(int button,void *input,void *file) { if (!button) { if (PL_Save(&playlist,file)) CF_set_string(&config.pl_name,file,PATH_MAX); else dlg_error_show("Error saving playlist!\n(%s)"); } if (file) free(file); } /* saves a playlist */ static void cb_save_as(int button,void *input,void *data) { if (!button) { if (file_exist(input)) { char *f_copy=strdup(input); char *msg=str_sprintf("File \"%s\" exists.\n" "Really overwrite the file?",f_copy); dlg_message_open(msg,"&Yes|&No",1,cb_overwrite,f_copy); free(msg); } else { if (PL_Save(&playlist,input)) CF_set_string(&config.pl_name,input,PATH_MAX); else dlg_error_show("Error saving playlist!\n(%s)"); } } } /* loads or merges a playlist */ static void cb_load_playlist(int button,void *input,void *data) { if (!button) { int actLine=(long)data; /* <0: Load list/module */ if (actLine<0) PL_ClearList(&playlist); else PL_StartInsert(&playlist,actLine); MA_FindFiles(&playlist,input); PL_StopInsert(&playlist); if (actLine<0) { PL_InitCurrent(&playlist); Player_SetNextMod(-1); } else { /* remove duplicates entries */ int current,old_cur=PL_GetCurrentPos(&playlist); PL_DelDouble(&playlist); current=PL_GetCurrentPos(&playlist); if (current!=old_cur) Player_SetNextMod(current); } } } /* playlist menu handler */ static void cb_handle_menu(MMENU *menu) { MENU_DATA *data=menu->data; int actLine=*data->actLine; PLAYENTRY *cur; char *name,*msg; /* main menu */ if (!menu->id) { switch (menu->cur) { /* play highlighted module */ case 0: if (actLine>=0) Player_SetNextMod(actLine); break; /* remove highlighted module */ case 1: if (actLine>=0) remove_entry(actLine); break; /* delete highlighted module */ case 2: cur=PL_GetEntry(&playlist,actLine); if (!cur) break; if (cur->archive) { name=strrchr(cur->file,PATH_SEP); if (name) name++; else name=cur->file; if (strlen(cur->archive)>60) msg=str_sprintf2("File \"%s\" is in an archive!\n" "Really delete whole archive\n" " \"...%s\"?",name, &(cur->archive[strlen(cur->archive)-57])); else msg=str_sprintf2("File \"%s\" is in an archive!\n" "Really delete whole archive\n" " \"%s\"?",name,cur->archive); dlg_message_open(msg,"&Yes|&No",1, cb_delete_entry,(void*)(long)actLine); } else { if (strlen(cur->file)>50) msg=str_sprintf("Delete file \"...%s\"?", &(cur->file[strlen(cur->file)-47])); else msg=str_sprintf("Delete file \"%s\"?",cur->file); dlg_message_open(msg,"&Yes|&No",1, cb_delete_entry,(void*)(long)actLine); } free(msg); break; /* shuffle list */ case 5: PL_Randomize(&playlist,1); break; /* cancel */ case 7: break; default: return; } /* file menu */ } else if (menu->id == 1) { switch (menu->cur) { /* load */ case 0: dlg_input_str("Load playlist/module:",config.pl_name,PATH_MAX, cb_load_playlist,(void*)-1); break; /* insert */ case 1: dlg_input_str("Insert playlist/module:",config.pl_name,PATH_MAX, cb_load_playlist,(void*)(long)actLine); break; /* save */ case 2: if (!PL_Save(&playlist,config.pl_name)) dlg_error_show("Error saving playlist!\n(%s)"); break; /* save as */ case 3: dlg_input_str("Save playlist as:",config.pl_name,PATH_MAX, cb_save_as,NULL); break; default: return; } /* sort menu */ } else { /* reverse flag */ sort_rev=(long)menu->entries[5].data; switch (menu->cur) { /* by name */ case 0: sort_mode=SORT_NAME; PL_Sort(&playlist,cb_cmp_sort); break; /* by extension */ case 1: sort_mode=SORT_EXT; PL_Sort(&playlist,cb_cmp_sort); break; /* by path */ case 2: sort_mode=SORT_PATH; PL_Sort(&playlist,cb_cmp_sort); break; /* by time */ case 3: sort_mode=SORT_TIME; PL_Sort(&playlist,cb_cmp_sort); break; default: return; } } menu_close(data->menu); return; } static void display_playentry(PLAYENTRY *pos,PLAYENTRY *cur,int nr,int y,int x,BOOL reverse,int width) { char *name,sort; char time[8]="",tmpfmt[30]; int timelen=0; if (pos->time>0) { #ifdef HAVE_SNPRINTF snprintf(time,7," %2d:%02d", (int)((pos->time/60)%60),(int)(pos->time%60)); #else sprintf(time," %2d:%02d", (int)((pos->time/60)%60),(int)(pos->time%60)); #endif timelen=strlen(time); } name=strrchr(pos->file,PATH_SEP); if (name && !config.fullpaths) name++; else name=pos->file; if (pos==cur) sort='>'; else if (pos->played) sort='*'; else sort=' '; /* Display number */ attr_list_num(); #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%4i ", nr); #else snprintf(storage, "%4i ", nr); #endif win_print(x,y,storage); x += strlen(storage); attr_normal(); /* Display sort */ attr_list_sort(); #ifdef HAVE_SNPRINTF snprintf(storage, STORAGELEN, "%c", sort); #else snprintf(storage, "%c", sort); #endif win_print(x,y,storage); x += strlen(storage); attr_normal(); if (pos->archive) { if (strlen(name)>width-13-timelen) { name=name+strlen(name)-(width-16-timelen); if (timelen) { sprintf(tmpfmt,"...%%-%ds%%s",width-22); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name,time); #else sprintf(storage,tmpfmt,name,time); #endif } else { sprintf(tmpfmt,"...%%-%ds",width-16); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name); #else sprintf(storage,tmpfmt,name); #endif } } else { if (timelen) { sprintf(tmpfmt,"%%-%ds%%s",width-19); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name,time); #else sprintf(storage,tmpfmt,name,time); #endif } else { sprintf(tmpfmt,"%%-%ds",width-13); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name); #else sprintf(storage,tmpfmt,name); #endif } } } else if (strlen(name)>width-7-timelen) { name=name+strlen(name)-(width-10-timelen); if (timelen) { sprintf(tmpfmt,"...%%-%ds%%s",width-16); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name,time); #else sprintf(storage,tmpfmt,name,time); #endif } else { sprintf(tmpfmt,"...%%-%ds",width-10); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name); #else sprintf(storage,tmpfmt,name); #endif } } else { if (timelen) { sprintf(tmpfmt,"%%-%ds%%s",width-13); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name,time); #else sprintf(storage,tmpfmt,name,time); #endif } else { sprintf(tmpfmt,"%%-%ds",width-7); #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,tmpfmt,name); #else sprintf(storage,tmpfmt,name); #endif } } if (reverse) win_attrset(A_REVERSE); attr_list_name(); win_print(x,y,storage); x+=strlen(storage); win_attrset(A_NORMAL); attr_normal(); if (pos->archive) { attr_list_pack(); win_print(x,y,"(pack)"); attr_normal(); } // win_print(x,y,storage); } /* playlist panel */ static void display_list(int diff,COMMAND com) { static char *no_data ="\nPlaylist is empty!\n"; static MENU_DATA menu_data; static int actLine=-1; static MENTRY file_entries[]={ {"&Load...", 0,"Load new playlist/module"}, {"&Insert...", 0,"Insert new playlist/module in current playlist"}, {"&Save", 0,NULL}, {"Save &as...",0,"Save playlist in a specified file"}, }; static MMENU file_menu={0,0,4,1,file_entries,cb_handle_menu,NULL,&menu_data,1}; static MENTRY sort_entries[]={ {"by &name", 0,"Sort list by name of modules"}, {"by &extension",0,"Sort list by extension of modules"}, {"by &path", 0,"Sort list by path of modules/archives"}, {"by &time", 0,"Sort list by playing time of modules"}, {"----------", 0,NULL}, {"[%c] &reverse",0,"Smaller to bigger or reverse sort"}}; static MMENU sort_menu={0,0,6,1,sort_entries,cb_handle_menu,NULL,&menu_data,2}; static MENTRY entries[]={ {"&Play", 0,"Play selected entry"}, {"&Remove", 0,"Remove selected entry from list"}, {"&Delete...", 0,"Remove selected entry from list and delete it on disk"}, {"-----------", 0,NULL}, {"&File >",&file_menu,"Load/Save playlist/modules"}, {"&Shuffle", 0,"Shuffle the list"}, {"S&ort >",&sort_menu,"Sort the list"}, {"&Back", 0,"Leave menu"}}; static MMENU menu={0,0,8,1,entries,cb_handle_menu,NULL,&menu_data,0}; int count,semicount,playcount,t,winx,x,width; PLAYENTRY *cur; playcount=PL_GetLength(&playlist); if (actLine>=playcount) actLine=playcount-1; if (com==MENU_ACTIVATE) { menu_data.menu=&menu; menu_data.actLine=&actLine; set_help(&file_entries[2],"Save list in '%s'",config.pl_name); menu_open(&menu,5,5); return; } win_clear(); if (playcount) { win_get_size(&winx,&semicount); if (winx<40+MINVISIBLE) { count=semicount; width=winx; } else { count=semicount*2; width=winx>>1; } cur=PL_GetCurrent(&playlist); if (actLine<0) { actLine=PL_GetCurrentPos(&playlist); first_list=actLine-semicount/2; if (first_list<0) first_list=0; } actLine+=diff; if (actLine<0) actLine=0; else if (actLine>=playcount) actLine=playcount-1; if (actLine=first_list+count) first_list=actLine-count+1; for (t=first_list;tflags&UF_INST)))|| ((cur_display==DISPLAY_COMMENT)&&(!mf->comment))) { cur_display=(cur_display==old_display)?DISPLAY_SAMPLE:old_display; change=1; } else break; } if (change) { win_change_panel(cur_display); return 0; } /* set panel title */ switch(cur_display) { case DISPLAY_HELP: strcpy(paneltitle,"[ Help ]"); break; case DISPLAY_INST: #ifdef HAVE_SNPRINTF snprintf(paneltitle,STORAGELEN,"[ %d Instruments ]",mf->numins); #else sprintf(paneltitle,"[ %d Instruments ]",mf->numins); #endif break; case DISPLAY_SAMPLE: #ifdef HAVE_SNPRINTF snprintf(paneltitle,STORAGELEN,"[ %d Samples ]",mf->numsmp); #else sprintf(paneltitle,"[ %d Samples ]",mf->numsmp); #endif break; case DISPLAY_COMMENT: strcpy(paneltitle,"[ Message ]"); break; case DISPLAY_LIST: #ifdef HAVE_SNPRINTF snprintf(paneltitle,STORAGELEN,"[ %d Modules ]",PL_GetLength(&playlist)); #else sprintf(paneltitle,"[ %d Modules ]",PL_GetLength(&playlist)); #endif break; case DISPLAY_CONFIG: strcpy(paneltitle,"[ Config ]"); break; } pos = 0; attr_info1(); win_print_root(pos, 6, paneltitle); pos += strlen(paneltitle); attr_info2(); win_print_root(pos, 6, " --"); pos += 3; /* set available panel information */ strcpy(otherpanels," --"); if (cur_display!=DISPLAY_HELP) { //strcat(otherpanels," H:[help]"); attr_info3(); win_print_root(pos, 6, " H:"); pos += 3; attr_info4(); win_print_root(pos, 6, "[help]"); pos += 6; } if ((cur_display!=DISPLAY_INST) && mf && (mf->flags&UF_INST)) { //strcat(otherpanels," I:[instruments]"); attr_info3(); win_print_root(pos, 6, " I:"); pos += 3; attr_info4(); win_print_root(pos, 6, "[instruments]"); pos += 13; } if (cur_display!=DISPLAY_SAMPLE && mf) { //strcat(otherpanels," S:[samples]"); attr_info3(); win_print_root(pos, 6, " S:"); pos += 3; attr_info4(); win_print_root(pos, 6, "[samples]"); pos += 9; } if ((cur_display!=DISPLAY_COMMENT) && mf && (mf->comment)) { //strcat(otherpanels," M:[message]"); attr_info3(); win_print_root(pos, 6, " M:"); pos += 3; attr_info4(); win_print_root(pos, 6, "[messages]"); pos += 10; } if (cur_display!=DISPLAY_LIST) { //strcat(otherpanels," L:[playlist]"); attr_info3(); win_print_root(pos, 6, " L:"); pos += 3; attr_info4(); win_print_root(pos, 6, "[playlist]"); pos += 10; } if (cur_display!=DISPLAY_CONFIG) { //strcat(otherpanels," C:[config]"); attr_info3(); win_print_root(pos, 6, " C:"); pos += 3; attr_info4(); win_print_root(pos, 6, "[config]"); pos += 8; } attr_normal(); //strcat (otherpanels,"\n"); // win_attrset(A_REVERSE); // win_print_root(0,6,paneltitle); // win_attrset(A_NORMAL); // win_print_root(strlen(paneltitle),6,otherpanels); /* display panel contents */ switch(cur_display) { case DISPLAY_HELP: display_help(diff); break; case DISPLAY_INST: display_inst(diff); break; case DISPLAY_SAMPLE: display_sample(diff); break; case DISPLAY_COMMENT: display_comment(diff); break; case DISPLAY_LIST: display_list(diff,com); break; case DISPLAY_CONFIG: display_config(diff); break; } return 1; } /* displays the top of the screen */ void display_header(void) { if (quiet) return; display_version(); update_message(); if (Player_Paused()) display_pausebanner(); else { display_driver(); display_file(); display_name(); display_status(); } } static BOOL display_head_repaint(MWINDOW *win) { display_header(); return 1; } static BOOL display_inf_repaint(MWINDOW *win) { if ((long)win->data!=cur_display) old_display=cur_display; cur_display=(long)win->data; return display_information(0,COM_NONE); } void display_start(void) { if (quiet) return; first_inst=first_sample=first_comment=0; win_panel_repaint(); } /* handle interface-specific keys */ static BOOL display_handle_key(MWINDOW *win,int ch) { switch (ch) { case KEY_DOWN: display_information(1,COM_NONE); break; case KEY_UP: display_information(-1,COM_NONE); break; case KEY_RIGHT: if (cur_display!=DISPLAY_LIST) return 0; /* fall through */ case KEY_NPAGE: display_information(win->height,COM_NONE); break; case KEY_LEFT: if (cur_display!=DISPLAY_LIST) return 0; /* fall through */ case KEY_PPAGE: display_information(-win->height,COM_NONE); break; case KEY_HOME: display_information(-32000,COM_NONE); break; #ifdef KEY_END case KEY_END: display_information(32000,COM_NONE); break; #endif case KEY_ENTER: case '\r': if (cur_display==DISPLAY_LIST) display_information(0,MENU_ACTIVATE); else return 0; break; default: return 0; } return 1; } /* setup interface */ void display_init(void) { int i; win_panel_set_repaint(DISPLAY_ROOT,display_head_repaint); for (i=1;i<=DISPLAY_CONFIG;i++) { win_panel_open(i,0,PANEL_Y,999,999,0,NULL); win_panel_set_repaint(i,display_inf_repaint); win_panel_set_handle_key(i,display_handle_key); win_panel_set_resize(i,1,NULL); win_panel_set_data(i,(void*)(long)i); } win_change_panel(cur_display); setup_printf(); } /* This will set the xterm (or equivalent) Title and Icon title. * * The title contains -= MikMod x.x.x =- (%s) where %s is the song name * the icon contains -= MikMod x.x.x =- * * pass NULL as songname to reset the title * * Written using the 'Xterm-Title mini-howto' */ void set_term_title(char *songname) { char *env_term; static int last_config=0; if (!config.xterm_title && !last_config) { return; } if (last_config && !config.xterm_title) { /* xterm title setting has just been disabled */ songname = NULL; } last_config = config.xterm_title; env_term = getenv("TERM"); if (env_term==NULL) { return; } if (songname!=NULL) { #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,"%s (%s)", mikversion, songname); #else sprintf(storage,"%s: (%s)", mikversion, songname); #endif } else { #ifdef HAVE_SNPRINTF snprintf(storage,STORAGELEN,""); #else sprintf(storage,""); #endif } if ( strcmp(env_term, "xterm")==0 || strcmp(env_term, "xterm-color")==0 || strcmp(env_term, "rxvt")==0 || strcmp(env_term, "aixterm")==0 || strcmp(env_term, "dtterm")==0 || strcmp(env_term, "xterm-color")==0 || strcmp(env_term, "xterm-color")==0 || strcmp(env_term, "xterm-color")==0 ) { printf("%c]0;%s%c", '\033', storage, '\007'); printf("%c]1;%s%c", '\033', mikversion, '\007'); } else if (strcmp(env_term, "iris-ansi")==0) { printf("%cP1.y%s%c\\", '\033', storage, '\033'); printf("%cP3.y%s%c\\", '\033', mikversion, '\033'); } else if (strcmp(env_term, "hpterm")==0) { printf("\033&f0k%dD%s", strlen(storage), storage); printf("\033&f-1k%dD%s", strlen(mikversion), mikversion); } } /* ex:set ts=4: */ mikmod-3.2.1/src/display.h0100644001161100116100000000276707740670667015106 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat -- see file AUTHORS for complete list. (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: display.h,v 1.3 2003/10/07 18:17:20 raph Exp $ Common display definitions, curses-related ==============================================================================*/ #ifndef DISPLAY_H #define DISPLAY_H #if defined(__OS2__)||defined(__EMX__) #ifdef _MIKMOD_H_ #error include "display.h" before #endif #define INCL_VIO #include #else #ifdef HAVE_NCURSES_H #include #else #include #endif #endif #if defined(__OS2__)||defined(__EMX__) #define A_REVERSE 0x70 #define A_NORMAL 0x07 #endif #endif /* DISPLAY_H */ mikmod-3.2.1/src/fnmatch.c0100644001161100116100000001305407740670670015035 0ustar raphtechnolab/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Enable GNU extensions in fnmatch.h. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #include #include "fnmatch.h" #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) # if defined (STDC_HEADERS) || !defined (isascii) # define ISASCII(c) 1 # else # define ISASCII(c) isascii(c) # endif # define ISUPPER(c) (ISASCII (c) && isupper (c)) # ifndef errno extern int errno; # endif /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int fnmatch (pattern, string, flags) const char *pattern; const char *string; int flags; { register const char *p = pattern, *n = string; register char c; /* Note that this evaluates C many times. */ # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') { c = FOLD (c); switch (c) { case '?': if (*n == '\0') return FNM_NOMATCH; else if ((flags & FNM_FILE_NAME) && *n == '/') return FNM_NOMATCH; else if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; break; case '\\': if (!(flags & FNM_NOESCAPE)) { c = *p++; if (c == '\0') /* Trailing \ loses. */ return FNM_NOMATCH; c = FOLD (c); } if (FOLD (*n) != c) return FNM_NOMATCH; break; case '*': if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; for (c = *p++; c == '?' || c == '*'; c = *p++) { if ((flags & FNM_FILE_NAME) && *n == '/') /* A slash does not match a wildcard under FNM_FILE_NAME. */ return FNM_NOMATCH; else if (c == '?') { /* A ? needs to match one character. */ if (*n == '\0') /* There isn't another character; no match. */ return FNM_NOMATCH; else /* One character of the string is consumed in matching this ? wildcard, so *??? won't match if there are less than three characters. */ ++n; } } if (c == '\0') return 0; { char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; c1 = FOLD (c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD (*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } case '[': { /* Nonzero if the sense of the character class is inverted. */ register int not; if (*n == '\0') return FNM_NOMATCH; if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; not = (*p == '!' || *p == '^'); if (not) ++p; c = *p++; for (;;) { register char cstart = c, cend = c; if (!(flags & FNM_NOESCAPE) && c == '\\') { if (*p == '\0') return FNM_NOMATCH; cstart = cend = *p++; } cstart = cend = FOLD (cstart); if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; c = *p++; c = FOLD (c); if ((flags & FNM_FILE_NAME) && c == '/') /* [/] can never match. */ return FNM_NOMATCH; if (c == '-' && *p != ']') { cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == '\\') cend = *p++; if (cend == '\0') return FNM_NOMATCH; cend = FOLD (cend); c = *p++; } if (FOLD (*n) >= cstart && FOLD (*n) <= cend) goto matched; if (c == ']') break; } if (!not) return FNM_NOMATCH; break; matched:; /* Skip the rest of the [...] that already matched. */ while (c != ']') { if (c == '\0') /* [... (unterminated) loses. */ return FNM_NOMATCH; c = *p++; if (!(flags & FNM_NOESCAPE) && c == '\\') { if (*p == '\0') return FNM_NOMATCH; /* XXX 1003.2d11 is unclear if this is right. */ ++p; } } if (not) return FNM_NOMATCH; } break; default: if (c != FOLD (*n)) return FNM_NOMATCH; } ++n; } if (*n == '\0') return 0; if ((flags & FNM_LEADING_DIR) && *n == '/') /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ return 0; return FNM_NOMATCH; # undef FOLD } #endif /* _LIBC or not __GNU_LIBRARY__. */ mikmod-3.2.1/src/fnmatch.h0100644001161100116100000000470407740670670015044 0ustar raphtechnolab/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _FNMATCH_H #define _FNMATCH_H 1 #ifdef __cplusplus extern "C" { #endif #if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \ || defined (WIN32)) #undef __P #define __P(protos) protos #else /* Not C++ or ANSI C. */ #undef __P #define __P(protos) () /* We can get away without defining `const' here only because in this file it is used only inside the prototype for `fnmatch', which is elided in non-ANSI C where `const' is problematical. */ #endif /* C++ or ANSI C. */ /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME #undef FNM_NOESCAPE #undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ #define FNM_NOMATCH 1 /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch __P ((const char *__pattern, const char *__string, int __flags)); #ifdef __cplusplus } #endif #endif /* fnmatch.h */ mikmod-3.2.1/src/mwindow.c0100644001161100116100000004176107740670670015107 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwindow.c,v 1.2 2003/09/30 01:53:30 raph Exp $ Some window functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #ifdef HAVE_SYS_IOCTL_H #include #endif #include "display.h" #include #include "player.h" #include "mwindow.h" #include "attr.h" #define PANEL_HELP 1 #define PANEL_SAMPLE 2 #define PANEL_INSTR 3 #define PANEL_COMMENT 4 #define PANEL_LIST 5 #define PANEL_CONFIG 6 #define PANEL_CNT 7 #ifndef ACS_ULCORNER #if defined(__OS2__)||defined(__EMX__) #define BOX_UL '\xDA' #define BOX_UR '\xBF' #define BOX_LL '\xC0' #define BOX_LR '\xD9' #define BOX_HLINE '\xC4' #define BOX_VLINE '\xB3' #else #define BOX_UL '+' #define BOX_UR '+' #define BOX_LL '+' #define BOX_LR '+' #define BOX_HLINE '-' #define BOX_VLINE '|' #endif #else #define BOX_UL ACS_ULCORNER #define BOX_UR ACS_URCORNER #define BOX_LL ACS_LLCORNER #define BOX_LR ACS_LRCORNER #define BOX_HLINE ACS_HLINE #define BOX_VLINE ACS_VLINE #endif /* text creation buffer */ char storage[STORAGELEN]; static int root_y1=7,root_y2=0; /* size of visible root window partions */ static BOOL curses_on=0,win_quiet=1; static int cur_panel=0,old_panel=0; static MWINDOW *panel[PANEL_CNT],*cur_window=NULL; /* screen size */ static int winx=0,winy=0; #if !defined(__OS2__)&&!defined(__EMX__) static BOOL resize=0; static int cursor_old=0; #endif #if defined(__OS2__)||defined(__EMX__) static HVIO hvio=0; static VIOCURSORINFO viocursorinfo; static BYTE clearscreen[2]={0xff,A_NORMAL}; static BYTE mvattr=A_NORMAL; #endif /*========== Display routines */ /* old AIX curses are very limited */ #if defined(AIX) && !defined(mvaddnstr) void mvaddnstr(int y,int x,char *str,int len) { char buffer[STORAGELEN]; int l=strlen(str); strncpy(buffer,str,len); if (lwidth-x>0) { clearscreen[1]=mvattr; VioWrtNCell(clearscreen,cur_window->width-x, cur_window->y+y,cur_window->x+x,hvio); } } /* clear to end of line on root window */ void win_clrtoeol_root(int x,int y) { clearscreen[1]=mvattr; VioWrtNCell(clearscreen,winx-x,y,x,hvio); } #else /* #if defined(__OS2__)||defined(__EMX__) */ /* handler for terminal resize events */ RETSIGTYPE sigwinch_handler(int signum) { /* schedule a resizeterm() */ resize=1; signal(SIGWINCH,sigwinch_handler); } /* update window */ void win_refresh(void) { if (win_quiet) return; refresh(); } void win_cursor_set(BOOL visible) { if (cursor_old!=ERR) { if (visible) curs_set(cursor_old); else curs_set(0); } } static void init_curses(void) { initscr(); cbreak(); noecho(); nonl(); nodelay(stdscr,TRUE); #if !defined(AIX) || defined(NCURSES_VERSION) timeout(0); #endif keypad(stdscr,TRUE); cursor_old=curs_set(0); curses_on=1; } /* init window functions(e.g. init curses) */ void win_init(BOOL quiet) { win_quiet=quiet; if (!win_quiet) { init_curses(); getmaxyx(stdscr,winy,winx); signal(SIGWINCH,sigwinch_handler); } win_open(0,0,winx,winy,0,NULL); win_set_resize(1,NULL); } /* clean up(e.g. exit curses) */ void win_exit(void) { if (win_quiet || !curses_on) return; signal(SIGWINCH,SIG_DFL); clear(); mvaddnstr(winy-2,0,mikversion,winx); win_refresh(); win_cursor_set(1); endwin(); curses_on=0; } /* clear to end of line on uppermost window */ void win_clrtoeol(int x,int y) { int i,len=cur_window->width-x; if (len>0) { for (i=0;iy+y,cur_window->x+x,storage,len); } } /* clear to end of line on root window */ void win_clrtoeol_root(int x,int y) { move(y,x);clrtoeol(); } #endif BOOL win_clear_win(MWINDOW *win) { int i; if ((win->width>0)&&(win->height>0)) { for (i=0;iwidth;i++) storage[i]=' '; storage[i]='\0'; for (i=0;iheight;i++) mvaddnstr(win->y+i,win->x,storage,win->width); } return 1; } /* clear uppermost window */ void win_clear(void) { win_clear_win(cur_window); } /* clear root window */ void win_clear_root(void) { MWINDOW *win=panel[0]; int i; if ((win->width>0)&&(win->height>0)) { for (i=0;iwidth;i++) storage[i]=' '; storage[i]='\0'; for (i=0;iheight && iy+i,win->x,storage,win->width); i=win->height-root_y2; if (i<0) i=0; for (;iheight;i++) mvaddnstr(win->y+i,win->x,storage,win->width); } } void win_box(int x1,int y1,int x2,int y2,char *title) { int i,sx1,sx2,sy1,sy2; if (win_quiet) return; sx1=x1>=0?x1+1:0; sx2=x2=root_y1?y1+1:root_y1; sy2=y2=0) mvaddch(y2,x1,BOX_LL); if (x2=root_y1) { if (x1>=0) mvaddch(y1,x1,BOX_UL); if (x2=0) mvaddch(i,x1,BOX_VLINE); if (x2winy-ofs) height=winy-y-ofs; } else { if (ywiny-ofs-root_y2) height=winy-y-ofs-root_y2; } if (x+width>winx-ofs) width=winx-x-ofs; if (width<0) width=0; if (height<0) height=0; if (border &&(dst_panel==cur_panel)) win_box(x-1,y-1,x+width,y+height,title); win->x=x; win->y=y; win->width=width; win->height=height; win->border=border; win->resize=0; if (title) win->title=strdup(title); else win->title=NULL; win->next=NULL; win->repaint=win_clear_win; win->handle_key=NULL; for (help=panel[dst_panel];help && help->next;help=help->next); if (help) help->next=win; else panel[dst_panel]=win; if (dst_panel==cur_panel) cur_window=win; return win; } /* open new window on current panel */ MWINDOW* win_open(int x,int y,int width,int height,BOOL border,char *title) { return win_panel_open(cur_panel,x,y,width,height,border,title); } MWINDOW *win_get_first(int dst_panel) { MWINDOW *win; for (win=panel[dst_panel];win && win->next;win=win->next); return win; } /* set function which sould be called on a repaint request */ void win_set_repaint(WinRepaintFunc func) { cur_window->repaint=func; } void win_panel_set_repaint(int panel,WinRepaintFunc func) { win_get_first(panel)->repaint=func; } /* set function which sould be called on a key press */ void win_set_handle_key(WinKeyFunc func) { cur_window->handle_key=func; } void win_panel_set_handle_key(int panel,WinKeyFunc func) { win_get_first(panel)->handle_key=func; } /* should window be automatically resized? should a function be called on resize? */ void win_set_resize(BOOL auto_resize,WinResizeFunc func) { cur_window->resize=auto_resize; cur_window->handle_resize=func; } void win_panel_set_resize(int panel,BOOL auto_resize,WinResizeFunc func) { win_get_first(panel)->resize=auto_resize; win_get_first(panel)->handle_resize=func; } /* set private data */ void win_set_data(void *data) { cur_window->data=data; } void win_panel_set_data(int panel,void *data) { win_get_first(panel)->data=data; } void win_do_resize(int dx,int dy,BOOL root) { MWINDOW *win; int i=root?0:1; if (win_quiet) return; for (;inext) { if (win->resize) { win->width+=dx; if (win->width<0) win->width=0; win->height+=dy; if (win->height<0) win->height=0; } if (win->handle_resize) win->handle_resize(win,dx,dy); } win_panel_repaint(); } /* check if a resize was scheduled and do it */ BOOL win_check_resize(void) { if (win_quiet) return 0; #if !defined(__OS2__)&&!defined(__EMX__) /* if a resize was scheduled,do it now */ if (resize) { int oldx,oldy; #if (NCURSES_VERSION_MAJOR >= 4) && defined(TIOCGWINSZ) && defined(HAVE_NCURSES_RESIZETERM) struct winsize ws; ws.ws_col=ws.ws_row=0; ioctl(0,TIOCGWINSZ,&ws); if (ws.ws_col && ws.ws_row) resizeterm(ws.ws_row,ws.ws_col); #else endwin(); init_curses(); win_refresh(); #endif resize=0; oldx=winx;oldy=winy; getmaxyx(stdscr,winy,winx); win_do_resize(winx-oldx,winy-oldy,1); return 1; } #endif return 0; } static char status_message[MAXWIDTH+2]; static void win_status_repaint(void) { MWINDOW *win=panel[0]; int i; if (win_quiet) return; attr_bottom_status_line1(); if ((root_y2>1)&&(win->height>1)) for (i=0;iwidth;i++) mvaddch(win->height-2,i,BOX_HLINE); attr_normal(); } /* init the status line(height=0,1,2 0: no status line) */ void win_init_status(int height) { int old_y2=root_y2; if (height!=root_y2) { root_y2=height<0?0:(height>2?2:height); #if defined(__OS2__)||defined(__EMX__) status_message[0]='\0'; #else status_message[0]='\n'; status_message[1]='\0'; #endif win_do_resize(0,old_y2-root_y2,0); } } /* set the status line */ void win_status(char *msg) { MWINDOW *win=panel[0]; int len=0; if (msg) { len=strlen(msg); if (len>MAXWIDTH) len=MAXWIDTH; strncpy(status_message,msg,len); } #if defined(__OS2__)||defined(__EMX__) status_message[len]='\0'; #else status_message[len]='\n'; status_message[len+1]='\0'; #endif if (win_quiet) return; if ((root_y2>0)&&(win->height>0)) { mvaddnstr(win->y+win->height-1,win->x,status_message,win->width); #if defined(__OS2__)||defined(__EMX__) win_clrtoeol_root(win->x+len,win->y+win->height-1); #endif } } /* repaint the whole panel */ void win_panel_repaint(void) { if (win_quiet) return; clear(); if (panel[0]->repaint) if (!panel[0]->repaint(panel[0])) return; for (cur_window=panel[cur_panel];cur_window;cur_window=cur_window->next) { if (cur_window->border) win_box(cur_window->x-1,cur_window->y-1, cur_window->x+cur_window->width,cur_window->y+cur_window->height, cur_window->title); if (cur_window->repaint && cur_window->width>0 && cur_window->height>0) if (!cur_window->repaint(cur_window)) return; } win_status_repaint(); for (cur_window=panel[cur_panel];cur_window && cur_window->next;cur_window=cur_window->next); } /* close uppermost window */ void win_close(void) { if (cur_window) { MWINDOW *win; for (win=panel[cur_panel];win->next!=cur_window;win=win->next); if (cur_window->title) free(cur_window->title); free(cur_window); win->next=NULL; cur_window=win; win_panel_repaint(); } } /* close window win */ void win_close_win(MWINDOW *win) { int i; MWINDOW *pos; for (i=0;inext) if (pos==win) { if (win==cur_window) for (cur_window=panel[i]; cur_window->next!=win; cur_window=cur_window->next); for (pos=panel[i]; pos->next!=win; pos=pos->next); pos->next=win->next; if (win->title) free(win->title); free(win); if (i==cur_panel) win_panel_repaint(); return; } } /* get size of uppermost window */ void win_get_size(int *x,int *y) { *x=cur_window->width; *y=cur_window->height; } /* get size of whole screen */ void win_get_size_root(int *x,int *y) { *x=panel[0]->width; *y=panel[0]->height; } /* get maximal size of a new window without a border and therefore the needed minimal y position */ void win_get_size_max(int *y,int *width,int *height) { *y=root_y1; *width=panel[0]->width; *height=panel[0]->height-root_y1-root_y2; if (*height<0) *height=0; } /* get uppermost window */ MWINDOW *win_get_window(void) { return cur_window; } /* print string in current window(cur_window) */ void win_print(int x,int y,char *str) { int len=strlen(str); #if defined(__OS2__)||defined(__EMX__) if ((str[len-1]=='\n')&&(str[len-2]=='\r')) len--; #endif if ((x>=cur_window->width)||(y>=cur_window->height)|| ((cur_window!=panel[0])&&(y+cur_window->y>=winy-root_y2))|| (!len)||win_quiet) return; if (len+x>cur_window->width) len=cur_window->width-x; if ((str[len-1]=='\n')||(str[len-1]=='\r')) #if !defined(__OS2__)&&!defined(__EMX__) if (cur_window->x+cur_window->widthy,x+cur_window->x,str,len); } /* print string on root window */ void win_print_root(int x,int y,char *str) { MWINDOW *win=cur_window; cur_window=panel[0]; win_print(x,y,str); cur_window=win; } /* draw horizontal line(rev: in reverse) */ void win_line(int x1,int x2,int y) { int x; if ((yheight) &&(!win_quiet)) for (x=x1;x<=x2 && xwidth;x++) mvaddch(y+cur_window->y,x+cur_window->x,BOX_HLINE); } /* set attribute for the following output operations */ void win_attrset(int attrs) { attrset(attrs); } /* change current panel */ void win_change_panel(int new_panel) { if (new_panel==cur_panel) new_panel=old_panel; old_panel=cur_panel; if (new_panel!=cur_panel) { cur_panel=new_panel; for (cur_window=panel[cur_panel];cur_window && cur_window->next;cur_window=cur_window->next); win_panel_repaint(); } } /* handle key press(panel change and call of key handler of uppermost window),return: was key handled */ BOOL win_handle_key(int ch) { switch (ch) { case KEY_F(1): win_change_panel(PANEL_HELP); break; case KEY_F(2): win_change_panel(PANEL_SAMPLE); break; case KEY_F(3): win_change_panel(PANEL_INSTR); break; case KEY_F(4): #if defined(__OS2__)||defined(__EMX__) case KEY_SF(9): /* shift-F9 */ #else case KEY_F(19): /* shift-F9 on some curses implementations */ #endif win_change_panel(PANEL_COMMENT); break; case KEY_F(5): win_change_panel(PANEL_LIST); break; case KEY_F(6): win_change_panel(PANEL_CONFIG); break; default: if (cur_window->handle_key) return cur_window->handle_key(cur_window,ch); else return 0; } return 1; } /* ex:set ts=4: */ mikmod-3.2.1/src/mwindow.h0100644001161100116100000001030607740670670015103 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwindow.h,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Some window functions ==============================================================================*/ #ifndef MWINDOW_H #define MWINDOW_H typedef struct MWINDOW{ int x,y,width,height; /* Inner pos. and size */ BOOL border; /* Has window a border? */ BOOL resize; /* Window is automatically resized */ char *title; BOOL (*repaint)(struct MWINDOW *win); BOOL (*handle_key)(struct MWINDOW *win,int ch); void (*handle_resize)(struct MWINDOW *win,int dx,int dy); struct MWINDOW *next; void *data; /* not used by window functions */ } MWINDOW; /* return: 1: continue repaint with other windows 0: cancel repaint (if a new repaint was scheduled in the repaint func,e.g. by win_change_panel() */ typedef BOOL (*WinRepaintFunc)(MWINDOW*); /* return: 1: key was handled */ typedef BOOL (*WinKeyFunc)(MWINDOW*,int); /* dx,dy: amount of window size change */ typedef void (*WinResizeFunc)(MWINDOW*,int,int); /* init window functions (e.g. init curses) */ void win_init(BOOL); /* clean up (e.g. exit curses) */ void win_exit(void); /* open new window on current panel */ MWINDOW* win_open(int,int,int,int,BOOL,char*); /* open new window on panel 'panel' */ MWINDOW* win_panel_open(int,int,int,int,int,BOOL,char*); /* set function which should be called on a repaint request */ void win_set_repaint(WinRepaintFunc); void win_panel_set_repaint(int,WinRepaintFunc); /* set function which sould be called on a key press */ void win_set_handle_key(WinKeyFunc); void win_panel_set_handle_key(int,WinKeyFunc); /* should window be automatically resized? should a function be called on resize? */ void win_set_resize(BOOL,WinResizeFunc); void win_panel_set_resize(int,BOOL,WinResizeFunc); /* set private data */ void win_set_data(void*); void win_panel_set_data(int,void*); /* close uppermost window */ void win_close(void); /* close window win */ void win_close_win(MWINDOW*); /* check if a resize was scheduled and do it */ BOOL win_check_resize(void); /* repaint the whole panel */ void win_panel_repaint(void); /* init the status line (height=0,1,2 0: no status line) */ void win_init_status(int); /* set the status line */ void win_status(char*); /* clear to end of line on uppermost window */ void win_clrtoeol(int,int); /* clear to end of line on root window */ void win_clrtoeol_root(int,int); /* clear uppermost window */ void win_clear(void); /* clear root window */ void win_clear_root(void); /* get size of uppermost window */ void win_get_size(int*,int*); /* get size of whole screen */ void win_get_size_root(int*,int*); /* get maximal size of a new window without a border and therefore the needed minimal y position */ void win_get_size_max(int*,int*,int*); /* get uppermost window */ MWINDOW *win_get_window(void); /* print string (?_root: on root window) */ void win_print(int,int,char*); void win_print_root(int,int,char*); /* draw horizontal line (rev: in reverse) */ void win_line(int,int,int); /* set attribute for the following output operations */ void win_attrset(int); void win_cursor_set(BOOL); /* update window -> call curses.refresh() */ void win_refresh(void); /* change current panel */ void win_change_panel(int); /* handle key press (panel change and call of key handler of uppermost window), return: was key handled */ BOOL win_handle_key(int); #endif /* MWINDOW_H */ mikmod-3.2.1/src/attr.c0100644001161100116100000002577207740670670014401 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: attr.c,v 1.14 2003/10/05 02:00:34 raph Exp $ Functions called to set the color attributes for different area in the display ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_NCURSES_H #include #else #include #endif #include #include "display.h" #include "player.h" static int color_supported = 0; #define MAY_DO_COLOR (color_supported && config.color) void attr_init_colors(int quiet) { #ifdef ENABLE_COLOR_INTERFACE if (!quiet) { color_supported = has_colors(); if (color_supported) { start_color(); init_pair(1, COLOR_RED, COLOR_BLACK); init_pair(2, COLOR_GREEN, COLOR_BLACK); init_pair(3, COLOR_YELLOW, COLOR_BLACK); init_pair(4, COLOR_BLUE, COLOR_BLACK); init_pair(5, COLOR_MAGENTA, COLOR_BLACK); init_pair(6, COLOR_CYAN, COLOR_BLACK); init_pair(7, COLOR_WHITE, COLOR_BLACK); init_pair(8, COLOR_BLACK, COLOR_BLACK); init_pair(9, COLOR_BLACK, COLOR_CYAN); // version } } #endif } void attr_banner(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD|COLOR_PAIR(6)); #endif } void attr_banner1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } void attr_version(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(9)); #endif } void attr_normal(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_NORMAL); #endif } /* Name: ^^^^^ Use for this */ void attr_song_name1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* Name: song name ^^^^^^^^^ Use for this */ void attr_song_name2(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD|COLOR_PAIR(2)); #endif } /* File: filename <(archive)> * ^^^^^ * Use for this */ void attr_file1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* File: filename <(archive)> * ^^^^^ * Use for this */ void attr_file2(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD|COLOR_PAIR(5)); #endif } /* File: filename <(archive)> * ^^^^^ * Use for this */ void attr_file3(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD|COLOR_PAIR(1)); #endif } /* Output: 'drivername', %d bit 'surround/normal/interpolated', %d hz, 'reverb/no/value' * ^^^^^^ * use for this */ void attr_driver1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* Driver: 'drivername', %d bit 'surround/normal/interpolated', %d hz, 'reverb/no/value' * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * use for this */ void attr_driver2(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; //attrset(A_BOLD|COLOR_PAIR(4)); //attrset(COLOR_PAIR(4)); attrset(A_BOLD); #endif } /* Type: 'module type', Periods: 'period type', 'linear/log' * ^^^^^ * Use for this */ void attr_type1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* Type: 'module type', Periods: 'period type', 'linear/log' * ^^^^^^^^^^^^^ * Use for this */ void attr_type2(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* Type: 'module type', Periods: 'period type', 'linear/log' * ^^^^^^^^ * Use for this */ void attr_type3(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* Type: 'module type', Periods: 'period type', 'linear/log' * ^^^^^^^^^^^^^^ * Use for this */ void attr_type4(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* Type: 'module type', Periods: 'period type', 'linear/log' * ^^^^^^^^^^^^^^ * Use for this */ void attr_type5(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^ * Use for this * */ void attr_status_line1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^^^^^^ * Use for this * */ void attr_status_line2(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^ * Use for this * */ void attr_status_line3(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^^^ * Use for this * */ void attr_status_line4(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^ * Use for this * */ void attr_status_line5(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^^^^ * Use for this * */ void attr_status_line6(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^ * Use for this * */ void attr_status_line7(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^^^^^^^^ * Use for this * */ void attr_status_line8(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^^ * Use for this * */ void attr_status_line9(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^^^^^^^^^^^^^^^^^^ * Use for this * */ void attr_status_line10(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^ * Use for this * */ void attr_status_line11(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } /* pat:%03d/%03d pos:%02.2X spd:%2d/%3d vol:%3d%%/%3d%% time:%2d:%02d/ chn:%d/%d * ^^^^^ * Use for this * */ void attr_status_line12(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* [ panel title ] -- H:[help] S:[samples] C:[config] * ^^^^^^^^^^^^^^ * Use for this * */ void attr_info1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(9)); #endif } /* [ %d Modules ] -- H:[help] S:[samples] C:[config] * ^^ * Use for this * */ void attr_info2(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* [ %d Modules ] -- H:[help] S:[samples] C:[config] * ^^ ^^ ^^ * Use for this * */ void attr_info3(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(A_BOLD); #endif } /* [ %d Modules ] -- H:[help] S:[samples] C:[config] * ^^^^^^ ^^^^^^^^^ ^^^^^^^^ * Use for this * */ void attr_info4(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(9)); #endif } void attr_sample_num(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } void attr_sample_name(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(7)); #endif } void attr_inst_num(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(6)); #endif } void attr_inst_name(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attrset(COLOR_PAIR(7)); #endif } void attr_list_num(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attron(COLOR_PAIR(6)); #endif } void attr_list_sort(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attron(A_BOLD|COLOR_PAIR(7)); #endif } void attr_list_name(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attron(COLOR_PAIR(7)); #endif } void attr_list_time(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attron(A_BOLD|COLOR_PAIR(2)); #endif } void attr_list_pack(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attron(A_BOLD|COLOR_PAIR(1)); #endif } /* The status line */ void attr_bottom_status_line1(void) { #ifdef ENABLE_COLOR_INTERFACE if (!MAY_DO_COLOR) return; attron(A_BOLD|COLOR_PAIR(8)); #endif } mikmod-3.2.1/src/attr.h0100644001161100116100000000363607740670670014401 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: attr.h,v 1.7 2003/10/05 00:44:30 raph Exp $ Functions called to set the color attributes for different area in the display ==============================================================================*/ #ifndef _attr_h__ #define _attr_h__ void attr_init_colors(int quiet); void attr_banner(void); void attr_banner1(void); void attr_version(void); void attr_normal(void); void attr_song_name1(void); void attr_song_name2(void); void attr_file1(void); void attr_file2(void); void attr_file3(void); void attr_driver1(void); void attr_driver2(void); void attr_type1(void); void attr_type2(void); void attr_type3(void); void attr_type4(void); void attr_type5(void); void attr_info1(void); void attr_info2(void); void attr_info3(void); void attr_info4(void); void attr_sample_num(void); void attr_sample_name(void); void attr_inst_num(void); void attr_inst_name(void); void attr_list_num(void); void attr_list_sort(void); void attr_list_name(void); void attr_list_time(void); void attr_list_pack(void); void attr_bottom_status_line1(void); #endif // _attr_h__ mikmod-3.2.1/src/mlist.c0100644001161100116100000002761307740670670014553 0ustar raphtechnolab/* MikMod example player (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mlist.c,v 1.4 2003/09/25 16:42:19 raph Exp $ Functions to handle the playlist. ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_FNMATCH_H #include "fnmatch.h" #else #include #endif #include #include #include #include #ifdef SRANDOM_IN_MATH_H #include #endif #include #include "player.h" #include "mutilities.h" static int mikmod_random(int limit) { #if defined(__OS2__)||defined(__EMX__) return (rand()*limit)/(RAND_MAX+1.0); #else return random()%limit; #endif } /* Mark all the modules in the playlist as not played */ static void PL_ClearPlayed(PLAYLIST *pl) { int i; for (i=0;inumused;i++) pl->entry[i].played=0; } BOOL PL_isPlaylistFilename(CHAR *filename) { char *cfg_name=NULL; if (!fnmatch("*.mpl",filename,0)) return 1; if ((cfg_name=PL_GetFilename())) { if (!filecmp(cfg_name,filename)) { free(cfg_name); return 1; } free(cfg_name); } return 0; } void PL_InitList(PLAYLIST* pl) { pl->numused=0; pl->current=-1; pl->entry=NULL; pl->add_pos=-1; #if defined(__OS2__)||defined(__EMX__) srand(time(NULL)); #else srandom(time(NULL)); #endif } /* Choose the first non-played module */ void PL_InitCurrent(PLAYLIST *pl) { pl->current=0; while ((pl->currentnumused)&&(pl->entry[pl->current].played)) pl->current++; if (pl->current>=pl->numused) { PL_ClearPlayed(pl); pl->current=0; } pl->current--; } void PL_ClearList(PLAYLIST* pl) { int i; for (i=0;inumused;i++) { if (pl->entry[i].file) free(pl->entry[i].file); if (pl->entry[i].archive) free(pl->entry[i].archive); } if (pl->entry) { free(pl->entry); pl->entry=NULL; } pl->current=-1; pl->numused=0; } PLAYENTRY *PL_GetCurrent(PLAYLIST *pl) { if ((pl->current<0)||(!pl->numused)) return NULL; return &pl->entry[pl->current]; } int PL_GetCurrentPos(PLAYLIST *pl) { if ((pl->current<0)||(!pl->numused)) return -1; return pl->current; } PLAYENTRY *PL_GetEntry(PLAYLIST *pl,int number) { if ((number<0)||(number>=pl->numused)) return NULL; return &pl->entry[number]; } int PL_GetLength(PLAYLIST *pl) { return pl->numused; } void PL_SetTimeCurrent(PLAYLIST *pl,long sngtime) { if (pl->current>=0 && pl->currentnumused) pl->entry[pl->current].time=sngtime>>10; } void PL_SetPlayedCurrent(PLAYLIST *pl) { if (pl->current>=0 && pl->currentnumused) pl->entry[pl->current].played=1; } BOOL PL_DelEntry(PLAYLIST *pl,int number) { int i; if (!pl->numused) return 0; if (pl->entry[number].file) free(pl->entry[number].file); if (pl->entry[number].archive) free(pl->entry[number].archive); pl->numused--; if (pl->current>=number) { pl->current--; if ((pl->numused)&&(pl->current==-1)) pl->current=0; } for (i=number;inumused;i++) pl->entry[i]=pl->entry[i+1]; pl->entry=realloc(pl->entry,pl->numused*sizeof(PLAYENTRY)); return 1; } BOOL PL_DelDouble(PLAYLIST *pl) { int i,j; if (!pl->numused) return 0; for (i=pl->numused-2;i>=0;i--) for (j=i+1;jnumused;j++) if (!filecmp(pl->entry[i].file,pl->entry[j].file)&& (!(pl->entry[i].archive||pl->entry[j].archive)|| (pl->entry[i].archive&&pl->entry[j].archive&& !filecmp(pl->entry[i].archive,pl->entry[j].archive)))) { /* keep the time and played information whenever possible */ if (!pl->entry[i].time) pl->entry[i].time=pl->entry[j].time; if (!pl->entry[i].played) pl->entry[i].played=pl->entry[j].played; PL_DelEntry(pl,j); } return 1; } /* Following PL_Add will insert at pos */ void PL_StartInsert(PLAYLIST *pl,int pos) { pl->add_pos=pos; } /* Following PL_Add will append at end of playlist */ void PL_StopInsert(PLAYLIST *pl) { pl->add_pos=-1; } static void PL_Insert(PLAYLIST *pl,int pos,CHAR *file,CHAR *arc,int time,BOOL played) { int i; pl->numused++; pl->entry=realloc(pl->entry,pl->numused*sizeof(PLAYENTRY)); for (i=pl->numused-1;i>pos;i--) pl->entry[i]=pl->entry[i-1]; if (pl->current>=pos) pl->current++; pl->entry[pos].file=malloc((strlen(file)+1)*sizeof(CHAR)); strcpy(pl->entry[pos].file,file); if (arc) { pl->entry[pos].archive=malloc((strlen(arc)+1)*sizeof(CHAR)); strcpy(pl->entry[pos].archive,arc); } else pl->entry[pos].archive=NULL; pl->entry[pos].time=time; pl->entry[pos].played=played; } /* pl->add_pos < 0 => Append entry at end of playlist pl->add_pos >= 0 => Insert entry at pl->add_pos and increment pl->add_pos */ void PL_Add (PLAYLIST *pl,CHAR *file,CHAR *arc,int time,BOOL played) { if (pl->add_pos>=0) { PL_Insert(pl,pl->add_pos,file,arc,time,played); pl->add_pos++; } else PL_Insert(pl,pl->numused,file,arc,time,played); } #define LINE_LEN (PATH_MAX*2+20) /* "file" "arc" time played */ /* Loads a playlist */ BOOL PL_Load(PLAYLIST *pl,CHAR *filename) { FILE *file; CHAR line[LINE_LEN]; CHAR *mod,*arc,*pos,*slash; int time,played; CHAR *ok=NULL; if (!(file=fopen(filename,"r"))) return 0; while ((ok=fgets(line,LINE_LEN,file))&&(strcasecmp(line,PL_IDENT))); if (!ok) { fclose(file); return 0; /* file is not a playlist */ } slash=strrchr(filename,PATH_SEP); while (fgets(line,LINE_LEN,file)) { mod=line+1; /* line == '"file" "arc" time played' */ pos=mod; while (*pos!='"') pos++; *pos='\0'; pos+=3; arc=pos; while (*pos!='"') pos++; *pos='\0'; if (arc==pos) arc=NULL; pos+=2; time=played=0; sscanf(pos,"%d %d",&time,&played); if ((!arc)&&(!time)&&(!played)) MA_FindFiles(pl,mod); else { /* we're loading a playlist, so it might be necessary to convert playlist paths to relative paths from cwd */ if (slash && path_relative(arc?arc:mod)) { CHAR *dummy; dummy=malloc(slash+1-filename+strlen(arc?arc:mod)+1); strncpy(dummy,filename,slash+1-filename); dummy[slash+1-filename]='\0'; strcat(dummy,arc?arc:mod); PL_Add(pl,arc?mod:dummy,arc?dummy:NULL,time,(BOOL)played); } else PL_Add(pl,mod,arc,time,(BOOL)played); } } fclose(file); return 1; } BOOL PL_Save(PLAYLIST *pl,CHAR *filename) { FILE *file; int i; PLAYENTRY *entry; if (!(file=fopen(filename,"w"))) return 0; if (fputs(PL_IDENT,file)!=EOF) { for (i=0;inumused;i++) { entry=&pl->entry[i]; if (entry->archive) fprintf(file,"\"%s\" \"%s\" %d %d\n", entry->file,entry->archive,entry->time, (int)entry->played); else fprintf(file,"\"%s\" \"\" %d %d\n", entry->file,entry->time,(int)entry->played); } fclose(file); return 1; } fclose(file); return 0; } char* PL_GetFilename(void) { #if defined(__OS2__)||defined(__EMX__) return get_cfg_name("mikmodpl.cfg"); #else return get_cfg_name(".mikmod_playlist"); #endif } BOOL PL_LoadDefault(PLAYLIST *pl) { char *name=PL_GetFilename(); BOOL ret=0; if (name) { ret=PL_Load(pl,name); free(name); } return ret; } BOOL PL_SaveDefault (PLAYLIST *pl) { char *name=PL_GetFilename(); BOOL ret=0; if (name) { ret=PL_Save(pl,name); free(name); } return ret; } /* check if selected file is a playlist and exchange it with the playlist */ static BOOL PL_CheckPlaylist(PLAYLIST *pl,BOOL *ok,int old_current,int cont,CHAR **retfile,CHAR **retarc,int arg) { /* check if selected file is a playlist */ if ((pl->entry[pl->current].file)&&(!pl->entry[pl->current].archive)) { pl->add_pos=pl->current+1; if (PL_Load(pl,pl->entry[pl->current].file)) { /* Yes -> del playlist-entry and get next entry in now modified list */ pl->add_pos=-1; PL_DelEntry(pl,pl->current); pl->current=old_current; switch (cont) { case PL_CONT_NEXT: *ok=PL_ContNext(pl,retfile,retarc,arg); return 1; case PL_CONT_PREV: *ok=PL_ContPrev(pl,retfile,retarc); return 1; case PL_CONT_POS: *ok=PL_ContPos(pl,retfile,retarc,arg); return 1; } } pl->add_pos=-1; } return 0; } /* get next module to play mode: PM_MODULE, PM_MULTI, PM_SHUFFLE or PM_RANDOM return: was there a module? */ BOOL PL_ContNext(PLAYLIST *pl,CHAR **retfile,CHAR **retarc,int mode) { int num,i,not_played,old_current=pl->current; BOOL ok= 1; if (!pl->numused) return 0; if (BTST(mode,PM_RANDOM)) { not_played=0; for (i=0;inumused;i++) if (!pl->entry[i].played) not_played++; if (!not_played) { PL_ClearPlayed (pl); not_played=pl->numused; if (BTST(mode,PM_SHUFFLE)) PL_Randomize(pl,0); if (!BTST(mode,PM_MULTI)) return 0; } num=mikmod_random(not_played)+1; while (num>0) { pl->current++; if (pl->current==pl->numused) pl->current=0; if (!pl->entry[pl->current].played) num--; } } else { pl->current++; if (pl->current==pl->numused) { if (config.exit_after) return 0; not_played=0; for (i=0;inumused;i++) if (!pl->entry[i].played) not_played++; if (!not_played) { PL_ClearPlayed(pl); if (BTST(mode,PM_SHUFFLE)) PL_Randomize(pl,0); } pl->current=0; if (!BTST(mode,PM_MULTI)) return 0; } } /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl,&ok,old_current,PL_CONT_NEXT,retfile,retarc,mode)) return ok; if (retfile) *retfile=pl->entry[pl->current].file; if (retarc) *retarc=pl->entry[pl->current].archive; return 1; } BOOL PL_ContPrev(PLAYLIST *pl,CHAR **retfile,CHAR **retarc) { int old_current=pl->current; BOOL ok=1; if (!pl->numused) return 0; pl->current--; if (pl->current<0) pl->current=pl->numused-1; /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl,&ok,old_current,PL_CONT_PREV,retfile,retarc,0)) return ok; if (retfile) *retfile=pl->entry[pl->current].file; if (retarc) *retarc=pl->entry[pl->current].archive; return 1; } BOOL PL_ContPos(PLAYLIST *pl,CHAR **retfile,CHAR **retarc,int number) { int old_current=pl->current; BOOL ok=1; if ((number<0)||(number>=pl->numused)) return 0; pl->current=number; /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl,&ok,old_current,PL_CONT_POS,retfile,retarc,number)) return ok; if (retfile) *retfile=pl->entry[pl->current].file; if (retarc) *retarc=pl->entry[pl->current].archive; return 1; } void PL_Sort(PLAYLIST *pl,int (*compar)(PLAYENTRY *small,PLAYENTRY *big)) { int i,j; BOOL end=0; PLAYENTRY tmp; for (i=0;inumused && !end;i++) { end=1; for (j=pl->numused-1;j>i;j--) if (compar(&pl->entry[j-1],&pl->entry[j])>0) { tmp=pl->entry[j]; pl->entry[j]=pl->entry[j-1]; pl->entry[j-1]=tmp; if (pl->current==j) pl->current=j-1; else if (pl->current==j-1) pl->current=j; end=0; } } } void PL_Randomize(PLAYLIST *pl,BOOL track) { if (pl->numused>1) { int i,target; for (i=0;inumused-1;i++) { target=mikmod_random(pl->numused-i)+i; if (target!=i) { PLAYENTRY temp; temp=pl->entry[i]; pl->entry[i]=pl->entry[target]; pl->entry[target]=temp; /* track selection if requested */ if (track) { if (pl->current==i) pl->current=target; else if (pl->current==target) pl->current=i; } } } if (!track) pl->current=-1; } } /* ex:set ts=4: */ mikmod-3.2.1/src/mmenu.c0100644001161100116100000002464107740670670014542 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mmenu.c,v 1.2 2003/09/30 01:53:30 raph Exp $ Menu functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "display.h" #include #include "player.h" #include "mmenu.h" #include "mwindow.h" #include "mdialog.h" static BOOL menu_is_sub(MENTRY *entry) { char *pos; return((entry->text[strlen(entry->text)-1]=='>')&& (!((pos=strchr(entry->text,'%'))&& (*(pos+1)!='%')))); } static BOOL menu_is_option(MENTRY *entry) { char *pos; return((pos=strchr(entry->text,'%'))&& (*(pos+1)=='o')); } static BOOL menu_is_toggle(MENTRY *entry) { char *pos; return((pos=strchr(entry->text,'%'))&& (*(pos+1)=='c')); } static BOOL menu_is_int(MENTRY *entry) { char *pos; return((pos=strchr(entry->text,'%'))&& (*(pos+1)=='d')); } static BOOL menu_is_str(MENTRY *entry) { char *pos; return((pos=strchr(entry->text,'%'))&& (*(pos+1)=='s')); } static BOOL menu_has_sub(MENTRY *entry) { return menu_is_str(entry)||menu_is_int(entry)|| menu_is_option(entry)||menu_is_sub(entry); } static char *get_text(MENTRY *entry,int width) { char help[50],sub[50],*start,*pos; int i; if (entry) { if ((pos=strchr(entry->text,'%'))) { if (*(pos+1)=='c') sprintf(storage,entry->text,(long)(entry->data)?'x':' '); else if ((*(pos+1)=='o')&&(start=strchr(entry->text,'|'))) { char *s_pos=NULL; int max=0; strncpy(help,entry->text,start-entry->text); help[start-entry->text]='\0'; help[1+pos-entry->text]='s'; start++; i=(long)(entry->data); pos=start; while (start) { if (!i) s_pos=pos; if ((start=strchr(pos,'|'))) { if (start-pos>max) max=start-pos; pos=start+1; } i--; } if (strlen(pos)>max) max=strlen(pos); i=0; while (s_pos&&(*s_pos)&&(*s_pos!='|')) sub[i++]=*s_pos++; while (itext,'|'))) { char *right=strrchr(start,'|') + 1; strncpy(help,entry->text,pos+1-entry->text); help[pos+1-entry->text]='\0'; if (*(pos+1)=='d') { sprintf(sub,"%d",(int)strlen(right)); strcat(help,sub); } else strcat(help,right); i=strlen(help); strncat(help,pos+1,start-pos-1); help[i+start-pos-1]='\0'; if (*(pos+1)=='d') sprintf(storage,help,(long)(entry->data)); else { char ch; sscanf(right,"%d",&i); pos=(char*)(entry->data); ch=pos[i]; pos[i]='\0'; sprintf(storage,help,pos); pos[i]=ch; } } else if (*(pos+1)=='%') { /* '...%%...' -> '...%...' */ strncpy(storage,entry->text,pos-entry->text); strcpy(&storage[pos-entry->text],&entry->text[pos-entry->text+1]); } else strcpy(storage,entry->text); } else strcpy(storage,entry->text); i=strlen(storage); while (idata; int height,t,hl_pos; char *pos,*txt,hl[2]; height=win->height; if (height>m->count) height=m->count; m->cur+=diff; if (m->cur<0) m->cur=m->count-1; else if (m->cur>=m->count) m->cur=0; while (m->entries[m->cur].text[0]=='-') m->cur+=diff>0?1:-1; if (m->curfirst) m->first=m->cur; else if (m->cur>=m->first+height) m->first=m->cur-height+1; hl[1]='\0'; win_attrset(A_REVERSE); for (t=m->first;tcount && t<(height+m->first);t++) { txt=get_text(&m->entries[t],win->width); hl_pos=-1; if ((pos=strchr(txt,'&'))) { if ((*(pos+1)!='&')) { hl_pos=pos-txt; hl[0]=*(pos+1); } for (++pos;*pos;pos++) *(pos-1)=*pos; *(pos-1)=' '; if (hl_pos>=0) txt[hl_pos]='\0'; } if (t==m->cur) { win_attrset(A_NORMAL); win_print(0,t-m->first,txt); if (hl_pos>=0) { win_attrset(A_REVERSE); win_print(hl_pos,t-m->first,hl); win_attrset(A_NORMAL); win_print(hl_pos+1,t-m->first,&txt[hl_pos+1]); } win_status(m->entries[t].help); win_attrset(A_REVERSE); } else if (m->entries[t].text[0]=='-') { win_line(0,win->width-1,t-m->first); } else { if (hl_pos>=0) { win_print(0,t-m->first,txt); win_attrset(A_NORMAL); win_print(hl_pos,t-m->first,hl); win_attrset(A_REVERSE); win_print(hl_pos+1,t-m->first,&txt[hl_pos+1]); } else win_print(0,t-m->first,txt); } } win_attrset(A_NORMAL); } static BOOL menu_repaint(MWINDOW *win) { menu_do_repaint(win,0); return 1; } static void handle_opt_menu(MMENU *menu) { int i; MENTRY *entry=menu->data; entry->data=(void*)(long)menu->cur; menu_close(menu); for (i=0;icount;i++) free(menu->entries[i].text); free(menu->entries); free(menu); } static void handle_input_str(int button,void *input,void *data) { if (!button) strcpy(*((char**)data),input); } static void handle_input_int(int button,void *input,void *data) { if (!button) *((int*)data)=atoi(input); } static BOOL menu_do_select(MWINDOW *win) { MMENU *m=win->data; MENTRY *entry=&m->entries[m->cur]; if (menu_is_toggle(entry)) { entry->data=(void*)(long)(!((long)(entry->data))); menu_do_repaint(win,0); return 1; } else if (menu_is_option(entry)) { char *pos,*start; MENTRY *sub; MMENU *new=malloc(sizeof(MMENU)); int cnt=1,i; start=strchr(entry->text,'|'); pos=++start; while ((pos=strchr(pos,'|'))) { pos++; cnt++; } new->cur=(long)(entry->data); new->first=0; new->count=cnt; new->key_left=1; new->entries=malloc(sizeof(MENTRY)*cnt); new->handle_select=handle_opt_menu; new->win=NULL; new->data=entry; sub=new->entries; for (i=0;itext=malloc(sizeof(char)*(pos-start+1)); strncpy(sub->text,start,pos-start); sub->text[pos-start]='\0'; sub->data=NULL; sub->help=entry->help; start=pos+1; sub++; } menu_open(new,win->x+win->width+1,win->y+m->cur-m->first); return 1; } else if (menu_is_str(entry)) { char *msg=NULL,*start,*pos; int length=0; start=strchr(entry->text,'|') + 1; pos=strchr(start,'|'); msg=malloc(sizeof(char)*(pos-start+1)); strncpy(msg,start,pos-start); msg[pos-start]='\0'; sscanf(pos+1,"%d",&length); dlg_input_str(msg,(char*)(entry->data),length, handle_input_str,&entry->data); free(msg); } else if (menu_is_int(entry)) { char *msg=NULL,*start,*pos; int min=0,max=0; start=strchr(entry->text,'|') + 1; pos=strchr(start,'|'); msg=malloc(sizeof(char)*(pos-start+1)); strncpy(msg,start,pos-start); msg[pos-start]='\0'; sscanf(pos+1,"%d|%d",&min,&max); dlg_input_int(msg,(long)(entry->data),min,max, handle_input_int,&entry->data); free(msg); } else if (menu_is_sub(entry)) { MMENU *sub=entry->data; sub->cur=sub->first=0; menu_open(sub,win->x+win->width+1,win->y+m->cur-m->first); return 1; } return 0; } void menu_close(MMENU *menu) { int i; for (i=0;icount;i++) if (menu_is_sub(&menu->entries[i])) menu_close(menu->entries[i].data); if (menu->win) { win_status(NULL); win_close_win(menu->win); menu->win=NULL; } } static BOOL menu_handle_key(MWINDOW *win,int ch) { MMENU *menu=win->data; char *pos; int i,key; if ((ch<256) &&(isalpha(ch))) ch=toupper(ch); switch (ch) { case KEY_DOWN: menu_do_repaint(win,1); break; case KEY_UP: menu_do_repaint(win,-1); break; case KEY_LEFT: if (menu->key_left) menu_close(menu); break; case KEY_RIGHT: if (menu_has_sub(&menu->entries[menu->cur])) menu_do_select(win); break; case KEY_ENTER: case '\r': if (!menu_do_select(win)) if (menu->handle_select) menu->handle_select(menu); break; default: for (i=0;icount;i++) { key=0; if ((pos=strchr(menu->entries[i].text,'&'))) key=toupper((int)(*(pos+1))); if (key==ch) { menu_do_repaint(win,i-menu->cur); if (!menu_do_select(win)) if (menu->handle_select) menu->handle_select(menu); return 1; } } return 0; } return 1; } static void menu_handle_resize(MWINDOW *win,int dx,int dy) { int m_y,m_width,m_height; MMENU *menu=win->data; win_get_size_max(&m_y,&m_width,&m_height); m_width-=2;m_height-=2; if (win->x+win->width>m_width) { win->x=m_width-win->width+1; if (win->x<1) win->x=1; } if (win->y+win->height-m_y>m_height || win->y+menu->count-m_y>m_height) { win->y=m_height-menu->count+m_y+1; if (win->y <= m_y) win->y=m_y+1; } if (win->heightcount) win->height=menu->count; if (win->height>m_height) win->height=m_height; if (menu->first+win->height>menu->count) menu->first=menu->count-win->height; if (menu->first<0) menu->first=0; } void menu_open(MMENU *menu,int x,int y) { MWINDOW *win; char *entry; int m_y,m_width,m_height,width=0; /* get max. width of entries */ for (m_y=0;m_ycount;m_y++) { entry=get_text(&menu->entries[m_y],0); m_width=strlen(entry); if (strchr(entry,'&')) m_width--; if (m_width>width) width=m_width; } win_get_size_max(&m_y,&m_width,&m_height); m_width-=2;m_height-=2; if (x+width-1>m_width) x=m_width-width+1; if (x<1) x=1; if (y+menu->count-m_y-1>m_height) y=m_height-menu->count+m_y+1; if (ywin=win_open(x,y,width,menu->count,1,NULL); win_set_repaint(menu_repaint); win_set_handle_key(menu_handle_key); win_set_resize(0,menu_handle_resize); win_set_data((void*)menu); win=win_get_window(); if (menu->first+win->height>menu->count) menu->first=menu->count-win->height; if (menu->first<0) menu->first=0; menu_repaint(win); } /* ex:set ts=4: */ mikmod-3.2.1/src/mmenu.h0100644001161100116100000000435607740670670014550 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mmenu.h,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Menu functions ==============================================================================*/ #ifndef MMENU_H #define MMENU_H #include "mwindow.h" /* text metacharacters: '&x': highlight 'x' '&&' -> '&' '-' : separator, if first character '%c': toggle menu data: menu active yes|no '%o...|opt0|opt1|...': option menu data: active option '%d...|label|min|max': int input data: current value '%s...|label|maxlength|length of inserted text': string input data: current value '>': submenu, if last character data: struct *MMENU, the sub menu else: normal menu ( '%%' -> '%') data: unused */ typedef struct { char *text; void *data; char *help; } MENTRY; typedef struct MMENU{ int cur; /* selected entry */ int first; /* first line of menu which is displayed */ int count; /* number of menu entries */ BOOL key_left; /* can menu be closed with KEY_LEFT */ MENTRY *entries; void (*handle_select) (struct MMENU *menu); /* called on menu selection */ MWINDOW *win; /* the window for this menu */ void *data; /* not used by menu functions */ int id; /* not used by menu functions */ } MMENU; typedef void (*MenuSelectFunc)(MMENU*,int); void menu_open(MMENU*,int,int); void menu_close(MMENU*); #endif /* MMENU_H */ mikmod-3.2.1/src/getopt.c0100644001161100116100000007274107740670670014727 0ustar raphtechnolab/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO #define _NO_PROTO #endif #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #include #endif /* GNU C library. */ #ifdef VMS #include #if HAVE_STRING_H - 0 #include #endif #endif #if defined (WIN32) && !defined (__CYGWIN32__) /* It's not Unix, really. See? Capital letters. */ #include #define getpid() GetCurrentProcessId() #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) #else # define _(msgid) (msgid) #endif #endif #if defined(__OS2__)||defined(__EMX__)||defined(sun) #include #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ char *getenv (); static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; extern pid_t __libc_pid; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } text_set_element (__libc_subinit, store_args_and_env); # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (&new_str[nonoption_flags_max_len], '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else { memcpy (__getopt_nonoption_flags, orig_str, len); memset (&__getopt_nonoption_flags[len], '\0', nonoption_flags_max_len - len); } } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ mikmod-3.2.1/src/getopt.h0100644001161100116100000001075407740670670014730 0ustar raphtechnolab/* Declarations for getopt. Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #if defined (__STDC__) && __STDC__ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ extern int getopt (); extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); #endif /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* _GETOPT_H */ mikmod-3.2.1/src/Makefile.in0100644001161100116100000001123207740670670015312 0ustar raphtechnolab# Makefile for MikMod module player exec_prefix=@exec_prefix@ prefix=@prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ PLAYER_LIB=@PLAYER_LIB@ MAN_SECTION=1 CC=@CC@ DEFS=@DEFS@ CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ INSTALL=@INSTALL@ COMPILE=$(CC) $(DEFS) $(CFLAGS) -I$(top_builddir) $(LIBMIKMOD_CFLAGS) .SUFFIXES: .c .o AOUT= mikmod MANPAGE= $(srcdir)/mikmod.1 OBJ = attr.o display.o marchive.o mconfedit.o mconfig.o mdialog.o mikmod.o mlist.o \ mmenu.o mutilities.o mwidget.o mwindow.o EXTRA_OBJ = @EXTRA_OBJ@ DIST_FILES = $(srcdir)/Makefile.in \ $(MANPAGE) \ $(srcdir)/attr.c \ $(srcdir)/attr.h \ $(srcdir)/display.c \ $(srcdir)/display.h \ $(srcdir)/marchive.c \ $(srcdir)/mconfedit.c \ $(srcdir)/mconfedit.h \ $(srcdir)/mconfig.c \ $(srcdir)/mdialog.c \ $(srcdir)/mdialog.h \ $(srcdir)/mikmod.c \ $(srcdir)/mlist.c \ $(srcdir)/mmenu.c \ $(srcdir)/mmenu.h \ $(srcdir)/mutilities.c \ $(srcdir)/mutilities.h \ $(srcdir)/mwidget.c \ $(srcdir)/mwidget.h \ $(srcdir)/mwindow.c \ $(srcdir)/mwindow.h \ $(srcdir)/player.h \ $(srcdir)/fnmatch.c \ $(srcdir)/fnmatch.h \ $(srcdir)/getopt.h \ $(srcdir)/getopt.c \ $(srcdir)/getopt1.c \ $(srcdir)/usleep.c all: $(AOUT) install: $(AOUT) -$(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(INSTALL) -s -m 755 $(AOUT) $(DESTDIR)$(bindir) -$(INSTALL) -d -m 755 $(DESTDIR)$(mandir)/man$(MAN_SECTION) $(INSTALL) -m 644 $(MANPAGE) $(DESTDIR)$(mandir)/man$(MAN_SECTION) clean: FORCE rm -fR .libs $(AOUT) $(OBJ) core distdir: (for file in $(DIST_FILES); \ do \ cp -f $$file $(distdir) && chmod 644 $$file; \ done) distclean: clean rm -f Makefile $(AOUT): $(OBJ) $(EXTRA_OBJ) $(LIB) $(CC) $(LDFLAGS) $(LIBMIKMOD_LDADD) -o $(AOUT) $(OBJ) $(EXTRA_OBJ) $(PLAYER_LIB) $(LIBMIKMOD_LIBS) attr.o: $(srcdir)/attr.c $(srcdir)/attr.h $(COMPILE) -o $@ -c $(srcdir)/attr.c display.o: $(srcdir)/display.c $(srcdir)/display.h \ $(srcdir)/player.h $(srcdir)/mutilities.h $(srcdir)/mwindow.h \ $(srcdir)/mmenu.h $(srcdir)/mdialog.h $(srcdir)/mconfedit.h $(COMPILE) -o $@ -c $(srcdir)/display.c marchive.o: $(srcdir)/marchive.c \ $(srcdir)/player.h $(srcdir)/mutilities.h $(COMPILE) -o $@ -c $(srcdir)/marchive.c mconfedit.o: $(srcdir)/mconfedit.c \ $(srcdir)/player.h $(srcdir)/mmenu.h $(srcdir)/mconfedit.h $(COMPILE) -o $@ -c $(srcdir)/mconfedit.c mconfig.o: $(srcdir)/mconfig.c \ $(srcdir)/player.h $(srcdir)/mutilities.h $(COMPILE) -o $@ -c $(srcdir)/mconfig.c mdialog.o: $(srcdir)/mdialog.c \ $(srcdir)/mdialog.h $(srcdir)/mwidget.h $(COMPILE) -o $@ -c $(srcdir)/mdialog.c mikmod.o: $(srcdir)/mikmod.c \ $(srcdir)/player.h $(srcdir)/mdialog.h $(srcdir)/mwindow.h $(COMPILE) -o $@ -c $(srcdir)/mikmod.c mlist.o: $(srcdir)/mlist.c \ $(srcdir)/player.h $(srcdir)/mutilities.h $(COMPILE) -o $@ -c $(srcdir)/mlist.c mmenu.o: $(srcdir)/mmenu.c $(srcdir)/display.h \ $(srcdir)/player.h $(srcdir)/mwindow.h \ $(srcdir)/mmenu.h $(srcdir)/mdialog.h $(COMPILE) -o $@ -c $(srcdir)/mmenu.c mutilities.o: $(srcdir)/mutilities.c \ $(srcdir)/player.h $(srcdir)/mutilities.h $(COMPILE) -o $@ -c $(srcdir)/mutilities.c mwidget.o: $(srcdir)/mwidget.c $(srcdir)/display.h \ $(srcdir)/player.h $(srcdir)/mwidget.h $(srcdir)/mwindow.h $(COMPILE) -o $@ -c $(srcdir)/mwidget.c mwindow.o: $(srcdir)/mwindow.c $(srcdir)/display.h \ $(srcdir)/player.h $(srcdir)/mwindow.h $(COMPILE) -o $@ -c $(srcdir)/mwindow.c getopt.o: $(srcdir)/getopt.c $(srcdir)/getopt.h $(COMPILE) -o $@ -c $(srcdir)/getopt.c getopt1.o: $(srcdir)/getopt1.c $(srcdir)/getopt.h $(COMPILE) -o $@ -c $(srcdir)/getopt1.c fnmatch.o: $(srcdir)/fnmatch.c $(srcdir)/fnmatch.h $(COMPILE) -o $@ -c $(srcdir)/fnmatch.c usleep.o: $(srcdir)/usleep.c $(COMPILE) -o $@ -c $(srcdir)/usleep.c FORCE: mikmod-3.2.1/src/getopt1.c0100644001161100116100000001062407740670670015000 0ustar raphtechnolab/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "getopt.h" #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ mikmod-3.2.1/src/mikmod.10100644001161100116100000003121107740670670014606 0ustar raphtechnolab.TH MIKMOD 1 "Version 3.2.0, 4th October 2003" .SH NAME mikmod - play soundtracker etc. modules on a Unix machine. .SH SYNOPSIS .B mikmod [\fB-options\fR]... [\fBmodule\fR|\fBplaylist\fR]... .SH DESCRIPTION \fIMikMod\fR is a \fIvery\fR portable module player based on libmikmod, written originally by Jean-Paul Mikkers (MikMak). It will play the IT, XM, MOD, MTM, S3M, STM, ULT, FAR, MED, DSM, AMF, IMF and 669 module formats. It works under AIX, FreeBSD, HP-UX, IRIX, Linux, NetBSD, OpenBSD, OSF/1, SunOS, Solaris and OS/2. It is controllable via an easy-to-use curses interface and will extract and play modules from a variety of different archive formats. .SH OPTIONS Options can be given in any order, and are case-sensitive. For the options which have both a short and a long form, the long form can be prefixed by one or two dashes. Note that the settings in your $HOME/.mikmodrc will override the defaults shown in this man page. .SH OUTPUT OPTIONS .IP "\fB-d\fR, \fB--driver \fIn\fR" Use the specified device driver for output, 0 is autodetect. The default is 0. If your installed libmikmod engine is recent enough (>=3.1.7), you can also specify the driver with an alias, as well as driver options separated by commas. The list and driver aliases and recognized options can be found in libmikmod's documentation. .IP "\fB-o\fR, \fB--output \fI8m\fR|\fI8s\fR|\fI16m\fR|\fI16s\fR" Output settings, 8 or 16 bit in stereo or mono. The default is "16s". .IP "\fB-f\fR, \fB--frequency \fIfreq\fR" Set mixing frequency in hertz. The default is 44100. .IP "\fB-i\fR, \fB--interpolate\fR" Use interpolated mixing. This will generally improve audio quality, at the expense of a bit more CPU usage. Note that this option alters the behaviour of software drivers only ; hardware drivers are not affected. .IP "\fB--nointerpolate\fR" Do not use interpolated mixing (default). .IP "\fB--hqmixer\fR" Use high quality software mixer. This improves audio quality, but requires a lot more CPU power. Note that this option alters the behaviour of software drivers only ; hardware drivers are not affected. .IP "\fB--nohqmixer" Do not use high quality software mixer (default). .IP "\fB--surround\fR" Use surround mixing. .IP "\fB--nosurround\fR" Do not use surround mixing (default). .IP "\fB-r\fR, \fB--reverb \fIn\fR" Sets reverb amount from 0 (no reverb) to 15 (max reverb). The default is 0 (no reverb). .SH PLAYBACK OPTIONS .IP "\fB-v\fR, \fB--volume \fIvolume\fR" Set volume from 0% (silence) to 100%. The default is 100%. .IP "\fB-F\fR, \fB--fadeout\fR" Fade out the volume during the last pattern of each module. .IP "\fB--nofadeout\fR" Do not fade out the volume during the last pattern of each module (default). .IP "\fB-l\fR, \fB--loops\fR" Enable in-module backwards loops. .IP "\fB--noloops\fR" Disable in-module backwards loops (default). .IP "\fB-a\fR, \fB--panning\fR" Process panning effects (default). This should be disabled (using --nopanning) for very old demo modules which use the panning effects for synchronization purposes. .IP "\fB--nopanning\fR" Do not process panning effects. .IP "\fB-x\fR, \fB--protracker\fR" Enable protracker extended speed effect (default). This should be disabled (using --noprotracker) for very old demo modules which use the extended speed effect for synchronization purposes. .IP "\fB--noprotracker\fR" Disable protracker extended speed effect. .IP "\fB-X\fR, \fB--exitafter\fR" Exit MikMod upon playlist completion. If there is nothing in the playlist, MikMod will not exit. Can be disabled with --noexitafter. .IP "\fB--noexitafter\fR" Do not exit MikMod upon playlist completion. .SH LOADING OPTIONS .IP "\fB-c\fR, \fB--curious\fR" Look for hidden patterns in module. Most modules don't have hidden patterns, but you can find "bonus" patterns (or just silence) in some modules. .IP "\fB--nocurious\fR" Do not look for hidden patterns in module (default). .IP "\fB-p\fR, \fB--playmode \fIn\fR" Playlist mode. The allowed values here are 0, to loop the current module ; 1, to play the whole playlist once ; 2, to play the whole playlist repeatedly, and 3, to play the whole playlist randomly. The default is 2. .IP "\fB-t\fR, \fB--tolerant\fR" Don't halt MikMod if a module cannot be read or is an unknown format. .IP "\fB--notolerant\fR" Halt MikMod if a module cannot be read or is an unknown format (default). .SH SCHEDULING OPTIONS The following options need root privileges (or a setuid root binary), and don't work under all systems. .IP "\fB-s\fR, \fB--renice\fR" Renice to -20 if possible to gain more CPU priority. This option is only available under FreeBSD, Linux, NetBSD, OpenBSD and OS/2. .IP "\fB--norenice\fR" Do not renice to -20 (default). .IP "\fB-S\fR, \fB--realtime\fR" Reschedule mikmod to gain real-time priority (and thus more CPU time). \fBDANGEROUS! USE WITH CAUTION!\fR This option is only available under FreeBSD, Linux and OS/2. .IP "\fB--norealtime\fR" Do not reschedule MikMod to gain real-time priority (default). .SH DISPLAY OPTIONS .IP "\fB-q\fR, \fB--quiet\fR" Quiet mode. Disables interactive commands and displays only errors. .IP "\fB--terse\fR" Terse display like MikMod 2, i.e. without the information panels. .SH INFORMATION OPTIONS .IP "\fB-n\fR, \fB--information\fR" Display the list of the known drivers and module loaders. .IP "\fB-V\fR, \fB--version\fR" Display MikMod version. .IP "\fB-h\fR, \fB--help\fR" Display a summary of the options. .SH CONFIGURATION OPTION .IP "\fB--norc\fR" Do not parse the $HOME/.mikmodrc configuration file. This file contains your default settings, so that you don't have to specify them each time you run MikMod. The file is read when you run MikMod and updated on exit. Using this option prevents MikMod from accessing this file. .SH RUNTIME COMMANDS At play time, the following keystrokes offer control over MikMod: .IP "\fBH\fR, \fBfunction key F1\fR" Display help panel. .IP "\fBS\fR, \fBfunction key F2\fR" Display samples panel. .IP "\fBI\fR, \fBfunction key F3\fR" Display instruments panel (if present in the module). .IP "\fBM\fR, \fBfunction key F4\fR" Display song message panel (if present in the module). .IP "\fBL\fR, \fBfunction key F5\fR" Display the playlist panel. .IP "\fBC\fR, \fBfunction key F6\fR" Display the configuration panel. .IP "\fBdigits\fR" Set volume from 10% (digit 1) to 100% (digit 0). .IP "\fB<\fR" Decrease volume. .IP "\fB>\fR" Increase volume. .IP "\fB-\fR, \fBLeft\fR" Restart current pattern / skip to previous pattern. .IP "\fB+\fR, \fBRight\fR" Skip to next pattern in current module. .IP "\fBUp\fR, \fBDown\fR" Scroll panel. .IP "\fBPgUp\fR, \fBPgDown\fR" Scroll panel (faster). .IP "\fBHome\fR" Go on top of the panel. .IP "\fBEnd\fR" Go to the end of the panel. .IP "\fB(\fR" Decrease speed variable (module plays faster). .IP "\fB)\fR" Increase speed variable (module plays slower). .IP "\fB{\fR" Decrease tempo variable (module plays slower). .IP "\fB}\fR" Increase tempo variable (module plays faster). .IP "\fB:\fR or \fB;\fR" Toggle interpolation mixing. .IP "\fBU\fR" Toggle surround mixing. .IP "\fBQ\fR" Exit MikMod. .IP "\fBP\fR" Switch to previous module in playlist. .IP "\fBN\fR" Switch to next module in playlist. .IP "\fBR\fR" Restart current module. .IP "\fBspace\fR" Toggle pause. .IP "\fBControl-L\fR" Refresh the screen. .SH MENU BASICS Some functions of MikMod are available through menus, in the playlist and configuration panels. You can select commands in the menus either by moving the selection with the arrow keys and pressing enter, or entering the highlighted letter corresponding ot the command you want to select. Menu entries ending with a \fB>\fR character open a submenu, whereas entries ending in \fB...\fR open a dialog box. You can dismiss a submenu either by choosing a command in this menu, or using the left arrow key to go back, or switching panels. In dialog boxes, you can move the focus from the input line to the \fBOk\fR and \fBCancel\fR buttons either with the "tab" key, or the up and down arrow keys. Also, if the statusbar is active (which is the default behaviour), it will contain a short help text describing the menu option currently highlighted. .SH PLAYLIST MENU When the playlist panel is displayed, pressing the \fIreturn\fR key will popup a menu. The menu commands are: .IP "\fBPlay\fR" Continue list playback from the currently highlighted module. .IP "\fBRemove\fR" Remove module from the playlist. .IP "\fBDelete...\fR" Remove module from the playlist, and delete module file on disk, or whole archive if the module is stored in an archive file. This function asks you to confirm your choice. .IP "\fBFile >\fR" This entry opens a submenu with four commands, "\fBLoad\fR", "\fBInsert\fR", "\fBSave\fR" and "\fBSave as\fR". The \fBLoad\fR and \fBInsert\fR commands ask you for a filename, and replace the playlist with it (load) or merge it with the playlist (insert). No wildcards are allowed. The \fBSave\fR and \fBSave as\fR commands save the current playlist in a file, by default ``playlist.mpl'', in the current directory. Note that playlist filenames should end in \fB.mpl\fR, or they won't be loaded by MikMod. .IP "\fBShuffle\fR" Randomize the playlist. .IP "\fBSort >\fR" This entry opens a submenu with sort commands. You can select a normal or \fBreverse\fR order, and then sort the playlist with one of the four criteria: \fBby name\fR, \fBby extension\fR, \fBby path\fR or \fBby time\fR. .IP "\fBBack\fR" Discards the menu. .SH CONFIGURATION PANEL The configuration panel lets you customize your MikMod settings, and save them. You can also try some particular settings without losing your previous configuration. .IP "\fBOutput options\fR" This section lets you choose various vital playback settings, such as the output driver, the stereo/mono and 16/8 bit output settings, the playback frequency, and the software mixer settings. .IP "\fBPlayback options\fR" This section lets you choose various module playback settings, such as the output volume, the processing of panning effects and bacwards loops, etc. .IP "\fBOther options\fR" This section lets you choose the remaining settings, such as the playlist mode, and various program settings. .IP "\fBUse config\fR" This command activates the current configuration settings, but does not save them. .IP "\fBSave config\fR" This command saves and activates the current configuration settings. .IP "\fBRevert config\fR" This command reverts to the on-disk configuration file settings. .SH MODULE FORMATS MikMod will currently play the following common and not so common formats: .IP "\fB669\fR" Composer 669 and Extended 669 modules. .IP "\fBAMF\fR" DSMI internal module format (Advanced Module Format, converted with M2AMF). .IP "\fBDSM\fR" DSIK's internal module format. .IP "\fBFAR\fR" Farandole composer modules. .IP "\fBGDM\fR" General Digital Munsic internal module format (converted with 2GDM). .IP "\fBIMF\fR" Imago Orpheus modules. .IP "\fBIT\fR" Impulse Tracker modules. .IP "\fBMED\fR" Amiga MED modules, but synthsounds are not supported. .IP "\fBMOD\fR" Protracker, Startracker, Fasttracker, Oktalyzer, and Taketracker modules. .IP "\fBMTM\fR" Multitracker module editor modules. .IP "\fBS3M\fR" Screamtracker version 3 modules. .IP "\fBSTM\fR" Screamtracker version 2 modules. .IP "\fBSTX\fR" STMIK converted modules. .IP "\fBULT\fR" Ultratracker modules. .IP "\fBUNI\fR, \fBAPUN\fR" Old MikMod (UNI) and APlayer (APUN) internal module format. .IP "\fBXM\fR" Fasttracker 2 modules. .SH ARCHIVE FORMATS MikMod should recognize and extract the following common archive formats. However, to use each of these you will need to find the appropriate program(s) for MikMod to use to extract them. These are commonly available and you will most likely find them with this distribution of MikMod. .IP "\fBzip\fR" Info-zip or PkZip archives, commonly used on DOS/Windows platforms. .IP "\fBlha\fR, \fBlzh\fR" Lharc archives, commonly used on the Amiga. .IP "\fBzoo\fR" Zoo archives, quite rare those days... .IP "\fBrar\fR" Rar archives. .IP "\fBgz\fR" Gzip compressed files. .IP "\fBbz2\fR" Bzip2 compressed files. .IP "\fBtar\fR, \fBtar.gz\fR and \fBtar.bz2\fR" Tar archives, even compressed with gzip or bzip2. .SH FILES .IP "$HOME/.mikmodrc (or MikMod.cfg under OS/2)" User configuration settings, can also contain a default playlist. .IP playlist.mpl Default playlist filename. .SH AUTHORS \fIMikMod\fP is the result of the work of many people, including: Jean-Paul Mikkers, Jake Stine, Miodrag Vallat, Frank Loemker, Steve McIntyre, Raphael Assenat, Peter Amstutz, "MenTaLguY", Dimitri Boldyrev, Shlomi Fish, Stefan Tibus, Tinic Urou. A full list of people having worked on libmikmod and MikMod is displayed when MikMod starts. .SH LOCATING NEWER VERSIONS... The official MikMod and libmikmod home page is located on http://mikmod.raphnet.net mikmod-3.2.1/src/mikmod.c0100644001161100116100000006155207740670670014703 0ustar raphtechnolab/* MikMod example player (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mikmod.c,v 1.11 2003/10/08 02:08:48 raph Exp $ Module player example of MikMod ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #ifdef HAVE_GETOPT_LONG_ONLY #include #else #include "getopt.h" #endif #include #include #include #include #include #include #ifdef NEED_USLEEP void usleep(unsigned long); #endif #if defined(__OS2__)||defined(__EMX__) #define INCL_DOS #define INCL_KBD #define INCL_DOSPROCESS #include #endif #if !defined(__OS2__)&&!defined(__EMX__) #ifdef HAVE_NCURSES_H #include #else #include #endif #else #include #endif #include #include "player.h" #include "mwindow.h" #include "mdialog.h" #include "attr.h" #if defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) #ifdef HAVE_SYS_TIME_H #include #endif #include #include #ifdef __FreeBSD__ #include #endif #endif #if defined(__linux) #ifdef BROKEN_SCHED #define _P __P #endif #include #endif /* Long options definition */ static struct option options[]={ /* Output options */ {"driver", required_argument, NULL,'d'}, {"output", required_argument, NULL,'o'}, {"frequency", required_argument, NULL,'f'}, {"interpolate", no_argument, NULL,'i'}, {"nointerpolate", no_argument, NULL, 1}, {"hqmixer", no_argument, NULL, 2}, {"nohqmixer", no_argument, NULL, 3}, {"surround", no_argument, NULL, 4}, {"nosurround", no_argument, NULL, 5}, {"reverb", required_argument, NULL,'r'}, /* Playback options */ {"volume", required_argument, NULL,'v'}, {"fadeout", no_argument, NULL,'F'}, {"nofadeout", no_argument, NULL, 6}, {"loops", no_argument, NULL,'l'}, {"noloops", no_argument, NULL, 7}, {"panning", no_argument, NULL,'a'}, {"nopanning", no_argument, NULL, 8}, {"protracker", no_argument, NULL,'x'}, {"noprotracker", no_argument, NULL, 9}, {"exitafter", no_argument, NULL,'X'}, {"noexitafter", no_argument, NULL, 15}, /* Loading options */ {"curious", no_argument, NULL,'c'}, {"nocurious", no_argument, NULL, 10}, {"playmode", required_argument, NULL,'p'}, {"tolerant", no_argument, NULL,'t'}, {"notolerant", no_argument, NULL, 11}, /* Scheduling options */ {"renice", no_argument, NULL,'s'}, {"norenice", no_argument, NULL, 12}, {"realtime", no_argument, NULL,'S'}, {"norealtime", no_argument, NULL, 12}, /* Display options */ {"quiet", no_argument, NULL,'q'}, {"terse", no_argument, NULL, 14}, #ifdef ENABLE_COLOR_INTERFACE {"color", no_argument, NULL,'C'}, {"nocolor", no_argument, NULL, 16}, #endif /* Information options */ {"information", no_argument, NULL,'n'}, {"version", no_argument, NULL,'V'}, {"help", no_argument, NULL,'h'}, {NULL, 0, NULL, 0} }; static CHAR *PRG_NAME; PLAYLIST playlist; CONFIG config; /* current module */ MODULE *mf=NULL; /* set if quiet mode is enabled */ BOOL quiet=0; BOOL semiquiet=0; static BOOL player_on=0; static BOOL library_on=0; static BOOL quit=0; /* archive handling these variables need to be accessible from signal handlers */ static BOOL clean=1; static char *playfile=NULL; static char *archive=NULL; /* playlist handling */ static int next=0; /* 0 or a PL_CONT_xxx code */ static int next_pl_pos=0; /* for PL_CONT_POS, next pos in playlist */ static int next_sng_pos=0; /* next pos in module */ /* help text */ #define S_B(b) ((b)?"Yes":"No") static void help(CONFIG *c) { char output[4]; char *conf_name=CF_GetFilename(); puts(mikcopyr); #ifdef HAVE_SNPRINTF snprintf(output,4,"%s%c",c->mode_16bit?"16":"8",c->stereo?'s':'m'); #else sprintf(output,"%s%c",c->mode_16bit?"16":"8",c->stereo?'s':'m'); #endif printf( "\n" "Usage: %s [option]... [module|playlist]...\n" "\n" "Output options:\n" " -d, --driver n,options Use nth driver for output (0: autodetect),\n" " default: %d\n" " -o, --output 8m|8s|16m|16s 8/16 bit output in stereo/mono, default: %s\n" " -f, --frequency nnnnn Set mixing frequency, default: %d\n" "* -i, --interpolate Use interpolate mixing, default: %s\n" "* --hqmixer Use high-quality (but slower) software mixer,\n" " default: %s\n" "* --surround Use surround mixing, default: %s\n" " -r, --reverb nn Set reverb amount (0-15), default: %d\n" "Playback options:\n" " -v, --volume nn Set volume from 0%% (silence) to 100%%, default: %d%%\n" "* -F, --fadeout Force volume fade at the end of module,\n" " default: %s\n" "* -l, --loops Enable in-module loops, default: %s\n" "* -a, --panning Process panning effects, default: %s\n" "* -x, --protracker Disable extended protracker effects, default: %s\n" "* -X, --exitafter Exit MikMod when the playlist is finished,\n" " default: %s\n" "Loading options:\n" "* -c, --curious Look for hidden patterns in module, default: %s\n" " -p, --playmode n Playlist mode (1: loop module, 2: list multi,\n" " 4: shuffle list, 8: list random), default: %d\n" "* -t, --tolerant Don't halt on file access errors, default: %s\n", PRG_NAME,c->driver,output,c->frequency,S_B(c->interpolate), S_B(c->hqmixer),S_B(c->surround),c->reverb,c->volume,S_B(c->fade), S_B(c->loop),S_B(c->panning),S_B(!c->extspd),S_B(c->exit_after), S_B(c->curious),c->playmode,S_B(c->tolerant) ); #if defined(__OS2__)||defined(__EMX__)||defined(__linux)||defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) #if defined(__OS2__)||defined(__EMX__) puts("Scheduling options:"); #else puts("Scheduling options (need root privileges or a setuid root binary):"); #endif printf( "* -s, --renice Renice to -20 (more scheduling priority),\n" " default: %s\n", (c->renice==RENICE_PRI?"Yes":"No")); #if !defined(__NetBSD__)&&!defined(__OpenBSD__) printf( "* -S, --realtime Get realtime priority (will hog CPU power),\n" " default: %s\n", (c->renice==RENICE_REAL?"Yes":"No")); #endif #endif printf( "Display options:\n" " -q, --quiet Quiet mode, no interface, displays only errors.\n" " --terse Terse output : status line only.\n" #ifdef ENABLE_COLOR_INTERFACE " -C, --color Enable color interface. default: %s\n" #endif "Information options:\n" " -n, --information List all available drivers and module loaders.\n" " -V, --version Display MikMod version.\n" " -h, --help Display this help screen.\n" "Configuration option:\n" " --norc Don't parse the file '%s'\n" " on startup\n" "\n" "Options marked with '*' also exist in negative form (eg --nointerpolate)\n" "F1 or H while playing: Display help panel.\n", #ifdef ENABLE_COLOR_INTERFACE S_B(c->color), #endif conf_name); if (conf_name) free(conf_name); } #if defined(__EMX__)||defined(__OS2__) #ifdef __EMX__ static int kbhit(void) { KBDKEYINFO k; if (KbdPeek(&k,0)) return 0; else return(k.fbStatus&KBDTRF_FINAL_CHAR_IN); } #endif static int mikmod_getch(void) { int c=0; if (kbhit()) { c=getch(); if ((!c)||(c==0xe0)) c=0x100|getch(); } return c; } #define RETSIGTYPE void #else static int mikmod_getch(void) { int c=getch(); return c==ERR?0:c; } #endif /* nice exit function */ static void exit_player(int status,char *message,...) { va_list args; win_exit(); if (library_on) { MikMod_Exit(); library_on=0; } va_start(args,message); if (status>0) vfprintf(stderr,message,args); else vprintf(message,args); va_end(args); set_term_title(NULL); // reset the title exit(status); } /* signal handlers */ static RETSIGTYPE GotoNext(int signum) { next=PL_CONT_NEXT; signal(SIGUSR1,GotoNext); } static RETSIGTYPE GotoPrev(int signum) { next=PL_CONT_PREV; signal(SIGUSR2,GotoPrev); } static RETSIGTYPE ExitGracefully(int signum) { /* can't exit now if playing */ if (player_on) { quit=1; signal(signum,ExitGracefully); } else { win_exit(); /* erase temporary files if necessary */ if ((clean)&&(playfile)&&(archive)&&(archive[0])) unlink(playfile); if (!quiet) fputs((signum==SIGTERM)?"Halted by SIGTERM\n":"Halted by SIGINT\n",stderr); signal(SIGINT,SIG_DFL); signal(SIGTERM,SIG_DFL); set_term_title(NULL); // reset the title exit(0); } } static void Player_SetNextModPos(int pos,int sng_pos) { if (pos<0 || pos>=PL_GetLength(&playlist)) { next=PL_CONT_NEXT; next_sng_pos=sng_pos; } else { next_pl_pos=pos; next_sng_pos=sng_pos; next=PL_CONT_POS; } } void Player_SetNextMod(int pos) { Player_SetNextModPos(pos,0); } static void Player_InitLib(void) { long engineversion=MikMod_GetVersion(); if (engineversion>16)&255,(engineversion>>8)&255,(engineversion)&255, LIBMIKMOD_VERSION_MAJOR,LIBMIKMOD_VERSION_MINOR,LIBMIKMOD_REVISION); /* Register the loaders we want to use: */ MikMod_RegisterAllLoaders(); /* Register the drivers we want to use: */ MikMod_RegisterAllDrivers(); } static void set_priority(CONFIG *cfg) { if (cfg->renice==RENICE_PRI) { #if defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) setpriority(PRIO_PROCESS,0,-20); #endif #ifdef __linux nice(-20); #endif #if defined(__OS2__)||defined(__EMX__) DosSetPriority(PRTYS_PROCESSTREE,PRTYC_NOCHANGE,20,0); #endif } else if (cfg->renice==RENICE_REAL) { #ifdef __FreeBSD__ struct rtprio rtp; rtp.type=RTP_PRIO_REALTIME; rtp.prio=0; rtprio(RTP_SET,0,&rtp); #endif #ifdef __linux struct sched_param sp; memset(&sp,0,sizeof(struct sched_param)); sp.sched_priority=sched_get_priority_min(SCHED_RR); sched_setscheduler(0,SCHED_RR,&sp); #endif #if defined(__OS2__)||defined(__EMX__) DosSetPriority(PRTYS_PROCESSTREE,PRTYC_TIMECRITICAL,20,0); #endif } } static BOOL cmp_bit(int value,int mask,BOOL cmp) { return (BTST(value,mask))?cmp:!cmp; } void Player_SetConfig(CONFIG *cfg) { static char *driveroptions=NULL; BOOL restart=MikMod_Active() && ((cfg->frequency!=md_mixfreq)|| ((cfg->driver)&&(cfg->driver!=md_device))|| (!cmp_bit(md_mode,DMODE_16BITS,cfg->mode_16bit))|| (!cmp_bit(md_mode,DMODE_STEREO,cfg->stereo))|| (!cmp_bit(md_mode,DMODE_HQMIXER,cfg->hqmixer)) #if LIBMIKMOD_VERSION >= 0x030107 ||((!driveroptions && cfg->driveroptions) || (driveroptions && strcmp(driveroptions,cfg->driveroptions))) #endif ); #if LIBMIKMOD_VERSION >= 0x030107 if (driveroptions) free(driveroptions); driveroptions=strdup(cfg->driveroptions); #endif md_pansep=128; /* panning separation (0=mono 128=full stereo) */ md_volume=(cfg->volume*128)/100; md_reverb=cfg->reverb; md_device=cfg->driver; md_mixfreq=cfg->frequency; md_mode|=DMODE_SOFT_MUSIC; if (cfg->interpolate) md_mode|=DMODE_INTERP; else md_mode&=~DMODE_INTERP; if (cfg->hqmixer) md_mode|=DMODE_HQMIXER; else md_mode&=~DMODE_HQMIXER; if (cfg->surround) md_mode|=DMODE_SURROUND; else md_mode&=~DMODE_SURROUND; if (cfg->mode_16bit) md_mode|=DMODE_16BITS; else md_mode&=~DMODE_16BITS; if (cfg->stereo) md_mode|=DMODE_STEREO; else md_mode&=~DMODE_STEREO; if (restart) { int cur=PL_GetCurrentPos(&playlist),pos=0; if (cur>=0) { if (mf) pos=mf->sngpos; Player_SetNextModPos(cur,pos); } #if LIBMIKMOD_VERSION >= 0x030107 if (MikMod_Reset(cfg->driveroptions)) #else if (MikMod_Reset()) #endif exit_player(1,"MikMod reset error : %s\n", MikMod_strerror(MikMod_errno)); } else win_panel_repaint(); if (!semiquiet) win_init_status(cfg->statusbar); if (mf) mf->wrap=(BTST(config.playmode,PM_MODULE)?1:0); } /* Display the error when loading a file, and take the appropriate resume action */ static void handle_ListError(BOOL tolerant,CHAR *filename,CHAR *archive,BOOL mm_error) { char buf[PATH_MAX+40]=""; if (!tolerant) { if (mm_error) #ifdef HAVE_SNPRINTF snprintf(buf,PATH_MAX+40,"(reason: %s)\n",MikMod_strerror(MikMod_errno)); #else sprintf(buf,"(reason: %s)\n",MikMod_strerror(MikMod_errno)); #endif if (!filename) exit_player(1,"Corrupted playlist, filename is NULL.\n%s",buf); else if (archive) exit_player(1,"MikMod error: can't load \"%s\" from archive \"%s\".\n%s", filename,archive,buf); else exit_player(1,"MikMod error: can't load %s\n%s",filename,buf); } else { if (filename) #ifdef HAVE_SNPRINTF snprintf(buf,PATH_MAX+40,"Error loading list entry \"%s\" !",filename); #else sprintf(buf,"Error loading list entry \"%s\" !",filename); #endif else #ifdef HAVE_SNPRINTF snprintf(buf,PATH_MAX+40,"Error loading list entry !"); #else sprintf(buf,"Error loading list entry !"); #endif display_message(buf); PL_DelEntry(&playlist,PL_GetCurrentPos(&playlist)); } } /* parse an integer argument */ static void get_int(char *arg,int *value,int min,int max) { char *end=NULL; int t=min-1; if (arg) t=strtol(arg,&end,10); if ((end)&&(!*end)&&(t>=min)&&(t<=max)) *value=t; else exit_player(1,mikcopyr "\n\n" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information.\n", arg?arg:"(not given)",min,max,PRG_NAME); } int main(int argc,char *argv[]) { int t,c=0; BOOL finished=0,norc=0,settime=1; char *filename,*pos=NULL; int cfg_maxchn=128; int uservolume=128; long engineversion=MikMod_GetVersion(); #ifdef __EMX__ _wildcard(&argc,&argv); #endif /* Find program name without path component */ PRG_NAME=argv[0]; while (*PRG_NAME) PRG_NAME++; while ((PRG_NAME>=argv[0])&&(*PRG_NAME!=PATH_SEP)) PRG_NAME--; PRG_NAME++; /* Check if configuration file should be loaded */ for (t=0;t=0 #else !=ERR #endif ) { switch (t) { case 'd': /* -d --driver */ #if LIBMIKMOD_VERSION >= 0x030107 if (strlen(optarg)>2) { char *opts=strchr(optarg,','); if (opts) { *opts=0; /* numeric driver specification ? */ if (opts-optarg<=2) get_int(optarg,&config.driver,0,999); else config.driver=MikMod_DriverFromAlias(optarg); CF_set_string(&config.driveroptions,++opts,99); } else config.driver=MikMod_DriverFromAlias(optarg); } else #endif get_int(optarg,&config.driver,0,999); break; case 'o': /* -o --output */ for (pos=optarg;pos&&*pos;pos++) switch (toupper((int)*pos)) { case '1': case '6': config.mode_16bit=1; break; case '8': config.mode_16bit=0; break; case 'S': config.stereo=1; break; case 'M': config.stereo=0; break; } break; case 'f': /* -f --frequency */ get_int(optarg,&config.frequency,4000,60000); break; case 'i': /* -i --interpolate */ config.interpolate=1; break; case 1: /* --nointerpolate */ config.interpolate=0; break; case 2: /* --hqmixer */ config.hqmixer=1; break; case 3: /* --nohqmixer */ config.hqmixer=0; break; case 4: /* --surround */ config.surround=1; break; case 5: /* --nosurround */ config.surround=0; break; case 'r': /* -r --reverb */ get_int(optarg,&config.reverb,0,15); break; case 'v': /* -v --volume */ get_int(optarg,&config.volume,0,100); break; case 'F': /* -F --fadeout */ config.fade=1; break; case 6: /* --nofadeout */ config.fade=0; break; case 'l': /* -l --loops */ config.loop=1; break; case 7: /* --noloops */ config.loop=0; break; case 'a': /* -a --panning */ config.panning=1; break; case 8: /* --nopanning */ config.panning=0; break; case 'x': /* -x --protracker */ config.extspd=0; break; case 9: /* --noprotracker */ config.extspd=1; break; case 'X': /* -X --exitafter */ config.exit_after=1; break; case 15: /* --noexitafter */ config.exit_after=0; break; case 'c': /* -c --curious */ config.curious=1; break; case 10: /* --nocurious */ config.curious=0; break; case 'p': /* -p --playmode */ get_int(optarg,&config.playmode,0, PM_MODULE|PM_MULTI|PM_SHUFFLE|PM_RANDOM); break; case 't': /* -t --tolerant */ config.tolerant=1; break; case 11: /* --notolerant */ config.tolerant=0; break; case 's': /* -s --renice */ config.renice=RENICE_PRI; break; case 'S': /* -S --realtime */ config.renice=RENICE_REAL; break; case 12: /* --norenice --norealtime */ config.renice=RENICE_NONE; break; case 'q': /* -q --quiet */ quiet=1; break; case 14: /* --terse */ semiquiet=1; break; #ifdef ENABLE_COLOR_INTERFACE case 'C': /* --color */ config.color=1; break; case 16: /* --nocolor */ config.color=0; break; #endif case 'n': /* -n --information */ puts(mikcopyr); printf("Sound engine version %ld.%ld.%ld\n", (engineversion>>16)&255,(engineversion>>8)&255, (engineversion)&255); printf("\nAvailable drivers are :\n%s\n" "\nRecognized module formats are :\n%s\n", MikMod_InfoDriver(),MikMod_InfoLoader()); exit(0); case 'V': /* -V --version */ puts(mikcopyr); printf("Sound engine version %ld.%ld.%ld\n", (engineversion>>16)&255,(engineversion>>8)&255, (engineversion)&255); exit(0); case 'h': /* -h --help */ help(&config); exit(0); default: /* ignore errors */ break; } } set_priority(&config); /* Add remaining parameters to the playlist */ for (t=optind;t= 0x030107 if (MikMod_Init(config.driveroptions)) #else if (MikMod_Init()) #endif exit_player(1,"MikMod initialisation error : %s\n", MikMod_strerror(MikMod_errno)); library_on=1; /* initialize interface */ win_init(quiet); attr_init_colors(quiet); display_init(); signal(SIGTERM,ExitGracefully); signal(SIGINT,ExitGracefully); signal(SIGUSR1,GotoNext); signal(SIGUSR2,GotoPrev); while (!quit) { mf=NULL; filename=archive=NULL; switch (next) { case 0: case PL_CONT_NEXT: finished=!PL_ContNext(&playlist,&filename,&archive,config.playmode); break; case PL_CONT_PREV: finished=!PL_ContPrev(&playlist,&filename,&archive); break; case PL_CONT_POS: finished=!PL_ContPos(&playlist,&filename,&archive,next_pl_pos); break; } next=0; settime=1; if (finished && ((PL_GetLength(&playlist)>0) || quiet || semiquiet)) break; if (!finished) { if (!filename) { handle_ListError(config.tolerant,filename,archive,0); continue; } /* load the module */ playfile=MA_dearchive(archive,filename); if (!playfile) { handle_ListError(config.tolerant,filename,archive,0); continue; } display_loadbanner(); clean=1; mf=Player_Load(playfile,cfg_maxchn,config.curious); if ((archive)&&(archive[0])) unlink(playfile); clean=0; free(playfile); if (!mf) { handle_ListError(config.tolerant,filename,archive,1); continue; } mf->extspd=config.extspd; mf->panflag=config.panning; mf->wrap=(BTST(config.playmode,PM_MODULE)?1:0); mf->loop=config.loop; mf->fadeout=config.fade; player_on=1; Player_Start(mf); if (mf->volume>uservolume) Player_SetVolume(uservolume); if (next_sng_pos>0) { Player_SetPosition(next_sng_pos); settime=0; next_sng_pos=0; } } display_start(); /* if we have a quit signal, exit loop */ while (!quit && ((Player_Active() && !next) || (finished && (PL_GetLength(&playlist)<=0))) ) { MikMod_Update(); if (config.volrestrict && mf) if (mf->volume>uservolume) Player_SetVolume(uservolume); #if defined(__OS2__)||defined(__EMX__) DosSleep(5); #else usleep(5000); #endif /* update the status display... */ display_status(); if (!quiet && (c=mikmod_getch())) { if (win_handle_key(c)) c=0; if ((c<256) && (isalpha(c))) c=toupper(c); /* always enabled commands */ switch (c) { case ' ': /* toggle pause */ Player_TogglePause(); win_panel_repaint(); break; case 'N': next=PL_CONT_NEXT; break; case 'P': next=PL_CONT_PREV; break; case 'Q': quit=1; break; case CTRL_L: #if !defined(__OS2__)&&!defined(__EMX__) case KEY_CLEAR: #endif win_panel_repaint(); break; case 'H': win_change_panel(1); break; case 'S': win_change_panel(2); break; case 'I': win_change_panel(3); break; case 'M': win_change_panel(4); break; case 'L': win_change_panel(5); break; case 'C': win_change_panel(6); break; } /* commands which only work when module is not paused */ if (!Player_Paused()) switch(c) { case '+': case KEY_RIGHT: Player_NextPosition(); settime=0; break; case '-': case KEY_LEFT: Player_PrevPosition(); settime=0; break; case 'R': Player_SetPosition(0); settime=1; break; case '(': if (mf) Player_SetSpeed(mf->sngspd-1); settime=0; break; case ')': if (mf) Player_SetSpeed(mf->sngspd+1); settime=0; break; case '{': if (mf) Player_SetTempo(mf->bpm-1); settime=0; break; case '}': if (mf) Player_SetTempo(mf->bpm+1); settime=0; break; case ';': case ':': md_mode^=DMODE_INTERP; display_header(); break; case 'U': md_mode^=DMODE_SURROUND; display_header(); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': Player_SetVolume(uservolume=(((c-'0')<<7)+5)/10); break; case '0': Player_SetVolume(uservolume=128); break; case '<': if (mf && mf->volume) Player_SetVolume(uservolume=mf->volume-1); break; case '>': if (mf && mf->volume<128) Player_SetVolume(uservolume=mf->volume+1); break; } #if !defined(__OS2__)&&!defined(__EMX__) flushinp(); #endif } win_refresh(); } if (!finished) { if ((!quit)&&!BTST(config.playmode,PM_MODULE)&&(!next)&&(settime)) PL_SetTimeCurrent(&playlist,mf->sngtime); PL_SetPlayedCurrent(&playlist); Player_Stop(); /* stop playing */ Player_Free(mf); /* and free the module */ } player_on=0; } MikMod_Exit(); library_on=0; win_exit(); if ((!quit)&&(!quiet)) { if (!finished) exit_player(1,"MikMod error : %s\n",MikMod_strerror(MikMod_errno)); else puts("Finished playlist..."); } if (!norc) { if (config.save_config) CF_Save(&config); if (config.save_playlist) PL_SaveDefault(&playlist); } set_term_title(NULL); // reset the title exit(0); } /* ex:set ts=4: */ mikmod-3.2.1/src/mdialog.c0100644001161100116100000001040607740670670015027 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mdialog.c,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Some common dialog types ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "mwidget.h" #include "mdialog.h" typedef struct { handleDlgFunc handle_dlg; void *input; void *data; int min,max; } DLG_DATA; static int handle_focus(DIALOG *d,struct WIDGET *w,int focus) { if (focus==FOCUS_ACTIVATE) { DLG_DATA *data=w->data; if (data) { int button=0; if (w->type==TYPE_BUTTON) button=((WID_BUTTON*)w)->active; if ((!button)&&(data->min>=0)&&(data->max>=0)) { int value=atoi(data->input); if ((valuemin)||(value>data->max)) return focus; } data->handle_dlg(button,data->input,data->data); free(data); } dialog_close(d); return EVENT_HANDLED; } return focus; } static DLG_DATA* init_dlg_data(handleDlgFunc handle_dlg,void *input,void *data) { DLG_DATA *dlg_data=NULL; if (handle_dlg) { dlg_data=malloc(sizeof(DLG_DATA)); dlg_data->handle_dlg=handle_dlg; dlg_data->input=input; dlg_data->data=data; dlg_data->min=dlg_data->max=-1; } return dlg_data; } /* Opens a message box msg : text to display,can contain '\n' button: ".&..|...|...",&: hotkey,e.g.: "&Yes|&No" active: active button(0...n) data : passed to handle_dlg */ void dlg_message_open(char *msg,char *button,int active,handleDlgFunc handle_dlg,void *data) { WIDGET *w; DIALOG *d=dialog_new(); wid_label_add(d,0,msg); w=wid_button_add(d,1,button,active); if (handle_dlg) wid_set_func(w,NULL,handle_focus,init_dlg_data(handle_dlg,NULL,data)); dialog_open(d,"Message"); } /* Shows message describing the errno error code. txt must contain '%s'(err-txt will be inserted) */ void dlg_error_show(char *txt) { if (errno) { char *err=strerror(errno); char *msg=malloc(strlen(txt)+strlen(err)+1); sprintf(msg,txt,err); dlg_message_open(msg,"&Ok",0,NULL,NULL); free(msg); } } /* Opens a string input dialog msg : text to display,can contain '\n' str : default text length: max allowed input length */ void dlg_input_str(char *msg,char *str,int length,handleDlgFunc handle_dlg,void *data) { WIDGET *w; WID_STR *str_wid; DLG_DATA *dlg_data; DIALOG *d=dialog_new(); if (msg) wid_label_add(d,0,msg); str_wid=(WID_STR*)wid_str_add(d,0,str,length); w=wid_button_add(d,1,"<&Ok>|&Cancel",0); dlg_data=init_dlg_data(handle_dlg,str_wid->input,data); wid_set_func((WIDGET*)str_wid,NULL,handle_focus,dlg_data); wid_set_func(w,NULL,handle_focus,dlg_data); dialog_open(d,"Enter string"); } /* Opens an integer input dialog msg : text to display,can contain '\n' value : default integer min,max: min,max allowed values */ void dlg_input_int(char *msg,int value,int min,int max,handleDlgFunc handle_dlg,void *data) { char title[40]; WIDGET *w; WID_INT *int_wid; DLG_DATA *dlg_data; DIALOG *d=dialog_new(); if (msg) wid_label_add(d,0,msg); sprintf(title,"%d",max); int_wid=(WID_INT*)wid_int_add(d,0,value,strlen(title)); w=wid_button_add(d,1,"<&Ok>|&Cancel",0); dlg_data=init_dlg_data(handle_dlg,int_wid->input,data); dlg_data->min=min; dlg_data->max=max; wid_set_func((WIDGET*)int_wid,NULL,handle_focus,dlg_data); wid_set_func(w,NULL,handle_focus,dlg_data); sprintf(title,"Enter value(%d - %d)",min,max); dialog_open(d,title); } /* ex:set ts=4: */ mikmod-3.2.1/src/mdialog.h0100644001161100116100000000415307740670670015036 0ustar raphtechnolab/* MikMod example player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mdialog.h,v 1.1.1.1 2003/09/19 13:16:01 raph Exp $ Some common dialog types ==============================================================================*/ #ifndef MDIALOG_H #define MDIALOG_H /* Function which is called on input button: selected button (str- and int-fileds selected -> button==0) input: input in a int- or str-field data: user-pointer which was passed to dlg-function */ typedef void (*handleDlgFunc)(int,void*,void*); /* Opens a message box msg : text to display, can contain '\n' button: ".&..|...|...", &: hotkey, e.g.: "&Yes|&No" active: active button (0...n) data : passed to handle_dlg */ void dlg_message_open(char*,char*,int,handleDlgFunc,void*); /* Shows message describing the errno error code. txt must contain '%s' (err-txt will be inserted) */ void dlg_error_show(char*); /* Opens a string input dialog msg : text to display, can contain '\n' str : default text length: max allowed input length */ void dlg_input_str(char*,char*,int,handleDlgFunc,void*); /* Opens an integer input dialog msg : text to display, can contain '\n' value : default integer min,max: min, max allowed values */ void dlg_input_int(char*,int,int,int,handleDlgFunc,void*); #endif /* MDIALOG_H */ mikmod-3.2.1/src/player.h0100644001161100116100000002267707740670670014731 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat -- see file AUTHORS for complete list. (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: player.h,v 1.13 2003/10/08 02:08:48 raph Exp $ Module player example of MikMod ==============================================================================*/ #ifndef PLAYER_H #define PLAYER_H #ifdef HAVE_LIMITS_H #include #endif #if !defined(PATH_MAX) && defined(_POSIX_PATH_MAX) #define PATH_MAX _POSIX_PATH_MAX #endif #ifndef PATH_MAX #define PATH_MAX 256 #endif #if defined(__OS2__)||defined(__EMX__)||defined(WIN32) #define strcasecmp(s,t) stricmp(s,t) #define filecmp strcasecmp #else #define filecmp strcmp #endif #define MIN(a,b) ((a)<(b)?(a):(b)) #define BTST(v,m) ((v)&(m)?1:0) /*========== Messages */ #define version "3.2.1" #if defined(__OS2__)||defined(__EMX__) #define mikversion "-= MikMod/2 " version " =-" #else #define mikversion "-= MikMod " version " =-" #endif #define mikcopyr mikversion \ "\n(c) 2003, Raphael Assenat and others - see file AUTHORS for complete list"\ "\n(c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for complete list" #define mikbanner mikcopyr "\n\n" \ " - MikMod authors and contributors are :\n" \ " Jean-Philippe Ajirent - Peter Amstutz - Anders Bjoerklund\n" \ " Dimitri Boldyrev - Peter Breitling - Arne de Bruijn - Douglas Carmichael\n"\ " Chris Conn - Arnout Cosman - Shlomi Fish - Paul Fisher - Tobias Gloth\n" \ " Roine Gustaffson - Bjornar Henden - Stephan Kanthak - Alexander Kerkhove\n"\ " ``Kodiak'' - Mario Koeppen - Mike Leibow - Andy Lo A Foe - Frank Loemker\n"\ " Sylvain Marchand - Claudio Matsuoka - Jeremy McDonald - Steve McIntyre\n" \ " Brian McKinney - ``MenTaLguY'' - Jean-Paul Mikkers - Thomas Neumann\n" \ " C Ray C - Steffen Rusitschka - Jake Stine - Stefan Tibus - Tinic Urou\n" \ " Miodrag Vallat - Raphael Assenat - Kev Vance - Lutz Vieweg - Vince Vu\n" \ " Valtteri Vuorikoski\n" \ "\n" \ " - This program is free software covered by the GNU General Public License\n" \ " and comes with ABSOLUTELY NO WARRANTY.\n" \ "\nType 'mikmod -h' for command line options!\n" #define pausebanner \ "'||''|. | '||' '|' .|'''.| '||''''| '||''|. \n" \ " || || ||| || | ||.. ' || . || || \n" \ " ||...|' | || || | ''|||. ||''| || ||\n" \ " || .''''|. || | . '|| || || ||\n" \ ".||. .|. .||. '|..' |'....|' .||.....|.||...|' \n" #define extractbanner \ "'||''''| . . || \n" \ " || . ... ....||. ... .. .... .... .||. ... .. ... ... .\n" \ " ||''| '|..' || ||' '''' .|| .| '' || || || || || || \n" \ " || .|. || || .|' || || || || || || |'' \n" \ ".||.....|.| ||. '|.'.||. '|..'|' '|...' '|.'.||..||. ||.'||||.\n" \ " .|....'\n" #define loadbanner \ "'||' '|| || \n" \ " || ... .... .. || ... .. ... ... .\n" \ " || .| '|. '' .|| .' '|| || || || || || \n" \ " || || || .|' || |. || || || || |'' \n" \ ".||.....| '|..|' '|..'|' '|..'||. .||. .||. || .'||||.\n" \ " .|....'\n" /*========== Playlist */ #define PL_CONT_NEXT (1) #define PL_CONT_PREV (2) #define PL_CONT_POS (3) #define PM_MODULE (1) /* Module repeatly */ #define PM_MULTI (2) /* PlayList repeatly */ #define PM_SHUFFLE (4) /* shuffle PlayList */ #define PM_RANDOM (8) /* PlayList in random order */ #define PL_IDENT "MikMod playlist\n" typedef struct { CHAR *file; CHAR *archive; int time; BOOL played; } PLAYENTRY; typedef struct { int current; int numused; PLAYENTRY* entry; int add_pos; } PLAYLIST; extern PLAYLIST playlist; extern BOOL PL_isPlaylistFilename(CHAR*); extern void PL_InitList(PLAYLIST*); extern void PL_InitCurrent(PLAYLIST*); extern void PL_ClearList(PLAYLIST*); extern int PL_GetCurrentPos(PLAYLIST*); extern PLAYENTRY *PL_GetCurrent(PLAYLIST*); extern PLAYENTRY *PL_GetEntry(PLAYLIST*,int); extern int PL_GetLength(PLAYLIST*); extern void PL_SetTimeCurrent(PLAYLIST*,long); extern void PL_SetPlayedCurrent(PLAYLIST*); extern BOOL PL_DelEntry(PLAYLIST*,int); extern BOOL PL_DelDouble(PLAYLIST*); extern void PL_Add(PLAYLIST*,CHAR*,CHAR*,int,BOOL); extern void PL_StartInsert(PLAYLIST*,int); extern void PL_StopInsert(PLAYLIST*); extern BOOL PL_Load(PLAYLIST*,CHAR*); extern BOOL PL_Save(PLAYLIST*,CHAR*); extern char* PL_GetFilename(void); extern BOOL PL_LoadDefault(PLAYLIST*); extern BOOL PL_SaveDefault(PLAYLIST*); /* Get new playlist entry and change current accordingly */ extern BOOL PL_ContNext(PLAYLIST*,CHAR**,CHAR**,int); extern BOOL PL_ContPrev(PLAYLIST*,CHAR**,CHAR**); extern BOOL PL_ContPos(PLAYLIST*,CHAR**,CHAR**,int); extern void PL_Sort(PLAYLIST*,int(*)(PLAYENTRY*,PLAYENTRY*)); extern void PL_Randomize(PLAYLIST*,BOOL); /*========== Archive support */ extern CHAR *MA_dearchive(CHAR*,CHAR*); extern void MA_FindFiles(PLAYLIST*,CHAR*); #if defined(__OS2__)||defined(__EMX__) #define PATH_SEP '\\' #define PATH_SEP_STR "\\" #else #define PATH_SEP '/' #define PATH_SEP_STR "/" extern BOOL DropPrivileges(void); #endif /*========== Configuration file */ #define RENICE_NONE (0) #define RENICE_PRI (1) #define RENICE_REAL (2) typedef struct { int driver; /* nth driver for output */ #if LIBMIKMOD_VERSION >= 0x030107 char *driveroptions; #endif BOOL stereo; /* mono/stereo output */ BOOL mode_16bit; /* 8/16 bit output */ int frequency; /* mixing frequency */ BOOL interpolate; /* Use interpolate mixing */ BOOL hqmixer; /* Use high-quality (but slow) mixer */ BOOL surround; /* surround mixing */ int reverb; /* reverb amount (0-15) */ int volume; /* volume from 0% (silence) to 100% */ BOOL volrestrict; /* restrict playervolume to volume supplied by user */ BOOL fade; /* allow volume fade at the end of the module */ BOOL loop; /* allow in-module loops */ BOOL panning; /* process panning effects */ BOOL extspd; /* extended protracker effects */ int playmode; /* PM_MODULE | PM_MULTI | PM_SHUFFLE | PM_RANDOM*/ BOOL exit_after; /* Exit after reaching the end of the playlist */ BOOL curious; /* look for hidden patterns in module */ BOOL tolerant; /* don't halt on file access errors */ int renice; /* RENICE_xxx */ int statusbar; /* size of statusbar */ BOOL color; /* use color in gui */ BOOL xterm_title; /* set the xterm(or equivalent title)? */ BOOL save_config; /* save config on exit */ BOOL save_playlist;/* save playlist on exit */ char *pl_name; /* current playlist name */ BOOL fullpaths; /* display full path of the filenames */ } CONFIG; extern CONFIG config; extern char* CF_GetFilename(void); extern void CF_set_string(char**,char*,int); extern void CF_Init(CONFIG*); extern BOOL CF_Save(CONFIG*); extern BOOL CF_Load(CONFIG*); /*========== Display */ /* maximum screen width we handle */ #define MAXWIDTH (200) /* storage buffer length - used everywhere */ #define STORAGELEN MAXWIDTH+80+1 extern char storage[STORAGELEN]; #define DISPLAY_ROOT (0) #define DISPLAY_HELP (1) #define DISPLAY_SAMPLE (2) #define DISPLAY_INST (3) #define DISPLAY_COMMENT (4) #define DISPLAY_LIST (5) #define DISPLAY_CONFIG (6) typedef enum { COM_NONE, MENU_ACTIVATE } COMMAND; extern void init_display(void); extern void exit_display(void); extern void display_message(char*); extern void display_status(void); extern void display_header(void); extern void display_start(void); extern void display_extractbanner(void); extern void display_loadbanner(void); extern void display_pausebanner(void); extern void set_term_title(char *songname); void display_init(void); /*========== Player control */ extern void Player_SetNextMod(int); extern void Player_SetConfig(CONFIG*); /*========== Keycodes */ #define CTRL_A 1 #define CTRL_B 2 #define CTRL_D 4 #define CTRL_E 5 #define CTRL_F 6 #define CTRL_K 11 #define CTRL_L 12 #define CTRL_U 21 #define KEY_ASCII_DEL 127 #if defined(__OS2__)||defined(__EMX__) #define KEY_UP (0x100|72) #define KEY_DOWN (0x100|80) #define KEY_LEFT (0x100|75) #define KEY_RIGHT (0x100|77) #define KEY_NPAGE (0x100|81) #define KEY_PPAGE (0x100|73) #define KEY_HOME (0x100|71) #define KEY_END (0x100|79) #define KEY_ENTER ('\n') #define KEY_DC (127) #define KEY_BACKSPACE (8) #define KEY_F(x) (0x100|(58+(x))) #define KEY_SF(x) (0x100|(83+(x))) #endif #endif mikmod-3.2.1/src/usleep.c0100644001161100116100000000502107740670670014705 0ustar raphtechnolab/* * NAME: * usleep -- This is the precision timer for Test Set * Automation. It uses the select(2) system * call to delay for the desired number of * micro-seconds. This call returns ZERO * (which is usually ignored) on successful * completion, -1 otherwise. * * ALGORITHM: * 1) We range check the passed in microseconds and log a * warning message if appropriate. We then return without * delay, flagging an error. * 2) Load the Seconds and micro-seconds portion of the * interval timer structure. * 3) Call select(2) with no file descriptors set, just the * timer, this results in either delaying the proper * ammount of time or being interupted early by a signal. * * HISTORY: * Added when the need for a subsecond timer was evident. * Modified for Solaris-specific bits by SAM 24/10/96 * AUTHOR: * Michael J. Dyer Telephone: AT&T 414.647.4044 * General Electric Medical Systems GE DialComm 8 *767.4044 * P.O. Box 414 Mail Stop 12-27 Sect'y AT&T 414.647.4584 * Milwaukee, Wisconsin USA 53201 8 *767.4584 * internet: mike@sherlock.med.ge.com GEMS WIZARD e-mail: DYER */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef HAVE_SYS_TIME_H #include #endif #include #include int usleep(unsigned long microSeconds) { unsigned int Seconds, uSec; int nfds; struct timeval Timer; #if (defined(SOLARIS) || (defined(SGI))) fd_set readfds, writefds, exceptfds; nfds = 0; FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); #else int readfds, writefds, exceptfds; nfds = readfds = writefds = exceptfds = 0; #endif if( (microSeconds == (unsigned long) 0) || microSeconds > (unsigned long) 4000000 ) { errno = ERANGE; /* value out of range */ perror( "usleep time out of range ( 0 -> 4000000 ) " ); return -1; } Seconds = microSeconds / (unsigned long) 1000000; uSec = microSeconds % (unsigned long) 1000000; Timer.tv_sec = Seconds; Timer.tv_usec = uSec; if( select( nfds, &readfds, &writefds, &exceptfds, &Timer ) < 0 ) { perror( "usleep (select) failed" ); return -1; } return 0; } mikmod-3.2.1/src/mconfedit.c0100644001161100116100000003006207740670670015363 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat -- see file AUTHORS for complete list. (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mconfedit.c,v 1.11 2003/10/08 01:48:50 raph Exp $ The config editor ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "player.h" #include "mconfedit.h" #include "mmenu.h" #define OPT_DRIVER 0 #if LIBMIKMOD_VERSION >= 0x030107 #define OPT_DRV_OPTION 1 #define OPT_STEREO 2 #define OPT_MODE_16BIT 3 #define OPT_FREQUENCY 4 #define OPT_INTERPOLATE 5 #define OPT_HQMIXER 6 #define OPT_SURROUND 7 #define OPT_REVERB 8 #else #define OPT_STEREO 1 #define OPT_MODE_16BIT 2 #define OPT_FREQUENCY 3 #define OPT_INTERPOLATE 4 #define OPT_HQMIXER 5 #define OPT_SURROUND 6 #define OPT_REVERB 7 #endif #define OPT_VOLUME 0 #define OPT_VOLRESTRICT 1 #define OPT_FADE 2 #define OPT_LOOP 3 #define OPT_PANNING 4 #define OPT_EXTSPD 5 #define OPT_PM_MODULE 0 #define OPT_PM_MULTI 1 #define OPT_PM_SHUFFLE 2 #define OPT_PM_RANDOM 3 #define OPT_PM_EXITAFTER 4 #define OPT_CURIOUS 1 #define OPT_TOLERANT 2 #define OPT_FULLPATHS 3 #define OPT_XTERM 4 #define OPT_COLOR 5 #define OPT_RENICE 6 #define OPT_STATUSBAR 7 #define OPT_S_CONFIG 0 #define OPT_S_PLAYLIST 1 #define MENU_USE 4 #define MENU_SAVE 5 #define MENU_REVERT 6 static void handle_menu(MMENU *menu); static MENTRY output_entries[]={ {NULL, 0,"The device driver for output"}, #if LIBMIKMOD_VERSION >= 0x030107 {"Driver &options [%s]|Enter driver options:|99|16", 0,"Driver options (e.g. \"buffer=14,count=16\" for the OSS-driver)"}, #endif {"[%c] &Stereo", 0,"mono/stereo output"}, {"[%c] 16 &bit output",0,"8/16 bit output"}, {"&Frequency [%d]|Enter mixing frequency:|4000|60000", 0,"Mixing frequency in hertz (from 4000 Hz to 60000 Hz)"}, {"[%c] &Interpolate",0,"Use interpolated mixing"}, {"[%c] &HQmixer",0,"Use high-quality (but slower) software mixer"}, {"[%c] S&urround",0,"Use surround mixing"}, {"&Reverb [%d]|Enter reverb amount:|0|15", 0,"Reverb amount from 0 (no reverb) to 15"}}; static MMENU output_menu={0,0, #if LIBMIKMOD_VERSION >= 0x030107 9, #else 8, #endif 1,output_entries,handle_menu,NULL,NULL,1}; static MENTRY playback_entries[]={ {"&Volume [%d]|Enter output volume:|0|100", 0,"Output volume from 0 to 100 in %"}, {"[%c] &Restrict Volume",0, "Restrict volume of player to volume supplied by user (with 1..0,<,>)"}, {"[%c] &Fadeout",0,"Force volume fade at the end of module"}, {"[%c] &Loops", 0,"Enable in-module loops"}, {"[%c] &Panning",0,"Process panning effects"}, {"[%c] Pro&tracker",0,"Use extended protracker effects"}}; static MMENU playback_menu={0,0,6,1,playback_entries,handle_menu,NULL,NULL,2}; static MENTRY plmode_entries[]={ {"[%c] Loop &module",0,"Loop current module"}, {"[%c] Loop &list", 0,"Play the list repeatedly"}, {"[%c] &Shuffle list",0,"Shuffle list at start and when all entries are played"}, {"[%c] List &random",0,"Play list in random order"}, {"[%c] Exit After",0,"Exit after reaching the end of the playlist"}}; static MMENU plmode_menu={0,0,5,1,plmode_entries,handle_menu,NULL,NULL,4}; static MENTRY exit_entries[]={ {"[%c] Save &config",0,NULL}, {"[%c] Save &playlist",0,NULL}}; static MMENU exit_menu={0,0,2,1,exit_entries,handle_menu,NULL,NULL,5}; static MENTRY other_entries[]={ {"&Playmode >",&plmode_menu,"Playlist playing mode"}, {"[%c] &Curious", 0,"Look for hidden patterns in module"}, {"[%c] &Tolerant", 0,"Don't halt on file access errors"}, {"[%c] &Full path", 0,"Display full path of files"}, {"[%c] Xterm title", 0,"Set the xterm window title"}, #ifdef ENABLE_COLOR_INTERFACE {"[%c] Color",0,"Use color interface"}, #endif {"&Scheduling [%o]|Normal|Renice|Realtime",0, "Change process priority, MikMod must be restarted to change this"}, {"Status&bar [%o]|None|Small|Big",0,"Size of the statusbar"}, {"&On exit >",&exit_menu,""} }; static MMENU other_menu={0,0, #ifdef ENABLE_COLOR_INTERFACE 9, #else 8, #endif 1,other_entries,handle_menu,NULL,NULL,3}; static MENTRY entries[]={ {"&Output options >",&output_menu,""}, {"&Playback options >",&playback_menu,""}, {"O&ther options >",&other_menu,""}, {"-------------", 0,NULL}, {"&Use config" , 0,"Activate the edited configuration"}, {"S&ave config" , 0,"Save and activate the edited configuration"}, {"R&evert config", 0,"Reset the configuration to the actual used one"}}; static MMENU menu={0,0,7,0,entries,handle_menu,NULL,NULL,0}; /* set help text of menu entry free old menu->help and malloc new entry */ void set_help(MENTRY* entry,char* str,...) { va_list args; int len=0; if (entry->help) free(entry->help); va_start(args,str); vsprintf(storage,str,args); va_end(args); len=MIN(strlen(storage),STORAGELEN); entry->help=malloc(sizeof(char)*(len+1)); strncpy(entry->help,storage,len); entry->help[len]='\0'; } static char* skip_number(char *str) { while (str &&(*str==' ')) str++; while (str && isdigit((int)*str)) str++; while (str &&(*str==' ')) str++; return str; } /* extract drivers for the option menu */ static void get_drivers(MENTRY *entry) { char *driver=MikMod_InfoDriver(),*pos,*start; int len=0,x=0; BOOL end; for (pos=skip_number(driver);pos && *pos;pos++) { if (*pos=='\n') { if (x>35) x=35; len+=x; x=0; pos=skip_number(pos+1); } x++; } x--; if (*(pos-1)!='\n') len +=(x>=35?35:x); if (entry->text) free(entry->text); entry->text=malloc(sizeof(char)*(len+25)); strcpy(entry->text,"&Driver [%o]|Autodetect"); start=skip_number(driver); end=!(start && *start); for (pos=start;!end;pos++) { end=!*pos; if ((*pos=='\n')||(!(*pos)&& *(pos-1)!='\n')) { strcat(entry->text,"|"); len=strlen(entry->text); /* don't embed text in braces or 'v#.#' in string */ for (x=0;x<34 && start+x<=pos;x++) { if (*(start+x)=='(') break; if (((*(start+x))=='v')&&(isdigit((int)*(start+x+1)))) break; } while ((x>0)&&(*(start+x-1)==' ')) x--; strncat(entry->text,start,x); entry->text[len+x]='\0'; pos=skip_number(pos+1); start=pos; } } free(driver); } static void config_set_config(CONFIG *config) { output_entries[OPT_DRIVER].data=(void*)(long)config->driver; #if LIBMIKMOD_VERSION >= 0x030107 output_entries[OPT_DRV_OPTION].data=config->driveroptions; #endif output_entries[OPT_STEREO].data=(void*)(long)config->stereo; output_entries[OPT_MODE_16BIT].data=(void*)(long)config->mode_16bit; output_entries[OPT_FREQUENCY].data=(void*)(long)config->frequency; output_entries[OPT_INTERPOLATE].data=(void*)(long)config->interpolate; output_entries[OPT_HQMIXER].data=(void*)(long)config->hqmixer; output_entries[OPT_SURROUND].data=(void*)(long)config->surround; output_entries[OPT_REVERB].data=(void*)(long)config->reverb; playback_entries[OPT_VOLUME].data=(void*)(long)config->volume; playback_entries[OPT_VOLRESTRICT].data=(void*)(long)config->volrestrict; playback_entries[OPT_FADE].data=(void*)(long)config->fade; playback_entries[OPT_LOOP].data=(void*)(long)config->loop; playback_entries[OPT_PANNING].data=(void*)(long)config->panning; playback_entries[OPT_EXTSPD].data=(void*)(long)config->extspd; plmode_entries[OPT_PM_EXITAFTER].data=(void*)(long)config->exit_after; plmode_entries[OPT_PM_MODULE].data=(void*)(long)BTST(config->playmode,PM_MODULE); plmode_entries[OPT_PM_MULTI].data=(void*)(long)BTST(config->playmode,PM_MULTI); plmode_entries[OPT_PM_SHUFFLE].data=(void*)(long)BTST(config->playmode,PM_SHUFFLE); plmode_entries[OPT_PM_RANDOM].data=(void*)(long)BTST(config->playmode,PM_RANDOM); other_entries[OPT_CURIOUS].data=(void*)(long)config->curious; other_entries[OPT_TOLERANT].data=(void*)(long)config->tolerant; other_entries[OPT_FULLPATHS].data=(void*)(long)config->fullpaths; other_entries[OPT_RENICE].data=(void*)(long)config->renice; other_entries[OPT_STATUSBAR].data=(void*)(long)config->statusbar; #ifdef ENABLE_COLOR_INTERFACE other_entries[OPT_COLOR].data=(void*)(long)config->color; #endif other_entries[OPT_XTERM].data=(void*)(long)config->xterm_title; exit_entries[OPT_S_CONFIG].data=(void*)(long)config->save_config; exit_entries[OPT_S_PLAYLIST].data=(void*)(long)config->save_playlist; } static void config_get_config(CONFIG *config) { config->driver=(long)output_entries[OPT_DRIVER].data; #if LIBMIKMOD_VERSION >= 0x030107 config->driveroptions=output_entries[OPT_DRV_OPTION].data; #endif config->stereo=(BOOL)(long)output_entries[OPT_STEREO].data; config->mode_16bit=(BOOL)(long)output_entries[OPT_MODE_16BIT].data; config->frequency=(long)output_entries[OPT_FREQUENCY].data; config->interpolate=(BOOL)(long)output_entries[OPT_INTERPOLATE].data; config->hqmixer=(BOOL)(long)output_entries[OPT_HQMIXER].data; config->surround=(BOOL)(long)output_entries[OPT_SURROUND].data; config->reverb=(long)output_entries[OPT_REVERB].data; config->volume=(long)playback_entries[OPT_VOLUME].data; config->volrestrict=(BOOL)(long)playback_entries[OPT_VOLRESTRICT].data; config->fade=(BOOL)(long)playback_entries[OPT_FADE].data; config->loop=(BOOL)(long)playback_entries[OPT_LOOP].data; config->panning=(BOOL)(long)playback_entries[OPT_PANNING].data; config->extspd=(BOOL)(long)playback_entries[OPT_EXTSPD].data; config->exit_after=(BOOL)(long)plmode_entries[OPT_PM_EXITAFTER].data; config->playmode= (((BOOL)(long)plmode_entries[OPT_PM_MODULE].data)?PM_MODULE:0)| (((BOOL)(long)plmode_entries[OPT_PM_MULTI].data)?PM_MULTI:0)| (((BOOL)(long)plmode_entries[OPT_PM_SHUFFLE].data)?PM_SHUFFLE:0)| (((BOOL)(long)plmode_entries[OPT_PM_RANDOM].data)?PM_RANDOM:0); config->curious=(BOOL)(long)other_entries[OPT_CURIOUS].data; config->tolerant=(BOOL)(long)other_entries[OPT_TOLERANT].data; config->fullpaths=(BOOL)(long)other_entries[OPT_FULLPATHS].data; config->renice=(long)other_entries[OPT_RENICE].data; config->statusbar=(long)other_entries[OPT_STATUSBAR].data; #ifdef ENABLE_COLOR_INTERFACE config->color=(BOOL)(long)other_entries[OPT_COLOR].data; #endif config->xterm_title=(BOOL)(long)other_entries[OPT_XTERM].data; config->save_config=(BOOL)(long)exit_entries[OPT_S_CONFIG].data; config->save_playlist=(BOOL)(long)exit_entries[OPT_S_PLAYLIST].data; } static void handle_menu(MMENU *menu) { if (!menu->id) { switch (menu->cur) { case MENU_USE: config_get_config(&config); Player_SetConfig(&config); win_status("Configuration activated"); break; case MENU_SAVE: config_get_config(&config); CF_Save(&config); Player_SetConfig(&config); win_status("Configuration saved and activated"); break; case MENU_REVERT: config_set_config(&config); win_status("Changed configuration reseted"); break; } } } /* open config editor */ void config_open(void) { char *name=CF_GetFilename(); set_help(&exit_entries[OPT_S_CONFIG], "Save config at exit in '%s'",name); if (name) free(name); name=PL_GetFilename(); set_help(&exit_entries[OPT_S_PLAYLIST], "Save playlist at exit in '%s'",name); if (name) free(name); get_drivers(&output_entries[OPT_DRIVER]); config_set_config(&config); menu_open(&menu,5,5); } /* ex:set ts=4: */ mikmod-3.2.1/src/mconfedit.h0100644001161100116100000000252607740670670015374 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat -- see file AUTHORS for complete list. (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mconfedit.h,v 1.2 2003/10/05 03:35:46 raph Exp $ The config editor ==============================================================================*/ #ifndef MCONFEDIT_H #define MCONFEDIT_H #include "mmenu.h" /* set help text of menu entry free old menu->help and malloc new entry */ void set_help(MENTRY*,char*,...); /* open config editor */ void config_open(void); #endif /* MCONFEDIT_H */ mikmod-3.2.1/src/mconfig.c0100644001161100116100000003407107740670670015041 0ustar raphtechnolab/* MikMod example player (c) 2003 Raphael Assenat -- see file AUTHORS for complete list. (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mconfig.c,v 1.8 2003/10/08 01:48:51 raph Exp $ Load/Save of config options. ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "player.h" #include "mutilities.h" /* hope this will be enough... */ #define LINE_LEN 500 typedef struct { int id; char *label; } LABEL_CONV; typedef enum { OPT_DRIVER, #if LIBMIKMOD_VERSION >= 0x030107 OPT_DRV_OPTION, #endif OPT_STEREO, OPT_MODE_16BIT, OPT_FREQUENCY, OPT_INTERPOLATE, OPT_HQMIXER, OPT_SURROUND, OPT_REVERB, OPT_VOLUME, OPT_VOLRESTRICT, OPT_FADE, OPT_LOOP, OPT_PANNING, OPT_EXTSPD, OPT_PM_MODULE, OPT_PM_MULTI, OPT_PM_SHUFFLE, OPT_PM_RANDOM, OPT_EXIT_AFTER, OPT_CURIOUS, OPT_TOLERANT, OPT_XTERM, #ifdef ENABLE_COLOR_INTERFACE OPT_COLOR, #endif OPT_RENICE, OPT_STATUSBAR, OPT_S_CONFIG, OPT_S_PLAYLIST, OPT_PL_NAME, OPT_FULLPATHS, OPT_NONE } OPTION_ID; typedef struct { OPTION_ID id; char *label,*description; } OPTION; static LABEL_CONV renice_conv[]={ {RENICE_NONE,"RENICE_NONE"}, {RENICE_PRI, "RENICE_PRI"}, {RENICE_REAL,"RENICE_REAL"}, {-1,NULL} }; static OPTION options[]={ {OPT_DRIVER, "DRIVER", "# DRIVER = , nth driver for output, default: 0\n"}, #if LIBMIKMOD_VERSION >= 0x030107 {OPT_DRV_OPTION, "DRV_OPTIONS", "# DRV_OPTIONS = \"options\", the driver options, e.g. \"buffer=14,count=16\"\n" "# for the OSS-driver\n"}, #endif {OPT_STEREO, "STEREO", "# STEREO = Yes|No, stereo or mono output, default: stereo\n"}, {OPT_MODE_16BIT, "16BIT", "# 16BIT = Yes|No, 8 or 16 bit output, default: 16 bit\n"}, {OPT_FREQUENCY, "FREQUENCY", "# FREQUENCY = , mixing frequency, default: 44100 Hz\n"}, {OPT_INTERPOLATE, "INTERPOLATE", "# INTERPOLATE = Yes|No, use interpolate mixing, default: No\n"}, {OPT_HQMIXER, "HQMIXER", "# HQMIXER = Yes|No, use high-quality (but slow) software mixer, default: No\n"}, {OPT_SURROUND, "SURROUND", "# SURROUND = Yes|No, use surround mixing, default: No\n"}, {OPT_REVERB, "REVERB", "# REVERB = , set reverb amount (0-15), default:0 (none)\n"}, {OPT_VOLUME, "VOLUME", "# VOLUME = , volume from 0 (silence) to 100, default: 100\n"}, {OPT_VOLRESTRICT, "VOLRESTRICT", "# VOLRESTRICT = Yes|No, restrict volume of player to volume supplied by user,\n" " default: No\n"}, {OPT_FADE, "FADEOUT", "# FADEOUT = Yes|No, volume fade at the end of the module, default: No\n"}, {OPT_LOOP, "LOOP", "# LOOP = Yes|No, enable in-module loops, default: No\n"}, {OPT_PANNING, "PANNING", "# PANNING = Yes|No, process panning effects, default: Yes\n"}, {OPT_EXTSPD, "EXTSPD", "# EXTSPD = Yes|No, process Protracker extended speed effect, default: Yes\n"}, {OPT_PM_MODULE ,"PM_MODULE", "# PM_MODULE = Yes|No, Module repeats, default: No\n"}, {OPT_PM_MULTI ,"PM_MULTI", "# PM_MULTI = Yes|No, PlayList repeats, default: Yes\n"}, {OPT_PM_SHUFFLE ,"PM_SHUFFLE", "# PM_SHUFFLE = Yes|No, Shuffle list at start and if all entries are played,\n" "# default: No\n"}, {OPT_PM_RANDOM ,"PM_RANDOM", "# PM_RANDOM = Yes|No, PlayList in random order, default: No\n"}, {OPT_EXIT_AFTER, "EXIT_AFTER", "# EXIT_AFTER = Yes|No, exit mikmod after reaching the end of the playlist, default: No\n"}, {OPT_CURIOUS, "CURIOUS", "# CURIOUS = Yes|No, look for hidden patterns in module, default: No\n"}, {OPT_TOLERANT, "TOLERANT", "# TOLERANT = Yes|No, don't halt on file access errors, default: No\n"}, {OPT_XTERM, "XTERM", "# XTERM = Yes|No, Set the xterm window title, default: Yes\n"}, #ifdef ENABLE_COLOR_INTERFACE {OPT_COLOR, "COLOR", "# COLOR = Yes/No, Use color interface, default: Yes\n"}, #endif {OPT_RENICE, "RENICE", "# RENICE = RENICE_NONE (change nothing), RENICE_PRI (Renice to -20) or\n" "# RENICE_REAL (get realtime priority), default: RENICE_NONE\n" "# Note that RENICE_PRI is only available under FreeBSD, Linux, NetBSD,\n" "# OpenBSD and OS/2, and RENICE_REAL is only available under FreeBSD, Linux\n" "# and OS/2.\n"}, {OPT_STATUSBAR, "STATUSBAR", "# STATUSBAR = , size of statusbar from 0 to 2, default: 2\n"}, {OPT_S_CONFIG, "SAVECONFIG", "# SAVECONFIG = Yes|No, save configuration on exit, default: No\n"}, {OPT_S_PLAYLIST, "SAVEPLAYLIST", "# SAVEPLAYLIST = Yes|No, save playlist on exit, default: No\n"}, {OPT_PL_NAME, "PL_NAME", "# PL_NAME = \"name\", name under which the playlist will be saved\n" "# by selecting 'Save' in the playlist-menu\n"}, {OPT_FULLPATHS, "FULLPATHS", "# FULLPATHS = Yes|No, display full path of files, default: No\n"}, {OPT_NONE, NULL, NULL} }; char* CF_GetFilename(void) { #if defined(__OS2__)||defined(__EMX__) return get_cfg_name("mikmod.cfg"); #else return get_cfg_name(".mikmodrc"); #endif } void CF_Init(CONFIG *cfg) { cfg->driver =0; #if LIBMIKMOD_VERSION >= 0x030107 CF_set_string(&cfg->driveroptions,"",99); #endif cfg->stereo =1; cfg->mode_16bit =1; cfg->frequency =44100; cfg->interpolate =0; cfg->hqmixer =0; cfg->surround =0; cfg->reverb =0; cfg->volume =100; cfg->volrestrict =0; cfg->fade =0; cfg->loop =0; cfg->panning =1; cfg->extspd =1; cfg->playmode =PM_MULTI; cfg->exit_after =0; cfg->curious =0; cfg->tolerant =0; cfg->renice =RENICE_NONE; cfg->statusbar =2; cfg->color =1; cfg->save_config =0; cfg->save_playlist=0; cfg->fullpaths =0; CF_set_string(&cfg->pl_name,"playlist.mpl",PATH_MAX); } static void write_bool(FILE *file,OPTION option,BOOL arg) { if (option.description) fputs(option.description,file); if (arg) fprintf(file,"%s=yes\n\n",option.label); else fprintf(file,"%s=no\n\n",option.label); } static void write_int(FILE *file,OPTION option,int arg) { if (option.description) fputs(option.description,file); fprintf(file,"%s=%d\n\n",option.label,arg); } static void write_label(FILE *file,OPTION option,LABEL_CONV *convert,int arg) { int i; if (option.description) fputs(option.description,file); for (i=0;convert[i].id!=arg;i++); fprintf(file,"%s=%s\n\n",option.label,convert[i].label); } static void write_string(FILE *file,OPTION option,char *arg) { if (option.description) fputs(option.description,file); if (arg) fprintf(file,"%s=\"%s\"\n\n",option.label,arg); else fprintf(file,"%s=\"\"\n\n",option.label); } BOOL CF_Save(CONFIG *cfg) { FILE *file; char *name; if (!(name=CF_GetFilename())) return 0; if (!(file=fopen(name,"w"))) return 0; free(name); if (fputs("#\n" "# "mikversion"\n" "# configuration file\n" "#\n\n",file)==EOF) { fclose(file); return 0; } write_int(file,options[OPT_DRIVER], cfg->driver); #if LIBMIKMOD_VERSION >= 0x030107 write_string(file,options[OPT_DRV_OPTION],cfg->driveroptions); #endif write_bool(file,options[OPT_STEREO], cfg->stereo); write_bool(file,options[OPT_MODE_16BIT], cfg->mode_16bit); write_int(file,options[OPT_FREQUENCY], cfg->frequency); write_bool(file,options[OPT_INTERPOLATE], cfg->interpolate); write_bool(file,options[OPT_HQMIXER], cfg->hqmixer); write_bool(file,options[OPT_SURROUND], cfg->surround); write_int(file,options[OPT_REVERB], cfg->reverb); write_int(file,options[OPT_VOLUME], cfg->volume); write_bool(file,options[OPT_VOLRESTRICT], cfg->volrestrict); write_bool(file,options[OPT_FADE], cfg->fade); write_bool(file,options[OPT_LOOP], cfg->loop); write_bool(file,options[OPT_PANNING], cfg->panning); write_bool(file,options[OPT_EXTSPD], cfg->extspd); write_bool(file,options[OPT_PM_MODULE], BTST(cfg->playmode,PM_MODULE)); write_bool(file,options[OPT_PM_MULTI], BTST(cfg->playmode,PM_MULTI)); write_bool(file,options[OPT_PM_SHUFFLE], BTST(cfg->playmode,PM_SHUFFLE)); write_bool(file,options[OPT_PM_RANDOM], BTST(cfg->playmode,PM_RANDOM)); write_bool(file,options[OPT_EXIT_AFTER], cfg->exit_after); write_bool(file,options[OPT_CURIOUS], cfg->curious); write_bool(file,options[OPT_TOLERANT], cfg->tolerant); write_bool(file,options[OPT_XTERM], cfg->xterm_title); #ifdef ENABLE_COLOR_INTERFACE write_bool(file,options[OPT_COLOR], cfg->color); #endif write_label(file,options[OPT_RENICE], renice_conv,cfg->renice); write_int(file,options[OPT_STATUSBAR], cfg->statusbar); write_bool(file,options[OPT_S_CONFIG], cfg->save_config); write_bool(file,options[OPT_S_PLAYLIST], cfg->save_playlist); write_string(file,options[OPT_PL_NAME], cfg->pl_name); write_bool(file,options[OPT_FULLPATHS], cfg->fullpaths); fclose(file); return 1; } static char skip_space(char **line) { while ((**line==' ')||(**line=='\t')) (*line)++; return **line; } static BOOL parse_line(char *line,char **label,char **arg) { char *end; *label=*arg=NULL; if (skip_space(&line)=='#') return 0; *label=line; while (isalnum((int)*line)||(*line == '_')) { *line=toupper((int)*line); line++; } end=line; if (skip_space(&line)=='='){ line++; skip_space(&line); if ((isgraph((int)*line))&&(*line!='\t')&&(*line!=' ')) { BOOL string=(*line=='"'); if (string) line++; *end='\0'; *arg=line; while ((!string && isgraph((int)*line) && *line!='\t' && *line!=' ') || (string && *line && *line!='"')) { if (!string) *line=toupper((int)*line); line++; } *line='\0'; return 1; } } return 0; } static void set_int(int *value,char *arg,int min,int max) { char *end; int t=strtol(arg,&end,10); if ((!*end)&&(t>=min)&&(t<=max)) *value=t; } static void set_bool(BOOL *value,char *arg) { if ((!strcasecmp(arg,"YES"))||(!strcasecmp(arg,"ON"))||(*arg=='1')) *value=1; else if ((!strcasecmp(arg,"NO"))||(!strcasecmp(arg,"OFF"))||(*arg=='0')) *value = 0; } static void set_bit(int *value,int mask,char *arg) { if ((!strcasecmp(arg,"YES"))||(!strcasecmp(arg,"ON"))||(*arg=='1')) *value |= mask; else if ((!strcasecmp(arg,"NO"))||(!strcasecmp(arg,"OFF"))||(*arg=='0')) *value &= ~mask; } static void set_label(int *value,char *arg,LABEL_CONV *convert) { int i=0; while (convert[i].label) { if (!strcmp(convert[i].label,arg)) { *value=convert[i].id; return; } i++; } } void CF_set_string(char **value,char *arg,int length) { int len=strlen(arg); if (len>length) len=length; if (*value) free(*value); *value=(char*)malloc((len+1)*sizeof(char)); strncpy(*value,arg,len); (*value)[len]='\0'; } static void set_option(CONFIG *cfg,OPTION_ID opt,char *arg) { switch (opt) { case OPT_NONE: break; case OPT_DRIVER: set_int(&cfg->driver,arg,0,999); break; #if LIBMIKMOD_VERSION >= 0x030107 case OPT_DRV_OPTION: CF_set_string(&cfg->driveroptions,arg,99); break; #endif case OPT_STEREO: set_bool(&cfg->stereo,arg); break; case OPT_MODE_16BIT: set_bool(&cfg->mode_16bit,arg); break; case OPT_FREQUENCY: set_int(&cfg->frequency,arg,4000,60000); break; case OPT_INTERPOLATE: set_bool(&cfg->interpolate,arg); break; case OPT_HQMIXER: set_bool(&cfg->hqmixer,arg); break; case OPT_SURROUND: set_bool(&cfg->surround,arg); break; case OPT_REVERB: set_int(&cfg->reverb,arg,0,15); break; case OPT_VOLUME: set_int(&cfg->volume,arg,0,100); break; case OPT_VOLRESTRICT: set_bool(&cfg->volrestrict,arg); break; case OPT_FADE: set_bool(&cfg->fade,arg); break; case OPT_LOOP: set_bool(&cfg->loop,arg); break; case OPT_PANNING: set_bool(&cfg->panning,arg); break; case OPT_EXTSPD: set_bool(&cfg->extspd,arg); break; case OPT_PM_MODULE: set_bit(&cfg->playmode,PM_MODULE,arg); break; case OPT_PM_MULTI: set_bit(&cfg->playmode,PM_MULTI,arg); break; case OPT_PM_SHUFFLE: set_bit(&cfg->playmode,PM_SHUFFLE,arg); break; case OPT_PM_RANDOM: set_bit(&cfg->playmode,PM_RANDOM,arg); break; case OPT_EXIT_AFTER: set_bool(&cfg->exit_after,arg); break; case OPT_CURIOUS: set_bool(&cfg->curious,arg); break; case OPT_TOLERANT: set_bool(&cfg->tolerant,arg); break; case OPT_XTERM: set_bool(&cfg->xterm_title,arg); break; #ifdef ENABLE_COLOR_INTERFACE case OPT_COLOR: set_bool(&cfg->color,arg); break; #endif case OPT_RENICE: set_label(&cfg->renice,arg,renice_conv); break; case OPT_STATUSBAR: set_int(&cfg->statusbar,arg,0,2); break; case OPT_S_CONFIG: set_bool(&cfg->save_config,arg); break; case OPT_S_PLAYLIST: set_bool(&cfg->save_playlist,arg); break; case OPT_PL_NAME: CF_set_string(&cfg->pl_name,arg,PATH_MAX); break; case OPT_FULLPATHS: set_bool(&cfg->fullpaths,arg); break; } } BOOL CF_Load(CONFIG *cfg) { FILE *file; char *name=CF_GetFilename(); CHAR line[LINE_LEN],*label,*arg; int i; if (!name) return 0; if (!(file=fopen(name,"r"))) return 0; free(name); while (fgets(line,LINE_LEN,file)) { if (line[strlen(line)-1]=='\n') line[strlen(line)-1]='\0'; if (!strcasecmp(line,PL_IDENT)) { fclose(file); return 1; } if (parse_line(line,&label,&arg)) { i = 0; while ((options[i].label)&&(strcmp(options[i].label,label))) i++; if (options[i].label) set_option(cfg,options[i].id,arg); } } fclose(file); return 1; } /* ex:set ts=4: */ mikmod-3.2.1/NEWS0100644001161100116100000002731607740670670013167 0ustar raphtechnolabSummary of changes between MikMod 3.2.0 and MikMod 3.2.1: ================================================================ MikMod 3.2.1 was released on 07/10/2003 BUGFIXES - Enable/disable color gui should have appeared in configuration dialog, and On exit sub-menu in other options did not appear. NEW FEATURES - If a supported terminal is detected int the $TERM env var, MikMod will set the title bar with -= MikMod x.x.x =- followed by the song title between (). There is a configuration option for this in config->other_options Summary of changes between MikMod 3.1.6 and MikMod 3.2.0: ================================================================ MikMod 3.2.0 was released on 04/10/2003 THANKS - Info Saitz , the debian MikMod package maintainer for many bug fixes. BUGFIXES - Bugfixes from the debian MikMod package + cleaned up the documentation to match the output of the manpage, mikmod --help and the actual option processing. + Security fix when dealing with archives + Won't play LHA-compressed MODs with spaces in their names + Support for files with the extension prepended to the filename. Pretty common on Aminet. Maybe an Amiga convention? + Installed new versions of configure.{guess.sub} to support compiling on newer arches. They are taken from autotools-dev 20030110.1. NEW FEATURES - Color ncurse interface, and Option to enable/disable it. - Option to quit MikMod automatically when the playlist is finished. Summary of changes between MikMod 3.1.5 and MikMod 3.1.6 (Riom): ================================================================ MikMod 3.1.6 was released on 07/05/1999. THANKS - As usual, Frank Loemker contributed lots of stuff to the player. Thanks for your work. BUGFIXES - MikMod segfaulted when run as root (there was a public patch to 3.1.5 for this). - The mono/stereo setting in the -output option was ignored. - The frequency range was restricted to 8kHz-44.1kHz without reason. - Loading playlist not located in the current directory should work now. NEW FEATURES - Interface is even more featured: * On-screen configuration panel. * Playlist sorting, loading files or playlists from the player. - Added a restart module (R key) feature. REMOVED FEATURES - Support for the ARJ archiver has been dropped, as unarj needed an 'extra to stdout' extra feature, and the URL of the patch gave me an error 404 recently... Besides, ARJ isn't widely used in the Unix world (perhaps because we don't like plagiarism...) PLATFORM SPECIFIC - Fixed a compilation problem on HP-UX systems lacking ncurses (HP-UX curses doesn't define KEY_END). Summary of changes between MikMod 3.1.2 and MikMod 3.1.5 (Pradelles): ===================================================================== MikMod 3.1.5 was released on 03/01/1999. Starting from this version, the engine (libmikmod) and the module player (MikMod) are made separate, to make the life easier for people who use libmikmod and don't need the player. THANKS - The player was nearly completely rewritten by Frank Loemker. Nice job ! BUGFIXES - If the player is interrupted while loading a compressed file, a temporary file was not removed. - Dealing with archives containing a lot of files hanged the player at start (under Unix only). - When playing from a playlist, the last file of the playlist was played twice. NEW FEATURES - Player now displays which information panels are available, and should look better with less than 80 character wide terminals. - Bzip2 compressed modules, as well as tar and compressed tar archives, are recognized. - MikMod now stores your default settings in $HOME/.mikmodrc, so you don't have to specify a butch of options each time you invoke MikMod. Summary of changes between MikMod 3.1.1 and MikMod 3.1.2 (Monistrol): ===================================================================== MikMod 3.1.2 was released on 12/07/1998. THANKS - For this version, the special thanks distinction is awarded to Michal Svec, Thomas Sailer and Winfried Scheibe. You guys rule ! And as usual, thanks to all the people who submitted bug reports and helped me to get rid of'em. BUG FIXES - Due to an inverted test, the DSM loader rejected every valid DSM module. - Surround panning was misunderstood by the DSM loader. - FAR modules with more than 64 notes per pattern were incorrectly rejected. - report whether an IT module was compressed or not wasn't accurate. - STM identification test was broken and didn't reject some incorrect modules. - A few glitches in the pattern break and pattern jump effect have been fixed (thanks to Firelight for his "Backwards" module which showed the problem !) - The OSS driver had a serious memory allocation bug which could cause systematic coredumps, depending on your hardware and your environment variable settings. - Archive support didn't work correctly with some versions of lharc (1.01, 1.14c+) and unzip (5.40+), hopefully they should work now. NEW FEATURES - Support for rar archives has been added. The player looks for 'unrar' to display and extract the archives ; don't forget to put a symbolic link if you only have rar. PLATFORM SPECIFIC - The Sun audio driver didn't work correctly at 44100 Hz 16 bit stereo under Solaris, due to an incorrect default buffer size. - The generated Makefiles for Watcom C++ under OS/2 were incorrect. - When compiling with emx under OS/2, the optimization level was set too high and caused incorrect playback for some modules. MISC - I've found more DSM information to throw in the documentation. Summary of changes between MikMod 3.1 and MikMod 3.1.1 (Landos): ================================================================ MikMod 3.1.1 was released on 12/02/1998. This version contains only bugfixes and was released shortly after 3.1 because of a really annoying bug in the error messages. THANKS - Special thanks to Scott Miller for his help in tracking a nasty bug. And as usual, thanks to all the people who submitted bug reports and helped me to get rid of'em. BUG FIXES - Due to a missing coma, most error message texts didn't correspond to what was really happening. - MikMod 3.1 was too strict regarding the S3M speed effect and did not allow >32 speeds. - The 15 instrument MOD loader has been made more robust by recognizing and some non module filetypes which could be misunderstood as valid modules and caused coredumps. - IT effects S5x (set panbrello waveform), S7x (instrument/NNA commands) and SAx (set sample offset high part) were not processed correctly. - Modules written by Impulse Tracker 2.14p3 in the uncompressed Impulse 2 format could be rejected (detection routine had to be modified to cope with an IT2.14p3 save bug...) PLATFORM SPECIFIC - A bug in the configure script prevented MikMod from compiling correctly under IRIX, AIX and perhaps some other Unices. - Another bug in the configure script caused the detection of esd_close() in libesd to always return true. - The README.OS2 file was missing in 3.1 Summary of changes between MikMod 3.0.4 and MikMod 3.1 (Davayat): ================================================================= MikMod 3.1 was released on 11/30/1998. THANKS - Many thanks to Bjornar Henden, Steve Martin, "MenTaLguY", Sebastiaan Megens and Thomas Neumann for their precise bug reports and bug fixes. Also thanks to all the people who submitted bug reports and helped me to make MikMod better. Thanks, guys ! BUG FIXES - Panning overflows which resulted in extra noises of high volume )-: are now fixed. - Surround mixer fixed. - 669 pitch slides are rendered correctly now (used logarithmic periods before). - FAR modules now play at correct speed, and more effects implemented. - IT pitch envelope now works correctly. - IT effect G (porta to note) misbehaviour when changing instrument on the same row, or after a note cut, fixed. - IT volume column effect G was misunderstood (G0 was treated as G1, G1 as G2 etc). - Lots of bug fixes in MED loader. Should now play modules at correct speed, but still not perfect. - Some notes were not played in MODs. - Some effect fixes in ULT loader. - The S3M volume slides were not rendered correctly. - XM modules with more than 256 samples caused systematic coredumps when trying to load them. - XM effect G (set global volume) was misinterpreted, resulting in halved volumes during playback. NEW FEATURES - MikMod now plays DMP's AMF files. - A "curious" option has been added to look for extra patterns in MODs, S3Ms and ITs (useful for some Skaven's modules). - MikMod now uses autoconf for building, and you can build a shared MikMod library. - Programmer's documentation in texinfo format, suitable for online browsing (with GNU info) as well as printing. API function names made more consistant and more thematic. PLATFORM SPECIFIC - New driver for the Advanced Linux Sound Architecture (ALSA). - The EsounD driver has been improved and will attempt daemon reconnection on a regular time basis, should the esd been killed. - The SGI driver caused coredumps on some machines ; hopefully this is now fixed. - integrated OS/2 support, with a new DART driver for use under Warp 4 and CPU snagger feature. MISC - I was asked to put a copyright notice in MikMod. Although I don't like that, it seems that there has to be one to be sure the GPL and LGPL apply correctly. I really hate copyrighting free software I haven't entirely written... - I've also shaved my beard the day before this release. Nice to see there was still skin under the thick beard (-: Summary of changes between MikMod 3.0.3 and MikMod 3.0.4 (Combronde): ===================================================================== MikMod 3.0.4 was released on 09/21/1998. BUG FIXES - FAR, STM and ULT loader are fixed and work (at least for me...) - Imbricated loops won't block the player. - Updated all the old drivers to work with MikMod 3 interface. - Nosound driver now works. - 669 modules are now played at correct speed. - MED loader pattern size bug fixed. - MOD sample offsets (in file) computation fixed. - S3M with more than 16 channels (i.e not created with Scream Tracker) caused previous version to coredump, but worked in 2.* - End of song marker is now recognized in S3M and IT when it appears inside the pattern list. - It was possible to register the same loader or driver twice and this made the library hang. - Speed and Tempo can't escape their bounds (1-31 for speed, 32-255 for tempo) now. - Delay note effect did not work correctly in previous version, but did in 2.* - All divide by zero conditions are prevented. - Archive code forgot to erase its temporary file (and had too short buffers). - More accurate error messages in player. NEW FEATURES - Compressed IT samples are now supported. - If you use ncurses >= 4.0, MikMod is resize-aware and will continue to display correctly in an xterm. - New driver for the Enlightened sound daemon (http://www.tux.org/~ricdude/EsounD.html) - New "volume fadeout" option. - New "don't loop" option. - Help screen in the curses player. - Module time is displayed in the player. - MikMod 2 banners are back. - Randomized playlist can now be walked through correctly. REMOVED FEATURES - The Unimod format is not supported anymore (nobody used it, right ?). The MikCvt utility has been withdrawn, too. Both will be put back on request if someone really need them. Just ask ! PLATFORM SPECIFIC - OpenBSD support, although in mono 8bit 8000 Hz only, but that's a start. - Merged NetBSD and FreeBSD specific patches from their "ports collection". - Player works with old AIX curses, as well as with old HP-UX curses. MISC - Rewritten building mechanism. It's not yet Autoconf, but it's coming... - License terms are clear : LGPL for the library, GPL for the player. mikmod-3.2.1/convert_playlist0100755001161100116100000000024007740670670016002 0ustar raphtechnolab#! /usr/bin/awk -f BEGIN { FS = "|" print "MikMod playlist" } { if ($2=="") printf("\"%s\" \"\" 0 0\n",$1); else printf("\"%s\" \"%s\" 0 0\n",$2,$1); } mikmod-3.2.1/aclocal.m40100644001161100116100000003623107740670670014324 0ustar raphtechnolabdnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # serial 1 AC_DEFUN(AM_MAINTAINER_MODE, [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT($USE_MAINTAINER_MODE) AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) # Define a conditional. AC_DEFUN(AM_CONDITIONAL, [AC_SUBST($1_TRUE) AC_SUBST($1_FALSE) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi]) # Configure paths for libmikmod # # Derived from glib.m4 (Owen Taylor 97-11-3) # dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and dnl LIBMIKMOD_LDADD dnl AC_DEFUN(AM_PATH_LIBMIKMOD, [dnl dnl Get the cflags and libraries from the libmikmod-config script dnl AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)], libmikmod_config_prefix="$withval", libmikmod_config_prefix="") AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)], libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="") AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program], , enable_libmikmodtest=yes) if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no) min_libmikmod_version=ifelse([$1], ,3.1.5,$1) AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version) no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" dnl dnl Now check if the installed libmikmod is sufficiently new. (Also sanity dnl checks the results of libmikmod-config to some extent dnl rm -f conf.mikmodtest AC_TRY_RUN([ #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main() { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; char *tmp_version; system ("touch conf.mikmodtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_libmikmod_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion()>>16)&255; libmikmod_minor_version=(MikMod_GetVersion()>> 8)&255; libmikmod_micro_version=(MikMod_GetVersion() )&255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_libmikmod" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" AC_TRY_LINK([ #include #include ], [ return (MikMod_GetVersion()!=0); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBMIKMOD_CFLAGS) AC_SUBST(LIBMIKMOD_LIBS) AC_SUBST(LIBMIKMOD_LDADD) rm -f conf.mikmodtest ]) dnl From Jim Meyering. # serial 1 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL, [AC_REQUIRE([AM_SYS_POSIX_TERMIOS]) AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h, [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no gwinsz_in_termios_h=no if test $am_cv_sys_posix_termios = yes; then AC_EGREP_CPP([yes], [#include # include # ifdef TIOCGWINSZ yes # endif ], gwinsz_in_termios_h=yes) fi if test $gwinsz_in_termios_h = no; then AC_EGREP_CPP([yes], [#include # include # ifdef TIOCGWINSZ yes # endif ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes) fi ]) if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1, [Define if TIOCGWINSZ requires sys/ioctl.h]) fi ]) dnl From Jim Meyering. # serial 1 AC_DEFUN(AM_SYS_POSIX_TERMIOS, [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios, [AC_TRY_LINK([#include #include #include ], [/* SunOS 4.0.3 has termios.h but not the library calls. */ tcgetattr(0, 0);], am_cv_sys_posix_termios=yes, am_cv_sys_posix_termios=no)]) ]) mikmod-3.2.1/README0100644001161100116100000001212607740670670013341 0ustar raphtechnolab Hello folks ! This is MikMod, version 3.2.1, a module player for Unix. As usual with each new version, there's a lot of bugfixes and improvements. Check out the file 'NEWS' for more information. >> BUILDING MIKMOD ------------------ This MikMod version can build with either libmikmod 3.1.7 (shared library version 2), or an older version, but all the configuration functions are not available for older versions. - If you're building MikMod under OS/2, please refer to the 'README' file located in the 'os2' subdirectory. - If you want to build MikMod under Windows, an extension package including Windows specific code is likely to be released soon. Check out the www site (yes, I know I'm late). The first thing you need is to get and compile the libmikmod sound library, which is not bundled with MikMod anymore ! If you don't know where to get libmikmod, look at the "contact and download info" section later in this document. So you're on a good old Unix workstation, aren't you ? You'll need an ANSI C compiler to build MikMod. To prevent clobbering the sources, I recommend building MikMod in an alternate directory, for example 'build' : mkdir build cd build In this directory, run MikMod's configure script : ../configure The configure script will attempt to guess correct values for various system-dependent variables used during the build process, and will create appropriate Makefiles for proper compilation. If you want to have color in the interface, pass the --enable-color-interface option to configure. If you're not familiar with configure scripts and their standard options, you can find more general information about them in the file INSTALL. After you've successfully run configure, simply run make to get all things build. Then, run make install to have the player installed. Depending on where you choose to install it (using the --prefix= option to configure), you may need root privileges for this operation. >> USING MIKMOD --------------- Run MikMod with the ``--help'' parameter to get the available options, or display its man page (if you did "make install") with man mikmod Also, after you've run MikMod for the first time, you might want to customize your $HOME/.mikmodrc, either from the configuration panel or by editing the file, so you won't need to supply the same options to MikMod all the time. Once you're in the player, if you haven't choosed terse mode (a la MikMod 2), pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. If you're playing MikMod in quiet mode (with the -q/-quiet switch), you can tell MikMod to jump to the next/previous song by sending the MikMod process SIGUSR1 or SIGUSR2 respectivly. In other words, let's say you're doing something like this: $ mikmod myalltimefavmods.mpl -quiet & [1] 7531 You've told MikMod to read the songs out of the playlist myalltimefavmods, to not spit out any output (-quiet), and to run in the background. Your shell will give you the process ID, in this case it's 7531. You can also find this out from "ps", "top", or a number of process management utilities. Now, let's say a song you don't like as much comes on, or for some reason one seems to be looping forever, you can do this... $ kill -s SIGUSR1 7531 or $ kill -USR1 %1 (if your shell supports the %n process notation) and MikMod will start playing the next file in the list. If you want the previous file, just use SIGUSR2 in place of SIGUSR1. This feature also works when MikMod is in interactive mode (with the curses interface), but is less useful then, since you have full player control... If you used the playlist features of the previous MikMod versions, your old playlist won't work anymore since the playlist format has changed. Now the playlist files must have an .mpl extension. To convert your old playlists into the new format, use the 'convert_playlist' awk script : ./convert_playlist < my_old_playlist > my_new_playlist.mpl >> Y2K COMPLIANCE ----------------- MikMod does not deal with dates. So, as long as the few libc functions used by the program are Y2K-compliant, MikMod is Y2K-compliant. However, the archive handler invokes archiver programs to display the contents of the archive files ; if these external programs are not Y2K compliant when displaying archive contents, MikMod may not work as expected when dealing with archives. >> THANKS --------- I would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- * email : Please send all your MikMod related e-mail to me, at : mikmod@raphnet.net * web : MikMod and libmikmod home page is located at : http://mikmod.raphnet.net mikmod-3.2.1/configure0100755001161100116100000027461707740670701014402 0ustar raphtechnolab#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" ac_help="$ac_help --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)" ac_help="$ac_help --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)" ac_help="$ac_help --disable-libmikmodtest Do not try to compile and run a test libmikmod program" ac_help="$ac_help --enable-color-interface Enable color interface " # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=src/mikmod.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:567: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:620: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:677: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=mikmod VERSION=3.1.6 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi cat >> confdefs.h <> confdefs.h <&6 echo "configure:723: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:736: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:749: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:762: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:775: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 echo "configure:792: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:819: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:849: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:900: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:932: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 943 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:974: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:979: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:1007: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1039: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:1130: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 echo "configure:1183: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata ac_cv_prog_LN_S="ln -s" else ac_cv_prog_LN_S=ln fi fi LN_S="$ac_cv_prog_LN_S" if test "$ac_cv_prog_LN_S" = "ln -s"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:1204: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi # Check whether --with-libmikmod-prefix or --without-libmikmod-prefix was given. if test "${with_libmikmod_prefix+set}" = set; then withval="$with_libmikmod_prefix" libmikmod_config_prefix="$withval" else libmikmod_config_prefix="" fi # Check whether --with-libmikmod-exec-prefix or --without-libmikmod-exec-prefix was given. if test "${with_libmikmod_exec_prefix+set}" = set; then withval="$with_libmikmod_exec_prefix" libmikmod_config_exec_prefix="$withval" else libmikmod_config_exec_prefix="" fi # Check whether --enable-libmikmodtest or --disable-libmikmodtest was given. if test "${enable_libmikmodtest+set}" = set; then enableval="$enable_libmikmodtest" : else enable_libmikmodtest=yes fi if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi # Extract the first word of "libmikmod-config", so it can be a program name with args. set dummy libmikmod-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1273: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LIBMIKMOD_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$LIBMIKMOD_CONFIG" in /*) ac_cv_path_LIBMIKMOD_CONFIG="$LIBMIKMOD_CONFIG" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_LIBMIKMOD_CONFIG="$LIBMIKMOD_CONFIG" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_LIBMIKMOD_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_LIBMIKMOD_CONFIG" && ac_cv_path_LIBMIKMOD_CONFIG="no" ;; esac fi LIBMIKMOD_CONFIG="$ac_cv_path_LIBMIKMOD_CONFIG" if test -n "$LIBMIKMOD_CONFIG"; then echo "$ac_t""$LIBMIKMOD_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi min_libmikmod_version=3.1.5 echo $ac_n "checking for libmikmod - version >= $min_libmikmod_version""... $ac_c" 1>&6 echo "configure:1308: checking for libmikmod - version >= $min_libmikmod_version" >&5 no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" rm -f conf.mikmodtest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main() { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; char *tmp_version; system ("touch conf.mikmodtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_libmikmod_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion()>>16)&255; libmikmod_minor_version=(MikMod_GetVersion()>> 8)&255; libmikmod_micro_version=(MikMod_GetVersion() )&255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } EOF if { (eval echo configure:1424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* no_libmikmod=yes fi rm -fr conftest* fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_libmikmod" = x ; then echo "$ac_t""yes" 1>&6 continue=yes else echo "$ac_t""no" 1>&6 if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" cat > conftest.$ac_ext < #include int main() { return (MikMod_GetVersion()!=0); ; return 0; } EOF if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" fi rm -f conftest* CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" echo "--- ERROR: No suitable libmikmod library found." echo " You need at least libmikmod 3.1.5 for this program to work." continue=no fi rm -f conf.mikmodtest if test $continue = yes then echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 echo "configure:1512: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 enable_ncurses=yes else echo "$ac_t""no" 1>&6 fi if test "$enable_ncurses" = "yes" then echo $ac_n "checking for resizeterm in -lncurses""... $ac_c" 1>&6 echo "configure:1554: checking for resizeterm in -lncurses" >&5 ac_lib_var=`echo ncurses'_'resizeterm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_NCURSES_RESIZETERM 1 EOF else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking POSIX termios""... $ac_c" 1>&6 echo "configure:1597: checking POSIX termios" >&5 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include int main() { /* SunOS 4.0.3 has termios.h but not the library calls. */ tcgetattr(0, 0); ; return 0; } EOF if { (eval echo configure:1612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_sys_posix_termios=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* am_cv_sys_posix_termios=no fi rm -f conftest* fi echo "$ac_t""$am_cv_sys_posix_termios" 1>&6 echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6 echo "configure:1628: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no gwinsz_in_termios_h=no if test $am_cv_sys_posix_termios = yes; then cat > conftest.$ac_ext < # include # ifdef TIOCGWINSZ yes # endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* gwinsz_in_termios_h=yes fi rm -f conftest* fi if test $gwinsz_in_termios_h = no; then cat > conftest.$ac_ext < # include # ifdef TIOCGWINSZ yes # endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes fi rm -f conftest* fi fi echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6 if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then cat >> confdefs.h <<\EOF #define GWINSZ_IN_SYS_IOCTL 1 EOF fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1689: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:1769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 echo "configure:1793: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF if { (eval echo configure:1814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi for ac_hdr in fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1838: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done for ac_hdr in fnmatch.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1878: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done for ac_hdr in ncurses.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1918: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done for ac_hdr in sched.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1958: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done if test "`uname`" = "Linux" then echo $ac_n "checking whether sched.h is correct""... $ac_c" 1>&6 echo "configure:1998: checking whether sched.h is correct" >&5 cat > conftest.$ac_ext < int main() { sched_yield(); ; return 0; } EOF if { (eval echo configure:2007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* broken_sched=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* broken_sched=yes fi rm -f conftest* if test "$broken_sched" = "yes" then cat >> confdefs.h <<\EOF #define BROKEN_SCHED 1 EOF echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 fi fi echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:2031: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:2085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 echo "configure:2106: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else rm -rf conftest* ac_cv_type_pid_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 if test $ac_cv_type_pid_t = no; then cat >> confdefs.h <<\EOF #define pid_t int EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo "configure:2139: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else rm -rf conftest* ac_cv_type_size_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 if test $ac_cv_type_size_t = no; then cat >> confdefs.h <<\EOF #define size_t unsigned EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo "configure:2172: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:2186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_time" 1>&6 if test $ac_cv_header_time = yes; then cat >> confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 echo "configure:2209: checking for working fnmatch" >&5 if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # Some versions of Solaris or SCO have a broken fnmatch function. # So we run a test program. If we are cross-compiling, take no chance. # Thanks to John Oleynick and Franc,ois Pinard for this test. if test "$cross_compiling" = yes; then ac_cv_func_fnmatch_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_fnmatch_works=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_fnmatch_works=no fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_func_fnmatch_works" 1>&6 if test $ac_cv_func_fnmatch_works = yes; then cat >> confdefs.h <<\EOF #define HAVE_FNMATCH 1 EOF fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 echo "configure:2248: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes else rm -rf conftest* ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 echo "configure:2294: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_memcmp_clean=no fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 echo "configure:2330: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifdef signal #undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main() { int i; ; return 0; } EOF if { (eval echo configure:2352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_signal" 1>&6 cat >> confdefs.h <&6 echo "configure:2371: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char vprintf(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_vprintf) || defined (__stub___vprintf) choke me #else vprintf(); #endif ; return 0; } EOF if { (eval echo configure:2399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_vprintf=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_VPRINTF 1 EOF else echo "$ac_t""no" 1>&6 fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 echo "configure:2423: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else _doprnt(); #endif ; return 0; } EOF if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func__doprnt=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_DOPRNT 1 EOF else echo "$ac_t""no" 1>&6 fi fi for ac_func in getopt_long_only do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2478: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2533: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "usleep" >/dev/null 2>&1; then rm -rf conftest* have_usleep_h=yes fi rm -f conftest* cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "usleep" >/dev/null 2>&1; then rm -rf conftest* have_usleep_h=yes fi rm -f conftest* for ac_func in srandom do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2612: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <> confdefs.h <<\EOF #define HAVE_SRANDOM 1 EOF else echo "$ac_t""no" 1>&6 fi done cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "srandom" >/dev/null 2>&1; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SRANDOM_IN_MATH_H 1 EOF fi rm -f conftest* for ac_func in snprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2685: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <> confdefs.h <<\EOF #define HAVE_SNPRINTF 1 EOF else echo "$ac_t""no" 1>&6 fi done if test "`uname`" = "AIX" then cat >> confdefs.h <<\EOF #define AIX 1 EOF fi if test "$have_usleep_h" != "yes" then cat >> confdefs.h <<\EOF #define NEED_USLEEP 1 EOF fi if test "$have_getopt_long_only" != "yes" then EXTRA_OBJ="getopt.o getopt1.o $EXTRA_OBJ" fi if test "$ac_cv_func_fnmatch_works" != "yes" then EXTRA_OBJ="fnmatch.o $EXTRA_OBJ" fi if test "$have_usleep" != "yes" then EXTRA_OBJ="usleep.o $EXTRA_OBJ" fi if test "$enable_ncurses" = "yes" then PLAYER_LIB="-lncurses $PLAYER_LIB" else PLAYER_LIB="-lcurses $PLAYER_LIB" fi # Check whether --enable-color_interface or --disable-color_interface was given. if test "${enable_color_interface+set}" = set; then enableval="$enable_color_interface" cat >> confdefs.h <<\EOF #define ENABLE_COLOR_INTERFACE 1 EOF fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile src/Makefile os2/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g s%@MAINT@%$MAINT%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@LN_S@%$LN_S%g s%@LIBMIKMOD_CONFIG@%$LIBMIKMOD_CONFIG%g s%@LIBMIKMOD_CFLAGS@%$LIBMIKMOD_CFLAGS%g s%@LIBMIKMOD_LIBS@%$LIBMIKMOD_LIBS%g s%@LIBMIKMOD_LDADD@%$LIBMIKMOD_LDADD%g s%@LIBOBJS@%$LIBOBJS%g s%@EXTRA_OBJ@%$EXTRA_OBJ%g s%@PLAYER_LIB@%$PLAYER_LIB%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 else exit 1 fi # if $continue mikmod-3.2.1/configure.in0100644001161100116100000000671607740670670015002 0ustar raphtechnolabdnl Process this file with autoconf to produce a configure script. dnl dnl $Id: configure.in,v 1.2 2003/10/05 02:04:51 raph Exp $ AC_INIT(src/mikmod.c) AM_INIT_AUTOMAKE(mikmod,3.1.6) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl ==================== dnl Checks for programs. dnl ==================== AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl ===================== dnl Checks for libraries. dnl ===================== dnl libmikmod AM_PATH_LIBMIKMOD(3.1.5,continue=yes,[ echo "--- ERROR: No suitable libmikmod library found." echo " You need at least libmikmod 3.1.5 for this program to work." continue=no ]) if test $continue = yes then dnl ncurses AC_CHECK_LIB(ncurses,initscr,enable_ncurses=yes) dnl resizeterm is an optional part of ncurses if test "$enable_ncurses" = "yes" then AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_NCURSES_RESIZETERM)) AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL fi dnl ======================== dnl Checks for header files. dnl ======================== AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h) AC_CHECK_HEADERS(fnmatch.h) AC_CHECK_HEADERS(ncurses.h) AC_CHECK_HEADERS(sched.h) dnl Checks for bogus Linux old libc5 sched.h if test "`uname`" = "Linux" then AC_MSG_CHECKING([whether sched.h is correct]) AC_TRY_COMPILE([#include ],[sched_yield();], broken_sched=no,broken_sched=yes) if test "$broken_sched" = "yes" then AC_DEFINE(BROKEN_SCHED) AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi fi dnl ============================================================== dnl Checks for typedefs, structures, and compiler characteristics. dnl ============================================================== AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME dnl ============================= dnl Checks for library functions. dnl ============================= AC_FUNC_FNMATCH AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(getopt_long_only,have_getopt_long_only=yes) AC_CHECK_FUNCS(usleep,have_usleep=yes) AC_HEADER_EGREP(usleep,unistd.h,have_usleep_h=yes) AC_HEADER_EGREP(usleep,sys/unistd.h,have_usleep_h=yes) AC_CHECK_FUNCS(srandom,AC_DEFINE(HAVE_SRANDOM)) AC_HEADER_EGREP(srandom,math.h,AC_DEFINE(SRANDOM_IN_MATH_H)) AC_CHECK_FUNCS(snprintf,AC_DEFINE(HAVE_SNPRINTF)) dnl ================ dnl Choose settings. dnl ================ if test "`uname`" = "AIX" then AC_DEFINE(AIX) fi dnl =================== dnl Choose extra stuff. dnl =================== if test "$have_usleep_h" != "yes" then AC_DEFINE(NEED_USLEEP) fi if test "$have_getopt_long_only" != "yes" then EXTRA_OBJ="getopt.o getopt1.o $EXTRA_OBJ" fi dnl Yet another kluge to get the result of AC_FUNC_FNMATCH. dnl WARNING ! Might break with newer versions of autoconf. if test "$ac_cv_func_fnmatch_works" != "yes" then EXTRA_OBJ="fnmatch.o $EXTRA_OBJ" fi if test "$have_usleep" != "yes" then EXTRA_OBJ="usleep.o $EXTRA_OBJ" fi if test "$enable_ncurses" = "yes" then PLAYER_LIB="-lncurses $PLAYER_LIB" else PLAYER_LIB="-lcurses $PLAYER_LIB" fi dnl Optional features dnl ================= AC_ARG_ENABLE(color_interface, [ --enable-color-interface Enable color interface ], [ AC_DEFINE(ENABLE_COLOR_INTERFACE, 1, Uncomment this if you want the color interface) ]) dnl ================= dnl Create Makefiles. dnl ================= AC_SUBST(EXTRA_OBJ) AC_SUBST(PLAYER_LIB) AC_OUTPUT(Makefile src/Makefile os2/Makefile) else exit 1 fi # if $continue mikmod-3.2.1/config.guess0100755001161100116100000012025607740670670015005 0ustar raphtechnolab#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-01-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:MicroBSD:*:*) echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. eval $set_cc_for_build cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null if test "$?" = 0 ; then case `$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; 3-1307) UNAME_MACHINE="alphaev7" ;; esac fi echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) echo i586-pc-interix3 exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mikmod-3.2.1/install-sh0100755001161100116100000001273607740670670014474 0ustar raphtechnolab#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 mikmod-3.2.1/config.sub0100755001161100116100000007210307740670670014445 0ustar raphtechnolab#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-01-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic4x | c4x*) basic_machine=tic4x-unknown os=-coff ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -microbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mikmod-3.2.1/missing0100755001161100116100000001421307740670670014057 0ustar raphtechnolab#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 mikmod-3.2.1/mkinstalldirs0100755001161100116100000000132607740670670015267 0ustar raphtechnolab#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1.1.1 2003/09/19 13:16:00 raph Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here mikmod-3.2.1/Makefile.am0100644001161100116100000000015407740670670014513 0ustar raphtechnolabAUTOMAKE_OPTIONS = foreign SUBDIRS = src os2 EXTRA_DIST = mikmod-3.1.6.lsm \ convert_playlist mikmod-3.2.1/Makefile.in0100644001161100116100000002553107740670670014532 0ustar raphtechnolab# Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ CPP = @CPP@ EXTRA_OBJ = @EXTRA_OBJ@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PLAYER_LIB = @PLAYER_LIB@ VERSION = @VERSION@ AUTOMAKE_OPTIONS = foreign SUBDIRS = src os2 EXTRA_DIST = mikmod-3.1.6.lsm convert_playlist ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = DIST_COMMON = README ./stamp-h.in AUTHORS COPYING INSTALL Makefile.am \ Makefile.in NEWS acconfig.h aclocal.m4 config.guess config.h.in \ config.sub configure configure.in install-sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h maintainer-clean-hdr: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive all-recursive-am: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall: uninstall-recursive all-am: Makefile config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ install-data-recursive uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ install-exec-am install-exec install-data-am install-data install-am \ install uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mikmod-3.2.1/config.h.in0100644001161100116100000000561607740670670014512 0ustar raphtechnolab/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE #undef _ALL_SOURCE #endif /* Define to empty if the keyword does not work. */ #undef const /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT /* Define if your system has a working fnmatch function. */ #undef HAVE_FNMATCH /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF /* Define to `int' if doesn't define. */ #undef pid_t /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if your system lacks usleep(3) */ #undef NEED_USLEEP /* Define if your system is AIX 3.* - might be needed for 4.* too */ #undef AIX /* Define if your system has random(3) and srandom(3) */ #undef HAVE_SRANDOM /* Define if your system has snprintf(3) */ #undef HAVE_SNPRINTF /* Define if your system defines random(3) and srandom(3) in math.h instead of stdlib.h */ #undef SRANDOM_IN_MATH_H /* Define if your copy of has a _P instead of __P (old Linux libc5) */ #undef BROKEN_SCHED /* Define if your libncurses defines resizeterm (not found in <4.2, and can be disabled with configure --disable-ext-functions) */ #undef HAVE_NCURSES_RESIZETERM /* Define if TIOCGWINSZ is defined in */ #undef GWINSZ_IN_SYS_IOCTL /* Define if you have the getopt_long_only function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF /* Define if you have the srandom function. */ #undef HAVE_SRANDOM /* Define if you have the usleep function. */ #undef HAVE_USLEEP /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the header file. */ #undef HAVE_FNMATCH_H /* Define if you have the header file. */ #undef HAVE_LIMITS_H /* Define if you have the header file. */ #undef HAVE_NCURSES_H /* Define if you have the header file. */ #undef HAVE_SCHED_H /* Define if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION /* Define if TIOCGWINSZ requires sys/ioctl.h */ #undef GWINSZ_IN_SYS_IOCTL /* Uncomment this if you want the color interface */ #undef ENABLE_COLOR_INTERFACE mikmod-3.2.1/stamp-h.in0100644001161100116100000000001207740670670014351 0ustar raphtechnolabtimestamp mikmod-3.2.1/AUTHORS0100644001161100116100000000337407740670670013536 0ustar raphtechnolabMikMod main authors ------------------- * Jean-Paul Mikkers (MikMak) wrote MikMod and maintained it until version 3. * Jake Stine (Air Richter) [email doesn't work anymore...] made decisive contributions to the code (esp. IT support) and maintained MikMod version 3 until it was discontinued. * Frank Loemker (floemker@techfak.uni-bielefeld.de> rewrote nearly all the player, adding lots of features (independant panels, windowing system, playlist editor, better archive support, etc). Unix mainteners --------------- * Steve McIntyre maintained MikMod'Unix version 2, and wrote the curses interface and the archive support. * Peter Amstutz maintained MikMod'Unix version 3.0, and wrote the playlist support. * Miodrag Vallat maintained MikMod'Unix version 3.0.4 to 3.1.6, made an audit of the code resulting in many bugs fixed. * Raphael Assenat current maintainer of MikMod'Unix, starting with version 3.2.0. Added color to the interface. Contributors on the Unix side ----------------------------- * "MenTaLguY" autoconfized the Unix MikMod distribution. Contributors on other platforms ------------------------------- * Anders Bjoerklund ported MikMod 3 to the Macintosh. * Dimitri Boldyrev ported MikMod 2 to the Macintosh. * Shlomi Fish ported MikMod to Java, and contributed bug fixes. * Stefan Tibus ported MikMod to OS/2. * Tinic Urou <5uro@informatik.uni-hamburg.de> ported MikMod 2 to BeOS. -- If your name is missing, don't hesitate to remind me at mikmod-3.2.1/INSTALL0100644001161100116100000001723007740670670013513 0ustar raphtechnolabBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. mikmod-3.2.1/acconfig.h0100644001161100116100000000162707740670670014407 0ustar raphtechnolab/* ========== Package information */ /* Package name (MikMod) */ #undef PACKAGE /* Package version */ #undef VERSION /* ========== Build environment information */ /* Define if your system lacks usleep(3) */ #undef NEED_USLEEP /* Define if your system is AIX 3.* - might be needed for 4.* too */ #undef AIX /* Define if your system has random(3) and srandom(3) */ #undef HAVE_SRANDOM /* Define if your system has snprintf(3) */ #undef HAVE_SNPRINTF /* Define if your system defines random(3) and srandom(3) in math.h instead of stdlib.h */ #undef SRANDOM_IN_MATH_H /* Define if your copy of has a _P instead of __P (old Linux libc5) */ #undef BROKEN_SCHED /* Define if your libncurses defines resizeterm (not found in <4.2, and can be disabled with configure --disable-ext-functions) */ #undef HAVE_NCURSES_RESIZETERM /* Define if TIOCGWINSZ is defined in */ #undef GWINSZ_IN_SYS_IOCTL mikmod-3.2.1/COPYING0100644001161100116100000004310507740670670013515 0ustar raphtechnolab GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.