Move example.c and minigzip.c to test/.

This commit is contained in:
Mark Adler 2011-11-21 18:56:02 -08:00
parent 0cbad869b0
commit 1b57de3aef
19 changed files with 45 additions and 52 deletions

View File

@ -171,20 +171,20 @@ endif()
# Example binaries # Example binaries
#============================================================================ #============================================================================
add_executable(example example.c) add_executable(example test/example.c)
target_link_libraries(example zlib) target_link_libraries(example zlib)
add_test(example example) add_test(example example)
add_executable(minigzip minigzip.c) add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib) target_link_libraries(minigzip zlib)
if(HAVE_OFF64_T) if(HAVE_OFF64_T)
add_executable(example64 example.c) add_executable(example64 test/example.c)
target_link_libraries(example64 zlib) target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64) add_test(example64 example64)
add_executable(minigzip64 minigzip.c) add_executable(minigzip64 test/minigzip.c)
target_link_libraries(minigzip64 zlib) target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif() endif()

4
FAQ
View File

@ -44,8 +44,8 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
6. Where's the zlib documentation (man pages, etc.)? 6. Where's the zlib documentation (man pages, etc.)?
It's in zlib.h . Examples of zlib usage are in the files example.c and It's in zlib.h . Examples of zlib usage are in the files test/example.c
minigzip.c, with more in examples/ . and test/minigzip.c, with more in examples/ .
7. Why don't you use GNU autoconf or libtool or ...? 7. Why don't you use GNU autoconf or libtool or ...?

2
INDEX
View File

@ -7,6 +7,8 @@ Makefile.in template for Unix Makefile
README guess what README guess what
configure configure script for Unix configure configure script for Unix
make_vms.com makefile for VMS make_vms.com makefile for VMS
test/example.c zlib usages examples for build testing
test/minigzip.c minimal gzip-like functionality for build testing
treebuild.xml XML description of source file dependencies treebuild.xml XML description of source file dependencies
zconf.h.cmakein zconf.h template for cmake zconf.h.cmakein zconf.h template for cmake
zconf.h.in zconf.h template for configure zconf.h.in zconf.h template for configure

View File

@ -127,17 +127,17 @@ match.lo: match.S
mv _match.o match.lo mv _match.o match.lo
rm -f _match.s rm -f _match.s
example.o: examples/example.c zlib.h zconf.h example.o: test/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ examples/example.c $(CC) $(CFLAGS) -I. -c -o $@ test/example.c
minigzip.o: examples/minigzip.c zlib.h zconf.h minigzip.o: test/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ examples/minigzip.c $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c
example64.o: examples/example.c zlib.h zconf.h example64.o: test/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ examples/example.c $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c
minigzip64.o: examples/minigzip.c zlib.h zconf.h minigzip64.o: test/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ examples/minigzip.c $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c
.SUFFIXES: .lo .SUFFIXES: .lo

12
README
View File

@ -8,15 +8,15 @@ rfc1952 (gzip format).
All functions of the compression library are documented in the file zlib.h All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example (volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
of the library is given in the file example.c which also tests that the library of the library is given in the file test/example.c which also tests that
is working correctly. Another example is given in the file minigzip.c. The the library is working correctly. Another example is given in the file
compression library itself is composed of all source files except example.c and test/minigzip.c. The compression library itself is composed of all source
minigzip.c. files in the root directory.
To compile all files and run the test program, follow the instructions given at To compile all files and run the test program, follow the instructions given at
the top of Makefile.in. In short "./configure; make test", and if that goes the top of Makefile.in. In short "./configure; make test", and if that goes
well, "make install" should work for most flavors of Unix. For Windows, use one well, "make install" should work for most flavors of Unix. For Windows, use
of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
make_vms.com. make_vms.com.
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant

View File

@ -63,9 +63,9 @@ uncompr.obj: uncompr.c zlib.h zconf.h
zutil.obj: zutil.c zutil.h zlib.h zconf.h zutil.obj: zutil.c zutil.h zlib.h zconf.h
example.obj: example.c zlib.h zconf.h example.obj: test/example.c zlib.h zconf.h
minigzip.obj: minigzip.c zlib.h zconf.h minigzip.obj: test/minigzip.c zlib.h zconf.h
# For the sake of the old Borland make, # For the sake of the old Borland make,

View File

@ -63,9 +63,9 @@ uncompr.obj: uncompr.c zlib.h zconf.h
zutil.obj: zutil.c zutil.h zlib.h zconf.h zutil.obj: zutil.c zutil.h zlib.h zconf.h
example.obj: example.c zlib.h zconf.h example.obj: test/example.c zlib.h zconf.h
minigzip.obj: minigzip.c zlib.h zconf.h minigzip.obj: test/minigzip.c zlib.h zconf.h
# For the sake of the old Borland make, # For the sake of the old Borland make,

View File

@ -6,10 +6,6 @@ enough.c
- calculates the maximum table space used in inflate tree - calculates the maximum table space used in inflate tree
construction over all possible Huffman codes construction over all possible Huffman codes
example.c
usage examples of zlib
- used in zlib build Makefile for testing
fitblk.c fitblk.c
compress just enough input to nearly fill a requested output size compress just enough input to nearly fill a requested output size
- zlib isn't designed to do this, but fitblk does it anyway - zlib isn't designed to do this, but fitblk does it anyway
@ -38,11 +34,6 @@ gzlog.h
and deflateSetDictionary() and deflateSetDictionary()
- illustrates use of a gzip header extra field - illustrates use of a gzip header extra field
minigzip.c
minimal implementation of gzip-like functionality using zlib
- used in zlib build Makefile for testing
- is not meant for and should not be used as a gzip replacement
zlib_how.html zlib_how.html
painfully comprehensive description of zpipe.c (see below) painfully comprehensive description of zpipe.c (see below)
- describes in excruciating detail the use of deflate() and inflate() - describes in excruciating detail the use of deflate() and inflate()

View File

@ -175,13 +175,13 @@ $ write sys$output "Building Zlib ..."
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ $ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
$ write sys$output "Building example..." $ write sys$output "Building example..."
$ CALL MAKE example.OBJ "CC ''CCOPT' example" - $ CALL MAKE example.OBJ "CC ''CCOPT' example" -
example.c zlib.h zconf.h test/example.c zlib.h zconf.h
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb $ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
$ if f$search("x11vms:xvmsutils.olb") .nes. "" $ if f$search("x11vms:xvmsutils.olb") .nes. ""
$ then $ then
$ write sys$output "Building minigzip..." $ write sys$output "Building minigzip..."
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" - $ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
minigzip.c zlib.h zconf.h test/minigzip.c zlib.h zconf.h
$ call make minigzip.exe - $ call make minigzip.exe -
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
minigzip.obj libz.olb minigzip.obj libz.olb
@ -431,7 +431,7 @@ adler32.obj : adler32.c zutil.h zlib.h zconf.h
compress.obj : compress.c zlib.h zconf.h compress.obj : compress.c zlib.h zconf.h
crc32.obj : crc32.c zutil.h zlib.h zconf.h crc32.obj : crc32.c zutil.h zlib.h zconf.h
deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h
example.obj : example.c zlib.h zconf.h example.obj : test/example.c zlib.h zconf.h
gzclose.obj : gzclose.c zutil.h zlib.h zconf.h gzclose.obj : gzclose.c zutil.h zlib.h zconf.h
gzlib.obj : gzlib.c zutil.h zlib.h zconf.h gzlib.obj : gzlib.c zutil.h zlib.h zconf.h
gzread.obj : gzread.c zutil.h zlib.h zconf.h gzread.obj : gzread.c zutil.h zlib.h zconf.h
@ -439,7 +439,7 @@ gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h
inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
inflate.obj : inflate.c zutil.h zlib.h zconf.h inflate.obj : inflate.c zutil.h zlib.h zconf.h
inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
minigzip.obj : minigzip.c zlib.h zconf.h minigzip.obj : test/minigzip.c zlib.h zconf.h
trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h
uncompr.obj : uncompr.c zlib.h zconf.h uncompr.obj : uncompr.c zlib.h zconf.h
zutil.obj : zutil.c zutil.h zlib.h zconf.h zutil.obj : zutil.c zutil.h zlib.h zconf.h

View File

@ -86,9 +86,9 @@ uncompr.obj: uncompr.c zlib.h zconf.h
zutil.obj: zutil.c zutil.h zlib.h zconf.h zutil.obj: zutil.c zutil.h zlib.h zconf.h
example.obj: example.c zlib.h zconf.h example.obj: test/example.c zlib.h zconf.h
minigzip.obj: minigzip.c zlib.h zconf.h minigzip.obj: test/minigzip.c zlib.h zconf.h
# the command line is cut to fit in the MS-DOS 128 byte limit: # the command line is cut to fit in the MS-DOS 128 byte limit:

View File

@ -80,10 +80,10 @@ uncompr.obj: uncompr.c zlib.h zconf.h
zutil.obj: zutil.c zutil.h zlib.h zconf.h zutil.obj: zutil.c zutil.h zlib.h zconf.h
example.obj: example.c zlib.h zconf.h example.obj: test/example.c zlib.h zconf.h
$(CC) -c $(CFLAGS) $*.c $(CC) -c $(CFLAGS) $*.c
minigzip.obj: minigzip.c zlib.h zconf.h minigzip.obj: test/minigzip.c zlib.h zconf.h
$(CC) -c $(CFLAGS) $*.c $(CC) -c $(CFLAGS) $*.c

View File

@ -71,9 +71,9 @@ uncompr.obj: uncompr.c zlib.h zconf.h
zutil.obj: zutil.c zutil.h zlib.h zconf.h zutil.obj: zutil.c zutil.h zlib.h zconf.h
example.obj: example.c zlib.h zconf.h example.obj: test/example.c zlib.h zconf.h
minigzip.obj: minigzip.c zlib.h zconf.h minigzip.obj: test/minigzip.c zlib.h zconf.h
# the command line is cut to fit in the MS-DOS 128 byte limit: # the command line is cut to fit in the MS-DOS 128 byte limit:

View File

@ -259,7 +259,7 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File # Begin Source File
SOURCE=..\..\example.c SOURCE=..\..\test\example.c
# End Source File # End Source File
# End Group # End Group
# Begin Group "Header Files" # Begin Group "Header Files"

View File

@ -74,9 +74,9 @@ uncompr.obj: uncompr.c zlib.h zconf.h
zutil.obj: zutil.c zutil.h zlib.h zconf.h zutil.obj: zutil.c zutil.h zlib.h zconf.h
example.obj: example.c zlib.h zconf.h example.obj: test/example.c zlib.h zconf.h
minigzip.obj: minigzip.c zlib.h zconf.h minigzip.obj: test/minigzip.c zlib.h zconf.h
# For the sake of the old Borland make, # For the sake of the old Borland make,

View File

@ -125,9 +125,9 @@ inffas32.obj: contrib\masmx86\inffas32.asm
match686.obj: contrib\masmx86\match686.asm match686.obj: contrib\masmx86\match686.asm
example.obj: example.c zlib.h zconf.h example.obj: test/example.c zlib.h zconf.h
minigzip.obj: minigzip.c zlib.h zconf.h minigzip.obj: test/minigzip.c zlib.h zconf.h
zlib1.res: win32/zlib1.rc zlib1.res: win32/zlib1.rc
$(RC) $(RCFLAGS) /fo$@ win32/zlib1.rc $(RC) $(RCFLAGS) /fo$@ win32/zlib1.rc

6
zlib.3
View File

@ -1,4 +1,4 @@
.TH ZLIB 3 "xx Sep 2011" .TH ZLIB 3 "27 Nov 2011"
.SH NAME .SH NAME
zlib \- compression/decompression library zlib \- compression/decompression library
.SH SYNOPSIS .SH SYNOPSIS
@ -36,9 +36,9 @@ All functions of the compression library are documented in the file
.IR zlib.h . .IR zlib.h .
The distribution source includes examples of use of the library The distribution source includes examples of use of the library
in the files in the files
.I example.c .I test/example.c
and and
.IR minigzip.c, .IR test/minigzip.c,
as well as other examples in the as well as other examples in the
.IR examples/ .IR examples/
directory. directory.

Binary file not shown.