zzip_entry_fopen(3)

NAME
zzip_entry_fopen, zzip_entry_ffile, zzip_entry_fread, zzip_entry_fclose, zzip_entry_feof - open a file within a zip disk for reading

SYNOPSIS

#include <zzip/fseeko.h>

b'zzip__new__ ZZIP_ENTRY_FILE *\fInzzip_entry_fopen(ZZIP_ENTRY * entry, int takeover)
b'zzip__new__ ZZIP_ENTRY_FILE *\fInzzip_entry_ffile(FILE * disk, char *filename)
b'zzip_size_t\fInzzip_entry_fread(void *ptr, zzip_size_t sized, zzip_size_t nmemb,                ZZIP_ENTRY_FILE * file)
b'int\fInzzip_entry_fclose(ZZIP_ENTRY_FILE * file)
b'int\fInzzip_entry_feof(ZZIP_ENTRY_FILE * file)n'

DESCRIPTION
b'The zzip_entry_fopen function does take an "entry" argument and copies it (or just takesit over as owner) to a new ZZIP_ENTRY_FILE handle structure. Thatstructure contains also a zlib buffer for decoding. The zzip_entry_fopen function doesseek to the file_header of the given "entry" and validates it for thedata buffer following it. We do also prefetch some data from the databuffer thereby trying to match the disk pagesize for faster access later.The zzip_entry_fread will then read in chunks of pagesizes which isthe size of the internal readahead buffer. If an error occurs then nullis returned.n'

b'The zzip_entry_ffile function opens a file found by name, so it does a search intothe zip central directory with zzip_entry_findfile and whateveris found first is given to zzip_entry_fopenn'

b'The zzip_entry_fread function reads more bytes into the output buffer specified asarguments. The return value is null on eof or error, the stdio-likeinterface can not distinguish between these so you need to checkwith zzip_entry_feof for the difference.n'

b' The zzip_entry_fclose function releases any zlib decoder info needed for decompressionand dumps the ZZIP_ENTRY_FILE struct then.n'

b'The zzip_entry_feof function allows to distinguish an error from an eof condition.Actually, if we found an error but we did already reach eof then wejust keep on saying that it was an eof, so the app can just continue.n

AUTHOR
b'Guido Draheim <guidod@gmx.de>

COPYRIGHT
b'Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL)n'