zzip_seek

Langue: en

Version: 0\&.13\&.49 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

zzip_seek -

SYNOPSIS

 #include <zzip/lib.h>
 
zzip_off_t zzip_seek((ZZIP_FILE * fp, zzip_off_t offset, int whence));

DESCRIPTION

The zzip_seek function will perform a lseek(2) operation on a real/zipped file

It will try to seek to the offset specified by offset, relative to whence, which is one of SEEK_SET, SEEK_CUR or SEEK_END.

If the file-handle is wrapping a stat'able file then it will actually just perform a normal lseek(2)-call. Otherwise the relative offset is calculated, negative offsets are transformed into positive ones by rewinding the file, and then data is read until the offset is reached. This can make the function terribly slow, but this is how gzio implements it, so I'm not sure there is a better way without using the internals of the algorithm.

AUTHOR

* Guido Draheim <guidod@gmx.de> Tomi Ollila <Tomi.Ollila@iki.fi>

Copyright (c) 1999,2000,2001,2002,2003 Guido Draheim All rights reserved, use under the restrictions of the Lesser GNU General Public License or alternatively the restrictions of the Mozilla Public License 1.1