zipfile

ZIP Archive Format (Stored Only)

Functions

FunctionDescription
_zip_byte_atInternal byte reader.
_zip_w16Internal: write little-endian 16-bit.
_zip_w32Internal: write little-endian 32-bit.
_zip_r16Internal: read little-endian 16-bit.
_zip_r32Internal: read little-endian 32-bit.
_zip_crc32_byteSimple CRC-32 for ZIP (same algorithm as gzip).
_zip_crc32Compute CRC-32 for data.
zip_createCreate a write handle.
zip_addAdd a stored file entry to the ZIP.
zip_finishWrite central directory and EOCD. Returns total archive length.
_zip_find_eocdInternal: scan for EOCD to find central directory.
zip_openOpen a ZIP archive for reading.
zip_countNumber of entries in the ZIP.
zip_entry_nameCopy entry name at index to out. Returns length.
zip_entry_sizeGet data size for entry at index.
zip_entry_dataCopy entry data at index to out. Returns length.

Details

_zip_byte_at

fn _zip_byte_at(buf: &i8, idx: i64) -> i64

Internal byte reader.

_zip_w16

fn _zip_w16(out: &i8, pos: i64, val: i64) -> i64

Internal: write little-endian 16-bit.

_zip_w32

fn _zip_w32(out: &i8, pos: i64, val: i64) -> i64

Internal: write little-endian 32-bit.

_zip_r16

fn _zip_r16(buf: &i8, pos: i64) -> i64

Internal: read little-endian 16-bit.

_zip_r32

fn _zip_r32(buf: &i8, pos: i64) -> i64

Internal: read little-endian 32-bit.

_zip_crc32_byte

fn _zip_crc32_byte(crc: i64, byte_val: i64) -> i64

Simple CRC-32 for ZIP (same algorithm as gzip).

_zip_crc32

fn _zip_crc32(buf: &i8, len: i64) -> i64

Compute CRC-32 for data.

zip_create

fn zip_create(out: &i8) -> &i64

Create a write handle.

zip_add

fn zip_add(h: &i64, name: &i8, nlen: i64, data: &i8, dlen: i64) -> i64

Add a stored file entry to the ZIP.

zip_finish

fn zip_finish(h: &i64) -> i64

Write central directory and EOCD. Returns total archive length.

_zip_find_eocd

fn _zip_find_eocd(buf: &i8, len: i64) -> i64

Internal: scan for EOCD to find central directory.

zip_open

fn zip_open(buf: &i8, len: i64) -> &i64

Open a ZIP archive for reading.

zip_count

fn zip_count(h: &i64) -> i64

Number of entries in the ZIP.

zip_entry_name

fn zip_entry_name(h: &i64, idx: i64, out: &i8) -> i64

Copy entry name at index to out. Returns length.

zip_entry_size

fn zip_entry_size(h: &i64, idx: i64) -> i64

Get data size for entry at index.

zip_entry_data

fn zip_entry_data(h: &i64, idx: i64, out: &i8) -> i64

Copy entry data at index to out. Returns length.