├── Client ├── zlib │ ├── contrib │ │ ├── blast │ │ │ ├── test.txt │ │ │ ├── README │ │ │ ├── test.pk │ │ │ ├── Makefile │ │ │ └── blast.h │ │ ├── infback9 │ │ │ ├── README │ │ │ ├── infback9.h │ │ │ ├── inflate9.h │ │ │ └── inftree9.h │ │ ├── README.contrib │ │ ├── puff │ │ │ ├── zeros.raw │ │ │ ├── puff.h │ │ │ ├── Makefile │ │ │ └── README │ │ ├── dotzlib │ │ │ ├── DotZLib.chm │ │ │ ├── DotZLib │ │ │ │ ├── Deflater.cs │ │ │ │ ├── DotZLib.cs │ │ │ │ ├── Inflater.cs │ │ │ │ ├── CodecBase.cs │ │ │ │ ├── GZipStream.cs │ │ │ │ ├── UnitTests.cs │ │ │ │ ├── ChecksumImpl.cs │ │ │ │ ├── CircularBuffer.cs │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── DotZLib.sln │ │ │ ├── DotZLib.build │ │ │ ├── LICENSE_1_0.txt │ │ │ └── readme.txt │ │ ├── masmx64 │ │ │ ├── bld_ml64.bat │ │ │ └── readme.txt │ │ ├── masmx86 │ │ │ ├── bld_ml32.bat │ │ │ └── readme.txt │ │ ├── minizip │ │ │ ├── MiniZip64_Changes.txt │ │ │ ├── minizip.pc.in │ │ │ ├── Makefile │ │ │ ├── mztools.h │ │ │ ├── configure.ac │ │ │ ├── iowin32.h │ │ │ ├── make_vms.com │ │ │ ├── Makefile.am │ │ │ └── MiniZip64_info.txt │ │ ├── vstudio │ │ │ ├── vc10 │ │ │ │ ├── miniunz.vcxproj.user │ │ │ │ ├── minizip.vcxproj.user │ │ │ │ ├── testzlib.vcxproj.user │ │ │ │ ├── zlibstat.vcxproj.user │ │ │ │ ├── zlibvc.vcxproj.user │ │ │ │ ├── testzlibdll.vcxproj.user │ │ │ │ ├── miniunz.vcxproj.filters │ │ │ │ ├── minizip.vcxproj.filters │ │ │ │ ├── testzlibdll.vcxproj.filters │ │ │ │ ├── zlib.rc │ │ │ │ ├── testzlib.vcxproj.filters │ │ │ │ ├── zlibstat.vcxproj.filters │ │ │ │ └── zlibvc.vcxproj.filters │ │ │ ├── vc9 │ │ │ │ └── zlib.rc │ │ │ └── readme.txt │ │ ├── delphi │ │ │ ├── ZLibConst.pas │ │ │ ├── readme.txt │ │ │ └── zlibd32.mak │ │ ├── testzlib │ │ │ └── testzlib.txt │ │ ├── untgz │ │ │ ├── Makefile │ │ │ └── Makefile.msc │ │ ├── iostream3 │ │ │ ├── TODO │ │ │ ├── README │ │ │ └── test.cc │ │ ├── ada │ │ │ ├── zlib.gpr │ │ │ ├── readme.txt │ │ │ ├── zlib-thin.adb │ │ │ └── buffer_demo.adb │ │ ├── iostream │ │ │ ├── test.cpp │ │ │ └── zfstream.h │ │ ├── iostream2 │ │ │ └── zstream_test.cpp │ │ ├── asm686 │ │ │ └── README.686 │ │ └── pascal │ │ │ ├── zlibd32.mak │ │ │ └── readme.txt │ ├── ChangeLog │ ├── zlib.3.pdf │ ├── Makefile │ ├── win32 │ │ ├── VisualC.txt │ │ ├── zlib1.rc │ │ ├── zlib.def │ │ └── Makefile.bor │ ├── old │ │ ├── README │ │ ├── os2 │ │ │ ├── zlib.def │ │ │ └── Makefile.os2 │ │ ├── descrip.mms │ │ ├── Makefile.emx │ │ └── Makefile.riscos │ ├── nintendods │ │ └── README │ ├── zlib.pc.in │ ├── zlib.pc.cmakein │ ├── inffast.h │ ├── gzclose.c │ ├── watcom │ │ ├── watcom_l.mak │ │ └── watcom_f.mak │ ├── msdos │ │ ├── Makefile.emx │ │ ├── Makefile.dj2 │ │ ├── Makefile.tc │ │ ├── Makefile.msc │ │ └── Makefile.bor │ ├── examples │ │ ├── README.examples │ │ └── gzlog.h │ ├── amiga │ │ ├── Makefile.sas │ │ └── Makefile.pup │ ├── uncompr.c │ ├── INDEX │ ├── compress.c │ ├── inftrees.h │ ├── treebuild.xml │ └── zlib2ansi ├── Buffer.cpp ├── Client.rc ├── resource.h ├── shelldlg.cpp ├── Debug │ ├── Client.lastbuildstate │ ├── BuildLog.htm │ └── ShellClient.exe ├── Release │ ├── BuildLog.htm │ └── ShellClient.exe ├── Client.vcxproj.user ├── shelldlg.h ├── SHELLCLIENT.DSW ├── SHELLCLIENT.sln ├── Buffer.h ├── ShellClient.vcproj.XXX.Administrator.user └── Client.vcxproj.filters ├── Server ├── test │ ├── build.sh │ ├── buffer_test │ └── buffer_test.c ├── Makefile ├── icmp_shell.h ├── buffer.h └── buffer.c ├── doc ├── icmp_shell.vsd └── TCP-IP Raw Sockets (Windows).mht ├── test ├── des_test │ ├── des.c │ ├── main.c │ ├── Debug │ │ └── des_test.lastbuildstate │ ├── des.h │ ├── des_test.vcxproj.filters │ └── des_test.vcxproj ├── recv_icmp │ ├── Makefile │ ├── recv_icmp │ ├── recv_icmp.c │ ├── recv_icmp.vcxproj.filters │ └── recv_icmp.vcxproj ├── sendicmp │ ├── sendicmp.c │ ├── Debug │ │ └── sendicmp.lastbuildstate │ ├── sendicmp.vcxproj.filters │ └── sendicmp.vcxproj └── linux_pipe │ ├── Makefile │ ├── linux_pipe │ ├── Debug │ └── linux_pipe.lastbuildstate │ ├── linux_pipe.vcxproj.filters │ ├── linux_pipe.c │ └── linux_pipe.vcxproj ├── clean.sh ├── README.md ├── CLEAN.BAT └── icmp_shell.sln /Client/zlib/contrib/blast/test.txt: -------------------------------------------------------------------------------- 1 | AIAIAIAIAIAIA -------------------------------------------------------------------------------- /Server/test/build.sh: -------------------------------------------------------------------------------- 1 | gcc buffer_test.c ../buffer.c -o buffer_test -lm -g 2 | -------------------------------------------------------------------------------- /Client/Buffer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/Buffer.cpp -------------------------------------------------------------------------------- /Client/Client.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/Client.rc -------------------------------------------------------------------------------- /Client/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/resource.h -------------------------------------------------------------------------------- /Client/shelldlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/shelldlg.cpp -------------------------------------------------------------------------------- /Client/zlib/contrib/infback9/README: -------------------------------------------------------------------------------- 1 | See infback9.h for what this is and how to use it. 2 | -------------------------------------------------------------------------------- /doc/icmp_shell.vsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/doc/icmp_shell.vsd -------------------------------------------------------------------------------- /test/des_test/des.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/test/des_test/des.c -------------------------------------------------------------------------------- /test/recv_icmp/Makefile: -------------------------------------------------------------------------------- 1 | recv_icmp:recv_icmp.c 2 | gcc -Wall -g recv_icmp.c -o recv_icmp 3 | -------------------------------------------------------------------------------- /Client/zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/ChangeLog -------------------------------------------------------------------------------- /Client/zlib/zlib.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/zlib.3.pdf -------------------------------------------------------------------------------- /test/des_test/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/test/des_test/main.c -------------------------------------------------------------------------------- /Client/Debug/Client.lastbuildstate: -------------------------------------------------------------------------------- 1 | #v4.0:v110_xp:false 2 | Debug|Win32|D:\project\icmp_shell\| 3 | -------------------------------------------------------------------------------- /Server/test/buffer_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Server/test/buffer_test -------------------------------------------------------------------------------- /test/recv_icmp/recv_icmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/test/recv_icmp/recv_icmp -------------------------------------------------------------------------------- /test/sendicmp/sendicmp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/test/sendicmp/sendicmp.c -------------------------------------------------------------------------------- /Client/Debug/BuildLog.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/Debug/BuildLog.htm -------------------------------------------------------------------------------- /Client/Release/BuildLog.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/Release/BuildLog.htm -------------------------------------------------------------------------------- /test/des_test/Debug/des_test.lastbuildstate: -------------------------------------------------------------------------------- 1 | #v4.0:v110:false 2 | Debug|Win32|D:\project\icmp_shell\| 3 | -------------------------------------------------------------------------------- /test/linux_pipe/Makefile: -------------------------------------------------------------------------------- 1 | linux_pipe:linux_pipe.c 2 | gcc -Wall -g -lpthread linux_pipe.c -o linux_pipe 3 | -------------------------------------------------------------------------------- /test/linux_pipe/linux_pipe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/test/linux_pipe/linux_pipe -------------------------------------------------------------------------------- /test/recv_icmp/recv_icmp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/test/recv_icmp/recv_icmp.c -------------------------------------------------------------------------------- /Client/Debug/ShellClient.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/Debug/ShellClient.exe -------------------------------------------------------------------------------- /Client/Release/ShellClient.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/Release/ShellClient.exe -------------------------------------------------------------------------------- /test/linux_pipe/Debug/linux_pipe.lastbuildstate: -------------------------------------------------------------------------------- 1 | #v4.0:v110:false 2 | Debug|Win32|D:\project\project\icmp_shell\| 3 | -------------------------------------------------------------------------------- /test/sendicmp/Debug/sendicmp.lastbuildstate: -------------------------------------------------------------------------------- 1 | #v4.0:v110:false 2 | Debug|Win32|D:\project\project\icmp_shell\| 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/README.contrib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/README.contrib -------------------------------------------------------------------------------- /Client/zlib/contrib/blast/README: -------------------------------------------------------------------------------- 1 | Read blast.h for purpose and usage. 2 | 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | -------------------------------------------------------------------------------- /Client/zlib/contrib/blast/test.pk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/blast/test.pk -------------------------------------------------------------------------------- /Client/zlib/contrib/puff/zeros.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/puff/zeros.raw -------------------------------------------------------------------------------- /doc/TCP-IP Raw Sockets (Windows).mht: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/doc/TCP-IP Raw Sockets (Windows).mht -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib.chm -------------------------------------------------------------------------------- /Client/zlib/contrib/masmx64/bld_ml64.bat: -------------------------------------------------------------------------------- 1 | ml64.exe /Flinffasx64 /c /Zi inffasx64.asm 2 | ml64.exe /Flgvmat64 /c /Zi gvmat64.asm 3 | -------------------------------------------------------------------------------- /Client/zlib/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | -@echo "Please use ./configure first. Thank you." 3 | 4 | distclean: 5 | make -f Makefile.in distclean 6 | -------------------------------------------------------------------------------- /Client/zlib/contrib/masmx86/bld_ml32.bat: -------------------------------------------------------------------------------- 1 | ml /coff /Zi /c /Flmatch686.lst match686.asm 2 | ml /coff /Zi /c /Flinffas32.lst inffas32.asm 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/Deflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/Deflater.cs -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/DotZLib.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/DotZLib.cs -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/Inflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/Inflater.cs -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/CodecBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/CodecBase.cs -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/GZipStream.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/GZipStream.cs -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/UnitTests.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/UnitTests.cs -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs -------------------------------------------------------------------------------- /Client/zlib/win32/VisualC.txt: -------------------------------------------------------------------------------- 1 | 2 | To build zlib using the Microsoft Visual C++ environment, 3 | use the appropriate project from the projects/ directory. 4 | -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sin5678/icmp_shell/HEAD/Client/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs -------------------------------------------------------------------------------- /Client/zlib/old/README: -------------------------------------------------------------------------------- 1 | This directory contains files that have not been updated for zlib 1.2.x 2 | 3 | (Volunteers are encouraged to help clean this up. Thanks.) 4 | -------------------------------------------------------------------------------- /Client/Client.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/MiniZip64_Changes.txt: -------------------------------------------------------------------------------- 1 | 2 | MiniZip 1.1 was derrived from MiniZip at version 1.01f 3 | 4 | Change in 1.0 (Okt 2009) 5 | - **TODO - Add history** 6 | 7 | -------------------------------------------------------------------------------- /Client/zlib/contrib/blast/Makefile: -------------------------------------------------------------------------------- 1 | blast: blast.c blast.h 2 | cc -DTEST -o blast blast.c 3 | 4 | test: blast 5 | blast < test.pk | cmp - test.txt 6 | 7 | clean: 8 | rm -f blast blast.o 9 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/miniunz.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/minizip.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/testzlib.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Server/Makefile: -------------------------------------------------------------------------------- 1 | OBJ = buffer.o icmp_shell.o 2 | icmp_shell : $(OBJ) 3 | gcc $(OBJ) -lpthread -lz -lm -o icmp_shell 4 | buffer.o : buffer.h 5 | icmp_shell.o : icmp_shell.h buffer.h 6 | 7 | clean : 8 | rm $(OBJ) icmp_shell 9 | -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ''' 3 | *.aps *.idb *.ncp *.obj *.ipch *.log *.pch *.sbr *.tmp *.pdb *.bsc *.map *.ilk *.res *.ncb *.opt *.suo *.manifest *.dep *.tlog *.sdf *.plg *.unsuccessfulbuild *.successfulbuild *.exp 4 | ''' 5 | for $a in 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | icmp_shell 2 | ========== 3 | 4 | shell over icmp 5 | 6 | server run at linux and client run at windows 7 | 8 | client send command to server use icmp packet and server exec the command then send result to client 9 | 10 | -------------------------------------------------------------------------------- /Client/zlib/nintendods/README: -------------------------------------------------------------------------------- 1 | This Makefile requires devkitARM (http://www.devkitpro.org/category/devkitarm/) and works inside "contrib/nds". It is based on a devkitARM template. 2 | 3 | Eduardo Costa 4 | January 3, 2009 5 | 6 | -------------------------------------------------------------------------------- /test/recv_icmp/recv_icmp.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/sendicmp/sendicmp.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/linux_pipe/linux_pipe.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Client/zlib/contrib/delphi/ZLibConst.pas: -------------------------------------------------------------------------------- 1 | unit ZLibConst; 2 | 3 | interface 4 | 5 | resourcestring 6 | sTargetBufferTooSmall = 'ZLib error: target buffer may be too small'; 7 | sInvalidStreamOp = 'Invalid stream operation'; 8 | 9 | implementation 10 | 11 | end. 12 | -------------------------------------------------------------------------------- /Client/zlib/contrib/testzlib/testzlib.txt: -------------------------------------------------------------------------------- 1 | To build testzLib with Visual Studio 2005: 2 | 3 | copy to a directory file from : 4 | - root of zLib tree 5 | - contrib/testzlib 6 | - contrib/masmx86 7 | - contrib/masmx64 8 | - contrib/vstudio/vc7 9 | 10 | and open testzlib8.sln -------------------------------------------------------------------------------- /Client/zlib/contrib/untgz/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-g 3 | 4 | untgz: untgz.o ../../libz.a 5 | $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz 6 | 7 | untgz.o: untgz.c ../../zlib.h 8 | $(CC) $(CFLAGS) -c -I../.. untgz.c 9 | 10 | ../../libz.a: 11 | cd ../..; ./configure; make 12 | 13 | clean: 14 | rm -f untgz untgz.o *~ 15 | -------------------------------------------------------------------------------- /Client/zlib/zlib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | sharedlibdir=@sharedlibdir@ 5 | includedir=@includedir@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/minizip.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@/minizip 5 | 6 | Name: minizip 7 | Description: Minizip zip file manipulation library 8 | Requires: 9 | Version: @PACKAGE_VERSION@ 10 | Libs: -L${libdir} -lminizip 11 | Libs.private: -lz 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /Client/zlib/zlib.pc.cmakein: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@INSTALL_LIB_DIR@ 4 | sharedlibdir=@INSTALL_LIB_DIR@ 5 | includedir=@INSTALL_INC_DIR@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /Client/zlib/contrib/untgz/Makefile.msc: -------------------------------------------------------------------------------- 1 | CC=cl 2 | CFLAGS=-MD 3 | 4 | untgz.exe: untgz.obj ..\..\zlib.lib 5 | $(CC) $(CFLAGS) untgz.obj ..\..\zlib.lib 6 | 7 | untgz.obj: untgz.c ..\..\zlib.h 8 | $(CC) $(CFLAGS) -c -I..\.. untgz.c 9 | 10 | ..\..\zlib.lib: 11 | cd ..\.. 12 | $(MAKE) -f win32\makefile.msc 13 | cd contrib\untgz 14 | 15 | clean: 16 | -del untgz.obj 17 | -del untgz.exe 18 | -------------------------------------------------------------------------------- /test/des_test/des.h: -------------------------------------------------------------------------------- 1 | #ifndef _DES_ENCRYPT_DECRYPT 2 | #define _DES_ENCRYPT_DECRYPT 3 | 4 | #define BYTE unsigned char 5 | #define LPBYTE BYTE* 6 | #define LPCBYTE const BYTE* 7 | #define BOOL int 8 | 9 | 10 | BOOL DesEnter(LPCBYTE in, LPBYTE out, int datalen, const BYTE key[8], BOOL type); 11 | BOOL DesMac(LPCBYTE mac_data, LPBYTE mac_code, int datalen, const BYTE key[8]); 12 | 13 | #endif -------------------------------------------------------------------------------- /Client/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /CLEAN.BAT: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo ---------------------------------------------------- 3 | echo Press any key to delete all files with ending: 4 | echo *.aps *.idb *.ncp *.obj *.pch *.tmp *.sbr 5 | echo Visual c++/.Net junk 6 | echo ---------------------------------------------------- 7 | 8 | del /F /Q /S *.aps *.idb *.ncp *.obj *.ipch *.log *.pch *.sbr *.tmp *.pdb *.bsc *.map *.ilk *.res *.ncb *.opt *.suo *.manifest *.dep *.tlog *.sdf *.plg *.unsuccessfulbuild *.successfulbuild *.exp 9 | 10 | rmdir /S /Q ipch 11 | rmdir /S /Q release 12 | rmdir /S /Q debug 13 | 14 | 15 | -------------------------------------------------------------------------------- /Client/zlib/contrib/iostream3/TODO: -------------------------------------------------------------------------------- 1 | Possible upgrades to gzfilebuf: 2 | 3 | - The ability to do putback (e.g. putbackfail) 4 | 5 | - The ability to seek (zlib supports this, but could be slow/tricky) 6 | 7 | - Simultaneous read/write access (does it make sense?) 8 | 9 | - Support for ios_base::ate open mode 10 | 11 | - Locale support? 12 | 13 | - Check public interface to see which calls give problems 14 | (due to dependence on library internals) 15 | 16 | - Override operator<<(ostream&, gzfilebuf*) to allow direct copying 17 | of stream buffer to stream ( i.e. os << is.rdbuf(); ) 18 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -I../.. 3 | 4 | UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a 5 | ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a 6 | 7 | .c.o: 8 | $(CC) -c $(CFLAGS) $*.c 9 | 10 | all: miniunz minizip 11 | 12 | miniunz: $(UNZ_OBJS) 13 | $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) 14 | 15 | minizip: $(ZIP_OBJS) 16 | $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) 17 | 18 | test: miniunz minizip 19 | ./minizip test readme.txt 20 | ./miniunz -l test.zip 21 | mv readme.txt readme.old 22 | ./miniunz test.zip 23 | 24 | clean: 25 | /bin/rm -f *.o *~ minizip miniunz 26 | -------------------------------------------------------------------------------- /Server/icmp_shell.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | 27 | -------------------------------------------------------------------------------- /Client/zlib/contrib/ada/zlib.gpr: -------------------------------------------------------------------------------- 1 | project Zlib is 2 | 3 | for Languages use ("Ada"); 4 | for Source_Dirs use ("."); 5 | for Object_Dir use "."; 6 | for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo"); 7 | 8 | package Compiler is 9 | for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst"); 10 | end Compiler; 11 | 12 | package Linker is 13 | for Default_Switches ("ada") use ("-lz"); 14 | end Linker; 15 | 16 | package Builder is 17 | for Default_Switches ("ada") use ("-s", "-gnatQ"); 18 | end Builder; 19 | 20 | end Zlib; 21 | -------------------------------------------------------------------------------- /Client/zlib/contrib/iostream/test.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "zfstream.h" 3 | 4 | int main() { 5 | 6 | // Construct a stream object with this filebuffer. Anything sent 7 | // to this stream will go to standard out. 8 | gzofstream os( 1, ios::out ); 9 | 10 | // This text is getting compressed and sent to stdout. 11 | // To prove this, run 'test | zcat'. 12 | os << "Hello, Mommy" << endl; 13 | 14 | os << setcompressionlevel( Z_NO_COMPRESSION ); 15 | os << "hello, hello, hi, ho!" << endl; 16 | 17 | setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) 18 | << "I'm compressing again" << endl; 19 | 20 | os.close(); 21 | 22 | return 0; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Client/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /Client/zlib/contrib/iostream2/zstream_test.cpp: -------------------------------------------------------------------------------- 1 | #include "zstream.h" 2 | #include 3 | #include 4 | #include 5 | 6 | void main() { 7 | char h[256] = "Hello"; 8 | char* g = "Goodbye"; 9 | ozstream out("temp.gz"); 10 | out < "This works well" < h < g; 11 | out.close(); 12 | 13 | izstream in("temp.gz"); // read it back 14 | char *x = read_string(in), *y = new char[256], z[256]; 15 | in > y > z; 16 | in.close(); 17 | cout << x << endl << y << endl << z << endl; 18 | 19 | out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results 20 | out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; 21 | out << z << endl << y << endl << x << endl; 22 | out << 1.1234567890123456789 << endl; 23 | 24 | delete[] x; delete[] y; 25 | } 26 | -------------------------------------------------------------------------------- /Client/shelldlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CShellDlg 4 | { 5 | public: 6 | CShellDlg() 7 | { 8 | m_hDlg = NULL; 9 | m_hEdit = NULL; 10 | m_OldEditProc = NULL; 11 | m_LastSel = m_Sel = 0; 12 | } 13 | ~CShellDlg() 14 | { 15 | SendMessage(m_hDlg,WM_CLOSE,0,0); 16 | } 17 | BOOL CreateDlg(); 18 | BOOL ProcessRecvData(WCHAR *data); 19 | BOOL CALLBACK DialogProc( 20 | HWND hwndDlg, 21 | UINT uMsg, 22 | WPARAM wParam, 23 | LPARAM lParam); 24 | BOOL CALLBACK EditProc( 25 | HWND hwndDlg, 26 | UINT uMsg, 27 | WPARAM wParam, 28 | LPARAM lParam); 29 | //private: 30 | HWND m_hDlg; 31 | HWND m_hEdit; 32 | int m_LastSel; 33 | int m_Sel; 34 | WNDPROC m_OldEditProc; 35 | }; 36 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | extern int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Client/SHELLCLIENT.DSW: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Server"=..\Server\Server.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "ShellClient"=.\ShellClient.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Global: 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<3> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | -------------------------------------------------------------------------------- /Server/buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BUFFER_H 2 | #define _BUFFER_H 3 | 4 | #ifndef WIN32 5 | typedef unsigned char BYTE; 6 | typedef BYTE * PBYTE; 7 | typedef unsigned int UINT; 8 | typedef unsigned long ULONG; 9 | typedef PBYTE LPBYTE; 10 | #endif 11 | //缓冲区类 。。 12 | typedef struct _buffer_context //不能手动编辑里面的内容 13 | { 14 | PBYTE m_pBase; 15 | PBYTE m_pPtr; 16 | UINT m_nSize; 17 | }buffer_context; 18 | 19 | void buffer_init(buffer_context *); //buffer 初始化 20 | void buffer_clean(buffer_context *); 21 | ULONG buffer_get_length(buffer_context *); 22 | ULONG buffer_write(buffer_context *,LPBYTE ,ULONG); 23 | /* 24 | read from buffer retuen num of bytes read 25 | */ 26 | ULONG buffer_read(buffer_context *,LPBYTE,ULONG); 27 | ULONG buffer_get_memsize(buffer_context *); 28 | void buffer_free(buffer_context *); 29 | LPBYTE buffer_getat(buffer_context *,ULONG ); 30 | void buffer_exch(buffer_context *buff1,buffer_context *buff2); 31 | 32 | #endif -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_INIT([minizip], [1.2.7], [bugzilla.redhat.com]) 5 | AC_CONFIG_SRCDIR([minizip.c]) 6 | AM_INIT_AUTOMAKE([foreign]) 7 | LT_INIT 8 | 9 | AC_MSG_CHECKING([whether to build example programs]) 10 | AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs])) 11 | AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes]) 12 | if test "$enable_demos" = yes 13 | then 14 | AC_MSG_RESULT([yes]) 15 | else 16 | AC_MSG_RESULT([no]) 17 | fi 18 | 19 | case "${host}" in 20 | *-mingw* | mingw*) 21 | WIN32="yes" 22 | ;; 23 | *) 24 | ;; 25 | esac 26 | AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) 27 | 28 | 29 | AC_SUBST([HAVE_UNISTD_H], [0]) 30 | AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], []) 31 | AC_CONFIG_FILES([Makefile minizip.pc]) 32 | AC_OUTPUT 33 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | Version 1.1, February 14h, 2010 3 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 4 | 5 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | Modifications for Zip64 support 8 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 9 | 10 | For more info read MiniZip_info.txt 11 | 12 | */ 13 | 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 22 | void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); 23 | void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); 24 | void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /Client/zlib/contrib/masmx86/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Summary 3 | ------- 4 | This directory contains ASM implementations of the functions 5 | longest_match() and inflate_fast(). 6 | 7 | 8 | Use instructions 9 | ---------------- 10 | Assemble using MASM, and copy the object files into the zlib source 11 | directory, then run the appropriate makefile, as suggested below. You can 12 | donwload MASM from here: 13 | 14 | http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 15 | 16 | You can also get objects files here: 17 | 18 | http://www.winimage.com/zLibDll/zlib124_masm_obj.zip 19 | 20 | Build instructions 21 | ------------------ 22 | * With Microsoft C and MASM: 23 | nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" 24 | 25 | * With Borland C and TASM: 26 | make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" 27 | 28 | -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotZLib", "DotZLib\DotZLib.csproj", "{BB1EE0B1-1808-46CB-B786-949D91117FC5}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.ActiveCfg = Debug|.NET 13 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.Build.0 = Debug|.NET 14 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.ActiveCfg = Release|.NET 15 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.Build.0 = Release|.NET 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Client/zlib/old/os2/zlib.def: -------------------------------------------------------------------------------- 1 | ; 2 | ; Slightly modified version of ../nt/zlib.dnt :-) 3 | ; 4 | 5 | LIBRARY Z 6 | DESCRIPTION "Zlib compression library for OS/2" 7 | CODE PRELOAD MOVEABLE DISCARDABLE 8 | DATA PRELOAD MOVEABLE MULTIPLE 9 | 10 | EXPORTS 11 | adler32 12 | compress 13 | crc32 14 | deflate 15 | deflateCopy 16 | deflateEnd 17 | deflateInit2_ 18 | deflateInit_ 19 | deflateParams 20 | deflateReset 21 | deflateSetDictionary 22 | gzclose 23 | gzdopen 24 | gzerror 25 | gzflush 26 | gzopen 27 | gzread 28 | gzwrite 29 | inflate 30 | inflateEnd 31 | inflateInit2_ 32 | inflateInit_ 33 | inflateReset 34 | inflateSetDictionary 35 | inflateSync 36 | uncompress 37 | zlibVersion 38 | gzprintf 39 | gzputc 40 | gzgetc 41 | gzseek 42 | gzrewind 43 | gztell 44 | gzeof 45 | gzsetparams 46 | zError 47 | inflateSyncPoint 48 | get_crc_table 49 | compress2 50 | gzputs 51 | gzgets 52 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/make_vms.com: -------------------------------------------------------------------------------- 1 | $ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig 2 | $ open/write zdef vmsdefs.h 3 | $ copy sys$input: zdef 4 | $ deck 5 | #define unix 6 | #define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from 7 | #define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator 8 | #define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord 9 | #define Write_EndOfCentralDirectoryRecord Write_EoDRecord 10 | $ eod 11 | $ close zdef 12 | $ copy vmsdefs.h,ioapi.h_orig ioapi.h 13 | $ cc/include=[--]/prefix=all ioapi.c 14 | $ cc/include=[--]/prefix=all miniunz.c 15 | $ cc/include=[--]/prefix=all unzip.c 16 | $ cc/include=[--]/prefix=all minizip.c 17 | $ cc/include=[--]/prefix=all zip.c 18 | $ link miniunz,unzip,ioapi,[--]libz.olb/lib 19 | $ link minizip,zip,ioapi,[--]libz.olb/lib 20 | $ mcr []minizip test minizip_info.txt 21 | $ mcr []miniunz -l test.zip 22 | $ rename minizip_info.txt; minizip_info.txt_old 23 | $ mcr []miniunz test.zip 24 | $ delete test.zip;* 25 | $exit 26 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libminizip.la 2 | 3 | if COND_DEMOS 4 | bin_PROGRAMS = miniunzip minizip 5 | endif 6 | 7 | zlib_top_srcdir = $(top_srcdir)/../.. 8 | zlib_top_builddir = $(top_builddir)/../.. 9 | 10 | AM_CPPFLAGS = -I$(zlib_top_srcdir) 11 | AM_LDFLAGS = -L$(zlib_top_builddir) 12 | 13 | if WIN32 14 | iowin32_src = iowin32.c 15 | iowin32_h = iowin32.h 16 | endif 17 | 18 | libminizip_la_SOURCES = \ 19 | ioapi.c \ 20 | mztools.c \ 21 | unzip.c \ 22 | zip.c \ 23 | ${iowin32_src} 24 | 25 | libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz 26 | 27 | minizip_includedir = $(includedir)/minizip 28 | minizip_include_HEADERS = \ 29 | crypt.h \ 30 | ioapi.h \ 31 | mztools.h \ 32 | unzip.h \ 33 | zip.h \ 34 | ${iowin32_h} 35 | 36 | pkgconfigdir = $(libdir)/pkgconfig 37 | pkgconfig_DATA = minizip.pc 38 | 39 | EXTRA_PROGRAMS = miniunzip minizip 40 | 41 | miniunzip_SOURCES = miniunz.c 42 | miniunzip_LDADD = libminizip.la 43 | 44 | minizip_SOURCES = minizip.c 45 | minizip_LDADD = libminizip.la -lz 46 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {048af943-022b-4db6-beeb-a54c34774ee2} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {c1d600d2-888f-4aea-b73e-8b0dd9befa0c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {0844199a-966b-4f19-81db-1e0125e141b9} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c0419b40-bf50-40da-b153-ff74215b79de} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {bb87b070-735b-478e-92ce-7383abb2f36c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {f46ab6a6-548f-43cb-ae96-681abb5bd5db} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {fa61a89f-93fc-4c89-b29e-36224b7592f4} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {d4b85da0-2ba2-4934-b57f-e2584e3848ee} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {e573e075-00bd-4a7d-bd67-a8cc9bfc5aca} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /Server/test/buffer_test.c: -------------------------------------------------------------------------------- 1 | // test buffer 2 | #include 3 | #include 4 | #include 5 | #include "../buffer.h" 6 | 7 | char *msg1 = "I am sincoder "; 8 | char *msg2 = " hello world "; 9 | 10 | int main(int argc, char **argv) 11 | { 12 | char null = 0; 13 | buffer_context ctx; 14 | char buff[1024]; 15 | int len ; 16 | 17 | buffer_init(&ctx); 18 | buffer_write(&ctx, msg1, strlen(msg1)); 19 | buffer_write(&ctx, msg2, strlen(msg2)); 20 | buffer_write(&ctx, &null, 1); 21 | printf("%s\n", buffer_getat(&ctx, 0)); 22 | printf("%s\n", buffer_getat(&ctx, 1)); 23 | memset(buff, 0, sizeof(buff)); 24 | len = buffer_read(&ctx, buff, 5); 25 | printf("read %d bytes : %s\n", len, buff ); 26 | printf("%s\n", buffer_getat(&ctx, 0)); 27 | 28 | memset(buff, 0, sizeof(buff)); 29 | len = buffer_read(&ctx, buff, 1024); 30 | printf("read %d bytes : %s\n", len, buff ); 31 | printf("%d\n", buffer_getat(&ctx, 0)); 32 | 33 | buffer_free(&ctx); 34 | return 0; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1.2.7,0 6 | PRODUCTVERSION 1.2.7,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.7\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlib.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2012 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc9/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1.2.7,0 6 | PRODUCTVERSION 1.2.7,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.7\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlib.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2012 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /Client/SHELLCLIENT.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{059D6162-CD51-11D0-AE1F-00A0C90FFFC3}") = "Server", "..\Server\Server.dsp", "{07B7F7C8-EC21-45BA-9971-6019DFC3D6EA}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShellClient", "ShellClient.vcproj", "{12802A9E-A883-4429-B7C3-01A7EF8FCC7E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {12802A9E-A883-4429-B7C3-01A7EF8FCC7E}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {12802A9E-A883-4429-B7C3-01A7EF8FCC7E}.Debug|Win32.Build.0 = Debug|Win32 16 | {12802A9E-A883-4429-B7C3-01A7EF8FCC7E}.Release|Win32.ActiveCfg = Release|Win32 17 | {12802A9E-A883-4429-B7C3-01A7EF8FCC7E}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Client/Buffer.h: -------------------------------------------------------------------------------- 1 | // Buffer.h: interface for the CBuffer class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_) 6 | #define AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CBuffer 13 | { 14 | // Attributes 15 | protected: 16 | PBYTE m_pBase; 17 | PBYTE m_pPtr; 18 | UINT m_nSize; 19 | 20 | 21 | // Methods 22 | protected: 23 | UINT ReAllocateBuffer(UINT nRequestedSize); 24 | UINT DeAllocateBuffer(UINT nRequestedSize); 25 | UINT GetMemSize(); 26 | public: 27 | void ClearBuffer(); 28 | 29 | UINT Delete(UINT nSize); 30 | UINT Read(PBYTE pData, UINT nSize); 31 | BOOL Write(PBYTE pData, UINT nSize); 32 | UINT GetBufferLen(); 33 | int Scan(PBYTE pScan,UINT nPos); 34 | BOOL Insert(PBYTE pData, UINT nSize); 35 | 36 | void Copy(CBuffer& buffer); 37 | 38 | PBYTE GetBuffer(UINT nPos=0); 39 | 40 | CBuffer(); 41 | virtual ~CBuffer(); 42 | 43 | }; 44 | 45 | #endif // !defined(AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_) 46 | -------------------------------------------------------------------------------- /test/des_test/des_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | -------------------------------------------------------------------------------- /Client/zlib/win32/zlib1.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../zlib.h" 3 | 4 | #ifdef GCC_WINDRES 5 | VS_VERSION_INFO VERSIONINFO 6 | #else 7 | VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 8 | #endif 9 | FILEVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 10 | PRODUCTVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 11 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 12 | #ifdef _DEBUG 13 | FILEFLAGS 1 14 | #else 15 | FILEFLAGS 0 16 | #endif 17 | FILEOS VOS__WINDOWS32 18 | FILETYPE VFT_DLL 19 | FILESUBTYPE 0 // not used 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904E4" 24 | //language ID = U.S. English, char set = Windows, Multilingual 25 | BEGIN 26 | VALUE "FileDescription", "zlib data compression library\0" 27 | VALUE "FileVersion", ZLIB_VERSION "\0" 28 | VALUE "InternalName", "zlib1.dll\0" 29 | VALUE "LegalCopyright", "(C) 1995-2006 Jean-loup Gailly & Mark Adler\0" 30 | VALUE "OriginalFilename", "zlib1.dll\0" 31 | VALUE "ProductName", "zlib\0" 32 | VALUE "ProductVersion", ZLIB_VERSION "\0" 33 | VALUE "Comments", "For more information visit http://www.zlib.net/\0" 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x0409, 1252 39 | END 40 | END 41 | -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib.build: -------------------------------------------------------------------------------- 1 | 2 | 3 | A .Net wrapper library around ZLib1.dll 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Client/zlib/contrib/masmx64/readme.txt: -------------------------------------------------------------------------------- 1 | Summary 2 | ------- 3 | This directory contains ASM implementations of the functions 4 | longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t), 5 | for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits. 6 | 7 | gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits 8 | assembly optimized version from Jean-loup Gailly original longest_match function 9 | 10 | inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing 11 | original function from Mark Adler 12 | 13 | Use instructions 14 | ---------------- 15 | Assemble the .asm files using MASM and put the object files into the zlib source 16 | directory. You can also get object files here: 17 | 18 | http://www.winimage.com/zLibDll/zlib124_masm_obj.zip 19 | 20 | define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, 21 | and inffasx64.obj and gvmat64.obj as object to link. 22 | 23 | 24 | Build instructions 25 | ------------------ 26 | run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) 27 | 28 | ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK 29 | 30 | You can get Windows 2003 server DDK with ml64 and cl for AMD64 from 31 | http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) 32 | -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/LICENSE_1_0.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Client/zlib/contrib/puff/puff.h: -------------------------------------------------------------------------------- 1 | /* puff.h 2 | Copyright (C) 2002-2010 Mark Adler, all rights reserved 3 | version 2.2, 25 Apr 2010 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the author be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Mark Adler madler@alumni.caltech.edu 22 | */ 23 | 24 | 25 | /* 26 | * See puff.c for purpose and usage. 27 | */ 28 | #ifndef NIL 29 | # define NIL ((unsigned char *)0) /* for no output option */ 30 | #endif 31 | 32 | int puff(unsigned char *dest, /* pointer to destination pointer */ 33 | unsigned long *destlen, /* amount of output space */ 34 | const unsigned char *source, /* pointer to source data pointer */ 35 | unsigned long *sourcelen); /* amount of input available */ 36 | -------------------------------------------------------------------------------- /Client/zlib/watcom/watcom_l.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # OpenWatcom large model 3 | # Last updated: 28-Dec-2005 4 | 5 | # To use, do "wmake -f watcom_l.mak" 6 | 7 | C_SOURCE = adler32.c compress.c crc32.c deflate.c & 8 | gzclose.c gzlib.c gzread.c gzwrite.c & 9 | infback.c inffast.c inflate.c inftrees.c & 10 | trees.c uncompr.c zutil.c 11 | 12 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj & 13 | gzclose.obj gzlib.obj gzread.obj gzwrite.obj & 14 | infback.obj inffast.obj inflate.obj inftrees.obj & 15 | trees.obj uncompr.obj zutil.obj 16 | 17 | CC = wcc 18 | LINKER = wcl 19 | CFLAGS = -zq -ml -s -bt=dos -oilrtfm -fr=nul -wx 20 | ZLIB_LIB = zlib_l.lib 21 | 22 | .C.OBJ: 23 | $(CC) $(CFLAGS) $[@ 24 | 25 | all: $(ZLIB_LIB) example.exe minigzip.exe 26 | 27 | $(ZLIB_LIB): $(OBJS) 28 | wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj 29 | wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj 30 | wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj 31 | wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj 32 | wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj 33 | 34 | example.exe: $(ZLIB_LIB) example.obj 35 | $(LINKER) -fe=example.exe example.obj $(ZLIB_LIB) 36 | 37 | minigzip.exe: $(ZLIB_LIB) minigzip.obj 38 | $(LINKER) -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) 39 | 40 | clean: .SYMBOLIC 41 | del *.obj 42 | del $(ZLIB_LIB) 43 | @echo Cleaning done 44 | -------------------------------------------------------------------------------- /Client/zlib/watcom/watcom_f.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # OpenWatcom flat model 3 | # Last updated: 28-Dec-2005 4 | 5 | # To use, do "wmake -f watcom_f.mak" 6 | 7 | C_SOURCE = adler32.c compress.c crc32.c deflate.c & 8 | gzclose.c gzlib.c gzread.c gzwrite.c & 9 | infback.c inffast.c inflate.c inftrees.c & 10 | trees.c uncompr.c zutil.c 11 | 12 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj & 13 | gzclose.obj gzlib.obj gzread.obj gzwrite.obj & 14 | infback.obj inffast.obj inflate.obj inftrees.obj & 15 | trees.obj uncompr.obj zutil.obj 16 | 17 | CC = wcc386 18 | LINKER = wcl386 19 | CFLAGS = -zq -mf -3r -fp3 -s -bt=dos -oilrtfm -fr=nul -wx 20 | ZLIB_LIB = zlib_f.lib 21 | 22 | .C.OBJ: 23 | $(CC) $(CFLAGS) $[@ 24 | 25 | all: $(ZLIB_LIB) example.exe minigzip.exe 26 | 27 | $(ZLIB_LIB): $(OBJS) 28 | wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj 29 | wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj 30 | wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj 31 | wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj 32 | wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj 33 | 34 | example.exe: $(ZLIB_LIB) example.obj 35 | $(LINKER) -ldos32a -fe=example.exe example.obj $(ZLIB_LIB) 36 | 37 | minigzip.exe: $(ZLIB_LIB) minigzip.obj 38 | $(LINKER) -ldos32a -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) 39 | 40 | clean: .SYMBOLIC 41 | del *.obj 42 | del $(ZLIB_LIB) 43 | @echo Cleaning done 44 | -------------------------------------------------------------------------------- /Client/zlib/contrib/iostream3/README: -------------------------------------------------------------------------------- 1 | These classes provide a C++ stream interface to the zlib library. It allows you 2 | to do things like: 3 | 4 | gzofstream outf("blah.gz"); 5 | outf << "These go into the gzip file " << 123 << endl; 6 | 7 | It does this by deriving a specialized stream buffer for gzipped files, which is 8 | the way Stroustrup would have done it. :-> 9 | 10 | The gzifstream and gzofstream classes were originally written by Kevin Ruland 11 | and made available in the zlib contrib/iostream directory. The older version still 12 | compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of 13 | this version. 14 | 15 | The new classes are as standard-compliant as possible, closely following the 16 | approach of the standard library's fstream classes. It compiles under gcc versions 17 | 3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard 18 | library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs 19 | from the previous one in the following respects: 20 | - added showmanyc 21 | - added setbuf, with support for unbuffered output via setbuf(0,0) 22 | - a few bug fixes of stream behavior 23 | - gzipped output file opened with default compression level instead of maximum level 24 | - setcompressionlevel()/strategy() members replaced by single setcompression() 25 | 26 | The code is provided "as is", with the permission to use, copy, modify, distribute 27 | and sell it for any purpose without fee. 28 | 29 | Ludwig Schwardt 30 | 31 | 32 | DSP Lab 33 | Electrical & Electronic Engineering Department 34 | University of Stellenbosch 35 | South Africa 36 | -------------------------------------------------------------------------------- /Client/zlib/contrib/iostream3/test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Test program for gzifstream and gzofstream 3 | * 4 | * by Ludwig Schwardt 5 | * original version by Kevin Ruland 6 | */ 7 | 8 | #include "zfstream.h" 9 | #include // for cout 10 | 11 | int main() { 12 | 13 | gzofstream outf; 14 | gzifstream inf; 15 | char buf[80]; 16 | 17 | outf.open("test1.txt.gz"); 18 | outf << "The quick brown fox sidestepped the lazy canine\n" 19 | << 1.3 << "\nPlan " << 9 << std::endl; 20 | outf.close(); 21 | std::cout << "Wrote the following message to 'test1.txt.gz' (check with zcat or zless):\n" 22 | << "The quick brown fox sidestepped the lazy canine\n" 23 | << 1.3 << "\nPlan " << 9 << std::endl; 24 | 25 | std::cout << "\nReading 'test1.txt.gz' (buffered) produces:\n"; 26 | inf.open("test1.txt.gz"); 27 | while (inf.getline(buf,80,'\n')) { 28 | std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; 29 | } 30 | inf.close(); 31 | 32 | outf.rdbuf()->pubsetbuf(0,0); 33 | outf.open("test2.txt.gz"); 34 | outf << setcompression(Z_NO_COMPRESSION) 35 | << "The quick brown fox sidestepped the lazy canine\n" 36 | << 1.3 << "\nPlan " << 9 << std::endl; 37 | outf.close(); 38 | std::cout << "\nWrote the same message to 'test2.txt.gz' in uncompressed form"; 39 | 40 | std::cout << "\nReading 'test2.txt.gz' (unbuffered) produces:\n"; 41 | inf.rdbuf()->pubsetbuf(0,0); 42 | inf.open("test2.txt.gz"); 43 | while (inf.getline(buf,80,'\n')) { 44 | std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; 45 | } 46 | inf.close(); 47 | 48 | return 0; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Client/ShellClient.vcproj.XXX.Administrator.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Client/zlib/win32/zlib.def: -------------------------------------------------------------------------------- 1 | ; zlib data compression library 2 | EXPORTS 3 | ; basic functions 4 | zlibVersion 5 | deflate 6 | deflateEnd 7 | inflate 8 | inflateEnd 9 | ; advanced functions 10 | deflateSetDictionary 11 | deflateCopy 12 | deflateReset 13 | deflateParams 14 | deflateTune 15 | deflateBound 16 | deflatePending 17 | deflatePrime 18 | deflateSetHeader 19 | inflateSetDictionary 20 | inflateSync 21 | inflateCopy 22 | inflateReset 23 | inflateReset2 24 | inflatePrime 25 | inflateMark 26 | inflateGetHeader 27 | inflateBack 28 | inflateBackEnd 29 | zlibCompileFlags 30 | ; utility functions 31 | compress 32 | compress2 33 | compressBound 34 | uncompress 35 | gzopen 36 | gzdopen 37 | gzbuffer 38 | gzsetparams 39 | gzread 40 | gzwrite 41 | gzprintf 42 | gzputs 43 | gzgets 44 | gzputc 45 | gzgetc 46 | gzungetc 47 | gzflush 48 | gzseek 49 | gzrewind 50 | gztell 51 | gzoffset 52 | gzeof 53 | gzdirect 54 | gzclose 55 | gzclose_r 56 | gzclose_w 57 | gzerror 58 | gzclearerr 59 | ; large file functions 60 | gzopen64 61 | gzseek64 62 | gztell64 63 | gzoffset64 64 | adler32_combine64 65 | crc32_combine64 66 | ; checksum functions 67 | adler32 68 | crc32 69 | adler32_combine 70 | crc32_combine 71 | ; various hacks, don't look :) 72 | deflateInit_ 73 | deflateInit2_ 74 | inflateInit_ 75 | inflateInit2_ 76 | inflateBackInit_ 77 | gzgetc_ 78 | zError 79 | inflateSyncPoint 80 | get_crc_table 81 | inflateUndermine 82 | inflateResetKeep 83 | deflateResetKeep 84 | gzopen_w 85 | -------------------------------------------------------------------------------- /Client/zlib/old/descrip.mms: -------------------------------------------------------------------------------- 1 | # descrip.mms: MMS description file for building zlib on VMS 2 | # written by Martin P.J. Zinser 3 | 4 | cc_defs = 5 | c_deb = 6 | 7 | .ifdef __DECC__ 8 | pref = /prefix=all 9 | .endif 10 | 11 | OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\ 12 | deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\ 13 | inftrees.obj, infcodes.obj, infutil.obj, inffast.obj 14 | 15 | CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) 16 | 17 | all : example.exe minigzip.exe 18 | @ write sys$output " Example applications available" 19 | libz.olb : libz.olb($(OBJS)) 20 | @ write sys$output " libz available" 21 | 22 | example.exe : example.obj libz.olb 23 | link example,libz.olb/lib 24 | 25 | minigzip.exe : minigzip.obj libz.olb 26 | link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib 27 | 28 | clean : 29 | delete *.obj;*,libz.olb;* 30 | 31 | 32 | # Other dependencies. 33 | adler32.obj : zutil.h zlib.h zconf.h 34 | compress.obj : zlib.h zconf.h 35 | crc32.obj : zutil.h zlib.h zconf.h 36 | deflate.obj : deflate.h zutil.h zlib.h zconf.h 37 | example.obj : zlib.h zconf.h 38 | gzio.obj : zutil.h zlib.h zconf.h 39 | infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 40 | infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h 41 | inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h 42 | inflate.obj : zutil.h zlib.h zconf.h infblock.h 43 | inftrees.obj : zutil.h zlib.h zconf.h inftrees.h 44 | infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h 45 | minigzip.obj : zlib.h zconf.h 46 | trees.obj : deflate.h zutil.h zlib.h zconf.h 47 | uncompr.obj : zlib.h zconf.h 48 | zutil.obj : zutil.h zlib.h zconf.h 49 | -------------------------------------------------------------------------------- /Client/zlib/msdos/Makefile.emx: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for emx 0.9c by Chr. Spieler, 6/17/98. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.emx; make test -fmakefile.emx 8 | # 9 | 10 | CC=gcc 11 | 12 | #CFLAGS=-MMD -O 13 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 14 | #CFLAGS=-MMD -g -DDEBUG 15 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 16 | -Wstrict-prototypes -Wmissing-prototypes 17 | 18 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 19 | CP=copy /Y 20 | # If gnu install.exe is available, replace $(CP) with ginstall. 21 | INSTALL=$(CP) 22 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 23 | RM=del 24 | LDLIBS=-L. -lzlib 25 | LD=$(CC) -s -o 26 | LDSHARED=$(CC) 27 | 28 | INCL=zlib.h zconf.h 29 | LIBS=zlib.a 30 | 31 | AR=ar rcs 32 | 33 | prefix=/usr/local 34 | exec_prefix = $(prefix) 35 | 36 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 37 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 38 | 39 | TEST_OBJS = example.o minigzip.o 40 | 41 | all: example.exe minigzip.exe 42 | 43 | test: all 44 | ./example 45 | echo hello world | .\minigzip | .\minigzip -d 46 | 47 | %.o : %.c 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | zlib.a: $(OBJS) 51 | $(AR) $@ $(OBJS) 52 | 53 | %.exe : %.o $(LIBS) 54 | $(LD) $@ $< $(LDLIBS) 55 | 56 | 57 | .PHONY : clean 58 | 59 | clean: 60 | $(RM) *.d 61 | $(RM) *.o 62 | $(RM) *.exe 63 | $(RM) zlib.a 64 | $(RM) foo.gz 65 | 66 | DEPS := $(wildcard *.d) 67 | ifneq ($(DEPS),) 68 | include $(DEPS) 69 | endif 70 | -------------------------------------------------------------------------------- /Client/zlib/contrib/infback9/infback9.h: -------------------------------------------------------------------------------- 1 | /* infback9.h -- header for using inflateBack9 functions 2 | * Copyright (C) 2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* 7 | * This header file and associated patches provide a decoder for PKWare's 8 | * undocumented deflate64 compression method (method 9). Use with infback9.c, 9 | * inftree9.h, inftree9.c, and inffix9.h. These patches are not supported. 10 | * This should be compiled with zlib, since it uses zutil.h and zutil.o. 11 | * This code has not yet been tested on 16-bit architectures. See the 12 | * comments in zlib.h for inflateBack() usage. These functions are used 13 | * identically, except that there is no windowBits parameter, and a 64K 14 | * window must be provided. Also if int's are 16 bits, then a zero for 15 | * the third parameter of the "out" function actually means 65536UL. 16 | * zlib.h must be included before this header file. 17 | */ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | ZEXTERN int ZEXPORT inflateBack9 OF((z_stream FAR *strm, 24 | in_func in, void FAR *in_desc, 25 | out_func out, void FAR *out_desc)); 26 | ZEXTERN int ZEXPORT inflateBack9End OF((z_stream FAR *strm)); 27 | ZEXTERN int ZEXPORT inflateBack9Init_ OF((z_stream FAR *strm, 28 | unsigned char FAR *window, 29 | const char *version, 30 | int stream_size)); 31 | #define inflateBack9Init(strm, window) \ 32 | inflateBack9Init_((strm), (window), \ 33 | ZLIB_VERSION, sizeof(z_stream)) 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /Client/zlib/old/Makefile.emx: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for emx/rsxnt by Chr. Spieler, 6/16/98. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.emx; make test -fmakefile.emx 8 | # 9 | 10 | CC=gcc -Zwin32 11 | 12 | #CFLAGS=-MMD -O 13 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 14 | #CFLAGS=-MMD -g -DDEBUG 15 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 16 | -Wstrict-prototypes -Wmissing-prototypes 17 | 18 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 19 | CP=copy /Y 20 | # If gnu install.exe is available, replace $(CP) with ginstall. 21 | INSTALL=$(CP) 22 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 23 | RM=del 24 | LDLIBS=-L. -lzlib 25 | LD=$(CC) -s -o 26 | LDSHARED=$(CC) 27 | 28 | INCL=zlib.h zconf.h 29 | LIBS=zlib.a 30 | 31 | AR=ar rcs 32 | 33 | prefix=/usr/local 34 | exec_prefix = $(prefix) 35 | 36 | OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \ 37 | gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 38 | 39 | TEST_OBJS = example.o minigzip.o 40 | 41 | all: example.exe minigzip.exe 42 | 43 | test: all 44 | ./example 45 | echo hello world | .\minigzip | .\minigzip -d 46 | 47 | %.o : %.c 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | zlib.a: $(OBJS) 51 | $(AR) $@ $(OBJS) 52 | 53 | %.exe : %.o $(LIBS) 54 | $(LD) $@ $< $(LDLIBS) 55 | 56 | 57 | .PHONY : clean 58 | 59 | clean: 60 | $(RM) *.d 61 | $(RM) *.o 62 | $(RM) *.exe 63 | $(RM) zlib.a 64 | $(RM) foo.gz 65 | 66 | DEPS := $(wildcard *.d) 67 | ifneq ($(DEPS),) 68 | include $(DEPS) 69 | endif 70 | -------------------------------------------------------------------------------- /Client/zlib/contrib/asm686/README.686: -------------------------------------------------------------------------------- 1 | This is a patched version of zlib, modified to use 2 | Pentium-Pro-optimized assembly code in the deflation algorithm. The 3 | files changed/added by this patch are: 4 | 5 | README.686 6 | match.S 7 | 8 | The speedup that this patch provides varies, depending on whether the 9 | compiler used to build the original version of zlib falls afoul of the 10 | PPro's speed traps. My own tests show a speedup of around 10-20% at 11 | the default compression level, and 20-30% using -9, against a version 12 | compiled using gcc 2.7.2.3. Your mileage may vary. 13 | 14 | Note that this code has been tailored for the PPro/PII in particular, 15 | and will not perform particuarly well on a Pentium. 16 | 17 | If you are using an assembler other than GNU as, you will have to 18 | translate match.S to use your assembler's syntax. (Have fun.) 19 | 20 | Brian Raiter 21 | breadbox@muppetlabs.com 22 | April, 1998 23 | 24 | 25 | Added for zlib 1.1.3: 26 | 27 | The patches come from 28 | http://www.muppetlabs.com/~breadbox/software/assembly.html 29 | 30 | To compile zlib with this asm file, copy match.S to the zlib directory 31 | then do: 32 | 33 | CFLAGS="-O3 -DASMV" ./configure 34 | make OBJA=match.o 35 | 36 | 37 | Update: 38 | 39 | I've been ignoring these assembly routines for years, believing that 40 | gcc's generated code had caught up with it sometime around gcc 2.95 41 | and the major rearchitecting of the Pentium 4. However, I recently 42 | learned that, despite what I believed, this code still has some life 43 | in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% 44 | faster than the code produced by gcc 4.1. 45 | 46 | In acknowledgement of its continuing usefulness, I've altered the 47 | license to match that of the rest of zlib. Share and Enjoy! 48 | 49 | Brian Raiter 50 | breadbox@muppetlabs.com 51 | April, 2007 52 | -------------------------------------------------------------------------------- /test/linux_pipe/linux_pipe.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | int read_pipe[2]; 13 | int write_pipe[2]; 14 | 15 | void MyCreateThread(void *(*func)(void *),void *lparam) 16 | { 17 | pthread_attr_t attr; 18 | pthread_t p; 19 | pthread_attr_init(&attr); 20 | pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); 21 | pthread_create(&p,&attr,func,lparam); 22 | pthread_attr_destroy(&attr); 23 | } 24 | 25 | void *read_thread(void *lparam) 26 | { 27 | char cmd[100]; 28 | int bytes = 0; 29 | while((bytes = read(STDIN_FILENO,cmd,100)) > 0) 30 | { 31 | write(write_pipe[1],cmd,bytes); 32 | } 33 | return NULL; 34 | } 35 | 36 | int main(int argc, char *argv[]) 37 | { 38 | int pid; 39 | pipe(read_pipe); 40 | pipe(write_pipe); 41 | pid = fork(); 42 | 43 | if(0 == pid) 44 | { 45 | //进入子进程 46 | // 启动 shell 进程 47 | close(read_pipe[0]); 48 | close(write_pipe[1]); 49 | char *argv[] = {"/bin/sh",NULL}; 50 | char *shell = "/bin/sh"; 51 | dup2(write_pipe[0],STDIN_FILENO); //将输入输出重定向到管道 52 | dup2(read_pipe[1],STDOUT_FILENO); 53 | dup2(read_pipe[1],STDERR_FILENO); 54 | execv(shell,argv); 55 | } 56 | else 57 | { 58 | char buff; 59 | 60 | close(read_pipe[1]); 61 | close(write_pipe[0]); 62 | printf("child process id %d \n",pid); 63 | write(write_pipe[1],"ls\n",3); 64 | //启动一个线程来读取 65 | MyCreateThread(read_thread,NULL); 66 | 67 | while(read(read_pipe[0],&buff,1) > 0) 68 | { 69 | putchar(buff); 70 | } 71 | waitpid(pid,NULL,0); 72 | printf("child exit. ..\n"); 73 | } 74 | return 0; 75 | } -------------------------------------------------------------------------------- /Client/zlib/examples/README.examples: -------------------------------------------------------------------------------- 1 | This directory contains examples of the use of zlib and other relevant 2 | programs and documentation. 3 | 4 | enough.c 5 | calculation and justification of ENOUGH parameter in inftrees.h 6 | - calculates the maximum table space used in inflate tree 7 | construction over all possible Huffman codes 8 | 9 | fitblk.c 10 | compress just enough input to nearly fill a requested output size 11 | - zlib isn't designed to do this, but fitblk does it anyway 12 | 13 | gun.c 14 | uncompress a gzip file 15 | - illustrates the use of inflateBack() for high speed file-to-file 16 | decompression using call-back functions 17 | - is approximately twice as fast as gzip -d 18 | - also provides Unix uncompress functionality, again twice as fast 19 | 20 | gzappend.c 21 | append to a gzip file 22 | - illustrates the use of the Z_BLOCK flush parameter for inflate() 23 | - illustrates the use of deflatePrime() to start at any bit 24 | 25 | gzjoin.c 26 | join gzip files without recalculating the crc or recompressing 27 | - illustrates the use of the Z_BLOCK flush parameter for inflate() 28 | - illustrates the use of crc32_combine() 29 | 30 | gzlog.c 31 | gzlog.h 32 | efficiently and robustly maintain a message log file in gzip format 33 | - illustrates use of raw deflate, Z_PARTIAL_FLUSH, deflatePrime(), 34 | and deflateSetDictionary() 35 | - illustrates use of a gzip header extra field 36 | 37 | zlib_how.html 38 | painfully comprehensive description of zpipe.c (see below) 39 | - describes in excruciating detail the use of deflate() and inflate() 40 | 41 | zpipe.c 42 | reads and writes zlib streams from stdin to stdout 43 | - illustrates the proper use of deflate() and inflate() 44 | - deeply commented in zlib_how.html (see above) 45 | 46 | zran.c 47 | index a zlib or gzip stream and randomly access it 48 | - illustrates the use of Z_BLOCK, inflatePrime(), and 49 | inflateSetDictionary() to provide random access 50 | -------------------------------------------------------------------------------- /Client/zlib/contrib/puff/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-O 2 | 3 | puff: puff.o pufftest.o 4 | 5 | puff.o: puff.h 6 | 7 | pufftest.o: puff.h 8 | 9 | test: puff 10 | puff zeros.raw 11 | 12 | puft: puff.c puff.h pufftest.o 13 | cc -fprofile-arcs -ftest-coverage -o puft puff.c pufftest.o 14 | 15 | # puff full coverage test (should say 100%) 16 | cov: puft 17 | @rm -f *.gcov *.gcda 18 | @puft -w zeros.raw 2>&1 | cat > /dev/null 19 | @echo '04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 20 | @echo '00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 21 | @echo '00 00 00 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 254 22 | @echo '00 01 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 23 | @echo '01 01 00 fe ff 0a' | xxd -r -p | puft -f 2>&1 | cat > /dev/null 24 | @echo '02 7e ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 25 | @echo '02' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 26 | @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 27 | @echo '04 80 49 92 24 49 92 24 71 ff ff 93 11 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 249 28 | @echo '04 c0 81 08 00 00 00 00 20 7f eb 0b 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 29 | @echo '0b 00 00' | xxd -r -p | puft -f 2>&1 | cat > /dev/null 30 | @echo '1a 07' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 31 | @echo '0c c0 81 00 00 00 00 00 90 ff 6b 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 245 32 | @puft -f zeros.raw 2>&1 | cat > /dev/null 33 | @echo 'fc 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 253 34 | @echo '04 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 252 35 | @echo '04 00 24 49' | xxd -r -p | puft 2> /dev/null || test $$? -eq 251 36 | @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 84' | xxd -r -p | puft 2> /dev/null || test $$? -eq 248 37 | @echo '04 00 24 e9 ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 250 38 | @echo '04 00 24 e9 ff 6d' | xxd -r -p | puft 2> /dev/null || test $$? -eq 247 39 | @gcov -n puff.c 40 | 41 | clean: 42 | rm -f puff puft *.o *.gc* 43 | -------------------------------------------------------------------------------- /Client/zlib/amiga/Makefile.sas: -------------------------------------------------------------------------------- 1 | # SMakefile for zlib 2 | # Modified from the standard UNIX Makefile Copyright Jean-loup Gailly 3 | # Osma Ahvenlampi 4 | # Amiga, SAS/C 6.56 & Smake 5 | 6 | CC=sc 7 | CFLAGS=OPT 8 | #CFLAGS=OPT CPU=68030 9 | #CFLAGS=DEBUG=LINE 10 | LDFLAGS=LIB z.lib 11 | 12 | SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \ 13 | NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \ 14 | DEF=POSTINC 15 | 16 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 17 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 18 | 19 | TEST_OBJS = example.o minigzip.o 20 | 21 | all: SCOPTIONS example minigzip 22 | 23 | check: test 24 | test: all 25 | example 26 | echo hello world | minigzip | minigzip -d 27 | 28 | install: z.lib 29 | copy clone zlib.h zconf.h INCLUDE: 30 | copy clone z.lib LIB: 31 | 32 | z.lib: $(OBJS) 33 | oml z.lib r $(OBJS) 34 | 35 | example: example.o z.lib 36 | $(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS) 37 | 38 | minigzip: minigzip.o z.lib 39 | $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS) 40 | 41 | mostlyclean: clean 42 | clean: 43 | -delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS 44 | 45 | SCOPTIONS: Makefile.sas 46 | copy to $@ STORED or TABLE or LEN or DONE 28 | STORED -> TYPE 29 | TABLE -> LENLENS -> CODELENS -> LEN 30 | Read deflate codes: 31 | LEN -> LEN or TYPE 32 | */ 33 | 34 | /* state maintained between inflate() calls. Approximately 7K bytes. */ 35 | struct inflate_state { 36 | /* sliding window */ 37 | unsigned char FAR *window; /* allocated sliding window, if needed */ 38 | /* dynamic table building */ 39 | unsigned ncode; /* number of code length code lengths */ 40 | unsigned nlen; /* number of length code lengths */ 41 | unsigned ndist; /* number of distance code lengths */ 42 | unsigned have; /* number of code lengths in lens[] */ 43 | code FAR *next; /* next available space in codes[] */ 44 | unsigned short lens[320]; /* temporary storage for code lengths */ 45 | unsigned short work[288]; /* work area for code table building */ 46 | code codes[ENOUGH]; /* space for code tables */ 47 | }; 48 | -------------------------------------------------------------------------------- /Client/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (Bytef*)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /Client/zlib/INDEX: -------------------------------------------------------------------------------- 1 | CMakeLists.txt cmake build file 2 | ChangeLog history of changes 3 | FAQ Frequently Asked Questions about zlib 4 | INDEX this file 5 | Makefile dummy Makefile that tells you to ./configure 6 | Makefile.in template for Unix Makefile 7 | README guess what 8 | configure configure script for Unix 9 | make_vms.com makefile for VMS 10 | test/example.c zlib usages examples for build testing 11 | test/minigzip.c minimal gzip-like functionality for build testing 12 | test/infcover.c inf*.c code coverage for build coverage testing 13 | treebuild.xml XML description of source file dependencies 14 | zconf.h.cmakein zconf.h template for cmake 15 | zconf.h.in zconf.h template for configure 16 | zlib.3 Man page for zlib 17 | zlib.3.pdf Man page in PDF format 18 | zlib.map Linux symbol information 19 | zlib.pc.in Template for pkg-config descriptor 20 | zlib.pc.cmakein zlib.pc template for cmake 21 | zlib2ansi perl script to convert source files for C++ compilation 22 | 23 | amiga/ makefiles for Amiga SAS C 24 | as400/ makefiles for AS/400 25 | doc/ documentation for formats and algorithms 26 | msdos/ makefiles for MSDOS 27 | nintendods/ makefile for Nintendo DS 28 | old/ makefiles for various architectures and zlib documentation 29 | files that have not yet been updated for zlib 1.2.x 30 | qnx/ makefiles for QNX 31 | watcom/ makefiles for OpenWatcom 32 | win32/ makefiles for Windows 33 | 34 | zlib public header files (required for library use): 35 | zconf.h 36 | zlib.h 37 | 38 | private source files used to build the zlib library: 39 | adler32.c 40 | compress.c 41 | crc32.c 42 | crc32.h 43 | deflate.c 44 | deflate.h 45 | gzclose.c 46 | gzguts.h 47 | gzlib.c 48 | gzread.c 49 | gzwrite.c 50 | infback.c 51 | inffast.c 52 | inffast.h 53 | inffixed.h 54 | inflate.c 55 | inflate.h 56 | inftrees.c 57 | inftrees.h 58 | trees.c 59 | trees.h 60 | uncompr.c 61 | zutil.c 62 | zutil.h 63 | 64 | source files for sample programs 65 | See examples/README.examples 66 | 67 | unsupported contributions by third parties 68 | See contrib/README.contrib 69 | -------------------------------------------------------------------------------- /Client/zlib/amiga/Makefile.pup: -------------------------------------------------------------------------------- 1 | # Amiga powerUP (TM) Makefile 2 | # makefile for libpng and SAS C V6.58/7.00 PPC compiler 3 | # Copyright (C) 1998 by Andreas R. Kleinert 4 | 5 | LIBNAME = libzip.a 6 | 7 | CC = scppc 8 | CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \ 9 | OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER 10 | AR = ppc-amigaos-ar cr 11 | RANLIB = ppc-amigaos-ranlib 12 | LD = ppc-amigaos-ld -r 13 | LDFLAGS = -o 14 | LDLIBS = LIB:scppc.a LIB:end.o 15 | RM = delete quiet 16 | 17 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 18 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 19 | 20 | TEST_OBJS = example.o minigzip.o 21 | 22 | all: example minigzip 23 | 24 | check: test 25 | test: all 26 | example 27 | echo hello world | minigzip | minigzip -d 28 | 29 | $(LIBNAME): $(OBJS) 30 | $(AR) $@ $(OBJS) 31 | -$(RANLIB) $@ 32 | 33 | example: example.o $(LIBNAME) 34 | $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) 35 | 36 | minigzip: minigzip.o $(LIBNAME) 37 | $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) 38 | 39 | mostlyclean: clean 40 | clean: 41 | $(RM) *.o example minigzip $(LIBNAME) foo.gz 42 | 43 | zip: 44 | zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \ 45 | descrip.mms *.[ch] 46 | 47 | tgz: 48 | cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \ 49 | zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch] 50 | 51 | # DO NOT DELETE THIS LINE -- make depend depends on it. 52 | 53 | adler32.o: zlib.h zconf.h 54 | compress.o: zlib.h zconf.h 55 | crc32.o: crc32.h zlib.h zconf.h 56 | deflate.o: deflate.h zutil.h zlib.h zconf.h 57 | example.o: zlib.h zconf.h 58 | gzclose.o: zlib.h zconf.h gzguts.h 59 | gzlib.o: zlib.h zconf.h gzguts.h 60 | gzread.o: zlib.h zconf.h gzguts.h 61 | gzwrite.o: zlib.h zconf.h gzguts.h 62 | inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 63 | inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 64 | infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 65 | inftrees.o: zutil.h zlib.h zconf.h inftrees.h 66 | minigzip.o: zlib.h zconf.h 67 | trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 68 | uncompr.o: zlib.h zconf.h 69 | zutil.o: zutil.h zlib.h zconf.h 70 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c1f6a2e3-5da5-4955-8653-310d3efe05a9} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {c2aaffdc-2c95-4d6f-8466-4bec5890af2c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {c274fe07-05f2-461c-964b-f6341e4e7eb5} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | -------------------------------------------------------------------------------- /Client/zlib/contrib/ada/readme.txt: -------------------------------------------------------------------------------- 1 | ZLib for Ada thick binding (ZLib.Ada) 2 | Release 1.3 3 | 4 | ZLib.Ada is a thick binding interface to the popular ZLib data 5 | compression library, available at http://www.gzip.org/zlib/. 6 | It provides Ada-style access to the ZLib C library. 7 | 8 | 9 | Here are the main changes since ZLib.Ada 1.2: 10 | 11 | - Attension: ZLib.Read generic routine have a initialization requirement 12 | for Read_Last parameter now. It is a bit incompartible with previous version, 13 | but extends functionality, we could use new parameters Allow_Read_Some and 14 | Flush now. 15 | 16 | - Added Is_Open routines to ZLib and ZLib.Streams packages. 17 | 18 | - Add pragma Assert to check Stream_Element is 8 bit. 19 | 20 | - Fix extraction to buffer with exact known decompressed size. Error reported by 21 | Steve Sangwine. 22 | 23 | - Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits 24 | computers. Patch provided by Pascal Obry. 25 | 26 | - Add Status_Error exception definition. 27 | 28 | - Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit. 29 | 30 | 31 | How to build ZLib.Ada under GNAT 32 | 33 | You should have the ZLib library already build on your computer, before 34 | building ZLib.Ada. Make the directory of ZLib.Ada sources current and 35 | issue the command: 36 | 37 | gnatmake test -largs -L -lz 38 | 39 | Or use the GNAT project file build for GNAT 3.15 or later: 40 | 41 | gnatmake -Pzlib.gpr -L 42 | 43 | 44 | How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2 45 | 46 | 1. Make a project with all *.ads and *.adb files from the distribution. 47 | 2. Build the libz.a library from the ZLib C sources. 48 | 3. Rename libz.a to z.lib. 49 | 4. Add the library z.lib to the project. 50 | 5. Add the libc.lib library from the ObjectAda distribution to the project. 51 | 6. Build the executable using test.adb as a main procedure. 52 | 53 | 54 | How to use ZLib.Ada 55 | 56 | The source files test.adb and read.adb are small demo programs that show 57 | the main functionality of ZLib.Ada. 58 | 59 | The routines from the package specifications are commented. 60 | 61 | 62 | Homepage: http://zlib-ada.sourceforge.net/ 63 | Author: Dmitriy Anisimkov 64 | 65 | Contributors: Pascal Obry , Steve Sangwine 66 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/readme.txt: -------------------------------------------------------------------------------- 1 | Building instructions for the DLL versions of Zlib 1.2.7 2 | ======================================================== 3 | 4 | This directory contains projects that build zlib and minizip using 5 | Microsoft Visual C++ 9.0/10.0. 6 | 7 | You don't need to build these projects yourself. You can download the 8 | binaries from: 9 | http://www.winimage.com/zLibDll 10 | 11 | More information can be found at this site. 12 | 13 | 14 | 15 | 16 | 17 | Build instructions for Visual Studio 2008 (32 bits or 64 bits) 18 | -------------------------------------------------------------- 19 | - Uncompress current zlib, including all contrib/* files 20 | - Compile assembly code (with Visual Studio Command Prompt) by running: 21 | bld_ml64.bat (in contrib\masmx64) 22 | bld_ml32.bat (in contrib\masmx86) 23 | - Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008 24 | - Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32" 25 | 26 | Build instructions for Visual Studio 2010 (32 bits or 64 bits) 27 | -------------------------------------------------------------- 28 | - Uncompress current zlib, including all contrib/* files 29 | - Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010 30 | 31 | 32 | Important 33 | --------- 34 | - To use zlibwapi.dll in your application, you must define the 35 | macro ZLIB_WINAPI when compiling your application's source files. 36 | 37 | 38 | Additional notes 39 | ---------------- 40 | - This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built 41 | by Gilles Vollant from the zlib 1.1.x sources, and distributed at 42 | http://www.winimage.com/zLibDll 43 | It uses the WINAPI calling convention for the exported functions, and 44 | includes the minizip functionality. If your application needs that 45 | particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll. 46 | 47 | - The new DLL was renamed because there exist several incompatible 48 | versions of zlib.dll on the Internet. 49 | 50 | - There is also an official DLL build of zlib, named zlib1.dll. This one 51 | is exporting the functions using the CDECL convention. See the file 52 | win32\DLL_FAQ.txt found in this zlib distribution. 53 | 54 | - There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol 55 | has a slightly different effect. To avoid compatibility problems, do 56 | not define it here. 57 | 58 | 59 | Gilles Vollant 60 | info@winimage.com 61 | -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains a .Net wrapper class library for the ZLib1.dll 2 | 3 | The wrapper includes support for inflating/deflating memory buffers, 4 | .Net streaming wrappers for the gz streams part of zlib, and wrappers 5 | for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples. 6 | 7 | Directory structure: 8 | -------------------- 9 | 10 | LICENSE_1_0.txt - License file. 11 | readme.txt - This file. 12 | DotZLib.chm - Class library documentation 13 | DotZLib.build - NAnt build file 14 | DotZLib.sln - Microsoft Visual Studio 2003 solution file 15 | 16 | DotZLib\*.cs - Source files for the class library 17 | 18 | Unit tests: 19 | ----------- 20 | The file DotZLib/UnitTests.cs contains unit tests for use with NUnit 2.1 or higher. 21 | To include unit tests in the build, define nunit before building. 22 | 23 | 24 | Build instructions: 25 | ------------------- 26 | 27 | 1. Using Visual Studio.Net 2003: 28 | Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll) 29 | will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on 30 | you are building the release or debug version of the library. Check 31 | DotZLib/UnitTests.cs for instructions on how to include unit tests in the 32 | build. 33 | 34 | 2. Using NAnt: 35 | Open a command prompt with access to the build environment and run nant 36 | in the same directory as the DotZLib.build file. 37 | You can define 2 properties on the nant command-line to control the build: 38 | debug={true|false} to toggle between release/debug builds (default=true). 39 | nunit={true|false} to include or esclude unit tests (default=true). 40 | Also the target clean will remove binaries. 41 | Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release 42 | or ./DotZLib/bin/debug, depending on whether you are building the release 43 | or debug version of the library. 44 | 45 | Examples: 46 | nant -D:debug=false -D:nunit=false 47 | will build a release mode version of the library without unit tests. 48 | nant 49 | will build a debug version of the library with unit tests 50 | nant clean 51 | will remove all previously built files. 52 | 53 | 54 | --------------------------------- 55 | Copyright (c) Henrik Ravn 2004 56 | 57 | Use, modification and distribution are subject to the Boost Software License, Version 1.0. 58 | (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 59 | -------------------------------------------------------------------------------- /Client/Client.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Client/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | // 9 | [assembly: AssemblyTitle("DotZLib")] 10 | [assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Henrik Ravn")] 13 | [assembly: AssemblyProduct("")] 14 | [assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Revision and Build Numbers 27 | // by using the '*' as shown below: 28 | 29 | [assembly: AssemblyVersion("1.0.*")] 30 | 31 | // 32 | // In order to sign your assembly you must specify a key to use. Refer to the 33 | // Microsoft .NET Framework documentation for more information on assembly signing. 34 | // 35 | // Use the attributes below to control which key is used for signing. 36 | // 37 | // Notes: 38 | // (*) If no key is specified, the assembly is not signed. 39 | // (*) KeyName refers to a key that has been installed in the Crypto Service 40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains 41 | // a key. 42 | // (*) If the KeyFile and the KeyName values are both specified, the 43 | // following processing occurs: 44 | // (1) If the KeyName can be found in the CSP, that key is used. 45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key 46 | // in the KeyFile is installed into the CSP and used. 47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. 48 | // When specifying the KeyFile, the location of the KeyFile should be 49 | // relative to the project output directory which is 50 | // %Project Directory%\obj\. For example, if your KeyFile is 51 | // located in the project directory, you would specify the AssemblyKeyFile 52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] 53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework 54 | // documentation for more information on this. 55 | // 56 | [assembly: AssemblyDelaySign(false)] 57 | [assembly: AssemblyKeyFile("")] 58 | [assembly: AssemblyKeyName("")] 59 | -------------------------------------------------------------------------------- /Client/zlib/contrib/delphi/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Overview 3 | ======== 4 | 5 | This directory contains an update to the ZLib interface unit, 6 | distributed by Borland as a Delphi supplemental component. 7 | 8 | The original ZLib unit is Copyright (c) 1997,99 Borland Corp., 9 | and is based on zlib version 1.0.4. There are a series of bugs 10 | and security problems associated with that old zlib version, and 11 | we recommend the users to update their ZLib unit. 12 | 13 | 14 | Summary of modifications 15 | ======================== 16 | 17 | - Improved makefile, adapted to zlib version 1.2.1. 18 | 19 | - Some field types from TZStreamRec are changed from Integer to 20 | Longint, for consistency with the zlib.h header, and for 64-bit 21 | readiness. 22 | 23 | - The zlib_version constant is updated. 24 | 25 | - The new Z_RLE strategy has its corresponding symbolic constant. 26 | 27 | - The allocation and deallocation functions and function types 28 | (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl, 29 | and _malloc and _free are added as C RTL stubs. As a result, 30 | the original C sources of zlib can be compiled out of the box, 31 | and linked to the ZLib unit. 32 | 33 | 34 | Suggestions for improvements 35 | ============================ 36 | 37 | Currently, the ZLib unit provides only a limited wrapper around 38 | the zlib library, and much of the original zlib functionality is 39 | missing. Handling compressed file formats like ZIP/GZIP or PNG 40 | cannot be implemented without having this functionality. 41 | Applications that handle these formats are either using their own, 42 | duplicated code, or not using the ZLib unit at all. 43 | 44 | Here are a few suggestions: 45 | 46 | - Checksum class wrappers around adler32() and crc32(), similar 47 | to the Java classes that implement the java.util.zip.Checksum 48 | interface. 49 | 50 | - The ability to read and write raw deflate streams, without the 51 | zlib stream header and trailer. Raw deflate streams are used 52 | in the ZIP file format. 53 | 54 | - The ability to read and write gzip streams, used in the GZIP 55 | file format, and normally produced by the gzip program. 56 | 57 | - The ability to select a different compression strategy, useful 58 | to PNG and MNG image compression, and to multimedia compression 59 | in general. Besides the compression level 60 | 61 | TCompressionLevel = (clNone, clFastest, clDefault, clMax); 62 | 63 | which, in fact, could have used the 'z' prefix and avoided 64 | TColor-like symbols 65 | 66 | TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax); 67 | 68 | there could be a compression strategy 69 | 70 | TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle); 71 | 72 | - ZIP and GZIP stream handling via TStreams. 73 | 74 | 75 | -- 76 | Cosmin Truta 77 | -------------------------------------------------------------------------------- /Client/zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (Bytef*)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 79 | (sourceLen >> 25) + 13; 80 | } 81 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {174213f6-7f66-4ae8-a3a8-a1e0a1e6ffdd} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | Source Files 14 | 15 | 16 | Source Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | 68 | 69 | Source Files 70 | 71 | 72 | 73 | 74 | Source Files 75 | 76 | 77 | -------------------------------------------------------------------------------- /Client/zlib/contrib/delphi/zlibd32.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # For use with Delphi and C++ Builder under Win32 3 | # Updated for zlib 1.2.x by Cosmin Truta 4 | 5 | # ------------ Borland C++ ------------ 6 | 7 | # This project uses the Delphi (fastcall/register) calling convention: 8 | LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl 9 | 10 | CC = bcc32 11 | LD = bcc32 12 | AR = tlib 13 | # do not use "-pr" in CFLAGS 14 | CFLAGS = -a -d -k- -O2 $(LOC) 15 | LDFLAGS = 16 | 17 | 18 | # variables 19 | ZLIB_LIB = zlib.lib 20 | 21 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 22 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 23 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 24 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 25 | 26 | 27 | # targets 28 | all: $(ZLIB_LIB) example.exe minigzip.exe 29 | 30 | .c.obj: 31 | $(CC) -c $(CFLAGS) $*.c 32 | 33 | adler32.obj: adler32.c zlib.h zconf.h 34 | 35 | compress.obj: compress.c zlib.h zconf.h 36 | 37 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 38 | 39 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 40 | 41 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 42 | 43 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 44 | 45 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 46 | 47 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 48 | 49 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 50 | inffast.h inffixed.h 51 | 52 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 53 | inffast.h 54 | 55 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 56 | inffast.h inffixed.h 57 | 58 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 59 | 60 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 61 | 62 | uncompr.obj: uncompr.c zlib.h zconf.h 63 | 64 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 65 | 66 | example.obj: test/example.c zlib.h zconf.h 67 | 68 | minigzip.obj: test/minigzip.c zlib.h zconf.h 69 | 70 | 71 | # For the sake of the old Borland make, 72 | # the command line is cut to fit in the MS-DOS 128 byte limit: 73 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 74 | -del $(ZLIB_LIB) 75 | $(AR) $(ZLIB_LIB) $(OBJP1) 76 | $(AR) $(ZLIB_LIB) $(OBJP2) 77 | 78 | 79 | # testing 80 | test: example.exe minigzip.exe 81 | example 82 | echo hello world | minigzip | minigzip -d 83 | 84 | example.exe: example.obj $(ZLIB_LIB) 85 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 86 | 87 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 88 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 89 | 90 | 91 | # cleanup 92 | clean: 93 | -del *.obj 94 | -del *.exe 95 | -del *.lib 96 | -del *.tds 97 | -del zlib.bak 98 | -del foo.gz 99 | 100 | -------------------------------------------------------------------------------- /Client/zlib/contrib/pascal/zlibd32.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # For use with Delphi and C++ Builder under Win32 3 | # Updated for zlib 1.2.x by Cosmin Truta 4 | 5 | # ------------ Borland C++ ------------ 6 | 7 | # This project uses the Delphi (fastcall/register) calling convention: 8 | LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl 9 | 10 | CC = bcc32 11 | LD = bcc32 12 | AR = tlib 13 | # do not use "-pr" in CFLAGS 14 | CFLAGS = -a -d -k- -O2 $(LOC) 15 | LDFLAGS = 16 | 17 | 18 | # variables 19 | ZLIB_LIB = zlib.lib 20 | 21 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 22 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 23 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 24 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 25 | 26 | 27 | # targets 28 | all: $(ZLIB_LIB) example.exe minigzip.exe 29 | 30 | .c.obj: 31 | $(CC) -c $(CFLAGS) $*.c 32 | 33 | adler32.obj: adler32.c zlib.h zconf.h 34 | 35 | compress.obj: compress.c zlib.h zconf.h 36 | 37 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 38 | 39 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 40 | 41 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 42 | 43 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 44 | 45 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 46 | 47 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 48 | 49 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 50 | inffast.h inffixed.h 51 | 52 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 53 | inffast.h 54 | 55 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 56 | inffast.h inffixed.h 57 | 58 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 59 | 60 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 61 | 62 | uncompr.obj: uncompr.c zlib.h zconf.h 63 | 64 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 65 | 66 | example.obj: test/example.c zlib.h zconf.h 67 | 68 | minigzip.obj: test/minigzip.c zlib.h zconf.h 69 | 70 | 71 | # For the sake of the old Borland make, 72 | # the command line is cut to fit in the MS-DOS 128 byte limit: 73 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 74 | -del $(ZLIB_LIB) 75 | $(AR) $(ZLIB_LIB) $(OBJP1) 76 | $(AR) $(ZLIB_LIB) $(OBJP2) 77 | 78 | 79 | # testing 80 | test: example.exe minigzip.exe 81 | example 82 | echo hello world | minigzip | minigzip -d 83 | 84 | example.exe: example.obj $(ZLIB_LIB) 85 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 86 | 87 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 88 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 89 | 90 | 91 | # cleanup 92 | clean: 93 | -del *.obj 94 | -del *.exe 95 | -del *.lib 96 | -del *.tds 97 | -del zlib.bak 98 | -del foo.gz 99 | 100 | -------------------------------------------------------------------------------- /Client/zlib/contrib/infback9/inftree9.h: -------------------------------------------------------------------------------- 1 | /* inftree9.h -- header to use inftree9.c 2 | * Copyright (C) 1995-2008 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 100eeeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1446, which is the sum of 852 for literal/length codes and 594 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 32 6 15" for distance codes returns 594. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in infback9.c. If the root table size is changed, 47 | then these maximum sizes would be need to be recalculated and updated. */ 48 | #define ENOUGH_LENS 852 49 | #define ENOUGH_DISTS 594 50 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 51 | 52 | /* Type of code to build for inflate_table9() */ 53 | typedef enum { 54 | CODES, 55 | LENS, 56 | DISTS 57 | } codetype; 58 | 59 | extern int inflate_table9 OF((codetype type, unsigned short FAR *lens, 60 | unsigned codes, code FAR * FAR *table, 61 | unsigned FAR *bits, unsigned short FAR *work)); 62 | -------------------------------------------------------------------------------- /Client/zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /Client/zlib/msdos/Makefile.dj2: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.dj2; make test -fmakefile.dj2 8 | # 9 | # To install libz.a, zconf.h and zlib.h in the djgpp directories, type: 10 | # 11 | # make install -fmakefile.dj2 12 | # 13 | # after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as 14 | # in the sample below if the pattern of the DJGPP distribution is to 15 | # be followed. Remember that, while 'es around <=> are ignored in 16 | # makefiles, they are *not* in batch files or in djgpp.env. 17 | # - - - - - 18 | # [make] 19 | # INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include 20 | # LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib 21 | # BUTT=-m486 22 | # - - - - - 23 | # Alternately, these variables may be defined below, overriding the values 24 | # in djgpp.env, as 25 | # INCLUDE_PATH=c:\usr\include 26 | # LIBRARY_PATH=c:\usr\lib 27 | 28 | CC=gcc 29 | 30 | #CFLAGS=-MMD -O 31 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 32 | #CFLAGS=-MMD -g -DDEBUG 33 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 34 | -Wstrict-prototypes -Wmissing-prototypes 35 | 36 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 37 | CP=copy /Y 38 | # If gnu install.exe is available, replace $(CP) with ginstall. 39 | INSTALL=$(CP) 40 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 41 | RM=del 42 | LDLIBS=-L. -lz 43 | LD=$(CC) -s -o 44 | LDSHARED=$(CC) 45 | 46 | INCL=zlib.h zconf.h 47 | LIBS=libz.a 48 | 49 | AR=ar rcs 50 | 51 | prefix=/usr/local 52 | exec_prefix = $(prefix) 53 | 54 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 55 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 56 | 57 | OBJA = 58 | # to use the asm code: make OBJA=match.o 59 | 60 | TEST_OBJS = example.o minigzip.o 61 | 62 | all: example.exe minigzip.exe 63 | 64 | check: test 65 | test: all 66 | ./example 67 | echo hello world | .\minigzip | .\minigzip -d 68 | 69 | %.o : %.c 70 | $(CC) $(CFLAGS) -c $< -o $@ 71 | 72 | libz.a: $(OBJS) $(OBJA) 73 | $(AR) $@ $(OBJS) $(OBJA) 74 | 75 | %.exe : %.o $(LIBS) 76 | $(LD) $@ $< $(LDLIBS) 77 | 78 | # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . 79 | 80 | .PHONY : uninstall clean 81 | 82 | install: $(INCL) $(LIBS) 83 | -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH) 84 | -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH) 85 | $(INSTALL) zlib.h $(INCLUDE_PATH) 86 | $(INSTALL) zconf.h $(INCLUDE_PATH) 87 | $(INSTALL) libz.a $(LIBRARY_PATH) 88 | 89 | uninstall: 90 | $(RM) $(INCLUDE_PATH)\zlib.h 91 | $(RM) $(INCLUDE_PATH)\zconf.h 92 | $(RM) $(LIBRARY_PATH)\libz.a 93 | 94 | clean: 95 | $(RM) *.d 96 | $(RM) *.o 97 | $(RM) *.exe 98 | $(RM) libz.a 99 | $(RM) foo.gz 100 | 101 | DEPS := $(wildcard *.d) 102 | ifneq ($(DEPS),) 103 | include $(DEPS) 104 | endif 105 | -------------------------------------------------------------------------------- /Client/zlib/contrib/iostream/zfstream.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef zfstream_h 3 | #define zfstream_h 4 | 5 | #include 6 | #include "zlib.h" 7 | 8 | class gzfilebuf : public streambuf { 9 | 10 | public: 11 | 12 | gzfilebuf( ); 13 | virtual ~gzfilebuf(); 14 | 15 | gzfilebuf *open( const char *name, int io_mode ); 16 | gzfilebuf *attach( int file_descriptor, int io_mode ); 17 | gzfilebuf *close(); 18 | 19 | int setcompressionlevel( int comp_level ); 20 | int setcompressionstrategy( int comp_strategy ); 21 | 22 | inline int is_open() const { return (file !=NULL); } 23 | 24 | virtual streampos seekoff( streamoff, ios::seek_dir, int ); 25 | 26 | virtual int sync(); 27 | 28 | protected: 29 | 30 | virtual int underflow(); 31 | virtual int overflow( int = EOF ); 32 | 33 | private: 34 | 35 | gzFile file; 36 | short mode; 37 | short own_file_descriptor; 38 | 39 | int flushbuf(); 40 | int fillbuf(); 41 | 42 | }; 43 | 44 | class gzfilestream_common : virtual public ios { 45 | 46 | friend class gzifstream; 47 | friend class gzofstream; 48 | friend gzofstream &setcompressionlevel( gzofstream &, int ); 49 | friend gzofstream &setcompressionstrategy( gzofstream &, int ); 50 | 51 | public: 52 | virtual ~gzfilestream_common(); 53 | 54 | void attach( int fd, int io_mode ); 55 | void open( const char *name, int io_mode ); 56 | void close(); 57 | 58 | protected: 59 | gzfilestream_common(); 60 | 61 | private: 62 | gzfilebuf *rdbuf(); 63 | 64 | gzfilebuf buffer; 65 | 66 | }; 67 | 68 | class gzifstream : public gzfilestream_common, public istream { 69 | 70 | public: 71 | 72 | gzifstream(); 73 | gzifstream( const char *name, int io_mode = ios::in ); 74 | gzifstream( int fd, int io_mode = ios::in ); 75 | 76 | virtual ~gzifstream(); 77 | 78 | }; 79 | 80 | class gzofstream : public gzfilestream_common, public ostream { 81 | 82 | public: 83 | 84 | gzofstream(); 85 | gzofstream( const char *name, int io_mode = ios::out ); 86 | gzofstream( int fd, int io_mode = ios::out ); 87 | 88 | virtual ~gzofstream(); 89 | 90 | }; 91 | 92 | template class gzomanip { 93 | friend gzofstream &operator<<(gzofstream &, const gzomanip &); 94 | public: 95 | gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { } 96 | private: 97 | gzofstream &(*func)(gzofstream &, T); 98 | T val; 99 | }; 100 | 101 | template gzofstream &operator<<(gzofstream &s, const gzomanip &m) 102 | { 103 | return (*m.func)(s, m.val); 104 | } 105 | 106 | inline gzofstream &setcompressionlevel( gzofstream &s, int l ) 107 | { 108 | (s.rdbuf())->setcompressionlevel(l); 109 | return s; 110 | } 111 | 112 | inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) 113 | { 114 | (s.rdbuf())->setcompressionstrategy(l); 115 | return s; 116 | } 117 | 118 | inline gzomanip setcompressionlevel(int l) 119 | { 120 | return gzomanip(&setcompressionlevel,l); 121 | } 122 | 123 | inline gzomanip setcompressionstrategy(int l) 124 | { 125 | return gzomanip(&setcompressionstrategy,l); 126 | } 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /Client/zlib/win32/Makefile.bor: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Borland C++ for Win32 3 | # 4 | # Usage: 5 | # make -f win32/Makefile.bor 6 | # make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj 7 | 8 | # ------------ Borland C++ ------------ 9 | 10 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 11 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or 12 | # added to the declaration of LOC here: 13 | LOC = $(LOCAL_ZLIB) 14 | 15 | CC = bcc32 16 | AS = bcc32 17 | LD = bcc32 18 | AR = tlib 19 | CFLAGS = -a -d -k- -O2 $(LOC) 20 | ASFLAGS = $(LOC) 21 | LDFLAGS = $(LOC) 22 | 23 | 24 | # variables 25 | ZLIB_LIB = zlib.lib 26 | 27 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 28 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 29 | #OBJA = 30 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 31 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 32 | #OBJPA= 33 | 34 | 35 | # targets 36 | all: $(ZLIB_LIB) example.exe minigzip.exe 37 | 38 | .c.obj: 39 | $(CC) -c $(CFLAGS) $< 40 | 41 | .asm.obj: 42 | $(AS) -c $(ASFLAGS) $< 43 | 44 | adler32.obj: adler32.c zlib.h zconf.h 45 | 46 | compress.obj: compress.c zlib.h zconf.h 47 | 48 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 49 | 50 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 51 | 52 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 53 | 54 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 55 | 56 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 57 | 58 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 59 | 60 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 61 | inffast.h inffixed.h 62 | 63 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 64 | inffast.h 65 | 66 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 67 | inffast.h inffixed.h 68 | 69 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 70 | 71 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 72 | 73 | uncompr.obj: uncompr.c zlib.h zconf.h 74 | 75 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 76 | 77 | example.obj: test/example.c zlib.h zconf.h 78 | 79 | minigzip.obj: test/minigzip.c zlib.h zconf.h 80 | 81 | 82 | # For the sake of the old Borland make, 83 | # the command line is cut to fit in the MS-DOS 128 byte limit: 84 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) 85 | -del $(ZLIB_LIB) 86 | $(AR) $(ZLIB_LIB) $(OBJP1) 87 | $(AR) $(ZLIB_LIB) $(OBJP2) 88 | $(AR) $(ZLIB_LIB) $(OBJPA) 89 | 90 | 91 | # testing 92 | test: example.exe minigzip.exe 93 | example 94 | echo hello world | minigzip | minigzip -d 95 | 96 | example.exe: example.obj $(ZLIB_LIB) 97 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 98 | 99 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 100 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 101 | 102 | 103 | # cleanup 104 | clean: 105 | -del $(ZLIB_LIB) 106 | -del *.obj 107 | -del *.exe 108 | -del *.tds 109 | -del zlib.bak 110 | -del foo.gz 111 | -------------------------------------------------------------------------------- /Client/zlib/msdos/Makefile.tc: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Turbo C 2.01, Turbo C++ 1.01 3 | # Last updated: 15-Mar-2003 4 | 5 | # To use, do "make -fmakefile.tc" 6 | # To compile in small model, set below: MODEL=s 7 | 8 | # WARNING: the small model is supported but only for small values of 9 | # MAX_WBITS and MAX_MEM_LEVEL. For example: 10 | # -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 11 | # If you wish to reduce the memory requirements (default 256K for big 12 | # objects plus a few K), you can add to CFLAGS below: 13 | # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 14 | # See zconf.h for details about the memory requirements. 15 | 16 | # ------------ Turbo C 2.01, Turbo C++ 1.01 ------------ 17 | MODEL=l 18 | CC=tcc 19 | LD=tcc 20 | AR=tlib 21 | # CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 22 | CFLAGS=-O2 -G -Z -m$(MODEL) 23 | LDFLAGS=-m$(MODEL) -f- 24 | 25 | 26 | # variables 27 | ZLIB_LIB = zlib_$(MODEL).lib 28 | 29 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 30 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 31 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 32 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 33 | 34 | 35 | # targets 36 | all: $(ZLIB_LIB) example.exe minigzip.exe 37 | 38 | .c.obj: 39 | $(CC) -c $(CFLAGS) $*.c 40 | 41 | adler32.obj: adler32.c zlib.h zconf.h 42 | 43 | compress.obj: compress.c zlib.h zconf.h 44 | 45 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 46 | 47 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 48 | 49 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 50 | 51 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 52 | 53 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 54 | 55 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 56 | 57 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 58 | inffast.h inffixed.h 59 | 60 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 61 | inffast.h 62 | 63 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 64 | inffast.h inffixed.h 65 | 66 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 67 | 68 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 69 | 70 | uncompr.obj: uncompr.c zlib.h zconf.h 71 | 72 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 73 | 74 | example.obj: test/example.c zlib.h zconf.h 75 | 76 | minigzip.obj: test/minigzip.c zlib.h zconf.h 77 | 78 | 79 | # the command line is cut to fit in the MS-DOS 128 byte limit: 80 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 81 | -del $(ZLIB_LIB) 82 | $(AR) $(ZLIB_LIB) $(OBJP1) 83 | $(AR) $(ZLIB_LIB) $(OBJP2) 84 | 85 | example.exe: example.obj $(ZLIB_LIB) 86 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 87 | 88 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 89 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 90 | 91 | test: example.exe minigzip.exe 92 | example 93 | echo hello world | minigzip | minigzip -d 94 | 95 | clean: 96 | -del *.obj 97 | -del *.lib 98 | -del *.exe 99 | -del zlib_*.bak 100 | -del foo.gz 101 | -------------------------------------------------------------------------------- /Client/zlib/contrib/pascal/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory contains a Pascal (Delphi, Kylix) interface to the 3 | zlib data compression library. 4 | 5 | 6 | Directory listing 7 | ================= 8 | 9 | zlibd32.mak makefile for Borland C++ 10 | example.pas usage example of zlib 11 | zlibpas.pas the Pascal interface to zlib 12 | readme.txt this file 13 | 14 | 15 | Compatibility notes 16 | =================== 17 | 18 | - Although the name "zlib" would have been more normal for the 19 | zlibpas unit, this name is already taken by Borland's ZLib unit. 20 | This is somehow unfortunate, because that unit is not a genuine 21 | interface to the full-fledged zlib functionality, but a suite of 22 | class wrappers around zlib streams. Other essential features, 23 | such as checksums, are missing. 24 | It would have been more appropriate for that unit to have a name 25 | like "ZStreams", or something similar. 26 | 27 | - The C and zlib-supplied types int, uInt, long, uLong, etc. are 28 | translated directly into Pascal types of similar sizes (Integer, 29 | LongInt, etc.), to avoid namespace pollution. In particular, 30 | there is no conversion of unsigned int into a Pascal unsigned 31 | integer. The Word type is non-portable and has the same size 32 | (16 bits) both in a 16-bit and in a 32-bit environment, unlike 33 | Integer. Even if there is a 32-bit Cardinal type, there is no 34 | real need for unsigned int in zlib under a 32-bit environment. 35 | 36 | - Except for the callbacks, the zlib function interfaces are 37 | assuming the calling convention normally used in Pascal 38 | (__pascal for DOS and Windows16, __fastcall for Windows32). 39 | Since the cdecl keyword is used, the old Turbo Pascal does 40 | not work with this interface. 41 | 42 | - The gz* function interfaces are not translated, to avoid 43 | interfacing problems with the C runtime library. Besides, 44 | gzprintf(gzFile file, const char *format, ...) 45 | cannot be translated into Pascal. 46 | 47 | 48 | Legal issues 49 | ============ 50 | 51 | The zlibpas interface is: 52 | Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler. 53 | Copyright (C) 1998 by Bob Dellaca. 54 | Copyright (C) 2003 by Cosmin Truta. 55 | 56 | The example program is: 57 | Copyright (C) 1995-2003 by Jean-loup Gailly. 58 | Copyright (C) 1998,1999,2000 by Jacques Nomssi Nzali. 59 | Copyright (C) 2003 by Cosmin Truta. 60 | 61 | This software is provided 'as-is', without any express or implied 62 | warranty. In no event will the author be held liable for any damages 63 | arising from the use of this software. 64 | 65 | Permission is granted to anyone to use this software for any purpose, 66 | including commercial applications, and to alter it and redistribute it 67 | freely, subject to the following restrictions: 68 | 69 | 1. The origin of this software must not be misrepresented; you must not 70 | claim that you wrote the original software. If you use this software 71 | in a product, an acknowledgment in the product documentation would be 72 | appreciated but is not required. 73 | 2. Altered source versions must be plainly marked as such, and must not be 74 | misrepresented as being the original software. 75 | 3. This notice may not be removed or altered from any source distribution. 76 | 77 | -------------------------------------------------------------------------------- /Client/zlib/contrib/puff/README: -------------------------------------------------------------------------------- 1 | Puff -- A Simple Inflate 2 | 3 Mar 2003 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | 6 | What this is -- 7 | 8 | puff.c provides the routine puff() to decompress the deflate data format. It 9 | does so more slowly than zlib, but the code is about one-fifth the size of the 10 | inflate code in zlib, and written to be very easy to read. 11 | 12 | Why I wrote this -- 13 | 14 | puff.c was written to document the deflate format unambiguously, by virtue of 15 | being working C code. It is meant to supplement RFC 1951, which formally 16 | describes the deflate format. I have received many questions on details of the 17 | deflate format, and I hope that reading this code will answer those questions. 18 | puff.c is heavily commented with details of the deflate format, especially 19 | those little nooks and cranies of the format that might not be obvious from a 20 | specification. 21 | 22 | puff.c may also be useful in applications where code size or memory usage is a 23 | very limited resource, and speed is not as important. 24 | 25 | How to use it -- 26 | 27 | Well, most likely you should just be reading puff.c and using zlib for actual 28 | applications, but if you must ... 29 | 30 | Include puff.h in your code, which provides this prototype: 31 | 32 | int puff(unsigned char *dest, /* pointer to destination pointer */ 33 | unsigned long *destlen, /* amount of output space */ 34 | unsigned char *source, /* pointer to source data pointer */ 35 | unsigned long *sourcelen); /* amount of input available */ 36 | 37 | Then you can call puff() to decompress a deflate stream that is in memory in 38 | its entirety at source, to a sufficiently sized block of memory for the 39 | decompressed data at dest. puff() is the only external symbol in puff.c The 40 | only C library functions that puff.c needs are setjmp() and longjmp(), which 41 | are used to simplify error checking in the code to improve readabilty. puff.c 42 | does no memory allocation, and uses less than 2K bytes off of the stack. 43 | 44 | If destlen is not enough space for the uncompressed data, then inflate will 45 | return an error without writing more than destlen bytes. Note that this means 46 | that in order to decompress the deflate data successfully, you need to know 47 | the size of the uncompressed data ahead of time. 48 | 49 | If needed, puff() can determine the size of the uncompressed data with no 50 | output space. This is done by passing dest equal to (unsigned char *)0. Then 51 | the initial value of *destlen is ignored and *destlen is set to the length of 52 | the uncompressed data. So if the size of the uncompressed data is not known, 53 | then two passes of puff() can be used--first to determine the size, and second 54 | to do the actual inflation after allocating the appropriate memory. Not 55 | pretty, but it works. (This is one of the reasons you should be using zlib.) 56 | 57 | The deflate format is self-terminating. If the deflate stream does not end 58 | in *sourcelen bytes, puff() will return an error without reading at or past 59 | endsource. 60 | 61 | On return, *sourcelen is updated to the amount of input data consumed, and 62 | *destlen is updated to the size of the uncompressed data. See the comments 63 | in puff.c for the possible return codes for puff(). 64 | -------------------------------------------------------------------------------- /Client/zlib/contrib/minizip/MiniZip64_info.txt: -------------------------------------------------------------------------------- 1 | MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson 2 | 3 | Introduction 4 | --------------------- 5 | MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0. 8 | All possible work was done for compatibility. 9 | 10 | 11 | Background 12 | --------------------- 13 | When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64 14 | support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ ) 15 | 16 | That was used as a starting point. And after that ZIP64 support was added to zip.c 17 | some refactoring and code cleanup was also done. 18 | 19 | 20 | Changed from MiniZip 1.0 to MiniZip 1.1 21 | --------------------------------------- 22 | * Added ZIP64 support for unzip ( by Even Rouault ) 23 | * Added ZIP64 support for zip ( by Mathias Svensson ) 24 | * Reverted some changed that Even Rouault did. 25 | * Bunch of patches received from Gulles Vollant that he received for MiniZip from various users. 26 | * Added unzip patch for BZIP Compression method (patch create by Daniel Borca) 27 | * Added BZIP Compress method for zip 28 | * Did some refactoring and code cleanup 29 | 30 | 31 | Credits 32 | 33 | Gilles Vollant - Original MiniZip author 34 | Even Rouault - ZIP64 unzip Support 35 | Daniel Borca - BZip Compression method support in unzip 36 | Mathias Svensson - ZIP64 zip support 37 | Mathias Svensson - BZip Compression method support in zip 38 | 39 | Resources 40 | 41 | ZipLayout http://result42.com/projects/ZipFileLayout 42 | Command line tool for Windows that shows the layout and information of the headers in a zip archive. 43 | Used when debugging and validating the creation of zip files using MiniZip64 44 | 45 | 46 | ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT 47 | Zip File specification 48 | 49 | 50 | Notes. 51 | * To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined. 52 | 53 | License 54 | ---------------------------------------------------------- 55 | Condition of use and distribution are the same than zlib : 56 | 57 | This software is provided 'as-is', without any express or implied 58 | warranty. In no event will the authors be held liable for any damages 59 | arising from the use of this software. 60 | 61 | Permission is granted to anyone to use this software for any purpose, 62 | including commercial applications, and to alter it and redistribute it 63 | freely, subject to the following restrictions: 64 | 65 | 1. The origin of this software must not be misrepresented; you must not 66 | claim that you wrote the original software. If you use this software 67 | in a product, an acknowledgment in the product documentation would be 68 | appreciated but is not required. 69 | 2. Altered source versions must be plainly marked as such, and must not be 70 | misrepresented as being the original software. 71 | 3. This notice may not be removed or altered from any source distribution. 72 | 73 | ---------------------------------------------------------- 74 | 75 | -------------------------------------------------------------------------------- /Client/zlib/contrib/blast/blast.h: -------------------------------------------------------------------------------- 1 | /* blast.h -- interface for blast.c 2 | Copyright (C) 2003 Mark Adler 3 | version 1.1, 16 Feb 2003 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the author be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Mark Adler madler@alumni.caltech.edu 22 | */ 23 | 24 | 25 | /* 26 | * blast() decompresses the PKWare Data Compression Library (DCL) compressed 27 | * format. It provides the same functionality as the explode() function in 28 | * that library. (Note: PKWare overused the "implode" verb, and the format 29 | * used by their library implode() function is completely different and 30 | * incompatible with the implode compression method supported by PKZIP.) 31 | */ 32 | 33 | 34 | typedef unsigned (*blast_in)(void *how, unsigned char **buf); 35 | typedef int (*blast_out)(void *how, unsigned char *buf, unsigned len); 36 | /* Definitions for input/output functions passed to blast(). See below for 37 | * what the provided functions need to do. 38 | */ 39 | 40 | 41 | int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow); 42 | /* Decompress input to output using the provided infun() and outfun() calls. 43 | * On success, the return value of blast() is zero. If there is an error in 44 | * the source data, i.e. it is not in the proper format, then a negative value 45 | * is returned. If there is not enough input available or there is not enough 46 | * output space, then a positive error is returned. 47 | * 48 | * The input function is invoked: len = infun(how, &buf), where buf is set by 49 | * infun() to point to the input buffer, and infun() returns the number of 50 | * available bytes there. If infun() returns zero, then blast() returns with 51 | * an input error. (blast() only asks for input if it needs it.) inhow is for 52 | * use by the application to pass an input descriptor to infun(), if desired. 53 | * 54 | * The output function is invoked: err = outfun(how, buf, len), where the bytes 55 | * to be written are buf[0..len-1]. If err is not zero, then blast() returns 56 | * with an output error. outfun() is always called with len <= 4096. outhow 57 | * is for use by the application to pass an output descriptor to outfun(), if 58 | * desired. 59 | * 60 | * The return codes are: 61 | * 62 | * 2: ran out of input before completing decompression 63 | * 1: output error before completing decompression 64 | * 0: successful decompression 65 | * -1: literal flag not zero or one 66 | * -2: dictionary size not in 4..6 67 | * -3: distance is too far back 68 | * 69 | * At the bottom of blast.c is an example program that uses blast() that can be 70 | * compiled to produce a command-line decompression filter by defining TEST. 71 | */ 72 | -------------------------------------------------------------------------------- /Client/zlib/msdos/Makefile.msc: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Microsoft C 5.1 or later 3 | # Last updated: 19-Mar-2003 4 | 5 | # To use, do "make makefile.msc" 6 | # To compile in small model, set below: MODEL=S 7 | 8 | # If you wish to reduce the memory requirements (default 256K for big 9 | # objects plus a few K), you can add to the LOC macro below: 10 | # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 11 | # See zconf.h for details about the memory requirements. 12 | 13 | # ------------- Microsoft C 5.1 and later ------------- 14 | 15 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 16 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added 17 | # to the declaration of LOC here: 18 | LOC = $(LOCAL_ZLIB) 19 | 20 | # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. 21 | CPU_TYP = 0 22 | 23 | # Memory model: one of S, M, C, L (small, medium, compact, large) 24 | MODEL=L 25 | 26 | CC=cl 27 | CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC) 28 | #-Ox generates bad code with MSC 5.1 29 | LIB_CFLAGS=-Zl $(CFLAGS) 30 | 31 | LD=link 32 | LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode 33 | # "/farcall/packcode" are only useful for `large code' memory models 34 | # but should be a "no-op" for small code models. 35 | 36 | 37 | # variables 38 | ZLIB_LIB = zlib_$(MODEL).lib 39 | 40 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 41 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 42 | 43 | 44 | # targets 45 | all: $(ZLIB_LIB) example.exe minigzip.exe 46 | 47 | .c.obj: 48 | $(CC) -c $(LIB_CFLAGS) $*.c 49 | 50 | adler32.obj: adler32.c zlib.h zconf.h 51 | 52 | compress.obj: compress.c zlib.h zconf.h 53 | 54 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 55 | 56 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 57 | 58 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 59 | 60 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 61 | 62 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 63 | 64 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 65 | 66 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 67 | inffast.h inffixed.h 68 | 69 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 70 | inffast.h 71 | 72 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 73 | inffast.h inffixed.h 74 | 75 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 76 | 77 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 78 | 79 | uncompr.obj: uncompr.c zlib.h zconf.h 80 | 81 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 82 | 83 | example.obj: test/example.c zlib.h zconf.h 84 | $(CC) -c $(CFLAGS) $*.c 85 | 86 | minigzip.obj: test/minigzip.c zlib.h zconf.h 87 | $(CC) -c $(CFLAGS) $*.c 88 | 89 | 90 | # the command line is cut to fit in the MS-DOS 128 byte limit: 91 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 92 | if exist $(ZLIB_LIB) del $(ZLIB_LIB) 93 | lib $(ZLIB_LIB) $(OBJ1); 94 | lib $(ZLIB_LIB) $(OBJ2); 95 | 96 | example.exe: example.obj $(ZLIB_LIB) 97 | $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB); 98 | 99 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 100 | $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB); 101 | 102 | test: example.exe minigzip.exe 103 | example 104 | echo hello world | minigzip | minigzip -d 105 | 106 | clean: 107 | -del *.obj 108 | -del *.lib 109 | -del *.exe 110 | -del *.map 111 | -del zlib_*.bak 112 | -del foo.gz 113 | -------------------------------------------------------------------------------- /Client/zlib/msdos/Makefile.bor: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Borland C++ 3 | # Last updated: 15-Mar-2003 4 | 5 | # To use, do "make -fmakefile.bor" 6 | # To compile in small model, set below: MODEL=s 7 | 8 | # WARNING: the small model is supported but only for small values of 9 | # MAX_WBITS and MAX_MEM_LEVEL. For example: 10 | # -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3 11 | # If you wish to reduce the memory requirements (default 256K for big 12 | # objects plus a few K), you can add to the LOC macro below: 13 | # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 14 | # See zconf.h for details about the memory requirements. 15 | 16 | # ------------ Turbo C++, Borland C++ ------------ 17 | 18 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 19 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added 20 | # to the declaration of LOC here: 21 | LOC = $(LOCAL_ZLIB) 22 | 23 | # type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. 24 | CPU_TYP = 0 25 | 26 | # memory model: one of s, m, c, l (small, medium, compact, large) 27 | MODEL=l 28 | 29 | # replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version 30 | CC=bcc 31 | LD=bcc 32 | AR=tlib 33 | 34 | # compiler flags 35 | # replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0 36 | CFLAGS=-O2 -Z -m$(MODEL) $(LOC) 37 | 38 | LDFLAGS=-m$(MODEL) -f- 39 | 40 | 41 | # variables 42 | ZLIB_LIB = zlib_$(MODEL).lib 43 | 44 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 45 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 46 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 47 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 48 | 49 | 50 | # targets 51 | all: $(ZLIB_LIB) example.exe minigzip.exe 52 | 53 | .c.obj: 54 | $(CC) -c $(CFLAGS) $*.c 55 | 56 | adler32.obj: adler32.c zlib.h zconf.h 57 | 58 | compress.obj: compress.c zlib.h zconf.h 59 | 60 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 61 | 62 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 63 | 64 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 65 | 66 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 67 | 68 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 69 | 70 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 71 | 72 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 73 | inffast.h inffixed.h 74 | 75 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 76 | inffast.h 77 | 78 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 79 | inffast.h inffixed.h 80 | 81 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 82 | 83 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 84 | 85 | uncompr.obj: uncompr.c zlib.h zconf.h 86 | 87 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 88 | 89 | example.obj: test/example.c zlib.h zconf.h 90 | 91 | minigzip.obj: test/minigzip.c zlib.h zconf.h 92 | 93 | 94 | # the command line is cut to fit in the MS-DOS 128 byte limit: 95 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 96 | -del $(ZLIB_LIB) 97 | $(AR) $(ZLIB_LIB) $(OBJP1) 98 | $(AR) $(ZLIB_LIB) $(OBJP2) 99 | 100 | example.exe: example.obj $(ZLIB_LIB) 101 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 102 | 103 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 104 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 105 | 106 | test: example.exe minigzip.exe 107 | example 108 | echo hello world | minigzip | minigzip -d 109 | 110 | clean: 111 | -del *.obj 112 | -del *.lib 113 | -del *.exe 114 | -del zlib_*.bak 115 | -del foo.gz 116 | -------------------------------------------------------------------------------- /Server/buffer.c: -------------------------------------------------------------------------------- 1 | #include "icmp_shell.h" 2 | #include "buffer.h" 3 | 4 | #ifndef WIN32 5 | #define CopyMemory memcpy 6 | #endif 7 | 8 | static ULONG buffer_realloc(buffer_context *, ULONG); 9 | 10 | void buffer_init(buffer_context *context) 11 | { 12 | //context->m_nSize = 0; 13 | // context->m_pBase = context->m_pPtr = 0; 14 | memset(context, 0, sizeof(buffer_context)); 15 | } 16 | 17 | void buffer_clean(buffer_context *pcontext) 18 | { 19 | pcontext->m_pPtr = pcontext->m_pBase; 20 | } 21 | 22 | ULONG buffer_get_length(buffer_context *context) 23 | { 24 | int nSize; 25 | if (context->m_pBase == NULL) 26 | return 0; 27 | nSize = context->m_pPtr - context->m_pBase; 28 | return nSize; 29 | } 30 | 31 | /* 32 | 在 data 为 NULL 只是预先分配内存 33 | */ 34 | ULONG buffer_write(buffer_context *context, LPBYTE data, ULONG size) 35 | { 36 | buffer_realloc(context, size + buffer_get_length(context)); 37 | if (data) // sincoder 改写,, 38 | { 39 | CopyMemory(context->m_pPtr, data, size); 40 | // Advance Pointer 41 | context->m_pPtr += size; 42 | } 43 | return size; 44 | } 45 | 46 | 47 | static ULONG buffer_realloc(buffer_context *context, ULONG size) 48 | { 49 | UINT nNewSize ; 50 | PBYTE pNewBuffer; 51 | UINT nBufferLen; 52 | 53 | if (size < buffer_get_memsize(context)) //需要的长度小于总的长度 54 | return 0; 55 | // Allocate new size 56 | nNewSize = (UINT) ceil(size / 1024.0) * 1024; 57 | // New Copy Data Over 58 | #ifdef WIN32 59 | pNewBuffer = (PBYTE) VirtualAlloc(NULL, nNewSize, MEM_COMMIT, PAGE_READWRITE); 60 | #else 61 | pNewBuffer = (PBYTE) malloc(nNewSize); 62 | #endif 63 | nBufferLen = buffer_get_length(context); 64 | CopyMemory(pNewBuffer, context->m_pBase, nBufferLen); 65 | if (context->m_pBase) 66 | { 67 | #ifdef WIN32 68 | VirtualFree(context->m_pBase, 0, MEM_RELEASE); 69 | #else 70 | free(context->m_pBase); 71 | #endif 72 | } 73 | // Hand over the pointer 74 | context->m_pBase = pNewBuffer; 75 | // Realign position pointer 76 | context->m_pPtr = context->m_pBase + nBufferLen; 77 | context->m_nSize = nNewSize; 78 | return size; 79 | } 80 | 81 | ULONG buffer_get_memsize(buffer_context *context) 82 | { 83 | return context->m_nSize; 84 | } 85 | 86 | void buffer_free(buffer_context *context) 87 | { 88 | if (context->m_pBase) 89 | { 90 | #ifdef WIN32 91 | VirtualFree(context->m_pBase, 0, MEM_RELEASE); 92 | #else 93 | free(context->m_pBase); 94 | #endif 95 | } 96 | context->m_nSize = 0; 97 | context->m_pBase = context->m_pPtr = NULL; 98 | } 99 | 100 | LPBYTE buffer_getat(buffer_context *context, ULONG offset) 101 | { 102 | if(offset >= buffer_get_length(context)) 103 | { 104 | return NULL; 105 | } 106 | return context->m_pBase + offset; 107 | } 108 | 109 | 110 | /* 111 | 交换两个 buffer 的内容 112 | */ 113 | void buffer_exch(buffer_context *buff1, buffer_context *buff2) 114 | { 115 | buffer_context tmp; 116 | memcpy(&tmp, buff1, sizeof(buffer_context)); 117 | memcpy(buff1, buff2, sizeof(buffer_context)); 118 | memcpy(buff2, &tmp, sizeof(buffer_context)); 119 | } 120 | 121 | ULONG buffer_read(buffer_context *ctx, LPBYTE buff, ULONG size) 122 | { 123 | if (size > buffer_get_length(ctx)) 124 | { 125 | size = buffer_get_length(ctx); 126 | } 127 | if (size) 128 | { 129 | memcpy(buff, buffer_getat(ctx, 0), size); 130 | memmove(ctx->m_pBase, ctx->m_pBase + size , buffer_get_length(ctx) - size); 131 | ctx->m_pPtr -= size; 132 | } 133 | 134 | return size; 135 | } -------------------------------------------------------------------------------- /Client/zlib/treebuild.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | zip compression library 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 117 | -------------------------------------------------------------------------------- /Client/zlib/contrib/ada/zlib-thin.adb: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------- 2 | -- ZLib for Ada thick binding. -- 3 | -- -- 4 | -- Copyright (C) 2002-2003 Dmitriy Anisimkov -- 5 | -- -- 6 | -- Open source license information is in the zlib.ads file. -- 7 | ---------------------------------------------------------------- 8 | 9 | -- $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $ 10 | 11 | package body ZLib.Thin is 12 | 13 | ZLIB_VERSION : constant Chars_Ptr := zlibVersion; 14 | 15 | Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit; 16 | 17 | -------------- 18 | -- Avail_In -- 19 | -------------- 20 | 21 | function Avail_In (Strm : in Z_Stream) return UInt is 22 | begin 23 | return Strm.Avail_In; 24 | end Avail_In; 25 | 26 | --------------- 27 | -- Avail_Out -- 28 | --------------- 29 | 30 | function Avail_Out (Strm : in Z_Stream) return UInt is 31 | begin 32 | return Strm.Avail_Out; 33 | end Avail_Out; 34 | 35 | ------------------ 36 | -- Deflate_Init -- 37 | ------------------ 38 | 39 | function Deflate_Init 40 | (strm : Z_Streamp; 41 | level : Int; 42 | method : Int; 43 | windowBits : Int; 44 | memLevel : Int; 45 | strategy : Int) 46 | return Int is 47 | begin 48 | return deflateInit2 49 | (strm, 50 | level, 51 | method, 52 | windowBits, 53 | memLevel, 54 | strategy, 55 | ZLIB_VERSION, 56 | Z_Stream_Size); 57 | end Deflate_Init; 58 | 59 | ------------------ 60 | -- Inflate_Init -- 61 | ------------------ 62 | 63 | function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is 64 | begin 65 | return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size); 66 | end Inflate_Init; 67 | 68 | ------------------------ 69 | -- Last_Error_Message -- 70 | ------------------------ 71 | 72 | function Last_Error_Message (Strm : in Z_Stream) return String is 73 | use Interfaces.C.Strings; 74 | begin 75 | if Strm.msg = Null_Ptr then 76 | return ""; 77 | else 78 | return Value (Strm.msg); 79 | end if; 80 | end Last_Error_Message; 81 | 82 | ------------ 83 | -- Set_In -- 84 | ------------ 85 | 86 | procedure Set_In 87 | (Strm : in out Z_Stream; 88 | Buffer : in Voidp; 89 | Size : in UInt) is 90 | begin 91 | Strm.Next_In := Buffer; 92 | Strm.Avail_In := Size; 93 | end Set_In; 94 | 95 | ------------------ 96 | -- Set_Mem_Func -- 97 | ------------------ 98 | 99 | procedure Set_Mem_Func 100 | (Strm : in out Z_Stream; 101 | Opaque : in Voidp; 102 | Alloc : in alloc_func; 103 | Free : in free_func) is 104 | begin 105 | Strm.opaque := Opaque; 106 | Strm.zalloc := Alloc; 107 | Strm.zfree := Free; 108 | end Set_Mem_Func; 109 | 110 | ------------- 111 | -- Set_Out -- 112 | ------------- 113 | 114 | procedure Set_Out 115 | (Strm : in out Z_Stream; 116 | Buffer : in Voidp; 117 | Size : in UInt) is 118 | begin 119 | Strm.Next_Out := Buffer; 120 | Strm.Avail_Out := Size; 121 | end Set_Out; 122 | 123 | -------------- 124 | -- Total_In -- 125 | -------------- 126 | 127 | function Total_In (Strm : in Z_Stream) return ULong is 128 | begin 129 | return Strm.Total_In; 130 | end Total_In; 131 | 132 | --------------- 133 | -- Total_Out -- 134 | --------------- 135 | 136 | function Total_Out (Strm : in Z_Stream) return ULong is 137 | begin 138 | return Strm.Total_Out; 139 | end Total_Out; 140 | 141 | end ZLib.Thin; 142 | -------------------------------------------------------------------------------- /icmp_shell.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Client", "Client\Client.vcxproj", "{FF8F50FF-5E17-483D-815C-16E50560EACB}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Server", "Server\Server.vcxproj", "{4117E0A1-D0F7-4353-9387-6FA4D8559F81}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6EDC1AE3-10CE-429B-A1B7-53D487F88C2F}" 9 | ProjectSection(SolutionItems) = preProject 10 | readme.txt = readme.txt 11 | EndProjectSection 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E537D5CE-7DD6-4C8C-9474-2C7F08B599A6}" 14 | EndProject 15 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "linux_pipe", "linux_pipe\linux_pipe.vcxproj", "{F44BF18F-3AC7-4A3A-96E2-8901BB2E9B73}" 16 | EndProject 17 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recv_icmp", "recv_icmp\recv_icmp.vcxproj", "{96A37B6F-10C5-4337-919C-0224A8CD0D78}" 18 | EndProject 19 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sendicmp", "sendicmp\sendicmp.vcxproj", "{B968E1C5-8784-4F49-9EC0-914E494A1DE4}" 20 | EndProject 21 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "des_test", "des_test\des_test.vcxproj", "{F08F8BE0-198D-4D38-AC3E-B885AE7A28AC}" 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | Debug|Win32 = Debug|Win32 26 | Release|Win32 = Release|Win32 27 | EndGlobalSection 28 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 29 | {FF8F50FF-5E17-483D-815C-16E50560EACB}.Debug|Win32.ActiveCfg = Debug|Win32 30 | {FF8F50FF-5E17-483D-815C-16E50560EACB}.Debug|Win32.Build.0 = Debug|Win32 31 | {FF8F50FF-5E17-483D-815C-16E50560EACB}.Release|Win32.ActiveCfg = Release|Win32 32 | {FF8F50FF-5E17-483D-815C-16E50560EACB}.Release|Win32.Build.0 = Release|Win32 33 | {4117E0A1-D0F7-4353-9387-6FA4D8559F81}.Debug|Win32.ActiveCfg = Debug|Win32 34 | {4117E0A1-D0F7-4353-9387-6FA4D8559F81}.Debug|Win32.Build.0 = Debug|Win32 35 | {4117E0A1-D0F7-4353-9387-6FA4D8559F81}.Release|Win32.ActiveCfg = Release|Win32 36 | {4117E0A1-D0F7-4353-9387-6FA4D8559F81}.Release|Win32.Build.0 = Release|Win32 37 | {F44BF18F-3AC7-4A3A-96E2-8901BB2E9B73}.Debug|Win32.ActiveCfg = Debug|Win32 38 | {F44BF18F-3AC7-4A3A-96E2-8901BB2E9B73}.Debug|Win32.Build.0 = Debug|Win32 39 | {F44BF18F-3AC7-4A3A-96E2-8901BB2E9B73}.Release|Win32.ActiveCfg = Release|Win32 40 | {F44BF18F-3AC7-4A3A-96E2-8901BB2E9B73}.Release|Win32.Build.0 = Release|Win32 41 | {96A37B6F-10C5-4337-919C-0224A8CD0D78}.Debug|Win32.ActiveCfg = Debug|Win32 42 | {96A37B6F-10C5-4337-919C-0224A8CD0D78}.Debug|Win32.Build.0 = Debug|Win32 43 | {96A37B6F-10C5-4337-919C-0224A8CD0D78}.Release|Win32.ActiveCfg = Release|Win32 44 | {96A37B6F-10C5-4337-919C-0224A8CD0D78}.Release|Win32.Build.0 = Release|Win32 45 | {B968E1C5-8784-4F49-9EC0-914E494A1DE4}.Debug|Win32.ActiveCfg = Debug|Win32 46 | {B968E1C5-8784-4F49-9EC0-914E494A1DE4}.Debug|Win32.Build.0 = Debug|Win32 47 | {B968E1C5-8784-4F49-9EC0-914E494A1DE4}.Release|Win32.ActiveCfg = Release|Win32 48 | {B968E1C5-8784-4F49-9EC0-914E494A1DE4}.Release|Win32.Build.0 = Release|Win32 49 | {F08F8BE0-198D-4D38-AC3E-B885AE7A28AC}.Debug|Win32.ActiveCfg = Debug|Win32 50 | {F08F8BE0-198D-4D38-AC3E-B885AE7A28AC}.Debug|Win32.Build.0 = Debug|Win32 51 | {F08F8BE0-198D-4D38-AC3E-B885AE7A28AC}.Release|Win32.ActiveCfg = Release|Win32 52 | {F08F8BE0-198D-4D38-AC3E-B885AE7A28AC}.Release|Win32.Build.0 = Release|Win32 53 | EndGlobalSection 54 | GlobalSection(SolutionProperties) = preSolution 55 | HideSolutionNode = FALSE 56 | EndGlobalSection 57 | GlobalSection(NestedProjects) = preSolution 58 | {F44BF18F-3AC7-4A3A-96E2-8901BB2E9B73} = {E537D5CE-7DD6-4C8C-9474-2C7F08B599A6} 59 | {96A37B6F-10C5-4337-919C-0224A8CD0D78} = {E537D5CE-7DD6-4C8C-9474-2C7F08B599A6} 60 | {B968E1C5-8784-4F49-9EC0-914E494A1DE4} = {E537D5CE-7DD6-4C8C-9474-2C7F08B599A6} 61 | {F08F8BE0-198D-4D38-AC3E-B885AE7A28AC} = {E537D5CE-7DD6-4C8C-9474-2C7F08B599A6} 62 | EndGlobalSection 63 | EndGlobal 64 | -------------------------------------------------------------------------------- /Client/zlib/contrib/ada/buffer_demo.adb: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------- 2 | -- ZLib for Ada thick binding. -- 3 | -- -- 4 | -- Copyright (C) 2002-2004 Dmitriy Anisimkov -- 5 | -- -- 6 | -- Open source license information is in the zlib.ads file. -- 7 | ---------------------------------------------------------------- 8 | -- 9 | -- $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $ 10 | 11 | -- This demo program provided by Dr Steve Sangwine 12 | -- 13 | -- Demonstration of a problem with Zlib-Ada (already fixed) when a buffer 14 | -- of exactly the correct size is used for decompressed data, and the last 15 | -- few bytes passed in to Zlib are checksum bytes. 16 | 17 | -- This program compresses a string of text, and then decompresses the 18 | -- compressed text into a buffer of the same size as the original text. 19 | 20 | with Ada.Streams; use Ada.Streams; 21 | with Ada.Text_IO; 22 | 23 | with ZLib; use ZLib; 24 | 25 | procedure Buffer_Demo is 26 | EOL : Character renames ASCII.LF; 27 | Text : constant String 28 | := "Four score and seven years ago our fathers brought forth," & EOL & 29 | "upon this continent, a new nation, conceived in liberty," & EOL & 30 | "and dedicated to the proposition that `all men are created equal'."; 31 | 32 | Source : Stream_Element_Array (1 .. Text'Length); 33 | for Source'Address use Text'Address; 34 | 35 | begin 36 | Ada.Text_IO.Put (Text); 37 | Ada.Text_IO.New_Line; 38 | Ada.Text_IO.Put_Line 39 | ("Uncompressed size : " & Positive'Image (Text'Length) & " bytes"); 40 | 41 | declare 42 | Compressed_Data : Stream_Element_Array (1 .. Text'Length); 43 | L : Stream_Element_Offset; 44 | begin 45 | Compress : declare 46 | Compressor : Filter_Type; 47 | I : Stream_Element_Offset; 48 | begin 49 | Deflate_Init (Compressor); 50 | 51 | -- Compress the whole of T at once. 52 | 53 | Translate (Compressor, Source, I, Compressed_Data, L, Finish); 54 | pragma Assert (I = Source'Last); 55 | 56 | Close (Compressor); 57 | 58 | Ada.Text_IO.Put_Line 59 | ("Compressed size : " 60 | & Stream_Element_Offset'Image (L) & " bytes"); 61 | end Compress; 62 | 63 | -- Now we decompress the data, passing short blocks of data to Zlib 64 | -- (because this demonstrates the problem - the last block passed will 65 | -- contain checksum information and there will be no output, only a 66 | -- check inside Zlib that the checksum is correct). 67 | 68 | Decompress : declare 69 | Decompressor : Filter_Type; 70 | 71 | Uncompressed_Data : Stream_Element_Array (1 .. Text'Length); 72 | 73 | Block_Size : constant := 4; 74 | -- This makes sure that the last block contains 75 | -- only Adler checksum data. 76 | 77 | P : Stream_Element_Offset := Compressed_Data'First - 1; 78 | O : Stream_Element_Offset; 79 | begin 80 | Inflate_Init (Decompressor); 81 | 82 | loop 83 | Translate 84 | (Decompressor, 85 | Compressed_Data 86 | (P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)), 87 | P, 88 | Uncompressed_Data 89 | (Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last), 90 | O, 91 | No_Flush); 92 | 93 | Ada.Text_IO.Put_Line 94 | ("Total in : " & Count'Image (Total_In (Decompressor)) & 95 | ", out : " & Count'Image (Total_Out (Decompressor))); 96 | 97 | exit when P = L; 98 | end loop; 99 | 100 | Ada.Text_IO.New_Line; 101 | Ada.Text_IO.Put_Line 102 | ("Decompressed text matches original text : " 103 | & Boolean'Image (Uncompressed_Data = Source)); 104 | end Decompress; 105 | end; 106 | end Buffer_Demo; 107 | -------------------------------------------------------------------------------- /test/sendicmp/sendicmp.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {B968E1C5-8784-4F49-9EC0-914E494A1DE4} 15 | Win32Proj 16 | sendicmp 17 | 18 | 19 | 20 | Application 21 | true 22 | v110 23 | Unicode 24 | 25 | 26 | Application 27 | false 28 | v110 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | 51 | 52 | Level3 53 | Disabled 54 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 55 | 56 | 57 | Console 58 | true 59 | 60 | 61 | 62 | 63 | Level3 64 | 65 | 66 | MaxSpeed 67 | true 68 | true 69 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 70 | 71 | 72 | Console 73 | true 74 | true 75 | true 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /test/linux_pipe/linux_pipe.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {F44BF18F-3AC7-4A3A-96E2-8901BB2E9B73} 15 | Win32Proj 16 | linux_pipe 17 | 18 | 19 | 20 | Application 21 | true 22 | v110 23 | Unicode 24 | 25 | 26 | Application 27 | false 28 | v110 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | X:\usr\include 45 | 46 | 47 | false 48 | 49 | 50 | 51 | 52 | 53 | Level3 54 | Disabled 55 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 56 | 57 | 58 | Console 59 | true 60 | 61 | 62 | 63 | 64 | Level3 65 | 66 | 67 | MaxSpeed 68 | true 69 | true 70 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 71 | 72 | 73 | Console 74 | true 75 | true 76 | true 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /test/recv_icmp/recv_icmp.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {96A37B6F-10C5-4337-919C-0224A8CD0D78} 15 | Win32Proj 16 | recv_icmp 17 | 18 | 19 | 20 | Application 21 | true 22 | v110 23 | Unicode 24 | 25 | 26 | Application 27 | false 28 | v110 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | Z:\usr\include 45 | 46 | 47 | false 48 | 49 | 50 | 51 | 52 | 53 | Level3 54 | Disabled 55 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 56 | 57 | 58 | Console 59 | true 60 | 61 | 62 | 63 | 64 | Level3 65 | 66 | 67 | MaxSpeed 68 | true 69 | true 70 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 71 | 72 | 73 | Console 74 | true 75 | true 76 | true 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /test/des_test/des_test.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {F08F8BE0-198D-4D38-AC3E-B885AE7A28AC} 15 | Win32Proj 16 | des_test 17 | 18 | 19 | 20 | Application 21 | true 22 | v110 23 | MultiByte 24 | 25 | 26 | Application 27 | false 28 | v110 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | 51 | 52 | Level3 53 | Disabled 54 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 55 | 56 | 57 | Console 58 | true 59 | 60 | 61 | 62 | 63 | Level3 64 | 65 | 66 | MaxSpeed 67 | true 68 | true 69 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 70 | 71 | 72 | Console 73 | true 74 | true 75 | true 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Client/zlib/old/Makefile.riscos: -------------------------------------------------------------------------------- 1 | # Project: zlib_1_03 2 | # Patched for zlib 1.1.2 rw@shadow.org.uk 19980430 3 | # test works out-of-the-box, installs `somewhere' on demand 4 | 5 | # Toolflags: 6 | CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah 7 | C++flags = -c -depend !Depend -IC: -throwback 8 | Linkflags = -aif -c++ -o $@ 9 | ObjAsmflags = -throwback -NoCache -depend !Depend 10 | CMHGflags = 11 | LibFileflags = -c -l -o $@ 12 | Squeezeflags = -o $@ 13 | 14 | # change the line below to where _you_ want the library installed. 15 | libdest = lib:zlib 16 | 17 | # Final targets: 18 | @.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \ 19 | @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \ 20 | @.o.uncompr @.o.zutil 21 | LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \ 22 | @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \ 23 | @.o.trees @.o.uncompr @.o.zutil 24 | test: @.minigzip @.example @.lib 25 | @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV 26 | @echo running tests: hang on. 27 | @/@.minigzip -f -9 libc 28 | @/@.minigzip -d libc-gz 29 | @/@.minigzip -f -1 libc 30 | @/@.minigzip -d libc-gz 31 | @/@.minigzip -h -9 libc 32 | @/@.minigzip -d libc-gz 33 | @/@.minigzip -h -1 libc 34 | @/@.minigzip -d libc-gz 35 | @/@.minigzip -9 libc 36 | @/@.minigzip -d libc-gz 37 | @/@.minigzip -1 libc 38 | @/@.minigzip -d libc-gz 39 | @diff @.lib @.libc 40 | @echo that should have reported '@.lib and @.libc identical' if you have diff. 41 | @/@.example @.fred @.fred 42 | @echo that will have given lots of hello!'s. 43 | 44 | @.minigzip: @.o.minigzip @.lib C:o.Stubs 45 | Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs 46 | @.example: @.o.example @.lib C:o.Stubs 47 | Link $(Linkflags) @.o.example @.lib C:o.Stubs 48 | 49 | install: @.lib 50 | cdir $(libdest) 51 | cdir $(libdest).h 52 | @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV 53 | @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV 54 | @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV 55 | @echo okay, installed zlib in $(libdest) 56 | 57 | clean:; remove @.minigzip 58 | remove @.example 59 | remove @.libc 60 | -wipe @.o.* F~r~cV 61 | remove @.fred 62 | 63 | # User-editable dependencies: 64 | .c.o: 65 | cc $(ccflags) -o $@ $< 66 | 67 | # Static dependencies: 68 | 69 | # Dynamic dependencies: 70 | o.example: c.example 71 | o.example: h.zlib 72 | o.example: h.zconf 73 | o.minigzip: c.minigzip 74 | o.minigzip: h.zlib 75 | o.minigzip: h.zconf 76 | o.adler32: c.adler32 77 | o.adler32: h.zlib 78 | o.adler32: h.zconf 79 | o.compress: c.compress 80 | o.compress: h.zlib 81 | o.compress: h.zconf 82 | o.crc32: c.crc32 83 | o.crc32: h.zlib 84 | o.crc32: h.zconf 85 | o.deflate: c.deflate 86 | o.deflate: h.deflate 87 | o.deflate: h.zutil 88 | o.deflate: h.zlib 89 | o.deflate: h.zconf 90 | o.gzio: c.gzio 91 | o.gzio: h.zutil 92 | o.gzio: h.zlib 93 | o.gzio: h.zconf 94 | o.infblock: c.infblock 95 | o.infblock: h.zutil 96 | o.infblock: h.zlib 97 | o.infblock: h.zconf 98 | o.infblock: h.infblock 99 | o.infblock: h.inftrees 100 | o.infblock: h.infcodes 101 | o.infblock: h.infutil 102 | o.infcodes: c.infcodes 103 | o.infcodes: h.zutil 104 | o.infcodes: h.zlib 105 | o.infcodes: h.zconf 106 | o.infcodes: h.inftrees 107 | o.infcodes: h.infblock 108 | o.infcodes: h.infcodes 109 | o.infcodes: h.infutil 110 | o.infcodes: h.inffast 111 | o.inffast: c.inffast 112 | o.inffast: h.zutil 113 | o.inffast: h.zlib 114 | o.inffast: h.zconf 115 | o.inffast: h.inftrees 116 | o.inffast: h.infblock 117 | o.inffast: h.infcodes 118 | o.inffast: h.infutil 119 | o.inffast: h.inffast 120 | o.inflate: c.inflate 121 | o.inflate: h.zutil 122 | o.inflate: h.zlib 123 | o.inflate: h.zconf 124 | o.inflate: h.infblock 125 | o.inftrees: c.inftrees 126 | o.inftrees: h.zutil 127 | o.inftrees: h.zlib 128 | o.inftrees: h.zconf 129 | o.inftrees: h.inftrees 130 | o.inftrees: h.inffixed 131 | o.infutil: c.infutil 132 | o.infutil: h.zutil 133 | o.infutil: h.zlib 134 | o.infutil: h.zconf 135 | o.infutil: h.infblock 136 | o.infutil: h.inftrees 137 | o.infutil: h.infcodes 138 | o.infutil: h.infutil 139 | o.trees: c.trees 140 | o.trees: h.deflate 141 | o.trees: h.zutil 142 | o.trees: h.zlib 143 | o.trees: h.zconf 144 | o.trees: h.trees 145 | o.uncompr: c.uncompr 146 | o.uncompr: h.zlib 147 | o.uncompr: h.zconf 148 | o.zutil: c.zutil 149 | o.zutil: h.zutil 150 | o.zutil: h.zlib 151 | o.zutil: h.zconf 152 | -------------------------------------------------------------------------------- /Client/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {07934a85-8b61-443d-a0ee-b2eedb74f3cd} 6 | cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90 7 | 8 | 9 | {1d99675b-433d-4a21-9e50-ed4ab8b19762} 10 | h;hpp;hxx;hm;inl;fi;fd 11 | 12 | 13 | {431c0958-fa71-44d0-9084-2d19d100c0cc} 14 | ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | Source Files 74 | 75 | 76 | Source Files 77 | 78 | 79 | 80 | 81 | Source Files 82 | 83 | 84 | 85 | 86 | Source Files 87 | 88 | 89 | 90 | 91 | Header Files 92 | 93 | 94 | Header Files 95 | 96 | 97 | Header Files 98 | 99 | 100 | Header Files 101 | 102 | 103 | Header Files 104 | 105 | 106 | Header Files 107 | 108 | 109 | Header Files 110 | 111 | 112 | Header Files 113 | 114 | 115 | Header Files 116 | 117 | 118 | -------------------------------------------------------------------------------- /Client/zlib/zlib2ansi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Transform K&R C function definitions into ANSI equivalent. 4 | # 5 | # Author: Paul Marquess 6 | # Version: 1.0 7 | # Date: 3 October 2006 8 | 9 | # TODO 10 | # 11 | # Asumes no function pointer parameters. unless they are typedefed. 12 | # Assumes no literal strings that look like function definitions 13 | # Assumes functions start at the beginning of a line 14 | 15 | use strict; 16 | use warnings; 17 | 18 | local $/; 19 | $_ = <>; 20 | 21 | my $sp = qr{ \s* (?: /\* .*? \*/ )? \s* }x; # assume no nested comments 22 | 23 | my $d1 = qr{ $sp (?: [\w\*\s]+ $sp)* $sp \w+ $sp [\[\]\s]* $sp }x ; 24 | my $decl = qr{ $sp (?: \w+ $sp )+ $d1 }xo ; 25 | my $dList = qr{ $sp $decl (?: $sp , $d1 )* $sp ; $sp }xo ; 26 | 27 | 28 | while (s/^ 29 | ( # Start $1 30 | ( # Start $2 31 | .*? # Minimal eat content 32 | ( ^ \w [\w\s\*]+ ) # $3 -- function name 33 | \s* # optional whitespace 34 | ) # $2 - Matched up to before parameter list 35 | 36 | \( \s* # Literal "(" + optional whitespace 37 | ( [^\)]+ ) # $4 - one or more anythings except ")" 38 | \s* \) # optional whitespace surrounding a Literal ")" 39 | 40 | ( (?: $dList )+ ) # $5 41 | 42 | $sp ^ { # literal "{" at start of line 43 | ) # Remember to $1 44 | //xsom 45 | ) 46 | { 47 | my $all = $1 ; 48 | my $prefix = $2; 49 | my $param_list = $4 ; 50 | my $params = $5; 51 | 52 | StripComments($params); 53 | StripComments($param_list); 54 | $param_list =~ s/^\s+//; 55 | $param_list =~ s/\s+$//; 56 | 57 | my $i = 0 ; 58 | my %pList = map { $_ => $i++ } 59 | split /\s*,\s*/, $param_list; 60 | my $pMatch = '(\b' . join('|', keys %pList) . '\b)\W*$' ; 61 | 62 | my @params = split /\s*;\s*/, $params; 63 | my @outParams = (); 64 | foreach my $p (@params) 65 | { 66 | if ($p =~ /,/) 67 | { 68 | my @bits = split /\s*,\s*/, $p; 69 | my $first = shift @bits; 70 | $first =~ s/^\s*//; 71 | push @outParams, $first; 72 | $first =~ /^(\w+\s*)/; 73 | my $type = $1 ; 74 | push @outParams, map { $type . $_ } @bits; 75 | } 76 | else 77 | { 78 | $p =~ s/^\s+//; 79 | push @outParams, $p; 80 | } 81 | } 82 | 83 | 84 | my %tmp = map { /$pMatch/; $_ => $pList{$1} } 85 | @outParams ; 86 | 87 | @outParams = map { " $_" } 88 | sort { $tmp{$a} <=> $tmp{$b} } 89 | @outParams ; 90 | 91 | print $prefix ; 92 | print "(\n" . join(",\n", @outParams) . ")\n"; 93 | print "{" ; 94 | 95 | } 96 | 97 | # Output any trailing code. 98 | print ; 99 | exit 0; 100 | 101 | 102 | sub StripComments 103 | { 104 | 105 | no warnings; 106 | 107 | # Strip C & C++ coments 108 | # From the perlfaq 109 | $_[0] =~ 110 | 111 | s{ 112 | /\* ## Start of /* ... */ comment 113 | [^*]*\*+ ## Non-* followed by 1-or-more *'s 114 | ( 115 | [^/*][^*]*\*+ 116 | )* ## 0-or-more things which don't start with / 117 | ## but do end with '*' 118 | / ## End of /* ... */ comment 119 | 120 | | ## OR C++ Comment 121 | // ## Start of C++ comment // 122 | [^\n]* ## followed by 0-or-more non end of line characters 123 | 124 | | ## OR various things which aren't comments: 125 | 126 | ( 127 | " ## Start of " ... " string 128 | ( 129 | \\. ## Escaped char 130 | | ## OR 131 | [^"\\] ## Non "\ 132 | )* 133 | " ## End of " ... " string 134 | 135 | | ## OR 136 | 137 | ' ## Start of ' ... ' string 138 | ( 139 | \\. ## Escaped char 140 | | ## OR 141 | [^'\\] ## Non '\ 142 | )* 143 | ' ## End of ' ... ' string 144 | 145 | | ## OR 146 | 147 | . ## Anything other char 148 | [^/"'\\]* ## Chars which doesn't start a comment, string or escape 149 | ) 150 | }{$2}gxs; 151 | 152 | } 153 | -------------------------------------------------------------------------------- /Client/zlib/examples/gzlog.h: -------------------------------------------------------------------------------- 1 | /* gzlog.h 2 | Copyright (C) 2004, 2008 Mark Adler, all rights reserved 3 | version 2.0, 25 Apr 2008 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the author be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Mark Adler madler@alumni.caltech.edu 22 | */ 23 | 24 | /* Version History: 25 | 1.0 26 Nov 2004 First version 26 | 2.0 25 Apr 2008 Complete redesign for recovery of interrupted operations 27 | Interface changed slightly in that now path is a prefix 28 | Compression now occurs as needed during gzlog_write() 29 | gzlog_write() now always leaves the log file as valid gzip 30 | */ 31 | 32 | /* 33 | The gzlog object allows writing short messages to a gzipped log file, 34 | opening the log file locked for small bursts, and then closing it. The log 35 | object works by appending stored (uncompressed) data to the gzip file until 36 | 1 MB has been accumulated. At that time, the stored data is compressed, and 37 | replaces the uncompressed data in the file. The log file is truncated to 38 | its new size at that time. After each write operation, the log file is a 39 | valid gzip file that can decompressed to recover what was written. 40 | 41 | The gzlog operations can be interupted at any point due to an application or 42 | system crash, and the log file will be recovered the next time the log is 43 | opened with gzlog_open(). 44 | */ 45 | 46 | #ifndef GZLOG_H 47 | #define GZLOG_H 48 | 49 | /* gzlog object type */ 50 | typedef void gzlog; 51 | 52 | /* Open a gzlog object, creating the log file if it does not exist. Return 53 | NULL on error. Note that gzlog_open() could take a while to complete if it 54 | has to wait to verify that a lock is stale (possibly for five minutes), or 55 | if there is significant contention with other instantiations of this object 56 | when locking the resource. path is the prefix of the file names created by 57 | this object. If path is "foo", then the log file will be "foo.gz", and 58 | other auxiliary files will be created and destroyed during the process: 59 | "foo.dict" for a compression dictionary, "foo.temp" for a temporary (next) 60 | dictionary, "foo.add" for data being added or compressed, "foo.lock" for the 61 | lock file, and "foo.repairs" to log recovery operations performed due to 62 | interrupted gzlog operations. A gzlog_open() followed by a gzlog_close() 63 | will recover a previously interrupted operation, if any. */ 64 | gzlog *gzlog_open(char *path); 65 | 66 | /* Write to a gzlog object. Return zero on success, -1 if there is a file i/o 67 | error on any of the gzlog files (this should not happen if gzlog_open() 68 | succeeded, unless the device has run out of space or leftover auxiliary 69 | files have permissions or ownership that prevent their use), -2 if there is 70 | a memory allocation failure, or -3 if the log argument is invalid (e.g. if 71 | it was not created by gzlog_open()). This function will write data to the 72 | file uncompressed, until 1 MB has been accumulated, at which time that data 73 | will be compressed. The log file will be a valid gzip file upon successful 74 | return. */ 75 | int gzlog_write(gzlog *log, void *data, size_t len); 76 | 77 | /* Force compression of any uncompressed data in the log. This should be used 78 | sparingly, if at all. The main application would be when a log file will 79 | not be appended to again. If this is used to compress frequently while 80 | appending, it will both significantly increase the execution time and 81 | reduce the compression ratio. The return codes are the same as for 82 | gzlog_write(). */ 83 | int gzlog_compress(gzlog *log); 84 | 85 | /* Close a gzlog object. Return zero on success, -3 if the log argument is 86 | invalid. The log object is freed, and so cannot be referenced again. */ 87 | int gzlog_close(gzlog *log); 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /Client/zlib/old/os2/Makefile.os2: -------------------------------------------------------------------------------- 1 | # Makefile for zlib under OS/2 using GCC (PGCC) 2 | # For conditions of distribution and use, see copyright notice in zlib.h 3 | 4 | # To compile and test, type: 5 | # cp Makefile.os2 .. 6 | # cd .. 7 | # make -f Makefile.os2 test 8 | 9 | # This makefile will build a static library z.lib, a shared library 10 | # z.dll and a import library zdll.lib. You can use either z.lib or 11 | # zdll.lib by specifying either -lz or -lzdll on gcc's command line 12 | 13 | CC=gcc -Zomf -s 14 | 15 | CFLAGS=-O6 -Wall 16 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 17 | #CFLAGS=-g -DDEBUG 18 | #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 19 | # -Wstrict-prototypes -Wmissing-prototypes 20 | 21 | #################### BUG WARNING: ##################### 22 | ## infcodes.c hits a bug in pgcc-1.0, so you have to use either 23 | ## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem) 24 | ## This bug is reportedly fixed in pgcc >1.0, but this was not tested 25 | CFLAGS+=-fno-force-mem 26 | 27 | LDFLAGS=-s -L. -lzdll -Zcrtdll 28 | LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll 29 | 30 | VER=1.1.0 31 | ZLIB=z.lib 32 | SHAREDLIB=z.dll 33 | SHAREDLIBIMP=zdll.lib 34 | LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP) 35 | 36 | AR=emxomfar cr 37 | IMPLIB=emximp 38 | RANLIB=echo 39 | TAR=tar 40 | SHELL=bash 41 | 42 | prefix=/usr/local 43 | exec_prefix = $(prefix) 44 | 45 | OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ 46 | zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o 47 | 48 | TEST_OBJS = example.o minigzip.o 49 | 50 | DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \ 51 | algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ 52 | nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \ 53 | contrib/asm386/*.asm contrib/asm386/*.c \ 54 | contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \ 55 | contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \ 56 | contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 57 | 58 | all: example.exe minigzip.exe 59 | 60 | test: all 61 | @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ 62 | echo hello world | ./minigzip | ./minigzip -d || \ 63 | echo ' *** minigzip test FAILED ***' ; \ 64 | if ./example; then \ 65 | echo ' *** zlib test OK ***'; \ 66 | else \ 67 | echo ' *** zlib test FAILED ***'; \ 68 | fi 69 | 70 | $(ZLIB): $(OBJS) 71 | $(AR) $@ $(OBJS) 72 | -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 73 | 74 | $(SHAREDLIB): $(OBJS) os2/z.def 75 | $(LDSHARED) -o $@ $^ 76 | 77 | $(SHAREDLIBIMP): os2/z.def 78 | $(IMPLIB) -o $@ $^ 79 | 80 | example.exe: example.o $(LIBS) 81 | $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) 82 | 83 | minigzip.exe: minigzip.o $(LIBS) 84 | $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) 85 | 86 | clean: 87 | rm -f *.o *~ example minigzip libz.a libz.so* foo.gz 88 | 89 | distclean: clean 90 | 91 | zip: 92 | mv Makefile Makefile~; cp -p Makefile.in Makefile 93 | rm -f test.c ztest*.c 94 | v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ 95 | zip -ul9 zlib$$v $(DISTFILES) 96 | mv Makefile~ Makefile 97 | 98 | dist: 99 | mv Makefile Makefile~; cp -p Makefile.in Makefile 100 | rm -f test.c ztest*.c 101 | d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ 102 | rm -f $$d.tar.gz; \ 103 | if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ 104 | files=""; \ 105 | for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \ 106 | cd ..; \ 107 | GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \ 108 | if test ! -d $$d; then rm -f $$d; fi 109 | mv Makefile~ Makefile 110 | 111 | tags: 112 | etags *.[ch] 113 | 114 | depend: 115 | makedepend -- $(CFLAGS) -- *.[ch] 116 | 117 | # DO NOT DELETE THIS LINE -- make depend depends on it. 118 | 119 | adler32.o: zlib.h zconf.h 120 | compress.o: zlib.h zconf.h 121 | crc32.o: zlib.h zconf.h 122 | deflate.o: deflate.h zutil.h zlib.h zconf.h 123 | example.o: zlib.h zconf.h 124 | gzio.o: zutil.h zlib.h zconf.h 125 | infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h 126 | infcodes.o: zutil.h zlib.h zconf.h 127 | infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h 128 | inffast.o: zutil.h zlib.h zconf.h inftrees.h 129 | inffast.o: infblock.h infcodes.h infutil.h inffast.h 130 | inflate.o: zutil.h zlib.h zconf.h infblock.h 131 | inftrees.o: zutil.h zlib.h zconf.h inftrees.h 132 | infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 133 | minigzip.o: zlib.h zconf.h 134 | trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 135 | uncompr.o: zlib.h zconf.h 136 | zutil.o: zutil.h zlib.h zconf.h 137 | --------------------------------------------------------------------------------