about summary refs log tree commit diff homepage
path: root/gzseek.3
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-11-13 16:30:50 -0500
committerJune McEnroe <june@causal.agency>2018-11-13 16:33:36 -0500
commita011202e9b2ca54c1f77a8257ba6aafd72f6c9aa (patch)
treebf1efd3bf7f71fa0d37f96b552c0fcc1d4369605 /gzseek.3
parentAdd gzseek.3 (diff)
downloadzlib-man-pages-a011202e9b2ca54c1f77a8257ba6aafd72f6c9aa.tar.gz
zlib-man-pages-a011202e9b2ca54c1f77a8257ba6aafd72f6c9aa.zip
Add gztell(3) to gzseek.3
Diffstat (limited to '')
-rw-r--r--gzseek.325
1 files changed, 24 insertions, 1 deletions
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