/* * Interface to the "zlib" compression library * * * Copyright (C) 2004, 2005 by Pascal Scheffers * Copyright (C) 2005 Unitas Software B.V. * * Created on 17 December 2004 * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * */ #ifndef TCL_ZLIB_H #define TCL_ZLIB_H #include #ifdef BUILD_zlib #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT #endif /* BUILD_zlib */ typedef struct ZlibHandleStruct *ZlibHandle; EXTERN CONST char * Zlib_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); EXTERN int Zlib_Init _ANSI_ARGS_((Tcl_Interp *interp)) ; #ifndef USE_TCL_STUBS /* * When not using stubs, make it a macro. */ #define Zlib_InitStubs(interp, version, exact) \ Tcl_PkgRequire(interp, "zlib", version, exact) #endif /* USE_TCL_STUBS */ /* * Windows needs to know which symbols to export. Unix does not. * BUILD_zlib should be undefined for Unix. */ #include "zlibDecls.h" #ifdef UNUSED int Zlib_Deflate _ANSI_ARGS_((Tcl_Interp *interp, int format, Tcl_Obj *data, int level)); int Zlib_Inflate _ANSI_ARGS_((Tcl_Interp *interp, int format, Tcl_Obj *data, int buffersize)); unsigned int Zlib_CRC32 _ANSI_ARGS_((unsigned int crc, const char *buf, unsigned int len)); unsigned int Zlib_Adler32 _ANSI_ARGS_((unsigned int adler, const char *buf, unsigned int len)); int Zlib_StreamInit _ANSI_ARGS_((Tcl_Interp *interp, int mode, int format, int level, int *zshandle)); Tcl_Obj * Zlib_StreamGetCommandName _ANSI_ARGS_((int zshandle)); int Zlib_StreamEof _ANSI_ARGS_((int zshandle)); int Zlib_StreamAdler32 _ANSI_ARGS_((int zshandle)); int Zlib_StreamPut _ANSI_ARGS_((int zshandle, Tcl_Obj *data, int flush)); int Zlib_StreamGet _ANSI_ARGS_((int zshandle, Tcl_Obj *data, int count)); int Zlib_StreamClose _ANSI_ARGS_((int zshandle)); #endif /* * Constants used for specifying the compressed format: * Together with the next set of constants passed in a single argument * to Zlib_StackChannel()! */ #define ZLIB_FORMAT_RAW 1 #define ZLIB_FORMAT_ZLIB 2 #define ZLIB_FORMAT_GZIP 4 #define ZLIB_FORMAT_AUTO 8 /* * Constants used for stacking/virtual channels * To be combined with the ZLIB_FORMAT_ flags */ #define ZLIB_PASSTHROUGH 0 #define ZLIB_DEFLATE 16 #define ZLIB_INFLATE 32 /* compression levels */ #define ZLIB_NO_COMPRESSION 0 #define ZLIB_BEST_SPEED 1 #define ZLIB_BEST_COMPRESSION 9 #define ZLIB_DEFAULT_COMPRESSION (-1) /* Flush parameters */ #define ZLIB_NO_FLUSH 0 #define ZLIB_FLUSH 2 #define ZLIB_FULLFLUSH 3 #define ZLIB_FINALIZE 4 #endif /* TCL_ZLIB_H */