ZIP_SOURCE_WIN32W(3)
β¨ zip_source_win32w, zip_source_win32w_create β¨
okay bestie, so this page is about zip_source_win32w() and zip_source_win32w_create() β two lil cuties that build you a data source out of a Windows Unicode file name π. That's the whole vibe. Sit down, sip ur drink, we're doing this.
π LIBRARY π
libzip β link it with -lzip and ur good to go, no cap.
β¨ SYNOPSIS β¨
#include <zip.h>
zip_source_t *
zip_source_win32w(zip_t *archive, const wchar_t *fname,
zip_uint64_t start, zip_int64_t len);
zip_source_t *
zip_source_win32w_create(const wchar_t *fname, zip_uint64_t start,
zip_int64_t len, zip_error_t *error);
π DESCRIPTION π
So. Both zip_source_win32w() and zip_source_win32w_create() make a zip source, but like, on Windows, using a Windows Unicode name πΈ. They open fname and read len bytes starting from offset start. That's it, that's the whole job.
For the tea on how len actually behaves, go read zip_source_file(3) β it explains it, and honestly it explains it better than I could in a group chat message π«Ά.
If the file supports seek, then the source can be used to open a zip archive from. Iconic.
Now here's the part u need to internalise: the file is opened and read when the data from the source is used, usually by zip_close() or zip_open_from_source(). Not before. Not at creation. When it's used. The way it just waits patientlyβ¦ main character energy, honestly π.
π¦ RETURN VALUES π¦
Slay β u get the created source back. π
Not slay β u get NULL, and the error code in archive or error is set to tell u what went wrong. Read it, bestie, it's literally right there.
π ERRORS π
zip_source_win32w() and zip_source_win32w_create() fail if:
[ZIP_ER_INVAL]βfname,start, orlenare invalid. π©[ZIP_ER_MEMORY]β required memory could not be allocated. the audacity π[ZIP_ER_OPEN]β openingfnamefailed. π
π₯ SEE ALSO π₯
libzip(3)zip_file_add(3)zip_file_replace(3)zip_source(5)zip_source_file(3)zip_source_win32a(3)zip_source_win32handle(3)
like a whole friend group fr fr, go say hi π
π HISTORY π
zip_source_win32w()was added in libzip 1.0. vintage β¨ZIP_LENGTH_TO_ENDandZIP_LENGTH_UNCHECKEDwere added in libzip 1.10.1. newer, shinier, obsessed π
π AUTHORS π
Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β the legends themselves, we stan π«Ά
ok that's the whole page bestie, u understood all of it, i'm so proud. now go read zip_source_file(3) like i told u ππ
Debian πΈ June 30, 2023 π¦ ZIP_SOURCE_WIN32W(3) β mwah, that's a wrap, periodt β¨π
π¦ 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) 2015-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