about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile1
-rw-r--r--gzflush.357
2 files changed, 58 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0f10616..0518b4b 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ MAN += deflateSetDictionary.3
 MAN += deflateSetHeader.3
 MAN += deflateTune.3
 MAN += gzbuffer.3
+MAN += gzflush.3
 MAN += gzfread.3
 MAN += gzfwrite.3
 MAN += gzgetc.3
diff --git a/gzflush.3 b/gzflush.3
new file mode 100644
index 0000000..b038556
--- /dev/null
+++ b/gzflush.3
@@ -0,0 +1,57 @@
+.Dd November 13, 2018
+.Dt GZFLUSH 3
+.Os
+.
+.Sh NAME
+.Nm gzflush
+.Nd flush output to compressed file
+.
+.Sh LIBRARY
+.Lb libz
+.
+.Sh SYNOPSIS
+.In zlib.h
+.Ft int
+.Fn gzflush "gzFile file" "int flush"
+.
+.Sh DESCRIPTION
+Flushes all pending output
+into the compressed file.
+The parameter
+.Fa flush
+is as in the
+.Xr deflate 3
+function.
+.Fn gzflush
+is only permitted when writing.
+.
+.Pp
+If the
+.Fa flush
+parameter is
+.Dv Z_FINISH ,
+the remaining data is written
+and the gzip stream
+is completed in the output.
+If
+.Xr gzwrite 3
+is called again,
+a new gzip stream
+will be started in the output.
+.Xr gzread 3
+is able to read
+such concatenated gzip streams.
+.
+.Pp
+.Fn gzflush
+should be called only when strictly necessary
+because it will degrade compression
+if called too often.
+.
+.Sh RETURN VALUE
+The return value
+is the zlib error number
+.Po
+see function
+.Xr gzerror 3
+.Pc .