'\" t .\" Title: zzip_entry_fopen .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 0.13.62 .\" Manual: zziplib Function List .\" Source: zziplib .\" Language: English .\" .TH "ZZIP_ENTRY_FOPEN" "3" "0\&.13\&.62" "zziplib" "zziplib Function List" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "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 .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'zzip__new__\ ZZIP_ENTRY_FILE\ *\ zzip_entry_fopen('u .BI "zzip__new__ ZZIP_ENTRY_FILE * zzip_entry_fopen((ZZIP_ENTRY\ *\ entry,\ int\ takeover));" .HP \w'zzip__new__\ ZZIP_ENTRY_FILE\ *\ zzip_entry_ffile('u .BI "zzip__new__ ZZIP_ENTRY_FILE * zzip_entry_ffile((FILE\ *\ disk,\ char\ *filename));" .HP \w'zzip_size_t\ zzip_entry_fread('u .BI "zzip_size_t zzip_entry_fread((void\ *ptr,\ zzip_size_t\ sized,\ zzip_size_t\ nmemb,\ ZZIP_ENTRY_FILE\ *\ file));" .HP \w'int\ zzip_entry_fclose('u .BI "int zzip_entry_fclose((ZZIP_ENTRY_FILE\ *\ file));" .HP \w'int\ zzip_entry_feof('u .BI "int zzip_entry_feof((ZZIP_ENTRY_FILE\ *\ file));" .SH "DESCRIPTION" .PP The \fBzzip_entry_fopen\fR function does take an "entry" argument and copies it (or just takes it over as owner) to a new ZZIP_ENTRY_FILE handle structure\&. That structure contains also a zlib buffer for decoding\&. The \fBzzip_entry_fopen\fR function does seek to the file_header of the given "entry" and validates it for the data buffer following it\&. We do also prefetch some data from the data buffer thereby trying to match the disk pagesize for faster access later\&. The \fBzzip_entry_fread\fR will then read in chunks of pagesizes which is the size of the internal readahead buffer\&. If an error occurs then null is returned\&. .PP The \fBzzip_entry_ffile\fR function opens a file found by name, so it does a search into the zip central directory with \fBzzip_entry_findfile\fR and whatever is found first is given to \fBzzip_entry_fopen\fR .PP The \fBzzip_entry_fread\fR function reads more bytes into the output buffer specified as arguments\&. The return value is null on eof or error, the stdio\-like interface can not distinguish between these so you need to check with \fBzzip_entry_feof\fR for the difference\&. .PP The \fBzzip_entry_fclose\fR function releases any zlib decoder info needed for decompression and dumps the ZZIP_ENTRY_FILE struct then\&. .PP The \fBzzip_entry_feof\fR function allows to distinguish an error from an eof condition\&. Actually, if we found an error but we did already reach eof then we just keep on saying that it was an eof, so the app can just continue\&. .SH "AUTHOR" .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Guido Draheim .RE .SH "COPYRIGHT" .PP Copyright (c) 2003,2004 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