From a011202e9b2ca54c1f77a8257ba6aafd72f6c9aa Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 13 Nov 2018 16:30:50 -0500 Subject: Add gztell(3) to gzseek.3 --- Makefile | 1 + gzseek.3 | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 45081d8..ffac1f1 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,7 @@ MLINKS += compress.3 compress2.3 MLINKS += crc32.3 crc32_z.3 MLINKS += gzopen.3 gzdopen.3 MLINKS += gzseek.3 gzrewind.3 +MLINKS += gzseek.3 gztell.3 MLINKS += inflateReset.3 inflateReset2.3 MLINKS += uncompress.3 uncompress2.3 diff --git a/gzseek.3 b/gzseek.3 index cf1bc71..dd69a5c 100644 --- a/gzseek.3 +++ b/gzseek.3 @@ -4,7 +4,8 @@ . .Sh NAME .Nm gzseek , -.Nm gzrewind +.Nm gzrewind , +.Nm gztell .Nd seek compressed file . .Sh LIBRARY @@ -16,6 +17,8 @@ .Fn gzseek "gzFile file" "z_off_t offset" "int whence" .Ft int .Fn gzrewind "gzFile file" +.Ft z_off_t +.Fn gztell "gzFile file" . .Sh DESCRIPTION Sets the starting position @@ -58,6 +61,26 @@ only for reading. is equivalent to .Li (int) Ns Fn gzseek file 0L SEEK_SET . . +.Pp +.Fn gztell +returns the starting position +for the next +.Xr gzread 3 +or +.Xr gzwrite 3 +on the given compressed file. +This position represents a number of bytes +in the uncompressed data stream, +and is zero when starting, +even if appending or reading +a gzip stream from the middle of a file using +.Xr gzdopen 3 . +. +.Pp +.Fn gztell file +is equivalent to +.Fn gzseek file 0L SEEK_CUR . +. .Sh RETURN VALUES .Fn gzseek returns the resulting offset location -- cgit 1.4.1