From 6c6d1eb57886d9758021252ed43901e0e96b6102 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 13 Nov 2018 16:17:30 -0500 Subject: Add gzflush.3 --- Makefile | 1 + gzflush.3 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 gzflush.3 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 . -- cgit 1.4.1