about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-11-10 01:55:57 -0500
committerJune McEnroe <june@causal.agency>2018-11-10 01:55:57 -0500
commitf8a44b38fb50a0a9aaeab367d27658e82065d178 (patch)
treebe842c86cba16d4b28756b2beea92134b4c2a824
parentAdd inflate.3 (diff)
downloadzlib-man-pages-f8a44b38fb50a0a9aaeab367d27658e82065d178.tar.gz
zlib-man-pages-f8a44b38fb50a0a9aaeab367d27658e82065d178.zip
Document z_stream fields in deflate.3
-rw-r--r--deflate.380
1 files changed, 80 insertions, 0 deletions
diff --git a/deflate.3 b/deflate.3
index f25b78e..0dcd28a 100644
--- a/deflate.3
+++ b/deflate.3
@@ -21,6 +21,86 @@
 .Fn deflateEnd "z_streamp strm"
 .
 .Sh DESCRIPTION
+The
+.Vt z_streamp
+type is defined as follows:
+.
+.Bd -literal -offset indent
+typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size);
+typedef void   (*free_func)  (voidpf opaque, voidpf address);
+
+typedef struct z_stream_s {
+	z_const Bytef *next_in;
+	uInt     avail_in;
+	uLong    total_in;
+	
+	Bytef    *next_out;
+	uInt     avail_out;
+	uLong    total_out;
+	
+	z_const char *msg;
+	struct internal_state FAR *state;
+	
+	alloc_func zalloc;
+	free_func  zfree;
+	voidpf     opaque;
+	
+	int     data_type;
+	uLong   adler;
+	uLong   reserved;
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+.Ed
+.
+.Pp
+The fields of
+.Vt z_stream
+are as follows:
+.
+.Bl -tag -width "data_type"
+.It Fa next_in
+next input byte
+.It Fa avail_in
+number of bytes available at
+.Fa next_in
+.It Fa total_in
+total number of input bytes read so far
+.It Fa next_out
+next output byte will go here
+.It Fa avail_out
+remaining free space at
+.Fa next_out
+.It Fa total_out
+total number of bytes output so far
+.It Fa msg
+last error message,
+.Dv NULL
+if no error
+.It Fa state
+not visible by applications
+.It Fa zalloc
+used to allocate the internal state
+.It Fa zfree
+used to free the internal state
+.It Fa opaque
+private data object passed to
+.Fa zalloc
+and
+.Fa zfree
+.It data_type
+best guess about the data type:
+binary or text for
+.Fn deflate ,
+or the decoding state for
+.Xr inflate 3
+.It adler
+Adler-32 or CRC-32 value of the uncompressed data
+.It reserved
+reserved for future use
+.El
+.
+.Pp
 .Fn deflateInit
 initializes the internal stream state for compression.
 The fields