GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
zzip_entry_fopen(3) zziplib Function List zzip_entry_fopen(3)

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

#include <zzip/fseeko.h>



zzip__new__ ZZIP_ENTRY_FILE *
zzip_entry_fopen(ZZIP_ENTRY * entry, int takeover)
zzip__new__ ZZIP_ENTRY_FILE *
zzip_entry_ffile(FILE * disk, char *filename)
zzip_size_t
zzip_entry_fread(void *ptr, zzip_size_t sized, zzip_size_t nmemb,
                 ZZIP_ENTRY_FILE * file)
int
zzip_entry_fclose(ZZIP_ENTRY_FILE * file)
int
zzip_entry_feof(ZZIP_ENTRY_FILE * file)

The zzip_entry_fopen 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 zzip_entry_fopen 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 zzip_entry_fread will then read in chunks of pagesizes which is the size of the internal readahead buffer. If an error occurs then null is returned.

The zzip_entry_ffile function opens a file found by name, so it does a search into the zip central directory with zzip_entry_findfile and whatever is found first is given to zzip_entry_fopen

The zzip_entry_fread 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 zzip_entry_feof for the difference.

The zzip_entry_fclose function releases any zlib decoder info needed for decompression and dumps the ZZIP_ENTRY_FILE struct then.

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 we just keep on saying that it was an eof, so the app can just continue.

Guido Draheim <guidod@gmx.de>

Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL)

0.13.72 zziplib

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.