CSEngine
|
Classes | |
struct | zip_t |
Macros | |
#define | ZIP_DEFAULT_COMPRESSION_LEVEL 6 |
#define | ZIP_ENOINIT -1 |
#define | ZIP_EINVENTNAME -2 |
#define | ZIP_ENOENT -3 |
#define | ZIP_EINVMODE -4 |
#define | ZIP_EINVLVL -5 |
#define | ZIP_ENOSUP64 -6 |
#define | ZIP_EMEMSET -7 |
#define | ZIP_EWRTENT -8 |
#define | ZIP_ETDEFLINIT -9 |
#define | ZIP_EINVIDX -10 |
#define | ZIP_ENOHDR -11 |
#define | ZIP_ETDEFLBUF -12 |
#define | ZIP_ECRTHDR -13 |
#define | ZIP_EWRTHDR -14 |
#define | ZIP_EWRTDIR -15 |
#define | ZIP_EOPNFILE -16 |
#define | ZIP_EINVENTTYPE -17 |
#define | ZIP_EMEMNOALLOC -18 |
#define | ZIP_ENOFILE -19 |
#define | ZIP_ENOPERM -20 |
#define | ZIP_EOOMEM -21 |
#define | ZIP_EINVZIPNAME -22 |
#define | ZIP_EMKDIR -23 |
#define | ZIP_ESYMLINK -24 |
#define | ZIP_ECLSZIP -25 |
#define | ZIP_ECAPSIZE -26 |
#define | ZIP_EFSEEK -27 |
#define | ZIP_EFREAD -28 |
#define | ZIP_EFWRITE -29 |
Functions | |
const char * | zip_strerror (int errnum) |
struct zip_t * | zip_open (const char *zipname, int level, char mode) |
void | zip_close (struct zip_t *zip) |
int | zip_is64 (struct zip_t *zip) |
int | zip_entry_open (struct zip_t *zip, const char *entryname) |
int | zip_entry_openbyindex (struct zip_t *zip, int index) |
int | zip_entry_close (struct zip_t *zip) |
const char * | zip_entry_name (struct zip_t *zip) |
int | zip_entry_index (struct zip_t *zip) |
int | zip_entry_isdir (struct zip_t *zip) |
unsigned long long | zip_entry_size (struct zip_t *zip) |
unsigned int | zip_entry_crc32 (struct zip_t *zip) |
int | zip_entry_write (struct zip_t *zip, const void *buf, size_t bufsize) |
int | zip_entry_fwrite (struct zip_t *zip, const char *filename) |
ssize_t | zip_entry_read (struct zip_t *zip, void **buf, size_t *bufsize) |
ssize_t | zip_entry_noallocread (struct zip_t *zip, void *buf, size_t bufsize) |
int | zip_entry_fread (struct zip_t *zip, const char *filename) |
int | zip_entry_extract (struct zip_t *zip, size_t(*on_extract)(void *arg, unsigned long long offset, const void *data, size_t size), void *arg) |
int | zip_entries_total (struct zip_t *zip) |
int | zip_entries_delete (struct zip_t *zip, char *const entries[], size_t len) |
int | zip_stream_extract (const char *stream, size_t size, const char *dir, int(*on_extract)(const char *filename, void *arg), void *arg) |
struct zip_t * | zip_stream_open (const char *stream, size_t size, int level, char mode) |
ssize_t | zip_stream_copy (struct zip_t *zip, void **buf, ssize_t *bufsize) |
void | zip_stream_close (struct zip_t *zip) |
int | zip_create (const char *zipname, const char *filenames[], size_t len) |
int | zip_extract (const char *zipname, const char *dir, int(*on_extract_entry)(const char *filename, void *arg), void *arg) |
#define ZIP_DEFAULT_COMPRESSION_LEVEL 6 |
|
extern |
Closes the zip archive, releases resources - always finalize.
zip | zip archive handler. |
Definition at line 836 of file zip.cpp.
|
extern |
Creates a new archive and puts files into a single zip archive.
zipname | zip archive file. |
filenames | input files. |
len | number of input files. |
Definition at line 1541 of file zip.cpp.
References ZIP_DEFAULT_COMPRESSION_LEVEL, and ZIP_ENOINIT.
|
extern |
Deletes zip archive entries.
zip | zip archive handler. |
entries | array of zip archive entries to be deleted. |
len | the number of entries to be deleted. |
Definition at line 1426 of file zip.cpp.
References ZIP_ENOINIT, and zip_entries_total().
|
extern |
Returns the number of all entries (files and directories) in the zip archive.
zip | zip archive handler. |
Definition at line 1417 of file zip.cpp.
References ZIP_ENOINIT.
Referenced by zip_entries_delete().
|
extern |
Closes a zip entry, flushes buffer and releases resources.
zip | zip archive handler. |
Definition at line 1087 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
|
extern |
Extracts the current zip entry using a callback function (on_extract).
zip | zip archive handler. |
on_extract | callback function. |
arg | opaque pointer (optional argument, which you can pass to the on_extract callback) |
|
extern |
Extracts the current zip entry into output file.
zip | zip archive handler. |
filename | output file. |
Definition at line 1346 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Compresses a file for the current zip entry.
zip | zip archive handler. |
filename | input file. |
Definition at line 1247 of file zip.cpp.
References ZIP_ENOINIT, and zip_entry_write().
|
extern |
Returns an index of the current zip entry.
zip | zip archive handler. |
Definition at line 1177 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Determines if the current zip entry is a directory entry.
zip | zip archive handler. |
Definition at line 1186 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Returns a local name of the current zip entry.
The main difference between user's entry name and local entry name is optional relative path. Following .ZIP File Format Specification - the path stored MUST not contain a drive or device letter, or a leading slash. All slashes MUST be forward slashes '/' as opposed to backwards slashes '\' for compatibility with Amiga and UNIX file systems etc.
zip | zip archive handler. |
Definition at line 1168 of file zip.cpp.
|
extern |
Extracts the current zip entry into a memory buffer using no memory allocation.
zip | zip archive handler. |
buf | preallocated output buffer. |
bufsize | output buffer size (in bytes). |
Definition at line 1324 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Opens an entry by name in the zip archive.
For zip archive opened in 'w' or 'a' mode the function will append a new entry. In readonly mode the function tries to locate the entry in global dictionary.
zip | zip archive handler. |
entryname | an entry name in local dictionary. |
Definition at line 858 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Opens a new entry by index in the zip archive.
This function is only valid if zip archive was opened in 'r' (readonly) mode.
zip | zip archive handler. |
index | index in local dictionary. |
Definition at line 1014 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Extracts the current zip entry into output buffer.
The function allocates sufficient memory for a output buffer.
zip | zip archive handler. |
buf | output buffer. |
bufsize | output buffer size (in bytes). |
Definition at line 1295 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
|
extern |
Compresses an input buffer for the current zip entry.
zip | zip archive handler. |
buf | input buffer. |
bufsize | input buffer size (in bytes). |
Definition at line 1209 of file zip.cpp.
References ZIP_ENOINIT.
Referenced by zip_entry_fwrite().
|
extern |
Extracts a zip archive file into directory.
If on_extract_entry is not NULL, the callback will be called after successfully extracted each zip entry. Returning a negative value from the callback will cause abort and return an error. The last argument (void *arg) is optional, which you can use to pass data to the on_extract_entry callback.
zipname | zip archive file. |
dir | output directory. |
on_extract_entry | on extract callback. |
arg | opaque pointer. |
Definition at line 1601 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Determines if the archive has a zip64 end of central directory headers.
zip | zip archive handler. |
Definition at line 849 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Opens zip archive with compression level using the given mode.
zipname | zip archive file name. |
level | compression level (0-9 are the standard zlib-style levels). |
mode | file access mode.
|
Definition at line 779 of file zip.cpp.
|
extern |
|
extern |
Copy zip archive stream output buffer.
zip | zip archive handler. |
buf | output buffer. User should free buf. |
bufsize | output buffer size (in bytes). |
Definition at line 1517 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Extracts a zip archive stream into directory.
If on_extract is not NULL, the callback will be called after successfully extracted each zip entry. Returning a negative value from the callback will cause abort and return an error. The last argument (void *arg) is optional, which you can use to pass data to the on_extract callback.
stream | zip archive stream. |
size | stream size. |
dir | output directory. |
on_extract | on extract callback. |
arg | opaque pointer. |
Definition at line 1461 of file zip.cpp.
References ZIP_ENOINIT.
|
extern |
Opens zip archive stream into memory.
stream | zip archive stream. |
size | stream size. |
Definition at line 1481 of file zip.cpp.
|
extern |
Looks up the error message string coresponding to an error number.
errnum | error number |
Definition at line 140 of file zip.cpp.