--- pgp/src/zunzip.h 2018/04/24 16:37:53 1.1 +++ pgp/src/zunzip.h 2018/04/24 16:45:30 1.1.1.8 @@ -15,6 +15,9 @@ /* OS-Dependent Includes */ /***************************/ +#include +#include "usuals.h" +#include "system.h" #ifndef MINIX /* Minix needs it after all the other includes (?) */ # include /* this is your standard header for all C compiles */ @@ -46,7 +49,6 @@ # define NO_MKDIR /* for mapped_name() */ # endif /* !AMIGA && !MINIX */ # include - struct tm *gmtime(), *localtime(); # else /* BSD */ # include # include @@ -60,7 +62,7 @@ And now, our MS-DOS and OS/2 corner: ---------------------------------------------------------------------------*/ -#ifdef __TURBOC__ +#if defined(__TURBOC__) && !defined(__PUREC__) # define DOS_OS2 /* Turbo C under DOS, MSC under DOS or OS2 */ # ifndef __BORLANDC__ /* There appears to be a bug ?? in Borland's */ # include @@ -119,7 +121,11 @@ # define SHORT_NAMES # define tzset settz # else /* !COHERENT */ -# include /* #define O_BINARY 0x8000 (no CR/LF */ +# ifndef __PUREC__ +# ifndef C370 /* not defined in C370 library */ +# include /* #define O_BINARY 0x8000 (no CR/LF */ +# endif /* !C370 */ +# endif # endif /* ?COHERENT */ /* translation), as used in open() */ # endif /* ?MTS */ # endif /* ?V7 */ @@ -129,14 +135,13 @@ And some Mac stuff for good measure: ---------------------------------------------------------------------------*/ -#ifdef THINK_C +#ifdef MACTC5 # define MACOS # ifndef __STDC__ /* THINK_C isn't truly ANSI-standard, */ # define __STDC__ 1 /* but it understands prototypes...so */ # endif /* it's close enough for our purposes */ # include # include -# include "macstat.h" #endif #ifdef MPW /* not tested yet - should be easy enough tho */ # define MACOS @@ -167,8 +172,13 @@ #define MAX_BITS 13 /* used in unShrink() */ #define HSIZE (1 << MAX_BITS) /* size of global work area */ +#ifdef EBCDIC /* already defined in usuals.h */ +#undef LF +#undef CR +#else #define LF 10 /* '\n' on ASCII machines. Must be 10 due to EBCDIC */ #define CR 13 /* '\r' on ASCII machines. Must be 13 due to EBCDIC */ +#endif #ifdef AMIGA # define FFLUSH fflush(stderr); @@ -191,19 +201,24 @@ /* Typedefs */ /**************/ -#ifndef _BULL_SOURCE /* Bull has it defined somewhere already */ - typedef unsigned char byte; /* code assumes UNSIGNED bytes */ -#endif /* !_BULL_SOURCE */ - typedef long longint; typedef unsigned short UWORD; +#ifndef OS2 typedef unsigned long ULONG; -typedef char boolean; +#endif /*************************/ /* Function Prototypes */ /*************************/ +#ifdef PROTO + +/* The following is for non-ansi compilers supporting prototypes */ +/* (e.g. old SGI compilers and Borland C in non-ansi mode */ + +#define __(X) X /* Inc. Should probably give them a call and see */ +#endif + #ifndef __ /* This amusing little construct was swiped without */ # if __STDC__ /* permission from the fine folks at Cray Research, */ # define __(X) X /* Inc. Should probably give them a call and see */ @@ -224,8 +239,12 @@ typedef char boolean; int open_input_file __( (void) ); int readbuf __( (char *buf, register unsigned size) ); int create_output_file __( (void) ); +#if 0 int FillBitBuffer __( (void) ); int ReadByte __( (UWORD *x) ); +#else +int FillInBuf __( (void) ); +#endif int FlushOutput __( (void) ); /*--------------------------------------------------------------------------- @@ -234,8 +253,8 @@ int FlushOutput __( (vo ble to external functions): ---------------------------------------------------------------------------*/ -void inflate __( (void) ); /* inflate.c */ -int unzip __( ( FILE *inFile, FILE *outFile ) ); +int inflate __( (void) ); /* inflate.c */ +int unzip __( ( FILE *inFile, FILE *outFile ) ); /************/ /* Macros */ @@ -258,8 +277,17 @@ int unzip __( ( FILE *inFile, FILE *o */ -#define READBIT(nbits,zdest) {if(nbits>bits_left) FillBitBuffer();\ - zdest=(int)(bitbuf&mask_bits[nbits]); bitbuf>>=nbits; bits_left-=nbits;} +#if 0 + +#define READBIT(nbits,zdest) \ + do \ + { \ + if(nbits>bits_left) \ + FillBitBuffer(); \ + zdest=(int)(bitbuf&mask_bits[nbits]); \ + bitbuf>>=nbits; \ + bits_left-=nbits; \ + } while(0) /* * macro READBIT(nbits,zdest) @@ -273,14 +301,18 @@ int unzip __( ( FILE *inFile, FILE *o * */ -#define PEEKBIT(nbits) ( nbits > bits_left ? (FillBitBuffer(), bitbuf & mask_bits[nbits]) : bitbuf & mask_bits[nbits] ) +#define PEEKBIT(nbits) ( nbits > bits_left ? \ +(FillBitBuffer(), bitbuf & mask_bits[nbits]) : bitbuf & mask_bits[nbits] ) + +#endif /*************/ /* Globals */ /*************/ +#if 0 /* FIX */ extern longint csize; - extern longint ucsize; +#endif extern ULONG mask_bits[];