Ruby: ext/zlib/zlib-1.2.13/contrib/minizip/zip.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Typedefs | Functions | Variables
zip.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <time.h>`
`#include "zlib.h"`
`#include "zip.h"`
`#include <errno.h>`
`#include "crypt.h"`

Go to the source code of this file.

## Data Structures
struct | linkedlist_datablock_internal_s
struct | linkedlist_data_s
struct | curfile64_info
struct | zip64_internal

## Macros
#define | local static
#define | VERSIONMADEBY (0x0) /* platform depedent */
#define | Z_BUFSIZE (64*1024)
#define | Z_MAXFILENAMEINZIP (256)
#define | ALLOC(size) (malloc(size))
#define | TRYFREE(p) {if (p) free(p);}
#define | MAKEULONG64(a, b) ((ZPOS64_T)(((unsigned long)(a)) | ((ZPOS64_T)((unsigned long)(b))) << 32))
#define | SEEK_CUR 1
#define | SEEK_END 2
#define | SEEK_SET 0
#define | SIZEDATA_INDATABLOCK (4096-(4*4))
#define | LOCALHEADERMAGIC (0x04034b50)
#define | CENTRALHEADERMAGIC (0x02014b50)
#define | ENDHEADERMAGIC (0x06054b50)
#define | ZIP64ENDHEADERMAGIC (0x6064b50)
#define | ZIP64ENDLOCHEADERMAGIC (0x7064b50)
#define | FLAG_LOCALHEADER_OFFSET (0x06)
#define | CRC_LOCALHEADER_OFFSET (0x0e)
#define | SIZECENTRALHEADER (0x2e) /* 46 */
#define | INCLUDECRYPTINGCODE_IFCRYPTALLOWED
#define | BUFREADCOMMENT (0x400)

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

## Functions
linkedlist_datablock_internal * | allocate_new_datablock ()
void | free_datablock (linkedlist_datablock_internal *ldi)
void | init_linkedlist (linkedlist_data *ll)
void | free_linkedlist (linkedlist_data *ll)
int | add_data_in_datablock (linkedlist_data *ll, const void *buf, uLong len)
int zip64local_putValue | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte))
int | zip64local_putValue (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)
void zip64local_putValue_inmemory | OF ((void *dest, ZPOS64_T x, int nbByte))
void | zip64local_putValue_inmemory (void *dest, ZPOS64_T x, int nbByte)
uLong | zip64local_TmzDateToDosDate (const tm_zip *ptm)
int zip64local_getByte | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi))
int | zip64local_getByte (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)
int zip64local_getShort | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX))
int | zip64local_getShort (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
int | zip64local_getLong (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
int zip64local_getLong64 | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX))
int | zip64local_getLong64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
ZPOS64_T zip64local_SearchCentralDir | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream))
ZPOS64_T | zip64local_SearchCentralDir (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
ZPOS64_T | zip64local_SearchCentralDir64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
int | LoadCentralDirectoryRecord (zip64_internal *pziinit)
zipFile ZEXPORT | zipOpen3 (const void *pathname, int append, zipcharpc *globalcomment, zlib_filefunc64_32_def *pzlib_filefunc64_32_def)
zipFile ZEXPORT | zipOpen2 (const char *pathname, int append, zipcharpc *globalcomment, zlib_filefunc_def *pzlib_filefunc32_def)
zipFile ZEXPORT | zipOpen2_64 (const void *pathname, int append, zipcharpc *globalcomment, zlib_filefunc64_def *pzlib_filefunc_def)
zipFile ZEXPORT | zipOpen (const char *pathname, int append)
zipFile ZEXPORT | zipOpen64 (const void *pathname, int append)
int | Write_LocalFileHeader (zip64_internal *zi, const char *filename, uInt size_extrafield_local, const void *extrafield_local)
int ZEXPORT | zipOpenNewFileInZip4_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64)
int ZEXPORT | zipOpenNewFileInZip4 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase)
int ZEXPORT | zipOpenNewFileInZip3 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting)
int ZEXPORT | zipOpenNewFileInZip3_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, int zip64)
int ZEXPORT | zipOpenNewFileInZip2 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw)
int ZEXPORT | zipOpenNewFileInZip2_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int zip64)
int ZEXPORT | zipOpenNewFileInZip64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int zip64)
int ZEXPORT | zipOpenNewFileInZip (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level)
int | zip64FlushWriteBuffer (zip64_internal *zi)
int ZEXPORT | zipWriteInFileInZip (zipFile file, const void *buf, unsigned int len)
int ZEXPORT | zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32)
int ZEXPORT | zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32)
int ZEXPORT | zipCloseFileInZip (zipFile file)
int | Write_Zip64EndOfCentralDirectoryLocator (zip64_internal *zi, ZPOS64_T zip64eocd_pos_inzip)
int | Write_Zip64EndOfCentralDirectoryRecord (zip64_internal *zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
int | Write_EndOfCentralDirectoryRecord (zip64_internal *zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
int | Write_GlobalComment (zip64_internal *zi, const char *global_comment)
int ZEXPORT | zipClose (zipFile file, const char *global_comment)
int ZEXPORT | zipRemoveExtraInfoBlock (char *pData, int *dataLen, short sHeader)

## 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))

Definition at line 62 of file zip.c.

## ◆ BUFREADCOMMENT

#define BUFREADCOMMENT (0x400)

Definition at line 472 of file zip.c.

## ◆ CENTRALHEADERMAGIC

#define CENTRALHEADERMAGIC (0x02014b50)

Definition at line 104 of file zip.c.

## ◆ CRC_LOCALHEADER_OFFSET

#define CRC_LOCALHEADER_OFFSET (0x0e)

Definition at line 110 of file zip.c.

## ◆ ENDHEADERMAGIC

#define ENDHEADERMAGIC (0x06054b50)

Definition at line 105 of file zip.c.

## ◆ FLAG_LOCALHEADER_OFFSET

#define FLAG_LOCALHEADER_OFFSET (0x06)

Definition at line 109 of file zip.c.

## ◆ INCLUDECRYPTINGCODE_IFCRYPTALLOWED

#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED

Definition at line 185 of file zip.c.

## ◆ local

#define local static

Definition at line 45 of file zip.c.

## ◆ LOCALHEADERMAGIC

#define LOCALHEADERMAGIC (0x04034b50)

Definition at line 103 of file zip.c.

## ◆ MAKEULONG64

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

Definition at line 77 of file zip.c.

## ◆ SEEK_CUR

#define SEEK_CUR 1

Definition at line 80 of file zip.c.

## ◆ SEEK_END

#define SEEK_END 2

Definition at line 84 of file zip.c.

## ◆ SEEK_SET

#define SEEK_SET 0

Definition at line 88 of file zip.c.

## ◆ SIZECENTRALHEADER

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

Definition at line 112 of file zip.c.

## ◆ SIZEDATA_INDATABLOCK

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

Definition at line 101 of file zip.c.

## ◆ TRYFREE

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

Definition at line 65 of file zip.c.

## ◆ VERSIONMADEBY

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

Definition at line 50 of file zip.c.

## ◆ Z_BUFSIZE

#define Z_BUFSIZE (64*1024)

Definition at line 54 of file zip.c.

## ◆ Z_MAXFILENAMEINZIP

#define Z_MAXFILENAMEINZIP (256)

Definition at line 58 of file zip.c.

## ◆ ZIP64ENDHEADERMAGIC

#define ZIP64ENDHEADERMAGIC (0x6064b50)

Definition at line 106 of file zip.c.

## ◆ ZIP64ENDLOCHEADERMAGIC

#define ZIP64ENDLOCHEADERMAGIC (0x7064b50)

Definition at line 107 of file zip.c.

## 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

## ◆ add_data_in_datablock()

int add_data_in_datablock | ( | linkedlist_data * | ll,
|  | const void * | buf,
|  | uLong | len
| ) |  |

Definition at line 225 of file zip.c.

References allocate_new_datablock(), linkedlist_datablock_internal_s::avail_in_this_block, linkedlist_datablock_internal_s::data, linkedlist_datablock_internal_s::filled_in_this_block, linkedlist_data_s::first_block, linkedlist_data_s::last_block, len, linkedlist_datablock_internal_s::next_datablock, NULL, ZIP_INTERNALERROR, and ZIP_OK.

Referenced by LoadCentralDirectoryRecord(), and zipCloseFileInZipRaw64().

## ◆ allocate_new_datablock()

linkedlist_datablock_internal * allocate_new_datablock | ( |  | ) |

Definition at line 189 of file zip.c.

References ALLOC, linkedlist_datablock_internal_s::avail_in_this_block, linkedlist_datablock_internal_s::filled_in_this_block, linkedlist_datablock_internal_s::next_datablock, NULL, and SIZEDATA_INDATABLOCK.

Referenced by add_data_in_datablock().

## ◆ free_datablock()

void free_datablock | ( | linkedlist_datablock_internal * | ldi | ) |

Definition at line 203 of file zip.c.

References linkedlist_datablock_internal_s::next_datablock, NULL, and TRYFREE.

Referenced by free_linkedlist().

## ◆ free_linkedlist()

void free_linkedlist | ( | linkedlist_data * | ll | ) |

Definition at line 218 of file zip.c.

References linkedlist_data_s::first_block, free_datablock(), linkedlist_data_s::last_block, and NULL.

Referenced by zipClose().

## ◆ init_linkedlist()

void init_linkedlist | ( | linkedlist_data * | ll | ) |

Definition at line 213 of file zip.c.

References linkedlist_data_s::first_block, linkedlist_data_s::last_block, and NULL.

Referenced by zipOpen3().

## ◆ LoadCentralDirectoryRecord()

int LoadCentralDirectoryRecord | ( | zip64_internal * | pziinit | ) |

Definition at line 640 of file zip.c.

References add_data_in_datablock(), zip64_internal::add_position_when_writing_offset, ALLOC, zip64_internal::begin_pos, zip64_internal::central_dir, err, zip64_internal::filestream, zip64_internal::globalcomment, zip64_internal::number_entry, SIZEDATA_INDATABLOCK, TRYFREE, zip64_internal::z_filefunc, ZCLOSE64, zip64local_getLong(), zip64local_getLong64(), zip64local_getShort(), zip64local_SearchCentralDir(), zip64local_SearchCentralDir64(), ZIP_BADZIPFILE, ZIP_ERRNO, ZIP_OK, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, and ZSEEK64.

Referenced by zipOpen3().

## ◆ OF() [1/6]

ZPOS64_T zip64local_SearchCentralDir OF | ( | (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream) |  | ) |

## ◆ OF() [2/6]

int zip64local_getByte OF | ( | (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi) |  | ) |

## ◆ OF() [3/6]

int zip64local_getShort OF | ( | (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX) |  | ) |

## ◆ OF() [4/6]

int zip64local_getLong64 OF | ( | (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) |  | ) |

## ◆ OF() [5/6]

int zip64local_putValue OF | ( | (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) |  | ) |

## ◆ OF() [6/6]

void zip64local_putValue_inmemory OF | ( | (void *dest, ZPOS64_T x, int nbByte) |  | ) |

## ◆ Write_EndOfCentralDirectoryRecord()

int Write_EndOfCentralDirectoryRecord | ( | zip64_internal * | zi,
|  | uLong | size_centraldir,
|  | ZPOS64_T | centraldir_pos_inzip
| ) |  |

Definition at line 1811 of file zip.c.

References zip64_internal::add_position_when_writing_offset, ENDHEADERMAGIC, err, zip64_internal::filestream, zip64_internal::number_entry, zip64_internal::z_filefunc, zip64local_putValue(), and ZIP_OK.

Referenced by zipClose().

## ◆ Write_GlobalComment()

int Write_GlobalComment | ( | zip64_internal * | zi,
|  | const char * | global_comment
| ) |  |

Definition at line 1859 of file zip.c.

References err, zip64_internal::filestream, NULL, strlen(), zip64_internal::z_filefunc, zip64local_putValue(), ZIP_ERRNO, ZIP_OK, and ZWRITE64.

Referenced by zipClose().

## ◆ Write_LocalFileHeader()

int Write_LocalFileHeader | ( | zip64_internal * | zi,
|  | const char * | filename,
|  | uInt | size_extrafield_local,
|  | const void * | extrafield_local
| ) |  |

Definition at line 958 of file zip.c.

References zip64_internal::ci, curfile64_info::dosDate, err, zip64_internal::filestream, curfile64_info::flag, LOCALHEADERMAGIC, curfile64_info::method, curfile64_info::pos_zip64extrainfo, strlen(), zip64_internal::z_filefunc, curfile64_info::zip64, zip64local_putValue(), ZIP_ERRNO, ZIP_OK, ZTELL64, and ZWRITE64.

Referenced by zipOpenNewFileInZip4_64().

## ◆ Write_Zip64EndOfCentralDirectoryLocator()

int Write_Zip64EndOfCentralDirectoryLocator | ( | zip64_internal * | zi,
|  | ZPOS64_T | zip64eocd_pos_inzip
| ) |  |

Definition at line 1750 of file zip.c.

References zip64_internal::add_position_when_writing_offset, err, zip64_internal::filestream, zip64_internal::z_filefunc, ZIP64ENDLOCHEADERMAGIC, zip64local_putValue(), and ZIP_OK.

Referenced by zipClose().

## ◆ Write_Zip64EndOfCentralDirectoryRecord()

int Write_Zip64EndOfCentralDirectoryRecord | ( | zip64_internal * | zi,
|  | uLong | size_centraldir,
|  | ZPOS64_T | centraldir_pos_inzip
| ) |  |

Definition at line 1772 of file zip.c.

References zip64_internal::add_position_when_writing_offset, err, zip64_internal::filestream, zip64_internal::number_entry, zip64_internal::z_filefunc, ZIP64ENDHEADERMAGIC, zip64local_putValue(), and ZIP_OK.

Referenced by zipClose().

## ◆ zip64FlushWriteBuffer()

int zip64FlushWriteBuffer | ( | zip64_internal * | zi | ) |

Definition at line 1363 of file zip.c.

References curfile64_info::buffered_data, zip64_internal::ci, curfile64_info::encrypt, err, zip64_internal::filestream, curfile64_info::keys, curfile64_info::method, curfile64_info::pcrc_32_tab, curfile64_info::pos_in_buffered_data, curfile64_info::stream, t, z_stream_s::total_in, curfile64_info::totalCompressedData, curfile64_info::totalUncompressedData, Z_BZIP2ED, zip64_internal::z_filefunc, zencode, ZIP_ERRNO, ZIP_OK, and ZWRITE64.

Referenced by zipCloseFileInZipRaw64(), and zipWriteInFileInZip().

## ◆ zip64local_getByte()

int zip64local_getByte | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream,
|  | int * | pi
| ) |  |

Definition at line 349 of file zip.c.

References err, int(), ZERROR64, ZIP_EOF, ZIP_ERRNO, ZIP_OK, and ZREAD64.

Referenced by zip64local_getLong(), zip64local_getLong64(), and zip64local_getShort().

## ◆ zip64local_getLong()

int zip64local_getLong | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream,
|  | uLong * | pX
| ) |  |

Definition at line 395 of file zip.c.

References err, zip64local_getByte(), and ZIP_OK.

Referenced by LoadCentralDirectoryRecord(), and zip64local_SearchCentralDir64().

## ◆ zip64local_getLong64()

int zip64local_getLong64 | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream,
|  | ZPOS64_T * | pX
| ) |  |

Definition at line 426 of file zip.c.

References err, zip64local_getByte(), and ZIP_OK.

Referenced by LoadCentralDirectoryRecord(), and zip64local_SearchCentralDir64().

## ◆ zip64local_getShort()

int zip64local_getShort | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream,
|  | uLong * | pX
| ) |  |

Definition at line 373 of file zip.c.

References err, zip64local_getByte(), and ZIP_OK.

Referenced by LoadCentralDirectoryRecord().

## ◆ zip64local_putValue()

int zip64local_putValue | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream,
|  | ZPOS64_T | x,
|  | int | nbByte
| ) |  |

Definition at line 287 of file zip.c.

References ZIP_ERRNO, ZIP_OK, and ZWRITE64.

Referenced by Write_EndOfCentralDirectoryRecord(), Write_GlobalComment(), Write_LocalFileHeader(), Write_Zip64EndOfCentralDirectoryLocator(), Write_Zip64EndOfCentralDirectoryRecord(), and zipCloseFileInZipRaw64().

## ◆ zip64local_putValue_inmemory()

void zip64local_putValue_inmemory | ( | void * | dest,
|  | ZPOS64_T | x,
|  | int | nbByte
| ) |  |

Definition at line 311 of file zip.c.

Referenced by zipCloseFileInZipRaw64(), and zipOpenNewFileInZip4_64().

## ◆ zip64local_SearchCentralDir()

ZPOS64_T zip64local_SearchCentralDir | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream
| ) |  |

Definition at line 480 of file zip.c.

References ALLOC, BUFREADCOMMENT, NULL, TRYFREE, ZLIB_FILEFUNC_SEEK_END, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, ZSEEK64, and ZTELL64.

Referenced by LoadCentralDirectoryRecord().

## ◆ zip64local_SearchCentralDir64()

ZPOS64_T zip64local_SearchCentralDir64 | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream
| ) |  |

Definition at line 542 of file zip.c.

References ALLOC, BUFREADCOMMENT, NULL, TRYFREE, zip64local_getLong(), zip64local_getLong64(), ZIP_OK, ZLIB_FILEFUNC_SEEK_END, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, ZSEEK64, and ZTELL64.

Referenced by LoadCentralDirectoryRecord().

## ◆ zip64local_TmzDateToDosDate()

uLong zip64local_TmzDateToDosDate | ( | const tm_zip * | ptm | ) |

Definition at line 332 of file zip.c.

References if(), tm_zip_s::tm_hour, tm_zip_s::tm_mday, tm_zip_s::tm_min, tm_zip_s::tm_mon, tm_zip_s::tm_sec, and tm_zip_s::tm_year.

Referenced by zipOpenNewFileInZip4_64().

## ◆ zipClose()

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

Definition at line 1877 of file zip.c.

References zip64_internal::add_position_when_writing_offset, zip64_internal::central_dir, linkedlist_datablock_internal_s::data, err, zip64_internal::filestream, linkedlist_datablock_internal_s::filled_in_this_block, linkedlist_data_s::first_block, free_linkedlist(), zip64_internal::globalcomment, zip64_internal::in_opened_file_inzip, linkedlist_datablock_internal_s::next_datablock, NULL, zip64_internal::number_entry, TRYFREE, Write_EndOfCentralDirectoryRecord(), Write_GlobalComment(), Write_Zip64EndOfCentralDirectoryLocator(), Write_Zip64EndOfCentralDirectoryRecord(), zip64_internal::z_filefunc, ZCLOSE64, ZIP_ERRNO, ZIP_OK, ZIP_PARAMERROR, zipCloseFileInZip(), ZTELL64, and ZWRITE64.

Referenced by main().

## ◆ zipCloseFileInZip()

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

Definition at line 1745 of file zip.c.

References zipCloseFileInZipRaw().

Referenced by main(), zipClose(), and zipOpenNewFileInZip4_64().

## ◆ zipCloseFileInZipRaw()

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

Definition at line 1504 of file zip.c.

References crc32(), and zipCloseFileInZipRaw64().

Referenced by zipCloseFileInZip().

## ◆ zipCloseFileInZipRaw64()

int ZEXPORT zipCloseFileInZipRaw64 | ( | zipFile | file,
|  | ZPOS64_T | uncompressed_size,
|  | uLong | crc32
| ) |  |

Definition at line 1509 of file zip.c.

References add_data_in_datablock(), z_stream_s::avail_in, z_stream_s::avail_out, curfile64_info::buffered_data, zip64_internal::central_dir, curfile64_info::central_header, zip64_internal::ci, curfile64_info::crc32, crc32(), curfile64_info::crypt_header_size, z_stream_s::data_type, deflate(), deflateEnd(), err, zip64_internal::filestream, free, zip64_internal::in_opened_file_inzip, curfile64_info::method, z_stream_s::next_out, NULL, zip64_internal::number_entry, curfile64_info::pos_in_buffered_data, curfile64_info::pos_local_header, curfile64_info::pos_zip64extrainfo, curfile64_info::raw, curfile64_info::size_centralExtra, curfile64_info::size_centralExtraFree, curfile64_info::size_centralheader, curfile64_info::stream, curfile64_info::stream_initialised, z_stream_s::total_out, curfile64_info::totalCompressedData, curfile64_info::totalUncompressedData, Z_ASCII, Z_BUFSIZE, Z_BZIP2ED, Z_DEFLATED, zip64_internal::z_filefunc, Z_FINISH, Z_STREAM_END, zip64FlushWriteBuffer(), zip64local_putValue(), zip64local_putValue_inmemory(), ZIP_BADZIPFILE, ZIP_ERRNO, ZIP_OK, ZIP_PARAMERROR, ZLIB_FILEFUNC_SEEK_SET, ZSEEK64, and ZTELL64.

Referenced by zipCloseFileInZipRaw().

## ◆ zipOpen()

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

Definition at line 948 of file zip.c.

References NULL, and zipOpen3().

## ◆ zipOpen2()

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

Definition at line 920 of file zip.c.

References fill_zlib_filefunc64_32_def_from_filefunc32(), NULL, and zipOpen3().

## ◆ zipOpen2_64()

zipFile ZEXPORT zipOpen2_64 | ( | const void * | pathname,
|  | int | append,
|  | zipcharpc * | globalcomment,
|  | zlib_filefunc64_def * | pzlib_filefunc_def
| ) |  |

Definition at line 932 of file zip.c.

References NULL, zlib_filefunc64_32_def_s::zfile_func64, zipOpen3(), zlib_filefunc64_32_def_s::zseek32_file, and zlib_filefunc64_32_def_s::ztell32_file.

Referenced by main().

## ◆ zipOpen3()

zipFile ZEXPORT zipOpen3 | ( | const void * | pathname,
|  | int | append,
|  | zipcharpc * | globalcomment,
|  | zlib_filefunc64_32_def * | pzlib_filefunc64_32_def
| ) |  |

Definition at line 849 of file zip.c.

References zip64_internal::add_position_when_writing_offset, ALLOC, APPEND_STATUS_ADDINZIP, APPEND_STATUS_CREATE, APPEND_STATUS_CREATEAFTER, zip64_internal::begin_pos, zip64_internal::central_dir, zip64_internal::ci, err, zip64_internal::filestream, fill_fopen64_filefunc(), zip64_internal::globalcomment, zip64_internal::in_opened_file_inzip, init_linkedlist(), LoadCentralDirectoryRecord(), NULL, zip64_internal::number_entry, SEEK_END, curfile64_info::stream_initialised, TRYFREE, zip64_internal::z_filefunc, ZCLOSE64, zlib_filefunc64_32_def_s::zfile_func64, ZIP_OK, ZLIB_FILEFUNC_MODE_CREATE, ZLIB_FILEFUNC_MODE_EXISTING, ZLIB_FILEFUNC_MODE_READ, ZLIB_FILEFUNC_MODE_WRITE, ZOPEN64, zlib_filefunc64_32_def_s::zseek32_file, ZSEEK64, zlib_filefunc64_32_def_s::ztell32_file, and ZTELL64.

Referenced by zipOpen(), zipOpen2(), zipOpen2_64(), and zipOpen64().

## ◆ zipOpen64()

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

Definition at line 953 of file zip.c.

References NULL, and zipOpen3().

Referenced by main().

## ◆ zipOpenNewFileInZip()

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

Definition at line 1350 of file zip.c.

References DEF_MEM_LEVEL, MAX_WBITS, NULL, VERSIONMADEBY, Z_DEFAULT_STRATEGY, and zipOpenNewFileInZip4_64().

## ◆ zipOpenNewFileInZip2()

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

Definition at line 1311 of file zip.c.

References DEF_MEM_LEVEL, MAX_WBITS, NULL, VERSIONMADEBY, Z_DEFAULT_STRATEGY, and zipOpenNewFileInZip4_64().

## ◆ zipOpenNewFileInZip2_64()

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

Definition at line 1324 of file zip.c.

References DEF_MEM_LEVEL, MAX_WBITS, NULL, VERSIONMADEBY, Z_DEFAULT_STRATEGY, and zipOpenNewFileInZip4_64().

## ◆ zipOpenNewFileInZip3()

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

Definition at line 1281 of file zip.c.

References VERSIONMADEBY, and zipOpenNewFileInZip4_64().

## ◆ zipOpenNewFileInZip3_64()

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

Definition at line 1296 of file zip.c.

References VERSIONMADEBY, and zipOpenNewFileInZip4_64().

Referenced by main().

## ◆ zipOpenNewFileInZip4()

int ZEXPORT zipOpenNewFileInZip4 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uInt | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uInt | size_extrafield_global,
|  | const char * | comment,
|  | int | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | uLong | crcForCrypting,
|  | uLong | versionMadeBy,
|  | uLong | flagBase
| ) |  |

Definition at line 1265 of file zip.c.

References zipOpenNewFileInZip4_64().

## ◆ zipOpenNewFileInZip4_64()

int ZEXPORT zipOpenNewFileInZip4_64 | ( | zipFile | file,
|  | const char * | filename,
|  | const zip_fileinfo * | zipfi,
|  | const void * | extrafield_local,
|  | uInt | size_extrafield_local,
|  | const void * | extrafield_global,
|  | uInt | size_extrafield_global,
|  | const char * | comment,
|  | int | method,
|  | int | level,
|  | int | raw,
|  | int | windowBits,
|  | int | memLevel,
|  | int | strategy,
|  | const char * | password,
|  | uLong | crcForCrypting,
|  | uLong | versionMadeBy,
|  | uLong | flagBase,
|  | int | zip64
| ) |  |

Definition at line 1055 of file zip.c.

References zip64_internal::add_position_when_writing_offset, ALLOC, z_stream_s::avail_in, z_stream_s::avail_out, curfile64_info::buffered_data, curfile64_info::central_header, CENTRALHEADERMAGIC, zip64_internal::ci, curfile64_info::crc32, curfile64_info::crypt_header_size, z_stream_s::data_type, deflateInit2, curfile64_info::dosDate, zip_fileinfo::dosDate, curfile64_info::encrypt, err, zip_fileinfo::external_fa, zip64_internal::filestream, curfile64_info::flag, get_crc_table(), zip64_internal::in_opened_file_inzip, zip_fileinfo::internal_fa, curfile64_info::keys, curfile64_info::method, z_stream_s::next_out, NULL, z_stream_s::opaque, curfile64_info::pcrc_32_tab, curfile64_info::pos_in_buffered_data, curfile64_info::pos_local_header, curfile64_info::pos_zip64extrainfo, curfile64_info::raw, curfile64_info::size_centralExtra, curfile64_info::size_centralExtraFree, curfile64_info::size_centralheader, SIZECENTRALHEADER, curfile64_info::stream, curfile64_info::stream_initialised, strlen(), zip_fileinfo::tmz_date, z_stream_s::total_in, z_stream_s::total_out, curfile64_info::totalCompressedData, curfile64_info::totalUncompressedData, Write_LocalFileHeader(), Z_BINARY, Z_BUFSIZE, Z_BZIP2ED, Z_DEFLATED, zip64_internal::z_filefunc, Z_OK, z_stream_s::zalloc, z_stream_s::zfree, curfile64_info::zip64, zip64local_putValue_inmemory(), zip64local_TmzDateToDosDate(), ZIP_ERRNO, ZIP_INTERNALERROR, ZIP_OK, ZIP_PARAMERROR, zipCloseFileInZip(), ZTELL64, and ZWRITE64.

Referenced by zipOpenNewFileInZip(), zipOpenNewFileInZip2(), zipOpenNewFileInZip2_64(), zipOpenNewFileInZip3(), zipOpenNewFileInZip3_64(), zipOpenNewFileInZip4(), and zipOpenNewFileInZip64().

## ◆ zipOpenNewFileInZip64()

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

Definition at line 1337 of file zip.c.

References DEF_MEM_LEVEL, MAX_WBITS, NULL, VERSIONMADEBY, Z_DEFAULT_STRATEGY, and zipOpenNewFileInZip4_64().

## ◆ zipRemoveExtraInfoBlock()

int ZEXPORT zipRemoveExtraInfoBlock | ( | char * | pData,
|  | int * | dataLen,
|  | short | sHeader
| ) |  |

Definition at line 1946 of file zip.c.

References ALLOC, memcpy, NULL, TRYFREE, ZIP_ERRNO, ZIP_OK, and ZIP_PARAMERROR.

## ◆ zipWriteInFileInZip()

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

Definition at line 1402 of file zip.c.

References z_stream_s::avail_in, z_stream_s::avail_out, curfile64_info::buffered_data, zip64_internal::ci, curfile64_info::crc32, crc32(), deflate(), err, zip64_internal::in_opened_file_inzip, len, curfile64_info::method, z_stream_s::next_in, z_stream_s::next_out, NULL, curfile64_info::pos_in_buffered_data, curfile64_info::raw, curfile64_info::stream, z_stream_s::total_in, z_stream_s::total_out, Z_BUFSIZE, Z_BZIP2ED, Z_DEFLATED, Z_NO_FLUSH, zip64FlushWriteBuffer(), ZIP_ERRNO, ZIP_OK, and ZIP_PARAMERROR.

Referenced by main().

## Variable Documentation

## ◆ zip_copyright

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

Definition at line 98 of file zip.c.