--- pgp/src/zipup.c 2018/04/24 16:41:10 1.1.1.4 +++ pgp/src/zipup.c 2018/04/24 16:45:39 1.1.1.7 @@ -16,11 +16,12 @@ #include #include "zip.h" #include "zrevisio.h" +#include "system.h" /* Use the raw functions for MSDOS and Unix to save on buffer space. They're not used for VMS since it doesn't work (raw is weird on VMS). (This sort of stuff belongs in fileio.c, but oh well.) */ -#ifdef VMS +#if defined(VMS) || defined(C370) typedef FILE *ftype; # define fhow FOPR # define fbad NULL @@ -31,14 +32,16 @@ # define zrew(f) rewind(f) # define zstdin stdin #else /* !VMS */ -# ifdef MSDOS +# if defined(MSDOS) || defined(WIN32) # include # include # define fhow (O_RDONLY|O_BINARY) -# else /* !MSDOS */ -#ifndef AMIGA - long lseek(); -#endif /* AMIGA */ +# elif defined(MACTC5) /* Macintosh */ +# define fhow 0 +# else /* !MSDOS && !Macintosh */ +# ifndef HAVE_UNISTD_H + size_t lseek(int handle, size_t offset, int whence); +# endif /* !HAVE_UNISTD_H */ # define fhow 0 # endif /* ?MSDOS */ typedef int ftype; @@ -58,18 +61,19 @@ local ftype ifile; /* file to compress void lm_free(); void ct_free(); -int zipup(FILE *inFile, FILE *y) /* Compress the file fileName and write it to the file *y. Return an error - code in the ZE_ class. Also, update tempzn by the number of bytes written. */ + code in the ZE_ class. Also, update tempzn by the number of bytes written. +*/ +int zipup(FILE *inFile, FILE *y) /* ??? Does not yet handle non-seekable y */ { int m; /* method for this entry */ long q = -1L; /* size returned by filetime */ - ush att; /* internal file attributes (dummy only) */ + ush att; /* internal file attributes (dummy only) */ ush flg; /* gp compresion flags (dummy only) */ /* Set input file and find its size */ -#ifdef VMS +#if defined(VMS) || defined(C370) ifile = inFile; fseek(ifile, 0L, SEEK_END); q = ftell(ifile);