zzip_disk_fopen(3)

NAME
zzip_disk_fopen, zzip_disk_entry_fopen, zzip_disk_fread, zzip_disk_fclose, zzip_disk_feof - openening a file part wrapped within a (mmapped) zip archive

SYNOPSIS

#include <zzip/mmapped.h>

b'zzip__new__ ZZIP_DISK_FILE *\fInzzip_disk_fopen(ZZIP_DISK * disk, char *filename)
b'zzip__new__ ZZIP_DISK_FILE *\fInzzip_disk_entry_fopen(ZZIP_DISK * disk, ZZIP_DISK_ENTRY * entry)
b'zzip_size_t\fInzzip_disk_fread(void *ptr, zzip_size_t sized, zzip_size_t nmemb,               ZZIP_DISK_FILE * file)
b'int\fInzzip_disk_fclose(ZZIP_DISK_FILE * file)
b'int\fInzzip_disk_feof(ZZIP_DISK_FILE * file)n'

DESCRIPTION
b'The zzip_disk_fopen function opens a file found by name, so it does a search intothe zip central directory with zzip_disk_findfile and whateveris found first is given to zzip_disk_entry_fopen

b'The zzip_disk_fopen function may return null on errors (errno).n'

b'the ZZIP_DISK_FILE* is rather simple in just encapsulating thearguments given to the zzip_disk_entry_fopen function plus a zlib deflate buffer.Note that the ZZIP_DISK pointer does already contain the fullmmapped file area of a zip disk, so open()ing a file part withinthat area happens to be a lookup of its bounds and encoding. Thatinformation is memorized on the ZZIP_DISK_FILE so that subsequent_read() operations will be able to get the next data portion orreturn an eof condition for that file part wrapped in the zip archive.

b'The zzip_disk_entry_fopen function may return null on errors (errno = ENOMEM|EBADMSG).n'

b'The zzip_disk_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_disk_feof for the difference.n'

b' The zzip_disk_fclose function releases any zlib decoder info needed for decompressionand dumps the ZZIP_DISK_FILE* then.

b'The zzip_disk_fclose function always returns 0.n'

b'The zzip_disk_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.

b'The zzip_disk_feof function returns EOF in case and 0 when not at the endof file.n

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

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