|
libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
|
Data Structures | |
| 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 |
| #define | ZIP_ERINIT -30 |
| #define | ZIP_EWINIT -31 |
| #define | ZIP_EWRINIT -32 |
Functions | |
| const char * | zip_strerror (int errnum) |
| struct zip_t * | zip_open (const char *zipname, int level, char mode) |
| struct zip_t * | zip_openwitherror (const char *zipname, int level, char mode, int *errnum) |
| void | zip_close (struct zip_t *zip) |
| int | zip_is64 (struct zip_t *zip) |
| int | zip_offset (struct zip_t *zip, uint64_t *offset) |
| int | zip_entry_open (struct zip_t *zip, const char *entryname) |
| int | zip_entry_opencasesensitive (struct zip_t *zip, const char *entryname) |
| int | zip_entry_openbyindex (struct zip_t *zip, size_t index) |
| int | zip_entry_close (struct zip_t *zip) |
| const char * | zip_entry_name (struct zip_t *zip) |
| ssize_t | 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 long long | zip_entry_uncomp_size (struct zip_t *zip) |
| unsigned long long | zip_entry_comp_size (struct zip_t *zip) |
| unsigned int | zip_entry_crc32 (struct zip_t *zip) |
| unsigned long long | zip_entry_dir_offset (struct zip_t *zip) |
| unsigned long long | zip_entry_header_offset (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, uint64_t offset, const void *data, size_t size), void *arg) |
| ssize_t | zip_entries_total (struct zip_t *zip) |
| ssize_t | zip_entries_delete (struct zip_t *zip, char *const entries[], size_t len) |
| ssize_t | zip_entries_deletebyindex (struct zip_t *zip, size_t 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) |
| struct zip_t * | zip_stream_openwitherror (const char *stream, size_t size, int level, char mode, int *errnum) |
| ssize_t | zip_stream_copy (struct zip_t *zip, void **buf, size_t *bufsize) |
| void | zip_stream_close (struct zip_t *zip) |
| struct zip_t * | zip_cstream_open (FILE *stream, int level, char mode) |
| struct zip_t * | zip_cstream_openwitherror (FILE *stream, int level, char mode, int *errnum) |
| void | zip_cstream_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 |
|
extern |
|
extern |
|
extern |
Opens zip archive from existing FILE stream with compression level using the given mode. The stream will not be closed when calling zip_close.
| stream | C FILE stream. |
| level | compression level (0-9 are the standard zlib-style levels). |
| mode | file access mode. This mode should be equivalent to the mode provided when opening the file.
|
|
extern |
Opens zip archive from existing FILE stream with compression level using the given mode. The function additionally returns
| errnum | - The stream will not be closed when calling zip_close. |
| stream | C FILE stream. |
| level | compression level (0-9 are the standard zlib-style levels). |
| mode | file access mode.
|
| errnum | 0 on success, negative number (< 0) on error. |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
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 |
|
extern |
|
extern |
|
extern |
|
extern |
|
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. |
|
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). |
|
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. |
|
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. |
|
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 (case sensitive).
| zip | zip archive handler. |
| entryname | an entry name in local dictionary (case sensitive). |
|
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). |
|
extern |
|
extern |
|
extern |
|
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. |
|
extern |
|
extern |
|
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.
|
|
extern |
Opens zip archive with compression level using the given mode. The function additionally returns
| errnum | - |
| zipname | zip archive file name. |
| level | compression level (0-9 are the standard zlib-style levels). |
| mode | file access mode.
|
| errnum | 0 on success, negative number (< 0) on error. |
|
extern |
|
extern |
|
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. |
|
extern |
Opens zip archive stream into memory.
| stream | zip archive stream. |
| size | stream size. |
| level | compression level (0-9 are the standard zlib-style levels). |
| mode | file access mode.
|
|
extern |
Opens zip archive stream into memory. The function additionally returns
| errnum | - |
| stream | zip archive stream. |
| size | stream size.* |
| level | compression level (0-9 are the standard zlib-style levels). |
| mode | file access mode.
|
| errnum | 0 on success, negative number (< 0) on error. |