diff --git a/.gitignore b/.gitignore index 11b0518..a9e06b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.o +all macunpack/macunpack diff --git a/binhex/binhex.c b/binhex/binhex.c index 4e58d98..7cc3ce2 100644 --- a/binhex/binhex.c +++ b/binhex/binhex.c @@ -1,12 +1,13 @@ +#include #include +#include +#include #include "../fileio/machdr.h" #include "../fileio/rdfile.h" +#include "../fileio/rdfileopt.h" #include "../util/patchlevel.h" +#include "../util/util.h" -extern char *malloc(); -extern char *realloc(); -extern char *strcat(); -extern void exit(); extern void transname(); extern void do_indent(); extern void dofile(); @@ -21,9 +22,7 @@ static int dir_ptr = -64; static int dir_max; int dorep = 1; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int c, i, j, n; extern int optind; diff --git a/binhex/dofile.c b/binhex/dofile.c index 599127a..a1b79ec 100644 --- a/binhex/dofile.c +++ b/binhex/dofile.c @@ -1,3 +1,4 @@ +#include #include "../fileio/machdr.h" #include "../fileio/rdfile.h" diff --git a/binhex/makefile b/binhex/makefile index f68ac7e..899c79e 100644 --- a/binhex/makefile +++ b/binhex/makefile @@ -38,10 +38,10 @@ lint: lint $(CF) $(LFLAGS) $(SRCS) $(XSRCS) clean: - -rm -f *.o + rm -f *.o clobber:clean - -rm -f binhex + rm -f binhex binhex.o: ../fileio/machdr.h binhex.o: ../fileio/rdfile.h diff --git a/comm/frommac.c b/comm/frommac.c index 41f346b..40a0ae8 100644 --- a/comm/frommac.c +++ b/comm/frommac.c @@ -1,14 +1,22 @@ +#include #include +#include +#include #include "comm.h" #include "../util/patchlevel.h" +#include "../util/transname.h" +#include "../util/util.h" #include "../fileio/machdr.h" #include "globals.h" #include "../fileio/fileglob.h" #include "../fileio/wrfile.h" +#include "../fileio/wrfileopt.h" +#ifdef XM +#include "xm_from.h" +#endif /* XM */ #define LOCALOPT "lmxyzoTVH" -extern void exit(); extern void setup_tty(); extern void reset_tty(); @@ -20,9 +28,7 @@ static char options[128]; static int multi_file = 0; static int listmode = 0; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { extern int optind; extern char *optarg; diff --git a/comm/globals.h b/comm/globals.h index 74b8c19..65fb9f2 100644 --- a/comm/globals.h +++ b/comm/globals.h @@ -5,4 +5,3 @@ extern int xfertype; extern int pre_beta; extern int time_out; - diff --git a/comm/makefile b/comm/makefile index 3298daf..7028d95 100644 --- a/comm/makefile +++ b/comm/makefile @@ -52,10 +52,10 @@ lint: lint $(CF) $(LFLAGS) $(SRCS1) $(XSRCS) clean: - -rm -f *.o + rm -f *.o clobber:clean - -rm -f all tomac frommac + rm -f all tomac frommac tomac.o: comm.h tomac.o: ../fileio/machdr.h @@ -88,4 +88,3 @@ globals.o: globals.h tty.o: ../util/masks.h tty.o: protocol.h tty.o: globals.h - diff --git a/comm/tomac.c b/comm/tomac.c index dbc6a1d..0063e88 100644 --- a/comm/tomac.c +++ b/comm/tomac.c @@ -1,14 +1,18 @@ +#include #include +#include +#include #include "comm.h" #include "../fileio/machdr.h" #include "../fileio/rdfile.h" +#include "../fileio/rdfileopt.h" #include "../util/patchlevel.h" +#include "../util/util.h" #include "globals.h" +#ifdef XM +#include "xm_to.h" +#endif /* XM */ -extern char *malloc(); -extern char *realloc(); -extern char *strcat(); -extern void exit(); extern void transname(); extern void do_indent(); extern void dofile(); @@ -24,9 +28,7 @@ static char *dir_stack; static int dir_ptr = -64; static int dir_max; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int c, i, j, n; extern int optind; diff --git a/comm/tty.c b/comm/tty.c index 38b0708..6162d87 100644 --- a/comm/tty.c +++ b/comm/tty.c @@ -1,5 +1,7 @@ +#include #include #include +#include #ifndef TERMIOS_H #include #else /* TERMIOS_H */ @@ -66,7 +68,7 @@ void reset_tty() #endif /* TERMIOS_H */ } -void cleanup(sig) int sig; +void cleanup(int sig) { reset_tty(); exit(sig); @@ -101,37 +103,34 @@ int i; } } -tgetrec(buf, count, timeout) -char *buf; -int count, timeout; +int tgetrec(char *buf, int count, int timeout) { -int i, tot = 0, cc = count; + int i, tot = 0, cc = count; - if(time_out) { - if(setjmp(timobuf)) { - return TMO; - } - (void)alarm(timeout); + if (time_out) { + if (setjmp(timobuf)) { + return TMO; + } + (void)alarm(timeout); } - while(tot < count) { - i = read(ttyfd, buf, cc); - if(i < 0) { - continue; - } - tot += i; - cc -= i; - buf += i; + while (tot < count) { + i = read(ttyfd, buf, cc); + if (i < 0) { + continue; + } + tot += i; + cc -= i; + buf += i; } - if(time_out) { - (void)alarm(0); + if (time_out) { + (void)alarm(0); } return 0; } -void tputc(c) -int c; +void tputc(int c) { -char cc; + char cc; cc = c & BYTEMASK; (void)write(ttyfd, &cc, 1); diff --git a/comm/tty.h b/comm/tty.h new file mode 100644 index 0000000..5b3db5e --- /dev/null +++ b/comm/tty.h @@ -0,0 +1 @@ +void cleanup(int sig); diff --git a/comm/xm_from.c b/comm/xm_from.c index d6e1af5..53c7a6d 100644 --- a/comm/xm_from.c +++ b/comm/xm_from.c @@ -4,8 +4,11 @@ #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/masks.h" +#include "../util/transname.h" +#include "../util/util.h" #include "globals.h" #include "protocol.h" +#include "tty.h" extern int tgetc(); extern int tgetrec(); @@ -89,7 +92,7 @@ int c; case ESC: break; case CAN: - cleanup(); + cleanup(0); break; case EOT: case TMO: diff --git a/comm/xm_from.h b/comm/xm_from.h new file mode 100644 index 0000000..95bc0fe --- /dev/null +++ b/comm/xm_from.h @@ -0,0 +1 @@ +void xm_from(); diff --git a/comm/xm_to.c b/comm/xm_to.c index 868b82d..93e9ede 100644 --- a/comm/xm_to.c +++ b/comm/xm_to.c @@ -5,6 +5,7 @@ #include "../util/masks.h" #include "globals.h" #include "protocol.h" +#include "tty.h" extern int tgetc(); extern void tputc(); diff --git a/comm/xm_to.h b/comm/xm_to.h new file mode 100644 index 0000000..7ebe8ae --- /dev/null +++ b/comm/xm_to.h @@ -0,0 +1 @@ +void xm_to(); diff --git a/crc/arc.c b/crc/arc.c deleted file mode 100644 index 58fbbec..0000000 --- a/crc/arc.c +++ /dev/null @@ -1,55 +0,0 @@ -unsigned long arc_crcinit = 0; - -static unsigned short crctab[256] = { - 0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, - 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, - 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, - 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, - 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, - 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, - 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, - 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, - 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, - 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, - 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, - 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, - 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, - 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, - 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, - 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, - 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, - 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, - 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, - 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, - 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, - 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, - 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, - 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, - 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, - 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, - 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, - 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, - 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, - 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, - 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, - 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040, -}; - -unsigned long arc_updcrc(icrc, icp, icnt) - unsigned long icrc; - unsigned char *icp; - int icnt; -{ -#define M1 0xff -#define M2 0xff00 - register unsigned long crc = icrc; - register unsigned char *cp = icp; - register int cnt = icnt; - - while(cnt--) { - crc=((crc>>8)&M1)^crctab[(crc&0xff)^*cp++]; - } - - return(crc); -} - diff --git a/crc/binhex.c b/crc/binhex.c deleted file mode 100644 index f73720d..0000000 --- a/crc/binhex.c +++ /dev/null @@ -1,55 +0,0 @@ -unsigned long binhex_crcinit = 0; - -static unsigned short crctab[256] = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, - 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, - 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, - 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, - 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, - 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, - 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, - 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, - 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, - 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, - 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, - 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, - 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, - 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, - 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, - 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, - 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, - 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, - 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, - 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, - 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, - 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, - 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, -}; - -unsigned long binhex_updcrc(icrc, icp, icnt) - unsigned long icrc; - unsigned char *icp; - int icnt; -{ -#define M1 0xff -#define M2 0xff00 - register unsigned long crc = icrc; - register unsigned char *cp = icp; - register int cnt = icnt; - - while(cnt--) { - crc=((crc<<8)&M2)^crctab[((crc>>8)&0xff)^*cp++]; - } - - return(crc); -} - diff --git a/crc/ccitt.c b/crc/ccitt.c deleted file mode 100644 index cedd2ff..0000000 --- a/crc/ccitt.c +++ /dev/null @@ -1,55 +0,0 @@ -unsigned long ccitt_crcinit = 65535; - -static unsigned short crctab[256] = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, - 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, - 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, - 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, - 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, - 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, - 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, - 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, - 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, - 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, - 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, - 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, - 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, - 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, - 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, - 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, - 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, - 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, - 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, - 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, - 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, - 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, - 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, -}; - -unsigned long ccitt_updcrc(icrc, icp, icnt) - unsigned long icrc; - unsigned char *icp; - int icnt; -{ -#define M1 0xff -#define M2 0xff00 - register unsigned long crc = icrc; - register unsigned char *cp = icp; - register int cnt = icnt; - - while(cnt--) { - crc=((crc<<8)&M2)^crctab[((crc>>8)&0xff)^*cp++]; - } - - return(crc); -} - diff --git a/crc/ccitt32.c b/crc/ccitt32.c deleted file mode 100644 index 170fbe2..0000000 --- a/crc/ccitt32.c +++ /dev/null @@ -1,87 +0,0 @@ -unsigned long ccitt32_crcinit = -1; - -static unsigned long crctab[256] = { - 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, - 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, - 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, - 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, - 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, - 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, - 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, - 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, - 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, - 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, - 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, - 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, - 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, - 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, - 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, - 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, - 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, - 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, - 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, - 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, - 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, - 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, - 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, - 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, - 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, - 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, - 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, - 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, - 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, - 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, - 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, - 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, - 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, - 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, - 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, - 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, - 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, - 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, - 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, - 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, - 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, - 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, - 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, - 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, - 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, - 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, - 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, - 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, - 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, - 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, - 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, - 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, - 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, - 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, - 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, - 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, - 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, - 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, - 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, - 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, - 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, - 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, - 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, - 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4, -}; - -unsigned long ccitt32_updcrc(icrc, icp, icnt) - unsigned long icrc; - unsigned char *icp; - int icnt; -{ -#define M1 0xffffff -#define M2 0xffffff00 - register unsigned long crc = icrc; - register unsigned char *cp = icp; - register int cnt = icnt; - - while(cnt--) { - crc=((crc<<8)&M2)^crctab[((crc>>24)&0xff)^*cp++]; - } - - return(crc); -} - diff --git a/crc/kermit.c b/crc/kermit.c deleted file mode 100644 index 088a204..0000000 --- a/crc/kermit.c +++ /dev/null @@ -1,55 +0,0 @@ -unsigned long kermit_crcinit = 0; - -static unsigned short crctab[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78, -}; - -unsigned long kermit_updcrc(icrc, icp, icnt) - unsigned long icrc; - unsigned char *icp; - int icnt; -{ -#define M1 0xff -#define M2 0xff00 - register unsigned long crc = icrc; - register unsigned char *cp = icp; - register int cnt = icnt; - - while(cnt--) { - crc=((crc>>8)&M1)^crctab[(crc&0xff)^*cp++]; - } - - return(crc); -} - diff --git a/crc/libcrc.a b/crc/libcrc.a deleted file mode 100644 index 3188f64..0000000 Binary files a/crc/libcrc.a and /dev/null differ diff --git a/crc/makecrc b/crc/makecrc deleted file mode 100755 index 2600cbf..0000000 Binary files a/crc/makecrc and /dev/null differ diff --git a/crc/makecrc.c b/crc/makecrc.c index 9112096..a1ca573 100644 --- a/crc/makecrc.c +++ b/crc/makecrc.c @@ -31,13 +31,12 @@ /* ZIP used by COMPACTOR */ #include - -extern void exit(); -extern char *strcat(); +#include +#include static void initcrctab(); -main() +int main() { initcrctab("ccitt", 0x1021, 0xffff, 0, 16); initcrctab("kermit", 0x8408, 0, 1, 16); @@ -46,7 +45,6 @@ main() initcrctab("ccitt32",0x04c11db7,0xffffffff,0,32); initcrctab("zip",0xedb88320,0xffffffff,1,32); exit(0); - /*NOTREACHED*/ } static void initcrctab(name, poly, init, swapped, bits) @@ -58,7 +56,7 @@ int poly, init, swapped, bits; unsigned long vv; FILE *fd; char buf[20]; - + buf[0] = 0; (void)strcat(buf, name); (void)strcat(buf, ".c"); diff --git a/crc/makefile b/crc/makefile index 0503869..f67a795 100644 --- a/crc/makefile +++ b/crc/makefile @@ -10,7 +10,7 @@ libcrc.a: $(CRCO) fi clean: - -rm -f $(CRCC) $(CRCO) libcrc.a makecrc makecrc.o + rm -f $(CRCC) $(CRCO) libcrc.a makecrc makecrc.o $(CRCC): makecrc ./makecrc diff --git a/crc/zip.c b/crc/zip.c deleted file mode 100644 index f7b98ef..0000000 --- a/crc/zip.c +++ /dev/null @@ -1,87 +0,0 @@ -unsigned long zip_crcinit = -1; - -static unsigned long crctab[256] = { - 0x00000000, 0x09073096, 0x120e612c, 0x1b0951ba, - 0xff6dc419, 0xf66af48f, 0xed63a535, 0xe46495a3, - 0xfedb8832, 0xf7dcb8a4, 0xecd5e91e, 0xe5d2d988, - 0x01b64c2b, 0x08b17cbd, 0x13b82d07, 0x1abf1d91, - 0xfdb71064, 0xf4b020f2, 0xefb97148, 0xe6be41de, - 0x02dad47d, 0x0bdde4eb, 0x10d4b551, 0x19d385c7, - 0x036c9856, 0x0a6ba8c0, 0x1162f97a, 0x1865c9ec, - 0xfc015c4f, 0xf5066cd9, 0xee0f3d63, 0xe7080df5, - 0xfb6e20c8, 0xf269105e, 0xe96041e4, 0xe0677172, - 0x0403e4d1, 0x0d04d447, 0x160d85fd, 0x1f0ab56b, - 0x05b5a8fa, 0x0cb2986c, 0x17bbc9d6, 0x1ebcf940, - 0xfad86ce3, 0xf3df5c75, 0xe8d60dcf, 0xe1d13d59, - 0x06d930ac, 0x0fde003a, 0x14d75180, 0x1dd06116, - 0xf9b4f4b5, 0xf0b3c423, 0xebba9599, 0xe2bda50f, - 0xf802b89e, 0xf1058808, 0xea0cd9b2, 0xe30be924, - 0x076f7c87, 0x0e684c11, 0x15611dab, 0x1c662d3d, - 0xf6dc4190, 0xffdb7106, 0xe4d220bc, 0xedd5102a, - 0x09b18589, 0x00b6b51f, 0x1bbfe4a5, 0x12b8d433, - 0x0807c9a2, 0x0100f934, 0x1a09a88e, 0x130e9818, - 0xf76a0dbb, 0xfe6d3d2d, 0xe5646c97, 0xec635c01, - 0x0b6b51f4, 0x026c6162, 0x196530d8, 0x1062004e, - 0xf40695ed, 0xfd01a57b, 0xe608f4c1, 0xef0fc457, - 0xf5b0d9c6, 0xfcb7e950, 0xe7beb8ea, 0xeeb9887c, - 0x0add1ddf, 0x03da2d49, 0x18d37cf3, 0x11d44c65, - 0x0db26158, 0x04b551ce, 0x1fbc0074, 0x16bb30e2, - 0xf2dfa541, 0xfbd895d7, 0xe0d1c46d, 0xe9d6f4fb, - 0xf369e96a, 0xfa6ed9fc, 0xe1678846, 0xe860b8d0, - 0x0c042d73, 0x05031de5, 0x1e0a4c5f, 0x170d7cc9, - 0xf005713c, 0xf90241aa, 0xe20b1010, 0xeb0c2086, - 0x0f68b525, 0x066f85b3, 0x1d66d409, 0x1461e49f, - 0x0edef90e, 0x07d9c998, 0x1cd09822, 0x15d7a8b4, - 0xf1b33d17, 0xf8b40d81, 0xe3bd5c3b, 0xeaba6cad, - 0xedb88320, 0xe4bfb3b6, 0xffb6e20c, 0xf6b1d29a, - 0x12d54739, 0x1bd277af, 0x00db2615, 0x09dc1683, - 0x13630b12, 0x1a643b84, 0x016d6a3e, 0x086a5aa8, - 0xec0ecf0b, 0xe509ff9d, 0xfe00ae27, 0xf7079eb1, - 0x100f9344, 0x1908a3d2, 0x0201f268, 0x0b06c2fe, - 0xef62575d, 0xe66567cb, 0xfd6c3671, 0xf46b06e7, - 0xeed41b76, 0xe7d32be0, 0xfcda7a5a, 0xf5dd4acc, - 0x11b9df6f, 0x18beeff9, 0x03b7be43, 0x0ab08ed5, - 0x16d6a3e8, 0x1fd1937e, 0x04d8c2c4, 0x0ddff252, - 0xe9bb67f1, 0xe0bc5767, 0xfbb506dd, 0xf2b2364b, - 0xe80d2bda, 0xe10a1b4c, 0xfa034af6, 0xf3047a60, - 0x1760efc3, 0x1e67df55, 0x056e8eef, 0x0c69be79, - 0xeb61b38c, 0xe266831a, 0xf96fd2a0, 0xf068e236, - 0x140c7795, 0x1d0b4703, 0x060216b9, 0x0f05262f, - 0x15ba3bbe, 0x1cbd0b28, 0x07b45a92, 0x0eb36a04, - 0xead7ffa7, 0xe3d0cf31, 0xf8d99e8b, 0xf1deae1d, - 0x1b64c2b0, 0x1263f226, 0x096aa39c, 0x006d930a, - 0xe40906a9, 0xed0e363f, 0xf6076785, 0xff005713, - 0xe5bf4a82, 0xecb87a14, 0xf7b12bae, 0xfeb61b38, - 0x1ad28e9b, 0x13d5be0d, 0x08dcefb7, 0x01dbdf21, - 0xe6d3d2d4, 0xefd4e242, 0xf4ddb3f8, 0xfdda836e, - 0x19be16cd, 0x10b9265b, 0x0bb077e1, 0x02b74777, - 0x18085ae6, 0x110f6a70, 0x0a063bca, 0x03010b5c, - 0xe7659eff, 0xee62ae69, 0xf56bffd3, 0xfc6ccf45, - 0xe00ae278, 0xe90dd2ee, 0xf2048354, 0xfb03b3c2, - 0x1f672661, 0x166016f7, 0x0d69474d, 0x046e77db, - 0x1ed16a4a, 0x17d65adc, 0x0cdf0b66, 0x05d83bf0, - 0xe1bcae53, 0xe8bb9ec5, 0xf3b2cf7f, 0xfab5ffe9, - 0x1dbdf21c, 0x14bac28a, 0x0fb39330, 0x06b4a3a6, - 0xe2d03605, 0xebd70693, 0xf0de5729, 0xf9d967bf, - 0xe3667a2e, 0xea614ab8, 0xf1681b02, 0xf86f2b94, - 0x1c0bbe37, 0x150c8ea1, 0x0e05df1b, 0x0702ef8d, -}; - -unsigned long zip_updcrc(icrc, icp, icnt) - unsigned long icrc; - unsigned char *icp; - int icnt; -{ -#define M1 0xffffff -#define M2 0xffffff00 - register unsigned long crc = icrc; - register unsigned char *cp = icp; - register int cnt = icnt; - - while(cnt--) { - crc=((crc>>8)&M1)^crctab[(crc&0xff)^*cp++]; - } - - return(crc); -} - diff --git a/fileio/all b/fileio/all deleted file mode 100644 index e69de29..0000000 diff --git a/fileio/makefile b/fileio/makefile index b46a7a3..3b12545 100644 --- a/fileio/makefile +++ b/fileio/makefile @@ -8,10 +8,10 @@ wrfile.o: wrfile.c rdfile.o: rdfile.c clean: - -rm -f wrfile.o - -rm -f rdfile.o - -rm -f fileglob.o - -rm -f all + rm -f wrfile.o + rm -f rdfile.o + rm -f fileglob.o + rm -f all wrfile.o: machdr.h wrfile.o: wrfile.h diff --git a/fileio/rdfile.c b/fileio/rdfile.c index f24e1cb..9567670 100644 --- a/fileio/rdfile.c +++ b/fileio/rdfile.c @@ -1,4 +1,7 @@ #include +#include +#include +#include #ifdef TYPES_H #include #endif /* TYPES_H */ @@ -13,6 +16,7 @@ #include #define dirstruct dirent #endif /* DIRENT_H */ +#include "../util/backtrans.h" #include "../util/curtime.h" #include "../util/masks.h" #include "../util/util.h" @@ -42,13 +46,6 @@ #define RSRC_FORMAT 2 #define UNIX_FORMAT 3 -extern char *malloc(); -extern char *realloc(); -extern char *strcpy(); -extern char *strncpy(); -extern char *strcat(); -extern void exit(); - static void check_files(); static void read_file(); static void enter_dir(); diff --git a/fileio/rdfile.h b/fileio/rdfile.h index 05e65a4..b7cf4a6 100644 --- a/fileio/rdfile.h +++ b/fileio/rdfile.h @@ -10,4 +10,3 @@ extern int data_size, rsrc_size; extern void setup(); extern int nextfile(); extern char *get_minb(); - diff --git a/fileio/wrfile.c b/fileio/wrfile.c index 59a2c65..e7ded17 100644 --- a/fileio/wrfile.c +++ b/fileio/wrfile.c @@ -2,8 +2,11 @@ #include #endif /* TYPES_H */ #include +#include +#include #include #include +#include #include "machdr.h" #include "wrfile.h" #include "wrfileopt.h" @@ -35,13 +38,6 @@ #define MACI 9 #endif /* SCAN */ -extern char *malloc(); -extern char *realloc(); -extern char *strcpy(); -extern char *strncpy(); -extern char *strcat(); -extern void exit(); - #ifdef UNDEF /* Do not declare sprintf; not portable (but lint will complain) */ char *sprintf(); #endif /* UNDEF */ @@ -802,12 +798,12 @@ void give_wrfileopt() #endif /* APPLESHARE */ } -void set_wrfileopt(restricted) +void set_wrfileopt(int restricted) { mode_restricted = restricted; } -void set_s_wrfileopt(restricted) +void set_s_wrfileopt(int restricted) { mode_s_restricted = restricted; } diff --git a/hexbin/buffer.c b/hexbin/buffer.c index 501b4e8..9b7459a 100644 --- a/hexbin/buffer.c +++ b/hexbin/buffer.c @@ -1,12 +1,9 @@ +#include #include "globals.h" #include "../util/util.h" #include "buffer.h" #include "../fileio/wrfile.h" -extern char *malloc(); -extern char *realloc(); -extern void exit(); - char *data_fork, *rsrc_fork; int data_size, rsrc_size; static int max_data_size, max_rsrc_size; diff --git a/hexbin/globals.h b/hexbin/globals.h index d22e9d5..5f757de 100644 --- a/hexbin/globals.h +++ b/hexbin/globals.h @@ -22,7 +22,7 @@ typedef struct macheader { long m_rsrclen; long m_createtime; long m_modifytime; -}; +} macheader; extern struct macheader mh; diff --git a/hexbin/hexbin.c b/hexbin/hexbin.c index a730858..51a1eaf 100644 --- a/hexbin/hexbin.c +++ b/hexbin/hexbin.c @@ -2,6 +2,9 @@ #include #endif /* TYPES_H */ #include +#include +#include +#include #include "globals.h" #include "crc.h" #include "readline.h" @@ -17,7 +20,6 @@ #define LOCALOPT "ilvcn:qVH" -extern void exit(); extern void backtrans(); #ifdef DL extern void dl(); diff --git a/hexbin/hqx.c b/hexbin/hqx.c index e998626..9e3b7ee 100644 --- a/hexbin/hqx.c +++ b/hexbin/hqx.c @@ -1,5 +1,6 @@ #include "hexbin.h" #ifdef HQX +#include #include "globals.h" #include "readline.h" #include "crc.h" @@ -9,14 +10,12 @@ #include "../util/util.h" #include "printhdr.h" -extern void exit(); - static void get_header(); static void oflush(); static int getq(); static long get2q(); static long get4q(); -static getqbuf(); +static void getqbuf(); static char *g_macname; @@ -380,15 +379,12 @@ static long get4q() } /* getqbuf(); q format -- read n characters from input into buf */ -static getqbuf(buf, n) - char *buf; - int n; +static void getqbuf(char *buf, int n) { - int i; - - for(i = 0; i < n; i++) { - *buf++ = getq(); - } + int i; + for (i = 0; i < n; i++) { + *buf++ = getq(); + } } #else /* HQX */ int hqx; /* keep lint and some compilers happy */ diff --git a/hexbin/makefile b/hexbin/makefile index 898df05..4e319bb 100644 --- a/hexbin/makefile +++ b/hexbin/makefile @@ -57,10 +57,10 @@ lint: lint $(CF) $(LFLAGS) $(SRCS) $(XSRCS) $(CRCS) clean: - -rm -f *.o + rm -f *.o clobber:clean - -rm -f hexbin + rm -f hexbin hexbin.o: globals.h hexbin.o: crc.h diff --git a/hexbin/printhdr.c b/hexbin/printhdr.c index aa3f22f..0141b79 100644 --- a/hexbin/printhdr.c +++ b/hexbin/printhdr.c @@ -2,45 +2,42 @@ #include "globals.h" /* print out header information in human-readable format */ -void print_header0(skip) -int skip; +void print_header0(int skip) { - if(listmode) { - (void)fprintf(stderr, "name=\"%s\", ", trname); - if(skip) { - (void)fprintf(stderr, "\n"); - } + if (listmode) { + (void)fprintf(stderr, "name=\"%s\", ", trname); + if (skip) { + (void)fprintf(stderr, "\n"); + } } } /* print out header information in human-readable format */ -void print_header1(skip1, skip2) -int skip1, skip2; +void print_header1(int skip1, int skip2) { - char ftype[5], fauth[5]; + char ftype[5], fauth[5]; - transname(mh.m_type, ftype, 4); - transname(mh.m_author, fauth, 4); - if(listmode) { - if(skip1) { - (void)fprintf(stderr, "\t"); - } - (void)fprintf(stderr, "type=%4.4s, author=%4.4s, ", ftype, fauth); - if(skip2) { - (void)fprintf(stderr, "\n"); - } + transname(mh.m_type, ftype, 4); + transname(mh.m_author, fauth, 4); + if (listmode) { + if (skip1) { + (void)fprintf(stderr, "\t"); + } + (void)fprintf(stderr, "type=%4.4s, author=%4.4s, ", ftype, fauth); + if (skip2) { + (void)fprintf(stderr, "\n"); + } } } /* print out header information in human-readable format */ -void print_header2(skip) +void print_header2(int skip) { - if(listmode) { - if(skip) { - (void)fprintf(stderr, "\t"); - } - (void)fprintf(stderr, "data=%ld, rsrc=%ld\n", - mh.m_datalen, mh.m_rsrclen); + if (listmode) { + if (skip) { + (void)fprintf(stderr, "\t"); + } + (void)fprintf(stderr, "data=%ld, rsrc=%ld\n", + mh.m_datalen, mh.m_rsrclen); } } - diff --git a/hexbin/readline.c b/hexbin/readline.c index 9ebe6f1..a4f82bd 100644 --- a/hexbin/readline.c +++ b/hexbin/readline.c @@ -37,4 +37,3 @@ int readline() } return 1; } - diff --git a/hexbin/readline.h b/hexbin/readline.h index af379fa..bebe741 100644 --- a/hexbin/readline.h +++ b/hexbin/readline.h @@ -1,2 +1,3 @@ extern char line[]; +int readline(); diff --git a/macunpack/bin.o b/macunpack/bin.o deleted file mode 100644 index bb7246a..0000000 Binary files a/macunpack/bin.o and /dev/null differ diff --git a/macunpack/de_huffman.c b/macunpack/de_huffman.c index 860d2fc..3242921 100644 --- a/macunpack/de_huffman.c +++ b/macunpack/de_huffman.c @@ -33,8 +33,7 @@ static node *nodeptr, *read_sub_tree(); static int bit; -void de_huffman(obytes) -unsigned long obytes; +void de_huffman(unsigned long obytes) { while(obytes != 0) { *out_ptr++ = gethuffbyte(nodelist); @@ -43,8 +42,7 @@ unsigned long obytes; return; } -void de_huffman_end(term) -unsigned int term; +void de_huffman_end(unsigned int term) { int c; @@ -53,8 +51,7 @@ unsigned int term; } } -void set_huffman(endian) -int endian; +void set_huffman(int endian) { if(endian == HUFF_LE) { get_bit = getbit_le; @@ -121,8 +118,7 @@ void clrhuff() bit = 0; } -int gethuffbyte(l_nodelist) -node *l_nodelist; +int gethuffbyte(node *l_nodelist) { register node *np; diff --git a/macunpack/globals.o b/macunpack/globals.o deleted file mode 100644 index ca68861..0000000 Binary files a/macunpack/globals.o and /dev/null differ diff --git a/macunpack/huffman.h b/macunpack/huffman.h index 7a678f6..30bafe8 100644 --- a/macunpack/huffman.h +++ b/macunpack/huffman.h @@ -8,7 +8,8 @@ typedef struct node { extern int (*get_bit)(); extern void clrhuff(); +int gethuffbyte(node *l_nodelist); +int getihuffbyte(); extern struct node nodelist[]; extern int bytesread; - diff --git a/macunpack/jdw.o b/macunpack/jdw.o deleted file mode 100644 index 4d04e71..0000000 Binary files a/macunpack/jdw.o and /dev/null differ diff --git a/macunpack/lzc.o b/macunpack/lzc.o deleted file mode 100644 index 10f3aae..0000000 Binary files a/macunpack/lzc.o and /dev/null differ diff --git a/macunpack/macbinary.o b/macunpack/macbinary.o deleted file mode 100644 index 96680a4..0000000 Binary files a/macunpack/macbinary.o and /dev/null differ diff --git a/macunpack/mcb.o b/macunpack/mcb.o deleted file mode 100644 index 24ec931..0000000 Binary files a/macunpack/mcb.o and /dev/null differ diff --git a/macunpack/pit.o b/macunpack/pit.o deleted file mode 100644 index 032b63d..0000000 Binary files a/macunpack/pit.o and /dev/null differ diff --git a/macunpack/sit.o b/macunpack/sit.o deleted file mode 100644 index eba74cb..0000000 Binary files a/macunpack/sit.o and /dev/null differ diff --git a/macunpack/stf.o b/macunpack/stf.o deleted file mode 100644 index 2f3ffc0..0000000 Binary files a/macunpack/stf.o and /dev/null differ diff --git a/mixed/dir.c b/mixed/dir.c index 494b395..276fb34 100644 --- a/mixed/dir.c +++ b/mixed/dir.c @@ -1,20 +1,17 @@ +#include #include "globals.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/util.h" #include "../util/masks.h" -extern char *malloc(); -extern char *realloc(); - static char *dir_stack; static int dir_ptr = -64; static int dir_max; -void dir(hdr) -char *hdr; +void dir(char *hdr) { -int doit; + int doit; if((hdr[I_NAMEOFF] & BYTEMASK) == 0x80) { if(dir_skip) { diff --git a/mixed/macsave.c b/mixed/macsave.c index 5fa797a..b9d9dca 100644 --- a/mixed/macsave.c +++ b/mixed/macsave.c @@ -1,3 +1,5 @@ +#include +#include #include "globals.h" #include "../util/patchlevel.h" #include "../fileio/wrfile.h" @@ -6,16 +8,13 @@ #define LOCALOPT "ilqVH" -extern char *strcat(); void macbinary(); static void usage(); static char options[128]; -int main(argc, argv) -int argc; -char *argv[]; +int main(int argc, char **argv) { int c; extern int optind; diff --git a/mixed/macstream.c b/mixed/macstream.c index a9b61aa..c3ba4e6 100644 --- a/mixed/macstream.c +++ b/mixed/macstream.c @@ -1,13 +1,13 @@ +#include #include +#include +#include #include "../fileio/machdr.h" #include "../fileio/rdfile.h" #include "../fileio/rdfileopt.h" #include "../util/patchlevel.h" +#include "../util/util.h" -extern char *malloc(); -extern char *realloc(); -extern char *strcat(); -extern void exit(); extern void transname(); extern void do_indent(); @@ -20,9 +20,7 @@ static char *dir_stack; static int dir_ptr = -64; static int dir_max; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int c, i, j, n; extern int optind; diff --git a/mixed/makefile b/mixed/makefile index 5a887bb..f228c04 100644 --- a/mixed/makefile +++ b/mixed/makefile @@ -59,10 +59,10 @@ lint: lint $(CF) $(LFLAGS) $(SRCS2) $(XSRCS2) clean: - -rm -f *.o + rm -f *.o clobber:clean - -rm -f all macsave macstream + rm -f all macsave macstream macsave.o: globals.h macsave.o: ../util/patchlevel.h @@ -89,4 +89,3 @@ macstream.o: ../fileio/machdr.h macstream.o: ../fileio/rdfile.h macstream.o: ../fileio/rdfileopt.h macstream.o: ../util/patchlevel.h - diff --git a/util/all b/util/all deleted file mode 100644 index e69de29..0000000 diff --git a/util/backtrans.c b/util/backtrans.c index fb6dd5d..3539dd7 100644 --- a/util/backtrans.c +++ b/util/backtrans.c @@ -54,8 +54,7 @@ static char char_mapping[] = { 0277, 0235, 0234, 0236, 0237, '_', '_', 0330}; #endif /* LATIN1 */ -void backtrans(macname, name) -char *macname, *name; +void backtrans(char *macname, char *name) { char *in, *out; int c, count = 0; diff --git a/util/backtrans.h b/util/backtrans.h new file mode 100644 index 0000000..cd5435a --- /dev/null +++ b/util/backtrans.h @@ -0,0 +1 @@ +void backtrans(char *macname, char *name); diff --git a/util/transname.c b/util/transname.c index 70f4591..ef724b8 100644 --- a/util/transname.c +++ b/util/transname.c @@ -83,9 +83,7 @@ static char char_mapping[] = { '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_'}; -void transname(name, namebuf, n) -char *name, *namebuf; -int n; +void transname(char *name, char *namebuf, int n) { char *np; diff --git a/util/transname.h b/util/transname.h new file mode 100644 index 0000000..847a250 --- /dev/null +++ b/util/transname.h @@ -0,0 +1 @@ +void transname(char *name, char *namebuf, int n); diff --git a/util/util.c b/util/util.c index 29ff425..0dcc536 100644 --- a/util/util.c +++ b/util/util.c @@ -1,4 +1,5 @@ #include +#include #include "../fileio/fileglob.h" #include "masks.h" #include "util.h" @@ -9,8 +10,7 @@ extern void exit(); static int mlength[] = {0, 31, 61, 92, 122, 153, 184, 214, 245, 275, 306, 337}; -unsigned long get4(bp) -char *bp; +unsigned long get4(char *bp) { register int i; long value = 0; @@ -24,14 +24,13 @@ char *bp; } /* For if integers are stored wrong-endian. */ -unsigned long get4i(bp) -char *bp; +unsigned long get4i(char *bp) { register int i; long value = 0; bp += 3; - for(i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { value <<= 8; value |= (*bp & BYTEMASK); bp--; @@ -39,8 +38,7 @@ char *bp; return value; } -unsigned long get2(bp) -char *bp; +unsigned long get2(char *bp) { register int i; int value = 0; @@ -54,8 +52,7 @@ char *bp; } /* For if integers are stored wrong-endian. */ -unsigned long get2i(bp) -char *bp; +unsigned long get2i(char *bp) { register int i; long value = 0;