From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/flate.html | 333 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 man/man3/flate.html (limited to 'man/man3/flate.html') diff --git a/man/man3/flate.html b/man/man3/flate.html new file mode 100644 index 00000000..41591034 --- /dev/null +++ b/man/man3/flate.html @@ -0,0 +1,333 @@ + +flate(3) - Plan 9 from User Space + + + + +
+
+
FLATE(3)FLATE(3) +
+
+

NAME
+ +
+ + deflateinit, deflate, deflatezlib, deflateblock, deflatezlibblock, + inflateinit, inflate, inflatezlib, inflateblock, inflatezlibblock, + flateerr, mkcrctab, blockcrc, adler32 – deflate compression
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h>
+ #include <flate.h> +
+
+ +
+ + int      deflateinit(void) +
+
+ int      deflate(void *wr, int (*w)(void*,void*,int),
+ +
+ + +
+ + void *rr, int (*r)(void*,void*,int),
+ int level, int debug) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int      deflatezlib(void *wr, int (*w)(void*,void*,int),
+ +
+ + +
+ + void *rr, int (*r)(void*,void*,int),
+ int level, int debug) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int      deflateblock(uchar *dst, int dsize,
+ +
+ + +
+ + uchar *src, int ssize,
+ int level, int debug) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int      deflatezlibblock(uchar *dst, int dsize,
+ +
+ + +
+ + uchar *src, int ssize,
+ int level, int debug) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int      inflateinit(void) +
+
+ int      inflate(void *wr, int (*w)(void*, void*, int),
+ +
+ + +
+ + void *getr, int (*get)(void*)) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int      inflatezlib(void *wr, int (*w)(void*, void*, int),
+ +
+ + +
+ + void *getr, int (*get)(void*)) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int      inflateblock(uchar *dst, int dsize,
+ +
+ + +
+ + uchar *src, int ssize) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int      inflatezlibblock(uchar *dst, int dsize,
+ +
+ + +
+ + uchar *src, int ssize) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ char     *flateerr(int error) +
+
+ ulong    *mkcrctab(ulong poly) +
+
+ ulong    blockcrc(ulong *tab, ulong crc, void *buf, int n) +
+
+ ulong    adler32(ulong adler, void *buf, int n)
+
+
+

DESCRIPTION
+ +
+ + These routines compress and decompress data using the deflate + compression algorithm, which is used for most gzip, zip, and zlib + files. +
+ + Deflate compresses input data retrieved by calls to r with arguments + rr, an input buffer, and a count of bytes to read. R should return + the number of bytes read; end of input is signaled by returning + zero, an input error by returning a negative number. The compressed + output is written to w with arguments wr, the + output data, and the number of bytes to write. W should return + the number of bytes written; writing fewer than the requested + number of bytes is an error. Level indicates the amount of computation + deflate should do while compressing the data. Higher levels usually + take more time and produce smaller outputs. Valid + values are 1 to 9, inclusive; 6 is a good compromise. If debug + is non-zero, cryptic debugging information is produced on standard + error. +
+ + Inflate reverses the process, converting compressed data into + uncompressed output. Input is retrieved one byte at a time by + calling get with the argument getr. End of input of signaled by + returning a negative value. The uncompressed output is written + to w, which has the same interface as for deflate. +
+ + Deflateblock and inflateblock operate on blocks of memory but + are otherwise similar to deflate and inflate. +
+ + The zlib functions are similar, but operate on files with a zlib + header and trailer. +
+ + Deflateinit or inflateinit must be called once before any call + to the corresponding routines. +
+ + If the above routines fail, they return a negative number indicating + the problem. The possible values are FlateNoMem, FlateInputFail, + FlateOutputFail, FlateCorrupted, and FlateInternal. Flateerr converts + the number into a printable message. FlateOk is defined to be + zero, the successful return value for deflateinit, + deflate, deflatezlib, inflateinit, inflate, and inflatezlib. The + block functions return the number of bytes produced when they + succeed. +
+ + Mkcrctab allocates (using malloc(3)), initializes, and returns + a table for rapid computation of 32 bit CRC values using the polynomial + poly. Blockcrc uses tab, a table returned by mkcrctab, to update + crc for the n bytes of data in buf, and returns the new value. + Crc should initially be zero. Blockcrc pre-conditions and + post-conditions crc by ones complementation. +
+ + Adler32 updates the Adler 32-bit checksum of the n butes of data + in buf. The initial value of adler (that is, its value after seeing + zero bytes) should be 1.
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/libflate
+
+
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3