ZIP_SOURCE_WINDOW_CREATE(3)
π ZIP_SOURCE_WINDOW_CREATE(3) π
okay bestie, buckle up, we're doing a deep dive on zip_source_window_create from the Library Functions Manual β it's a libzip thing and honestly? iconic. β¨
πΈ NAME πΈ
zip_source_window_create β create zip data source overlay π¦
π LIBRARY π
libzip (-lzip)
β¨ SYNOPSIS β¨
#include <zip.h>
zip_source_t *
zip_source_window_create(zip_source_t *source, zip_uint64_t start,
zip_int64_t len, zip_error_t *error);
π DESCRIPTION π
so zip_source_window_create() makes you a zip source out of an underlying zip source, except it only lets you peek at one specific window of it β that window starts at byte start and is len bytes big. and if len is -1? the window just goes all the way to the end of the underlying source. no cap. π
β οΈ okay important, real talk:zip_source_window()andzip_source_window_create()do NOT take ownership ofsource. like, at all. the caller is the one responsible for freeing it. this is different to other layered sources, so don't come for me when you leak memory. π (This is different to other layered sources.)
π«Ά RETURN VALUES π«Ά
if it works? you get your brand new source back. slay. π
if it doesn't? you get NULL, and the error code gets stashed in error so you know exactly what went wrong. π
π₯ ERRORS π₯
zip_source_window_create() fails when:
[ZIP_ER_INVAL]βsrcisNULL; or there's an integer overflow when addingstartandlentogether; orlenis less than-1. π«[ZIP_ER_MEMORY]β the memory it needed could not be allocated. rip. π
π SEE ALSO π
β HISTORY β
zip_source_window_create() was added in libzip 1.8.0. she's not old, she's just established. π
π§ AUTHORS π§
Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β the β¨main charactersβ¨ who brought her into this world.
and that's the whole page, bestie!! this one came from the Debian build, dated April 29, 2021, filed under ZIP_SOURCE_WINDOW_CREATE(3) β go forth and window responsibly π¦ππ
π¦ where this page comes from
- arch rolling: libzip 1.11.4-1 Β· BSD
- fedora 43: libzip-devel 1.11.4-2.fc43 Β· BSD-3-Clause
- fedora 43: libzip-devel 1.11.4-2.fc43 Β· BSD-3-Clause
- fedora 44: libzip-devel 1.11.4-3.fc44 Β· BSD-3-Clause
- fedora 44: libzip-devel 1.11.4-3.fc44 Β· BSD-3-Clause
- nixpkgs unstable: libzip 1.11.4
- ubuntu resolute: libzip-dev 1.11.4-2 Β· BSD-3-Clause
- ubuntu stonking: libzip-dev 1.11.4-2build1 Β· BSD-3-Clause
- Copyright (C) 2021 Dieter Baron and Thomas Klausner
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms