mirror of https://github.com/madler/zlib.git
parent
b1c19ca6d8
commit
d6231142d2
23 changed files with 344 additions and 722 deletions
@ -1,201 +0,0 @@ |
||||
# Makefile for zlib |
||||
# Copyright (C) 1995-2006 Jean-loup Gailly. |
||||
# For conditions of distribution and use, see copyright notice in zlib.h |
||||
|
||||
# To compile and test, type: |
||||
# ./configure; make test |
||||
# The call of configure is optional if you don't have special requirements |
||||
# If you wish to build zlib as a shared library, use: ./configure -s |
||||
|
||||
# To use the asm code, type: |
||||
# cp contrib/asm?86/match.S ./match.S |
||||
# make LOC=-DASMV OBJA=match.o |
||||
|
||||
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: |
||||
# make install |
||||
# To install in $HOME instead of /usr/local, use: |
||||
# make install prefix=$HOME |
||||
|
||||
CC=cc |
||||
|
||||
CFLAGS=-O |
||||
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 |
||||
#CFLAGS=-g -DDEBUG |
||||
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ |
||||
# -Wstrict-prototypes -Wmissing-prototypes |
||||
|
||||
SFLAGS=$(CFLAGS) |
||||
#SFLAGS=$(CFLAGS) -fPIC |
||||
|
||||
LD=$(CC) |
||||
LDFLAGS=libz.a |
||||
LDSHARED=$(CC) |
||||
CPP=$(CC) -E |
||||
|
||||
STATICLIB=libz.a |
||||
SHAREDLIB=libz.so |
||||
SHAREDLIBV=libz.so.1.2.3 |
||||
SHAREDLIBM=libz.so.1 |
||||
EXE= |
||||
|
||||
LIBS=$(STATICLIB) $(SHAREDLIBV) |
||||
|
||||
AR=ar rc |
||||
RANLIB=ranlib |
||||
TAR=tar |
||||
SHELL=/bin/sh |
||||
|
||||
prefix=/usr/local |
||||
exec_prefix=${prefix} |
||||
libdir=${exec_prefix}/lib |
||||
includedir=${prefix}/include |
||||
mandir=${prefix}/share/man |
||||
man3dir=${mandir}/man3 |
||||
pkgconfigdir = ${libdir}/pkgconfig |
||||
|
||||
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ |
||||
zutil.o inflate.o infback.o inftrees.o inffast.o |
||||
|
||||
OBJA = |
||||
#OBJA = match.o |
||||
# to use the asm code: make OBJA=match.o |
||||
|
||||
TEST_OBJS = example.o minigzip.o |
||||
|
||||
OBJS_PIC = $(OBJS:.o=.pic.o) |
||||
OBJA_PIC = $(OBJA:.o=.pic.o) |
||||
|
||||
.SUFFIXES: .c .o .pic.o |
||||
|
||||
.c.o: |
||||
$(CC) -c $(CFLAGS) -o $@ $*.c |
||||
|
||||
.c.pic.o: |
||||
$(CC) -c $(SFLAGS) -o $@ $*.c |
||||
|
||||
all: $(STATICLIB) example$(EXE) minigzip$(EXE) |
||||
#all: $(STATICLIB) $(SHAREDLIBV) example$(EXE) minigzip$(EXE) |
||||
|
||||
check: test |
||||
test: all |
||||
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ |
||||
echo hello world | ./minigzip | ./minigzip -d || \ |
||||
echo ' *** minigzip test FAILED ***' ; \ |
||||
if ./example; then \ |
||||
echo ' *** zlib test OK ***'; \ |
||||
else \ |
||||
echo ' *** zlib test FAILED ***'; \ |
||||
fi |
||||
|
||||
match.o: match.S |
||||
$(CPP) match.S > _match.s |
||||
$(CC) -c _match.s |
||||
mv _match.o match.o |
||||
rm -f _match.s |
||||
|
||||
match.pic.o: match.S |
||||
$(CPP) match.S > _match.s |
||||
$(CC) -c -fPIC _match.s |
||||
mv _match.o match.pic.o |
||||
rm -f _match.s |
||||
|
||||
$(STATICLIB): $(OBJS) $(OBJA) |
||||
$(AR) $@ $(OBJS) $(OBJA) |
||||
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1 |
||||
|
||||
$(SHAREDLIBV): $(OBJS_PIC) $(OBJA_PIC) |
||||
$(LDSHARED) -o $@ $(OBJS_PIC) $(OBJA_PIC) |
||||
rm -f $(SHAREDLIB) $(SHAREDLIBM) |
||||
ln -s $@ $(SHAREDLIB) |
||||
ln -s $@ $(SHAREDLIBM) |
||||
|
||||
example$(EXE): example.o $(STATICLIB) |
||||
$(LD) -o $@ example.o $(LDFLAGS) |
||||
|
||||
minigzip$(EXE): minigzip.o $(STATICLIB) |
||||
$(LD) -o $@ minigzip.o $(LDFLAGS) |
||||
|
||||
install: $(LIBS) |
||||
mkdir -p $(DESTDIR)$(exec_prefix) |
||||
mkdir -p $(DESTDIR)$(includedir) |
||||
mkdir -p $(DESTDIR)$(libdir) |
||||
mkdir -p $(DESTDIR)$(man3dir) |
||||
mkdir -p $(DESTDIR)$(pkgconfigdir) |
||||
cp zlib.h zconf.h $(DESTDIR)$(includedir) |
||||
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h |
||||
cp $(LIBS) $(DESTDIR)$(libdir) |
||||
cd $(DESTDIR)$(libdir); chmod 755 $(LIBS) |
||||
-@(cd $(DESTDIR)$(libdir); $(RANLIB) $(STATICLIB) || true) >/dev/null 2>&1 |
||||
cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \ |
||||
rm -f $(SHAREDLIB) $(SHAREDLIBM); \ |
||||
ln -s $(SHAREDLIBV) $(SHAREDLIB); \ |
||||
ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ |
||||
(ldconfig || true) >/dev/null 2>&1; \ |
||||
fi |
||||
cp zlib.3 $(DESTDIR)$(man3dir) |
||||
chmod 644 $(DESTDIR)$(man3dir)/zlib.3 |
||||
cp zlib.pc $(DESTDIR)$(pkgconfigdir) |
||||
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc |
||||
# The ranlib in install is needed on NeXTSTEP which checks file times |
||||
# ldconfig is for Linux |
||||
|
||||
uninstall: |
||||
cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h |
||||
cd $(DESTDIR)$(libdir); rm -f $(STATICLIB); \ |
||||
if test -f $(SHAREDLIBV); then \ |
||||
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ |
||||
fi |
||||
cd $(DESTDIR)$(man3dir); rm -f zlib.3 |
||||
cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc |
||||
|
||||
mostlyclean: clean |
||||
clean: |
||||
rm -f *.o *~ example$(EXE) minigzip$(EXE) \ |
||||
libz.* foo.gz so_locations \ |
||||
_match.s maketree contrib/infback9/*.o |
||||
|
||||
maintainer-clean: distclean |
||||
distclean: clean |
||||
cp -p Makefile.in Makefile |
||||
cp -p zconf.in.h zconf.h |
||||
rm -f zlib.pc .DS_Store |
||||
|
||||
tags: |
||||
etags *.[ch] |
||||
|
||||
depend: |
||||
makedepend -- $(CFLAGS) -- *.[ch] |
||||
|
||||
# "fake" targets: not real filenames and no deps (else "touch clean" defeats) |
||||
.PHONY: install uninstall clean tags depend |
||||
|
||||
# DO NOT DELETE THIS LINE -- "make depend" depends on it. |
||||
|
||||
adler32.o: zlib.h zconf.h |
||||
adler32.pic.o: zlib.h zconf.h |
||||
compress.o: zlib.h zconf.h |
||||
compress.pic.o: zlib.h zconf.h |
||||
crc32.o: crc32.h zlib.h zconf.h |
||||
crc32.pic.o: crc32.h zlib.h zconf.h |
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h |
||||
deflate.pic.o: deflate.h zutil.h zlib.h zconf.h |
||||
example.o: zlib.h zconf.h |
||||
example.pic.o: zlib.h zconf.h |
||||
gzio.o: zutil.h zlib.h zconf.h |
||||
gzio.pic.o: zutil.h zlib.h zconf.h |
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
inffast.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
inflate.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
infback.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h |
||||
inftrees.pic.o: zutil.h zlib.h zconf.h inftrees.h |
||||
minigzip.o: zlib.h zconf.h |
||||
minigzip.pic.o: zlib.h zconf.h |
||||
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h |
||||
trees.pic.o: deflate.h zutil.h zlib.h zconf.h trees.h |
||||
uncompr.o: zlib.h zconf.h |
||||
uncompr.pic.o: zlib.h zconf.h |
||||
zutil.o: zutil.h zlib.h zconf.h |
||||
zutil.pic.o: zutil.h zlib.h zconf.h |
@ -1 +0,0 @@ |
||||
This "todo" directory contains works in progress. Nothing in here works, so don't try to use it! |
@ -0,0 +1,114 @@ |
||||
<?xml version="1.0" ?> |
||||
<package name="zlib" version="1.2.3"> |
||||
<library name="zlib" dlversion="1.2.3" dlname="z"> |
||||
<property name="description"> zip compression library </property> |
||||
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" /> |
||||
|
||||
<!-- fixme: not implemented yet --> |
||||
<property name="compiler/c/inline" value="yes" /> |
||||
|
||||
<include-file name="zlib.h" scope="public" mode="644" /> |
||||
<include-file name="zconf.h" scope="public" mode="644" /> |
||||
<include-file name="zlibdefs.h" scope="public" mode="644" /> |
||||
|
||||
<source name="adler32.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
</source> |
||||
<source name="compress.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
</source> |
||||
<source name="crc32.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="crc32.h" /> |
||||
</source> |
||||
<source name="gzio.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
</source> |
||||
<source name="uncompr.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
</source> |
||||
<source name="deflate.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
<depend name="deflate.h" /> |
||||
</source> |
||||
<source name="trees.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
<depend name="deflate.h" /> |
||||
<depend name="trees.h" /> |
||||
</source> |
||||
<source name="zutil.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
</source> |
||||
<source name="inflate.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
<depend name="inftrees.h" /> |
||||
<depend name="inflate.h" /> |
||||
<depend name="inffast.h" /> |
||||
</source> |
||||
<source name="infback.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
<depend name="inftrees.h" /> |
||||
<depend name="inflate.h" /> |
||||
<depend name="inffast.h" /> |
||||
</source> |
||||
<source name="inftrees.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
<depend name="inftrees.h" /> |
||||
</source> |
||||
<source name="inffast.c"> |
||||
<depend name="zlib.h" /> |
||||
<depend name="zconf.h" /> |
||||
<depend name="zlibdefs.h" /> |
||||
<depend name="zutil.h" /> |
||||
<depend name="inftrees.h" /> |
||||
<depend name="inflate.h" /> |
||||
<depend name="inffast.h" /> |
||||
</source> |
||||
</library> |
||||
</package> |
||||
|
||||
<!-- |
||||
CFLAGS=-O |
||||
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 |
||||
#CFLAGS=-g -DDEBUG |
||||
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ |
||||
# -Wstrict-prototypes -Wmissing-prototypes |
||||
|
||||
# OBJA = |
||||
# to use the asm code: make OBJA=match.o |
||||
# |
||||
match.o: match.S |
||||
$(CPP) match.S > _match.s |
||||
$(CC) -c _match.s |
||||
mv _match.o match.o |
||||
rm -f _match.s |
||||
--> |
@ -1,396 +0,0 @@ |
||||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2006 Jean-loup Gailly. |
||||
* For conditions of distribution and use, see copyright notice in zlib.h |
||||
*/ |
||||
|
||||
/* @(#) $Id$ */ |
||||
|
||||
#ifndef ZCONF_H |
||||
#define ZCONF_H |
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions, |
||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. |
||||
* Even better than compiling with -DZ_PREFIX would be to use configure to set |
||||
* this permanently in zconf.h using "./configure --zprefix". |
||||
*/ |
||||
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ |
||||
|
||||
/* all linked symbols */ |
||||
# define _dist_code z__dist_code |
||||
# define _length_code z__length_code |
||||
# define _tr_align z__tr_align |
||||
# define _tr_flush_block z__tr_flush_block |
||||
# define _tr_init z__tr_init |
||||
# define _tr_stored_block z__tr_stored_block |
||||
# define _tr_tally z__tr_tally |
||||
# define adler32 z_adler32 |
||||
# define adler32_combine z_adler32_combine |
||||
# define compress z_compress |
||||
# define compress2 z_compress2 |
||||
# define compressBound z_compressBound |
||||
# define crc32 z_crc32 |
||||
# define crc32_combine z_crc32_combine |
||||
# define deflate z_deflate |
||||
# define deflateBound z_deflateBound |
||||
# define deflateCopy z_deflateCopy |
||||
# define deflateEnd z_deflateEnd |
||||
# define deflateInit2_ z_deflateInit2_ |
||||
# define deflateInit_ z_deflateInit_ |
||||
# define deflateParams z_deflateParams |
||||
# define deflatePrime z_deflatePrime |
||||
# define deflateReset z_deflateReset |
||||
# define deflateSetDictionary z_deflateSetDictionary |
||||
# define deflateSetHeader z_deflateSetHeader |
||||
# define deflateTune z_deflateTune |
||||
# define deflate_copyright z_deflate_copyright |
||||
# define get_crc_table z_get_crc_table |
||||
# define gzclearerr z_gzclearerr |
||||
# define gzclose z_gzclose |
||||
# define gzdirect z_gzdirect |
||||
# define gzdopen z_gzdopen |
||||
# define gzeof z_gzeof |
||||
# define gzerror z_gzerror |
||||
# define gzflush z_gzflush |
||||
# define gzgetc z_gzgetc |
||||
# define gzgets z_gzgets |
||||
# define gzopen z_gzopen |
||||
# define gzprintf z_gzprintf |
||||
# define gzputc z_gzputc |
||||
# define gzputs z_gzputs |
||||
# define gzread z_gzread |
||||
# define gzrewind z_gzrewind |
||||
# define gzseek z_gzseek |
||||
# define gzsetparams z_gzsetparams |
||||
# define gztell z_gztell |
||||
# define gzungetc z_gzungetc |
||||
# define gzwrite z_gzwrite |
||||
# define inflate z_inflate |
||||
# define inflateBack z_inflateBack |
||||
# define inflateBackEnd z_inflateBackEnd |
||||
# define inflateBackInit_ z_inflateBackInit_ |
||||
# define inflateCopy z_inflateCopy |
||||
# define inflateEnd z_inflateEnd |
||||
# define inflateGetHeader z_inflateGetHeader |
||||
# define inflateInit2_ z_inflateInit2_ |
||||
# define inflateInit_ z_inflateInit_ |
||||
# define inflatePrime z_inflatePrime |
||||
# define inflateReset z_inflateReset |
||||
# define inflateSetDictionary z_inflateSetDictionary |
||||
# define inflateSync z_inflateSync |
||||
# define inflateSyncPoint z_inflateSyncPoint |
||||
# define inflate_copyright z_inflate_copyright |
||||
# define inflate_fast z_inflate_fast |
||||
# define inflate_table z_inflate_table |
||||
# define uncompress z_uncompress |
||||
# define zError z_zError |
||||
# define z_errmsg z_z_errmsg |
||||
# define zcalloc z_zcalloc |
||||
# define zcfree z_zcfree |
||||
# define zlibCompileFlags z_zlibCompileFlags |
||||
# define zlibVersion z_zlibVersion |
||||
|
||||
/* all zlib typedefs in zlib.h and zconf.h */ |
||||
# define Byte z_Byte |
||||
# define Bytef z_Bytef |
||||
# define alloc_func z_alloc_func |
||||
# define charf z_charf |
||||
# define free_func z_free_func |
||||
# define gzFile z_gzFile |
||||
# define gz_header z_gz_header |
||||
# define gz_headerp z_gz_headerp |
||||
# define in_func z_in_func |
||||
# define intf z_intf |
||||
# define out_func z_out_func |
||||
# define uInt z_uInt |
||||
# define uIntf z_uIntf |
||||
# define uLong z_uLong |
||||
# define uLongf z_uLongf |
||||
# define voidp z_voidp |
||||
# define voidp z_voidp |
||||
# define voidpc z_voidpc |
||||
# define voidpc z_voidpc |
||||
# define voidpf z_voidpf |
||||
# define voidpf z_voidpf |
||||
# define z_stream z_z_stream |
||||
# define z_streamp z_z_streamp |
||||
|
||||
/* all zlib structs in zlib.h and zconf.h */ |
||||
# define gz_header_s z_gz_header_s |
||||
# define internal_state z_internal_state |
||||
# define z_stream_s z_z_stream_s |
||||
|
||||
#endif |
||||
|
||||
#if defined(__MSDOS__) && !defined(MSDOS) |
||||
# define MSDOS |
||||
#endif |
||||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) |
||||
# define OS2 |
||||
#endif |
||||
#if defined(_WINDOWS) && !defined(WINDOWS) |
||||
# define WINDOWS |
||||
#endif |
||||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) |
||||
# ifndef WIN32 |
||||
# define WIN32 |
||||
# endif |
||||
#endif |
||||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) |
||||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) |
||||
# ifndef SYS16BIT |
||||
# define SYS16BIT |
||||
# endif |
||||
# endif |
||||
#endif |
||||
|
||||
/*
|
||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more |
||||
* than 64k bytes at a time (needed on systems with 16-bit int). |
||||
*/ |
||||
#ifdef SYS16BIT |
||||
# define MAXSEG_64K |
||||
#endif |
||||
#ifdef MSDOS |
||||
# define UNALIGNED_OK |
||||
#endif |
||||
|
||||
#ifdef __STDC_VERSION__ |
||||
# ifndef STDC |
||||
# define STDC |
||||
# endif |
||||
# if __STDC_VERSION__ >= 199901L |
||||
# ifndef STDC99 |
||||
# define STDC99 |
||||
# endif |
||||
# endif |
||||
#endif |
||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) |
||||
# define STDC |
||||
#endif |
||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) |
||||
# define STDC |
||||
#endif |
||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) |
||||
# define STDC |
||||
#endif |
||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) |
||||
# define STDC |
||||
#endif |
||||
|
||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ |
||||
# define STDC |
||||
#endif |
||||
|
||||
#ifndef STDC |
||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ |
||||
# define const /* note: need a more gentle solution here */ |
||||
# endif |
||||
#endif |
||||
|
||||
/* Some Mac compilers merge all .h files incorrectly: */ |
||||
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) |
||||
# define NO_DUMMY_DECL |
||||
#endif |
||||
|
||||
/* Maximum value for memLevel in deflateInit2 */ |
||||
#ifndef MAX_MEM_LEVEL |
||||
# ifdef MAXSEG_64K |
||||
# define MAX_MEM_LEVEL 8 |
||||
# else |
||||
# define MAX_MEM_LEVEL 9 |
||||
# endif |
||||
#endif |
||||
|
||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files |
||||
* created by gzip. (Files created by minigzip can still be extracted by |
||||
* gzip.) |
||||
*/ |
||||
#ifndef MAX_WBITS |
||||
# define MAX_WBITS 15 /* 32K LZ77 window */ |
||||
#endif |
||||
|
||||
/* The memory requirements for deflate are (in bytes):
|
||||
(1 << (windowBits+2)) + (1 << (memLevel+9)) |
||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) |
||||
plus a few kilobytes for small objects. For example, if you want to reduce |
||||
the default memory requirements from 256K to 128K, compile with |
||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" |
||||
Of course this will generally degrade compression (there's no free lunch). |
||||
|
||||
The memory requirements for inflate are (in bytes) 1 << windowBits |
||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes |
||||
for small objects. |
||||
*/ |
||||
|
||||
/* Type declarations */ |
||||
|
||||
#ifndef OF /* function prototypes */ |
||||
# ifdef STDC |
||||
# define OF(args) args |
||||
# else |
||||
# define OF(args) () |
||||
# endif |
||||
#endif |
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations). |
||||
* This was tested only with MSC; for other MSDOS compilers you may have |
||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model, |
||||
* just define FAR to be empty. |
||||
*/ |
||||
#ifdef SYS16BIT |
||||
# if defined(M_I86SM) || defined(M_I86MM) |
||||
/* MSC small or medium model */ |
||||
# define SMALL_MEDIUM |
||||
# ifdef _MSC_VER |
||||
# define FAR _far |
||||
# else |
||||
# define FAR far |
||||
# endif |
||||
# endif |
||||
# if (defined(__SMALL__) || defined(__MEDIUM__)) |
||||
/* Turbo C small or medium model */ |
||||
# define SMALL_MEDIUM |
||||
# ifdef __BORLANDC__ |
||||
# define FAR _far |
||||
# else |
||||
# define FAR far |
||||
# endif |
||||
# endif |
||||
#endif |
||||
|
||||
#if defined(WINDOWS) || defined(WIN32) |
||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||
* This is not mandatory, but it offers a little performance increase. |
||||
*/ |
||||
# ifdef ZLIB_DLL |
||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) |
||||
# ifdef ZLIB_INTERNAL |
||||
# define ZEXTERN extern __declspec(dllexport) |
||||
# else |
||||
# define ZEXTERN extern __declspec(dllimport) |
||||
# endif |
||||
# endif |
||||
# endif /* ZLIB_DLL */ |
||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||
* define ZLIB_WINAPI. |
||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. |
||||
*/ |
||||
# ifdef ZLIB_WINAPI |
||||
# ifdef FAR |
||||
# undef FAR |
||||
# endif |
||||
# include <windows.h> |
||||
/* No need for _export, use ZLIB.DEF instead. */ |
||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */ |
||||
# define ZEXPORT WINAPI |
||||
# ifdef WIN32 |
||||
# define ZEXPORTVA WINAPIV |
||||
# else |
||||
# define ZEXPORTVA FAR CDECL |
||||
# endif |
||||
# endif |
||||
#endif |
||||
|
||||
#if defined (__BEOS__) |
||||
# ifdef ZLIB_DLL |
||||
# ifdef ZLIB_INTERNAL |
||||
# define ZEXPORT __declspec(dllexport) |
||||
# define ZEXPORTVA __declspec(dllexport) |
||||
# else |
||||
# define ZEXPORT __declspec(dllimport) |
||||
# define ZEXPORTVA __declspec(dllimport) |
||||
# endif |
||||
# endif |
||||
#endif |
||||
|
||||
#ifdef HAVE_VISIBILITY_PRAGMA |
||||
# define ZEXTERN __attribute__((visibility ("default"))) extern |
||||
#endif |
||||
|
||||
#ifndef ZEXTERN |
||||
# define ZEXTERN extern |
||||
#endif |
||||
#ifndef ZEXPORT |
||||
# define ZEXPORT |
||||
#endif |
||||
#ifndef ZEXPORTVA |
||||
# define ZEXPORTVA |
||||
#endif |
||||
|
||||
#ifndef FAR |
||||
# define FAR |
||||
#endif |
||||
|
||||
#if !defined(__MACTYPES__) |
||||
typedef unsigned char Byte; /* 8 bits */ |
||||
#endif |
||||
typedef unsigned int uInt; /* 16 bits or more */ |
||||
typedef unsigned long uLong; /* 32 bits or more */ |
||||
|
||||
#ifdef SMALL_MEDIUM |
||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ |
||||
# define Bytef Byte FAR |
||||
#else |
||||
typedef Byte FAR Bytef; |
||||
#endif |
||||
typedef char FAR charf; |
||||
typedef int FAR intf; |
||||
typedef uInt FAR uIntf; |
||||
typedef uLong FAR uLongf; |
||||
|
||||
#ifdef STDC |
||||
typedef void const *voidpc; |
||||
typedef void FAR *voidpf; |
||||
typedef void *voidp; |
||||
#else |
||||
typedef Byte const *voidpc; |
||||
typedef Byte FAR *voidpf; |
||||
typedef Byte *voidp; |
||||
#endif |
||||
|
||||
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
||||
# include <sys/types.h> /* for off_t */ |
||||
# include <unistd.h> /* for SEEK_* and off_t */ |
||||
# ifdef VMS |
||||
# include <unixio.h> /* for off_t */ |
||||
# endif |
||||
# define z_off_t off_t |
||||
#endif |
||||
#ifndef SEEK_SET |
||||
# define SEEK_SET 0 /* Seek from beginning of file. */ |
||||
# define SEEK_CUR 1 /* Seek from current position. */ |
||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ |
||||
#endif |
||||
#ifndef z_off_t |
||||
# define z_off_t long |
||||
#endif |
||||
|
||||
#if defined(__OS400__) |
||||
# define NO_vsnprintf |
||||
#endif |
||||
|
||||
#if defined(__MVS__) |
||||
# define NO_vsnprintf |
||||
#endif |
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */ |
||||
#if defined(__MVS__) |
||||
# pragma map(deflateInit_,"DEIN") |
||||
# pragma map(deflateInit2_,"DEIN2") |
||||
# pragma map(deflateEnd,"DEEND") |
||||
# pragma map(deflateBound,"DEBND") |
||||
# pragma map(inflateInit_,"ININ") |
||||
# pragma map(inflateInit2_,"ININ2") |
||||
# pragma map(inflateEnd,"INEND") |
||||
# pragma map(inflateSync,"INSY") |
||||
# pragma map(inflateSetDictionary,"INSEDI") |
||||
# pragma map(compressBound,"CMBND") |
||||
# pragma map(inflate_table,"INTABL") |
||||
# pragma map(inflate_fast,"INFA") |
||||
# pragma map(inflate_copyright,"INCOPY") |
||||
#endif |
||||
|
||||
#endif /* ZCONF_H */ |
Loading…
Reference in new issue