#include "nszlib.h"Defines | |
| #define | VERSION "4.5" |
| #define | FOOTER_SIZE 8 |
Functions | |
| int | Nszlib_Init (Tcl_Interp *interp) |
| int | NsZlibModInit (char *server, char *module) |
| unsigned char * | Ns_ZlibCompress (unsigned char *inbuf, unsigned long inlen, unsigned long *outlen) |
| unsigned char * | Ns_ZlibUncompress (unsigned char *inbuf, unsigned long inlen, unsigned long *outlen) |
| #define FOOTER_SIZE 8 |
| #define VERSION "4.5" |
nszlib.c -- Zlib API module
ns_zlib usage:
ns_zlib compress data Returns compressed string
ns_zlib uncompress data Uncompresses previously compressed string
ns_zlib gzip data Returns compressed string in gzip format, string can be saved in a file with extension .gz and gzip will be able to uncompress it
ns_zlib gzipfile file Compresses the specified file, creating a file with the same name but a .gz suffix appened
ns_zlib gunzip file Uncompresses gzip file and returns text
Authors
Vlad Seryakov vlad@crystalballinc.com
| unsigned char* Ns_ZlibCompress | ( | unsigned char * | inbuf, | |
| unsigned long | inlen, | |||
| unsigned long * | outlen | |||
| ) |
----------------------------------------------------------------------
Ns_ZlibCompress --
Compress a string.
Results: Pointer to ns_malloc's string of compressed data or NULL on error.
Side effects: None.
----------------------------------------------------------------------
| unsigned char* Ns_ZlibUncompress | ( | unsigned char * | inbuf, | |
| unsigned long | inlen, | |||
| unsigned long * | outlen | |||
| ) |
----------------------------------------------------------------------
Ns_ZlibUncompress --
Uncompress a string.
Results: Pointer to ns_malloc'ed string of uncompressed data or NULL on error.
Side effects: None.
----------------------------------------------------------------------
| int Nszlib_Init | ( | Tcl_Interp * | interp | ) |
----------------------------------------------------------------------
Nszlib_Init--
Tcl load-command entry point.
Results: TCL_OK.
Side effects: Adds the ns_zlib command.
----------------------------------------------------------------------
| int NsZlibModInit | ( | char * | server, | |
| char * | module | |||
| ) |
----------------------------------------------------------------------
NsZlibModInit--
AOLserver module entry point.
Results: NS_OK.
Side effects: Installs ZlibGzip as the Ns_Gzip proc and registers a trace to create ns_zlib command in all new interps.
----------------------------------------------------------------------
1.5.1