zip_fopen_index(3) - Linux man page
Name
zip_fopen , - .Nm zip_fopen_index open file in zip archive for reading
Library
libzip (-lzip)
Synopsis
#include <zip.h>
struct zip_file * zip_fopen(struct zip *archive, const char *fname, int flags);
struct zip_file * zip_fopen_index(struct zip *archive, int index, int flags);
Description
The zip_fopen function opens the file name fname in archive. The flags argument specifies how the name lookup should be done, according to the values are described in zip_name_locate(3). Also, the following values may be or'ed to it.
- ZIP_FL_COMPRESSED
Read the compressed data. Otherwise the data is uncompressed by zip_fread.
ZIP_FL_UNCHANGED
Read the original data from the zip archive, ignoring any changes made to the file.
- The zip_fopen_index function opens the file at position index.
Return Values
Upon successful completion, a
struct zip_file pointer is returned. Otherwise, NULL is returned and the error code in archive is set to indicate the error.
Errors
[ZIP_ER_CHANGED]
- The file data has been changed.
- [ZIP_ER_COMPNOTSUPP]
- The compression method used is not supported.
- [ZIP_ER_MEMORY]
- Required memory could not be allocated.
- [ZIP_ER_READ]
- A file read error occurred.
- [ZIP_ER_SEEK]
- A file seek error occurred.
- [ZIP_ER_ZLIB]
- Initializing the zlib stream failed.
- [ZIP_ER_COMPNOTSUPP]
- The function zip_fopen may also fail and set for any of the errors specified for the routine zip_name_locate(3).
The function zip_fopen_index may also fail with ZIP_ER_INVAL if index is invalid.
See Also
libzip(3), zip_fclose(3), zip_fread(3), zip_name_locate(3)
Authors
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>