Category : C Source Code
Archive   : PGP20SRC.ZIP
Filename : ZIP.H

 
Output of file : ZIP.H contained in archive : PGP20SRC.ZIP
/*

Copyright (C) 1990,1991 Mark Adler, Richard B. Wales, and Jean-loup Gailly.
Permission is granted to any individual or institution to use, copy, or
redistribute this software so long as all of the original files are included
unmodified, that it is not sold for profit, and that this copyright notice
is retained.

*/

/*
* zip.h by Mark Adler.
*/


/* Set up portability */
#include "ztailor.h"

#define MIN_MATCH 3
#define MAX_MATCH 258
/* The minimum and maximum match lengths */

#ifndef WSIZE
# define WSIZE 8192 /* for PGP only use 8192 */
#endif
/* Maximum window size = 32K. If you are really short of memory, compile
* with a smaller WSIZE but this reduces the compression ratio for files
* of size > WSIZE.
*/

#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
/* Minimum amount of lookahead, except at the end of the input file.
* See deflate.c for comments about the MIN_MATCH+1.
*/

#define MAX_DIST (WSIZE-MIN_LOOKAHEAD)
/* In order to simplify the code, particularly on 16 bit machines, match
* distances are limited to MAX_DIST instead of WSIZE.
*/

/* Define malloc() and string functions */
#ifdef MODERN
# include
#else /* !MODERN */
voidp *malloc();
voidp *calloc();
char *getenv();
long atol();
char *strcpy();
char *strcat();
char *strchr();
char *strrchr();
# ifndef ZMEM
char *memset();
char *memcpy();
# endif /* !ZMEM */
#endif /* ?MODERN */

/* Define fseek() commands */
#ifndef SEEK_SET
# define SEEK_SET 0
#endif /* !SEEK_SET */

#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif /* !SEEK_CUR */

#ifndef SEEK_END
# define SEEK_END 2
#endif /* !SEEK_END */

/* For setting stdout to binary */
#ifdef MSDOS
# include
# include
#endif /* MSDOS */

/* Types centralized here for easy modification */
#define local static /* More meaningful outside functions */
typedef unsigned char uch; /* unsigned 8-bit value */
typedef unsigned short ush; /* unsigned 16-bit value */
typedef unsigned long ulg; /* unsigned 32-bit value */


/* Error return codes and PERR macro */
#include "ziperr.h"

/* Internal attributes */
#define UNKNOWN -1
#define BINARY 0
#define ASCII 1

/* Public globals */
#define BEST -1 /* Use best method (deflation or store) */
#define STORE 0 /* Store method */
#define DEFLATE 8 /* Deflation method*/
extern int method; /* Restriction on compression method */
extern int level; /* Compression level */

/* Diagnostic functions */
#ifdef DEBUG
# ifdef MSDOS
# undef stderr
# define stderr stdout
# endif
# define diag(where) fprintf(stderr, "zip diagnostic: %s\n", where)
# define Assert(cond,msg) {if(!(cond)) error(msg);}
# define Trace(x) fprintf x
# define Tracev(x) {if (verbose) fprintf x ;}
# define Tracevv(x) {if (verbose>1) fprintf x ;}
# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
#else
# define diag(where)
# define Assert(cond,msg)
# define Trace(x)
# define Tracev(x)
# define Tracevv(x)
# define Tracec(c,x)
# define Tracecv(c,x)
#endif


/* Public function prototypes */

/* in zip.c, zipcloak.c, or zipsplit.c */
void err OF((int c, char *h));
void error OF((char *h));

/* in zipup.c */
int zipup OF((FILE *inFile, FILE *outFile));
int read_buf OF((char far *buf, unsigned size));

# define zfwrite fwrite /* ??? far */
# define zputc putc

/* in deflate.c */
void lm_init OF((int pack_level, ush *flags));
ulg deflate OF((void));

/* in trees.c */
void ct_init OF((ush *attr, int *method));
int ct_tally OF((int dist, int lc));
ulg flush_block OF((char *buf, ulg stored_len, int eof));

/* in bits.c */
void bi_init OF((FILE *zipfile));
void send_bits OF((int value, int length));
unsigned bi_reverse OF((unsigned value, int length));
void bi_windup OF((void));
void copy_block OF((char far *buf, unsigned len, int header));


/* end of zip.h */


  3 Responses to “Category : C Source Code
Archive   : PGP20SRC.ZIP
Filename : ZIP.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/