Skip to content

Commit

Permalink
Move example.c and minigzip.c to test/.
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Nov 27, 2011
1 parent 0cbad86 commit 1b57de3
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 52 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,20 @@ endif()
# Example binaries
#============================================================================

add_executable(example example.c)
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)

add_executable(minigzip minigzip.c)
add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib)

if(HAVE_OFF64_T)
add_executable(example64 example.c)
add_executable(example64 test/example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)

add_executable(minigzip64 minigzip.c)
add_executable(minigzip64 test/minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
4 changes: 2 additions & 2 deletions FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -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.)?

It's in zlib.h . Examples of zlib usage are in the files example.c and
minigzip.c, with more in examples/ .
It's in zlib.h . Examples of zlib usage are in the files test/example.c
and test/minigzip.c, with more in examples/ .

7. Why don't you use GNU autoconf or libtool or ...?

Expand Down
4 changes: 3 additions & 1 deletion INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Makefile.in template for Unix Makefile
README guess what
configure configure script for Unix
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
zconf.h.cmakein zconf.h template for cmake
zconf.h.in zconf.h template for configure
Expand All @@ -17,7 +19,7 @@ zlib.pc.in Template for pkg-config descriptor
zlib2ansi perl script to convert source files for C++ compilation

amiga/ makefiles for Amiga SAS C
as400/ makefiles for AS/400
as400/ makefiles for AS/400
doc/ documentation for formats and algorithms
msdos/ makefiles for MSDOS
nintendods/ makefile for Nintendo DS
Expand Down
16 changes: 8 additions & 8 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ match.lo: match.S
mv _match.o match.lo
rm -f _match.s

example.o: examples/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ examples/example.c
example.o: test/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ test/example.c

minigzip.o: examples/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ examples/minigzip.c
minigzip.o: test/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c

example64.o: examples/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ examples/example.c
example64.o: test/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c

minigzip64.o: examples/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ examples/minigzip.c
minigzip64.o: test/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c

.SUFFIXES: .lo

Expand Down
12 changes: 6 additions & 6 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ rfc1952 (gzip format).

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
of the library is given in the file example.c which also tests that the library
is working correctly. Another example is given in the file minigzip.c. The
compression library itself is composed of all source files except example.c and
minigzip.c.
of the library is given in the file test/example.c which also tests that
the library is working correctly. Another example is given in the file
test/minigzip.c. The compression library itself is composed of all source
files in the root directory.

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
well, "make install" should work for most flavors of Unix. For Windows, use one
of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
well, "make install" should work for most flavors of Unix. For Windows, use
one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
make_vms.com.

Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
Expand Down
4 changes: 2 additions & 2 deletions contrib/delphi/zlibd32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ uncompr.obj: uncompr.c 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,
Expand Down
4 changes: 2 additions & 2 deletions contrib/pascal/zlibd32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ uncompr.obj: uncompr.c 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,
Expand Down
9 changes: 0 additions & 9 deletions examples/README.examples
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ enough.c
- calculates the maximum table space used in inflate tree
construction over all possible Huffman codes

example.c
usage examples of zlib
- used in zlib build Makefile for testing

fitblk.c
compress just enough input to nearly fill a requested output size
- zlib isn't designed to do this, but fitblk does it anyway
Expand Down Expand Up @@ -38,11 +34,6 @@ gzlog.h
and deflateSetDictionary()
- 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
painfully comprehensive description of zpipe.c (see below)
- describes in excruciating detail the use of deflate() and inflate()
Expand Down
8 changes: 4 additions & 4 deletions make_vms.com
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ $ write sys$output "Building Zlib ..."
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
$ write sys$output "Building 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
$ if f$search("x11vms:xvmsutils.olb") .nes. ""
$ then
$ write sys$output "Building 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 -
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
minigzip.obj libz.olb
Expand Down Expand Up @@ -431,15 +431,15 @@ adler32.obj : adler32.c zutil.h zlib.h zconf.h
compress.obj : compress.c 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
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
gzlib.obj : gzlib.c zutil.h zlib.h zconf.h
gzread.obj : gzread.c zutil.h zlib.h zconf.h
gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.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
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
uncompr.obj : uncompr.c zlib.h zconf.h
zutil.obj : zutil.c zutil.h zlib.h zconf.h
Expand Down
4 changes: 2 additions & 2 deletions msdos/Makefile.bor
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ uncompr.obj: uncompr.c 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:
Expand Down
4 changes: 2 additions & 2 deletions msdos/Makefile.msc
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ uncompr.obj: uncompr.c 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

minigzip.obj: minigzip.c zlib.h zconf.h
minigzip.obj: test/minigzip.c zlib.h zconf.h
$(CC) -c $(CFLAGS) $*.c


Expand Down
4 changes: 2 additions & 2 deletions msdos/Makefile.tc
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ uncompr.obj: uncompr.c 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:
Expand Down
2 changes: 1 addition & 1 deletion old/visualc6/example.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions win32/Makefile.bor
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ uncompr.obj: uncompr.c 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,
Expand Down
4 changes: 2 additions & 2 deletions win32/Makefile.msc
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ inffas32.obj: contrib\masmx86\inffas32.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
$(RC) $(RCFLAGS) /fo$@ win32/zlib1.rc
Expand Down
6 changes: 3 additions & 3 deletions zlib.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH ZLIB 3 "xx Sep 2011"
.TH ZLIB 3 "27 Nov 2011"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
Expand Down Expand Up @@ -36,9 +36,9 @@ All functions of the compression library are documented in the file
.IR zlib.h .
The distribution source includes examples of use of the library
in the files
.I example.c
.I test/example.c
and
.IR minigzip.c,
.IR test/minigzip.c,
as well as other examples in the
.IR examples/
directory.
Expand Down
Binary file modified zlib.3.pdf
Binary file not shown.

0 comments on commit 1b57de3

Please sign in to comment.