zip_source_seek_compute_offset(3)

zip_source_seek_compute_offset3

Validate arguments and compute offset

Usage

#include <zip.h>

zip_int64_t

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

Library

libzip (-lzip)

Overview

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.

Return values

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

Errors

zip_source_seek_compute_offset() fails if:

[ZIP_ER_INVAL]

One of the arguments is invalid or the seek would place the offset outside the data.

Releases

6 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9
  2. 10–12
  3. 13–Arch

History

zip_source_seek_compute_offset() was added in libzip 1.0.

Authors

Dieter Baron ⟨[email protected]⟩ and Thomas Klausner ⟨[email protected]⟩

From libzip 1.11.4-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.