| ARX 1.0 The next-generation open source augmented reality toolkit.

Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
zip.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <stdint.h>`
`#include <string.h>`
`#include <limits.h>`
`#include <errno.h>`
`#include "zlib.h"`
`#include "zip.h"`
Include dependency graph for zip.c:

## Classes
struct | linkedlist_datablock_internal_s
struct | linkedlist_data_s
struct | curfile64_info
struct | zip64_internal

## Macros
#define | SIZEDATA_INDATABLOCK (4096-(4*4))
#define | DISKHEADERMAGIC (0x08074b50)
#define | LOCALHEADERMAGIC (0x04034b50)
#define | CENTRALHEADERMAGIC (0x02014b50)
#define | ENDHEADERMAGIC (0x06054b50)
#define | ZIP64ENDHEADERMAGIC (0x06064b50)
#define | ZIP64ENDLOCHEADERMAGIC (0x07064b50)
#define | DATADESCRIPTORMAGIC (0x08074b50)
#define | FLAG_LOCALHEADER_OFFSET (0x06)
#define | CRC_LOCALHEADER_OFFSET (0x0e)
#define | SIZECENTRALHEADER (0x2e) /* 46 */
#define | SIZECENTRALHEADERLOCATOR (0x14) /* 20 */
#define | SIZECENTRALDIRITEM (0x2e)
#define | SIZEZIPLOCALHEADER (0x1e)
#define | BUFREADCOMMENT (0x400)
#define | VERSIONMADEBY (0x0) /* platform dependent */
#define | Z_BUFSIZE (UINT16_MAX)
#define | ALLOC(size) (malloc(size))
#define | TRYFREE(p) {if (p) free(p);}
#define | MAKEULONG64(a, b) ((uint64_t)(((unsigned long)(a)) | ((uint64_t)((unsigned long)(b))) << 32))

## Typedefs
typedef struct linkedlist_datablock_internal_s | linkedlist_datablock_internal
typedef struct linkedlist_data_s | linkedlist_data

## Functions
zipFile ZEXPORT | zipOpen4 (const void *path, int append, uint64_t disk_size, const char **globalcomment, zlib_filefunc64_32_def *pzlib_filefunc64_32_def)
zipFile ZEXPORT | zipOpen2 (const char *path, int append, const char **globalcomment, zlib_filefunc_def *pzlib_filefunc32_def)
zipFile ZEXPORT | zipOpen2_64 (const void *path, int append, const char **globalcomment, zlib_filefunc64_def *pzlib_filefunc_def)
zipFile ZEXPORT | zipOpen3 (const char *path, int append, uint64_t disk_size, const char **globalcomment, zlib_filefunc_def *pzlib_filefunc32_def)
zipFile ZEXPORT | zipOpen3_64 (const void *path, int append, uint64_t disk_size, const char **globalcomment, zlib_filefunc64_def *pzlib_filefunc_def)
zipFile ZEXPORT | zipOpen (const char *path, int append)
zipFile ZEXPORT | zipOpen64 (const void *path, int append)
int ZEXPORT | zipOpenNewFileInZip_internal (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t flag_base, int zip64, uint16_t method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, int aes, uint16_t version_madeby)
int ZEXPORT | zipOpenNewFileInZip5 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t flag_base, int zip64, uint16_t method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, int aes)
int ZEXPORT | zipOpenNewFileInZip4_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base, int zip64)
int ZEXPORT | zipOpenNewFileInZip4 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, uint16_t version_madeby, uint16_t flag_base)
int ZEXPORT | zipOpenNewFileInZip3 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting)
int ZEXPORT | zipOpenNewFileInZip3_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, ZIP_UNUSED uint32_t crc_for_crypting, int zip64)
int ZEXPORT | zipOpenNewFileInZip2 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw)
int ZEXPORT | zipOpenNewFileInZip2_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int raw, int zip64)
int ZEXPORT | zipOpenNewFileInZip64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level, int zip64)
int ZEXPORT | zipOpenNewFileInZip (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, uint16_t size_extrafield_global, const char *comment, uint16_t method, int level)
int ZEXPORT | zipWriteInFileInZip (zipFile file, const void *buf, uint32_t len)
int ZEXPORT | zipCloseFileInZipRaw64 (zipFile file, uint64_t uncompressed_size, uint32_t crc32)
int ZEXPORT | zipCloseFileInZipRaw (zipFile file, uint32_t uncompressed_size, uint32_t crc32)
int ZEXPORT | zipCloseFileInZip (zipFile file)
int ZEXPORT | zipClose (zipFile file, const char *global_comment)
int ZEXPORT | zipClose_64 (zipFile file, const char *global_comment)
int ZEXPORT | zipClose2_64 (zipFile file, const char *global_comment, uint16_t version_madeby)

## Variables
const char | zip_copyright [] = " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"

## Macro Definition Documentation

## ◆ ALLOC

#define ALLOC | ( |  | size | ) | (malloc(size))

## ◆ BUFREADCOMMENT

#define BUFREADCOMMENT (0x400)

## ◆ CENTRALHEADERMAGIC

#define CENTRALHEADERMAGIC (0x02014b50)

## ◆ CRC_LOCALHEADER_OFFSET

#define CRC_LOCALHEADER_OFFSET (0x0e)

## ◆ DATADESCRIPTORMAGIC

#define DATADESCRIPTORMAGIC (0x08074b50)

## ◆ DISKHEADERMAGIC

#define DISKHEADERMAGIC (0x08074b50)

## ◆ ENDHEADERMAGIC

#define ENDHEADERMAGIC (0x06054b50)

## ◆ FLAG_LOCALHEADER_OFFSET

#define FLAG_LOCALHEADER_OFFSET (0x06)

## ◆ LOCALHEADERMAGIC

#define LOCALHEADERMAGIC (0x04034b50)

## ◆ MAKEULONG64

#define MAKEULONG64 | ( |  | a,
|  |  | b
| ) |  | ((uint64_t)(((unsigned long)(a)) | ((uint64_t)((unsigned long)(b))) << 32))

## ◆ SIZECENTRALDIRITEM

#define SIZECENTRALDIRITEM (0x2e)

## ◆ SIZECENTRALHEADER

#define SIZECENTRALHEADER (0x2e) /* 46 */

## ◆ SIZECENTRALHEADERLOCATOR

#define SIZECENTRALHEADERLOCATOR (0x14) /* 20 */

## ◆ SIZEDATA_INDATABLOCK

#define SIZEDATA_INDATABLOCK (4096-(4*4))

## ◆ SIZEZIPLOCALHEADER

#define SIZEZIPLOCALHEADER (0x1e)

## ◆ TRYFREE

#define TRYFREE | ( |  | p | ) | {if (p) free(p);}

## ◆ VERSIONMADEBY

#define VERSIONMADEBY (0x0) /* platform dependent */

## ◆ Z_BUFSIZE

#define Z_BUFSIZE (UINT16_MAX)

## ◆ ZIP64ENDHEADERMAGIC

#define ZIP64ENDHEADERMAGIC (0x06064b50)

## ◆ ZIP64ENDLOCHEADERMAGIC

#define ZIP64ENDLOCHEADERMAGIC (0x07064b50)

## Typedef Documentation

## ◆ linkedlist_data

typedef struct linkedlist_data_s linkedlist_data

## ◆ linkedlist_datablock_internal

typedef struct linkedlist_datablock_internal_s linkedlist_datablock_internal

## Function Documentation

## ◆ zipClose()

int ZEXPORT zipClose | ( | zipFile | file,
|  | const char * | global_comment
| ) |  |

Here is the call graph for this function:

## ◆ zipClose2_64()

int ZEXPORT zipClose2_64 | ( | zipFile | file,
|  | const char * | global_comment,
|  | uint16_t | version_madeby
| ) |  |

Here is the call graph for this function:

## ◆ zipClose_64()

int ZEXPORT zipClose_64 | ( | zipFile | file,
|  | const char * | global_comment
| ) |  |

Here is the call graph for this function:

## ◆ zipCloseFileInZip()

int ZEXPORT zipCloseFileInZip | ( | zipFile | file | ) |

Here is the call graph for this function:

## ◆ zipCloseFileInZipRaw()

int ZEXPORT zipCloseFileInZipRaw | ( | zipFile | file,
|  | uint32_t | uncompressed_size,
|  | uint32_t | crc32
| ) |  |

Here is the call graph for this function:

## ◆ zipCloseFileInZipRaw64()

int ZEXPORT zipCloseFileInZipRaw64 | ( | zipFile | file,
|  | uint64_t | uncompressed_size,
|  | uint32_t | crc32
| ) |  |

## ◆ zipOpen()

zipFile ZEXPORT zipOpen | ( | const char * | path,
|  | int | append
| ) |  |

Here is the call graph for this function:

## ◆ zipOpen2()

zipFile ZEXPORT zipOpen2 | ( | const char * | path,
|  | int | append,
|  | const char ** | globalcomment,
|  | zlib_filefunc_def * | pzlib_filefunc32_def
| ) |  |

Here is the call graph for this function:

## ◆ zipOpen2_64()

zipFile ZEXPORT zipOpen2_64 | ( | const void * | path,
|  | int | append,
|  | const char ** | globalcomment,
|  | zlib_filefunc64_def * | pzlib_filefunc_def
| ) |  |

Here is the call graph for this function:

## ◆ zipOpen3()

zipFile ZEXPORT zipOpen3 | ( | const char * | path,
|  | int | append,
|  | uint64_t | disk_size,
|  | const char ** | globalcomment,
|  | zlib_filefunc_def * | pzlib_filefunc32_def
| ) |  |

Here is the call graph for this function:

## ◆ zipOpen3_64()

zipFile ZEXPORT zipOpen3_64 | ( | const void * | path,
|  | int | append,
|  | uint64_t | disk_size,
|  | const char ** | globalcomment,
|  | zlib_filefunc64_def * | pzlib_filefunc_def
| ) |  |

Here is the call graph for this function:

## ◆ zipOpen4()

zipFile ZEXPORT zipOpen4 | ( | const void * | path,
|  | int | append,
|  | uint64_t | disk_size,
|  | const char ** | globalcomment,
|  | zlib_filefunc64_32_def * | pzlib_filefunc64_32_def
| ) |  |

Here is the call graph for this function:

## ◆ zipOpen64()

zipFile ZEXPORT zipOpen64 | ( | const void * | path,
|  | int | append
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip()

int ZEXPORT zipOpenNewFileInZip | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip2()

int ZEXPORT zipOpenNewFileInZip2 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level,
|  | int | raw
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip2_64()

int ZEXPORT zipOpenNewFileInZip2_64 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level,
|  | int | raw,
|  | int | zip64
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip3()

int ZEXPORT zipOpenNewFileInZip3 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | ZIP_UNUSED uint32_t | crc_for_crypting
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip3_64()

int ZEXPORT zipOpenNewFileInZip3_64 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | ZIP_UNUSED uint32_t | crc_for_crypting,
|  | int | zip64
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip4()

int ZEXPORT zipOpenNewFileInZip4 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | ZIP_UNUSED uint32_t | crc_for_crypting,
|  | uint16_t | version_madeby,
|  | uint16_t | flag_base
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip4_64()

int ZEXPORT zipOpenNewFileInZip4_64 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | ZIP_UNUSED uint32_t | crc_for_crypting,
|  | uint16_t | version_madeby,
|  | uint16_t | flag_base,
|  | int | zip64
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip5()

int ZEXPORT zipOpenNewFileInZip5 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | flag_base,
|  | int | zip64,
|  | uint16_t | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | int | aes
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip64()

int ZEXPORT zipOpenNewFileInZip64 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | method,
|  | int | level,
|  | int | zip64
| ) |  |

Here is the call graph for this function:

## ◆ zipOpenNewFileInZip_internal()

int ZEXPORT zipOpenNewFileInZip_internal | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uint16_t | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uint16_t | size_extrafield_global,
|  | const char * | comment,
|  | uint16_t | flag_base,
|  | int | zip64,
|  | uint16_t | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | int | aes,
|  | uint16_t | version_madeby
| ) |  |

Here is the call graph for this function:

## ◆ zipWriteInFileInZip()

int ZEXPORT zipWriteInFileInZip | ( | zipFile | file,
|  | const void * | buf,
|  | uint32_t | len
| ) |  |

## Variable Documentation

## ◆ zip_copyright

const char zip_copyright[] = " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"