diff -p1 -ur ext2sim/ext2sim-6.4.5/ext2sim.c magic-7.1/ext2sim/ext2sim-6.4.5/ext2sim.c --- ext2sim/ext2sim-6.4.5/ext2sim.c 2003-11-17 11:15:49.000000000 +0100 +++ magic-7.1/ext2sim/ext2sim-6.4.5/ext2sim.c 2003-11-17 11:26:52.000000000 +0100 @@ -31,3 +31,3 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include + #include "magic.h" diff -p1 -ur ext2sim/ext2sim-6.4.5/ext2sim6_3.c magic-7.1/ext2sim/ext2sim-6.4.5/ext2sim6_3.c --- ext2sim/ext2sim-6.4.5/ext2sim6_3.c 2003-11-17 11:15:49.000000000 +0100 +++ magic-7.1/ext2sim/ext2sim-6.4.5/ext2sim6_3.c 2003-11-17 11:26:52.000000000 +0100 @@ -31,3 +31,3 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include + #include "magic.h" diff -p1 -ur ext2sim/ext2sim.c magic-7.1/ext2sim/ext2sim.c --- ext2sim/ext2sim.c 2003-11-17 11:15:49.000000000 +0100 +++ magic-7.1/ext2sim/ext2sim.c 2003-11-17 11:26:52.000000000 +0100 @@ -21,3 +21,3 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include + #include "misc/magic.h" diff -p1 -ur ext2spice/ext2spice-6.4.5/ext2spice.c magic-7.1/ext2spice/ext2spice-6.4.5/ext2spice.c --- ext2spice/ext2spice-6.4.5/ext2spice.c 2003-11-17 11:15:47.000000000 +0100 +++ magic-7.1/ext2spice/ext2spice-6.4.5/ext2spice.c 2003-11-17 11:26:50.000000000 +0100 @@ -35,3 +35,3 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include + #include "magic.h" diff -p1 -ur ext2spice/ext2spice.c magic-7.1/ext2spice/ext2spice.c --- ext2spice/ext2spice.c 2003-11-17 11:15:47.000000000 +0100 +++ magic-7.1/ext2spice/ext2spice.c 2003-11-17 12:00:37.000000000 +0100 @@ -20,3 +20,4 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include +#include + #include "misc/magic.h" @@ -1588,3 +1589,3 @@ int l, w; /* debugging stuff */ -#include + @@ -1592,7 +1593,5 @@ int l, w; -DBPRINT( va_alist ) - va_dcl +DBPRINT( const char * fmt, ... ) { va_list args; - char *fmt; FILE *fp; @@ -1601,5 +1600,4 @@ DBPRINT( va_alist ) if ( DBG ) { - va_start( args ); + va_start( args,fmt ); fp = stderr ; - fmt = va_arg( args, char * ); (void) vsprintf( buff, fmt, args ); diff -p1 -ur extcheck/extcheck.c magic-7.1/extcheck/extcheck.c --- extcheck/extcheck.c 2003-11-17 11:15:47.000000000 +0100 +++ magic-7.1/extcheck/extcheck.c 2003-11-17 11:26:50.000000000 +0100 @@ -30,3 +30,3 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include + #include "misc/magic.h" diff -p1 -ur extflat/EFargs.c magic-7.1/extflat/EFargs.c --- extflat/EFargs.c 2003-11-17 11:15:49.000000000 +0100 +++ magic-7.1/extflat/EFargs.c 2003-11-17 12:01:36.000000000 +0100 @@ -26,3 +26,3 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include +#include #ifdef SYSV diff -p1 -ur extflat/EFread.c magic-7.1/extflat/EFread.c --- extflat/EFread.c 2003-11-17 11:15:49.000000000 +0100 +++ magic-7.1/extflat/EFread.c 2003-11-17 11:50:53.000000000 +0100 @@ -26,3 +26,4 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include +#include + #include "misc/magic.h" @@ -35,2 +36,5 @@ static char rcsid[] = "$Header: /ufs/rep + +void efReadError(const char *fmt, ...); + /* @@ -536,5 +540,4 @@ start: /*VARARGS1*/ -efReadError(fmt, va_alist) - char *fmt; - va_dcl + +void efReadError(const char *fmt, ...) { @@ -543,3 +546,3 @@ efReadError(fmt, va_alist) (void) printf("%s, line %d: ", efReadFileName, efReadLineNum); - va_start(args); + va_start(args,fmt); vfprintf(stdout, fmt, args); diff -p1 -ur graphics/X11Helper.c magic-7.1/graphics/X11Helper.c --- graphics/X11Helper.c 2003-11-17 11:15:48.000000000 +0100 +++ magic-7.1/graphics/X11Helper.c 2003-11-17 12:11:09.000000000 +0100 @@ -13,2 +13,4 @@ +#define X11HELP_PROG "XHelper7" + #include diff -p1 -ur graphics/grMain.c magic-7.1/graphics/grMain.c --- graphics/grMain.c 2003-11-17 11:15:48.000000000 +0100 +++ magic-7.1/graphics/grMain.c 2003-11-17 11:26:51.000000000 +0100 @@ -122,3 +122,3 @@ static char rcsid[]="$Header: /ufs/repos #ifndef NO_VARARGS -#include + #endif diff -p1 -ur graphics/grX11su1.c magic-7.1/graphics/grX11su1.c --- graphics/grX11su1.c 2003-11-17 11:15:48.000000000 +0100 +++ magic-7.1/graphics/grX11su1.c 2003-11-17 12:13:22.000000000 +0100 @@ -19,2 +19,5 @@ */ + +#define X11HELP_PROG "XHelper7" + #define HIRES diff -p1 -ur lisp/other/txOutput.c magic-7.1/lisp/other/txOutput.c --- lisp/other/txOutput.c 2003-11-17 11:15:47.000000000 +0100 +++ magic-7.1/lisp/other/txOutput.c 2003-11-17 11:26:49.000000000 +0100 @@ -41,3 +41,3 @@ static char rcsid[] = "$Header: /ufs/rep #ifndef NO_VARARGS -#include + #endif diff -p1 -ur mpack/magicStubs.c magic-7.1/mpack/magicStubs.c --- mpack/magicStubs.c 2003-11-17 11:15:48.000000000 +0100 +++ magic-7.1/mpack/magicStubs.c 2003-11-17 12:23:32.000000000 +0100 @@ -55,5 +55,5 @@ void SigDisableInterrupts(){} /*VARARGS1*/ -void +/*void TxError(format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) -char *format; +const char *format; { @@ -64,5 +64,5 @@ char *format; } - +*/ /*VARARGS1*/ -void +/*void TxPrintf(format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) @@ -73,3 +73,3 @@ char *format; } - +*/ void diff -p1 -ur tech/tech.h magic-7.1/tech/tech.h --- tech/tech.h 2003-11-17 11:15:47.000000000 +0100 +++ magic-7.1/tech/tech.h 2003-11-17 11:53:25.000000000 +0100 @@ -25,2 +25,2 @@ typedef int SectionID; /* Mask set by T extern char *TechDefault; /* Name of default technology */ -extern void TechError(); +extern void TechError(const char *fmt, ...); diff -p1 -ur textio/textio.h magic-7.1/textio/textio.h --- textio/textio.h 2003-11-17 11:15:50.000000000 +0100 +++ magic-7.1/textio/textio.h 2003-11-17 12:19:56.000000000 +0100 @@ -31,6 +31,6 @@ /* printing procedures */ -extern void TxPrintf(); +extern void TxPrintf(const char*, ...); extern bool TxPrintOn(); /* enables TxPrintf output */ extern bool TxPrintOff(); /* disables TxPrintf output */ -extern void TxError(); +extern void TxError(const char *, ...); extern void TxFlush(); diff -p1 -ur textio/textioInt.h magic-7.1/textio/textioInt.h --- textio/textioInt.h 2003-11-17 11:15:50.000000000 +0100 +++ magic-7.1/textio/textioInt.h 2003-11-17 12:16:13.000000000 +0100 @@ -58,2 +58,2 @@ typedef struct { extern int TxGetInputEvent(); -extern void txFprintfBasic(); +extern void txFprintfBasic(FILE *, const char*, ...); diff -p1 -ur textio/txOutput.c magic-7.1/textio/txOutput.c --- textio/txOutput.c 2003-11-17 11:15:50.000000000 +0100 +++ magic-7.1/textio/txOutput.c 2003-11-17 12:21:19.000000000 +0100 @@ -18,2 +18,4 @@ +#include + #ifndef lint @@ -44,3 +46,3 @@ static char rcsid[] = "$Header: /ufs/rep #ifndef NO_VARARGS -#include + #endif @@ -84,12 +86,7 @@ static bool txPrintFlag = TRUE; void -txFprintfBasic(va_alist) -va_dcl +txFprintfBasic(FILE *f, const char * fmt, ...) { va_list args; - char *fmt; - FILE *f; - va_start(args); - f = va_arg(args, FILE *); - fmt = va_arg(args, char *); + va_start(args, fmt); (void) GrVfprintf(f, fmt, args); @@ -137,7 +134,5 @@ txFprintfBasic(f, format, a1, a2, a3, a4 void -TxPrintf(va_alist) -va_dcl +TxPrintf(const char *fmt, ...) { va_list args; - char *fmt; FILE *f; @@ -158,4 +153,3 @@ va_dcl TxUnPrompt(); - va_start(args); - fmt = va_arg(args, char *); + va_start(args, fmt); (void) GrVfprintf(f, fmt, args); @@ -166,4 +160,3 @@ va_dcl { - va_start(args); - fmt = va_arg(args, char *); + va_start(args, fmt); (void) GrVfprintf(f, fmt, args); @@ -308,7 +301,5 @@ TxFlush() void -TxError(va_alist) -va_dcl +TxError(const char *fmt, ...) { va_list args; - char *fmt; FILE *f; @@ -323,4 +314,3 @@ va_dcl TxUnPrompt(); - va_start(args); - fmt = va_arg(args, char *); + va_start(args, fmt); (void) GrVfprintf(f, fmt, args); @@ -330,4 +320,3 @@ va_dcl else { - va_start(args); - fmt = va_arg(args, char *); + va_start(args,fmt); (void) GrVfprintf(f, fmt, args); diff -p1 -ur utils/LIBtextio.c magic-7.1/utils/LIBtextio.c --- utils/LIBtextio.c 2003-11-17 11:15:48.000000000 +0100 +++ magic-7.1/utils/LIBtextio.c 2003-11-17 12:25:20.000000000 +0100 @@ -19,2 +19,4 @@ +#include + #ifndef lint @@ -24,3 +26,3 @@ static char rcsid[] = "$Header: /ufs/rep #include -#include + @@ -67,5 +69,3 @@ TxGetLine(buf, size) /*VARARGS*/ -TxError(fmt, va_alist) - char *fmt; - va_dcl +TxError(const char *fmt, ...) { @@ -75,3 +75,3 @@ TxError(fmt, va_alist) (void) fflush(stderr); - va_start(ap); + va_start(ap,fmt); vfprintf(stderr, fmt, ap); @@ -98,5 +98,3 @@ TxError(fmt, va_alist) /*VARARGS*/ -TxPrintf(fmt, va_alist) - char *fmt; - va_dcl +TxPrintf(const char *fmt, ...) { @@ -106,3 +104,3 @@ TxPrintf(fmt, va_alist) (void) fflush(stdout); - va_start(ap); + va_start(ap,fmt); vfprintf(stdout, fmt, ap); diff -p1 -ur windows/windCmdAM.c magic-7.1/windows/windCmdAM.c --- windows/windCmdAM.c 2003-11-17 11:15:50.000000000 +0100 +++ magic-7.1/windows/windCmdAM.c 2003-11-17 12:29:08.000000000 +0100 @@ -304,6 +304,3 @@ windFilesCmd(w, cmd) } else { - if (errno < sys_nerr) - TxError("file descriptor %d: %s\n", fd, STRERROR(errno)); - else - TxError("file descriptor %d: unknown error\n", fd); + TxError("file descriptor %d: %s\n", fd, strerror(errno)); } --- tech/tech.c 2003-11-17 13:18:16.000000000 +0100 +++ tech/tech.c.new 2003-11-17 13:20:13.000000000 +0100 @@ -22,6 +22,7 @@ #include #include +#include #include "misc/magic.h" #include "utils/geometry.h" #include "utils/utils.h" @@ -30,10 +31,6 @@ #include "graphics/graphics.h" #include "utils/malloc.h" -#ifndef NO_VARARGS -#include -#endif NO_VARARGS - global char *TechDefault = NULL; int techLineNumber; @@ -415,15 +412,12 @@ /*VARARGS0*/ void -TechError(va_alist) -va_dcl +TechError(const char *fmt, ...) { va_list args; - char *fmt; TechPrintLine(); - va_start(args); - fmt = va_arg(args, char *); + va_start(args, fmt); (void) GrVfprintf(stderr, fmt, args); va_end(args); } diff -ru Makefile magic-7.1/Makefile --- Makefile 2001-01-14 20:22:26.000000000 +0100 +++ magic-7.1/Makefile 2003-11-17 17:05:41.000000000 +0100 @@ -56,7 +56,7 @@ install-real: install-dirs for dir in ${INSTALL_CAD_DIRS}; do \ - (cd $$dir && ${MAKE} install); done + (cd $$dir && ${MAKE} DESTDIR="${DESTDIR}" install); done install-dirs: ${MAGICDIR}/scripts/mkdirs ${BINDIR} ${MANDIR} ${SYSDIR} ${SCMDIR} diff -ru misc/paths.h magic-7.1/misc/paths.h --- misc/paths.h 2003-11-17 17:01:50.000000000 +0100 +++ magic-7.1/misc/paths.h 2003-11-17 17:09:29.000000000 +0100 @@ -27,18 +27,18 @@ * */ -#define EXT_PATH "~cad/share/lib/magic/%s ~cad/share/lib/magic/tutorial" -#define DOT_MAGIC_PATH "~cad/share/lib/magic/sys ~ ." +#define EXT_PATH "/usr/share/magic/%s /usr/share/magic/tutorial" +#define DOT_MAGIC_PATH "/usr/share/magic/sys ~ ." /* * Paths used by 'magic'. * */ -#define MAGIC_CMOS_PATH "~cad/share/lib/magic/cmos ~cad/share/lib/magic/tutorial" -#define MAGIC_NMOS_PATH "~cad/share/lib/magic/nmos ~cad/share/lib/magic/tutorial" -#define MAGIC_SYS_PATH ". ~cad/share/lib/magic/sys ~cad/share/lib/magic/sys/current" -#define MAGIC_SYS_DOT "~cad/share/lib/magic/sys/.magic" -#define MAGIC_LIB_PATH "~cad/share/lib/magic/%s ~cad/share/lib/magic/tutorial" +#define MAGIC_CMOS_PATH "/usr/share/magic/cmos /usr/share/magic/tutorial" +#define MAGIC_NMOS_PATH "/usr/share/magic/nmos /usr/share/magic/tutorial" +#define MAGIC_SYS_PATH ". /usr/share/magic/sys /usr/share/magic/sys/current" +#define MAGIC_SYS_DOT "/usr/share/magic/sys/.magic" +#define MAGIC_LIB_PATH "/usr/share/magic/%s /usr/share/magic/tutorial" #define HELPER_PATH ". ~cad/bin" /* Used by graphics drivers */ /* diff -ru utils/flock.c magic-7.1/utils/flock.c --- utils/flock.c 2003-11-17 17:59:45.000000000 +0100 +++ utils/flock.c 2003-11-17 18:01:01.000000000 +0100 @@ -123,7 +123,7 @@ struct timeval name_time; struct timezone dtime; char cur_path[400]; - char *cad_path; + /* char *cad_path; */ char cad_buf[400]; FILE *lfile, *mfile; /* local file and master file */ char *normal_cad = "~cad"; @@ -132,7 +132,7 @@ /* environment variable CAD_HOME overrides, otherwise do tilde expansion */ /* on "~cad". */ - if ((cad_path = getenv("CAD_HOME")) == NULL) + /* if ((cad_path = getenv("CAD_HOME")) == NULL) { cad_path = cad_buf; if (PaConvertTilde (&normal_cad, &cad_path, 400) == -1) @@ -145,7 +145,7 @@ } } - sprintf(lock_buf, "%s/flock", cad_path); + */ strcpy(lock_buf,"/var/lock/magic"); dir = stat(lock_buf, &dirstat); if((dir == -1) || !(( dirstat.st_mode) & S_IFDIR)) { @@ -161,7 +161,7 @@ /* Open the master file to create a link in CAD_HOME/flock */ - sprintf(lock_buf, "%s/flock/lock_%u%u", cad_path, + sprintf(lock_buf, "/var/lock/magic/lock_%u%u", name_time.tv_sec, name_time.tv_usec); if ((mfile = fopen(lock_buf, "w")) == NULL) --- magic/proto.magic 2003-11-26 10:08:48.000000000 +0100 +++ magic/proto.magic.new 2003-11-26 10:12:36.000000000 +0100 @@ -1,12 +1,4 @@ -# $(CAD_HOME)/lib/sys/.magic -# System wide start up file for magic, defines default macros. -# -# rcsid $NO_RCS_Header: /ufs/repository/magic/magic/proto.magic,v 1.4 2001/09/26 18:24:39 tim Exp $ -# #ifndef USE_NEW_MACROS -############################################################################### -# Default .magic macro file (original) -############################################################################### echo "" macro s "select" macro S "select more" @@ -222,19 +214,13 @@ macro XK_F11 "paint pc" macro XK_F12 "paint via" #endif -#endif (USE_NEW_MACROS) +#endif #ifndef NO_PLOT -# -# additions for plot package -# plot parameter spoolCommand "echo use 'lpr -P%s -v -s -JMagic %s' to print plot" plot parameter directory "." -#endif (NO_PLOT) +#endif #ifndef NO_SCHEME_INTERPRETER -# -# additions for default scm path -# define scm-library-path "~cad/lib/magic/scm" load-scm "default.scm" load-scm "layout.scm" -#endif (NO_SCHEME_INTERPRETER) +#endif