"Fossies" - the Fresh Open Source Software Archive

Member "libzip-1.5.2/man/zip_source_seek_compute_offset.html" (12 Mar 2019, 5371 Bytes) of package /linux/misc/libzip-1.5.2.tar.xz:

Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the libzip-1.5.2.tar.xz project site itself.


validate arguments and compute offset

libzip (-lzip)

#include <zip.h>

zip_source_seek_compute_offset(zip_uint64_t offset, zip_uint64_t length, void *data, zip_uint64_t data_length, zip_error_t *error);

Use this function to compute the offset for a ZIP_SOURCE_SEEK or ZIP_SOURCE_SEEK_WRITE command. data and data_length are the arguments to the source callback, offset is the current offset and length is the length of the source data or, for ZIP_SOURCE_SEEK_WRITE, the amount of data written.

On success, it returns the new offset, on error it returns -1 and sets error.

zip_source_seek_compute_offset() fails if:
One of the arguments is invalid or the seek would place the offset outside the data.


zip_source_seek_compute_offset() was added in libzip 1.0.

Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
December 18, 2017 NetBSD 8.99.35