ZIP_SOURCE_WIN32W(3)

πŸ“¦
version 1.11.4 Β· 4 versions
, in arch rolling, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

✨ 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, or len are invalid. 🚩
  • [ZIP_ER_MEMORY] β€” required memory could not be allocated. the audacity 😭
  • [ZIP_ER_OPEN] β€” opening fname failed. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

like a whole friend group fr fr, go say hi πŸ‘‘


🌈 HISTORY 🌈

  • zip_source_win32w() was added in libzip 1.0. vintage ✨
  • ZIP_LENGTH_TO_END and ZIP_LENGTH_UNCHECKED were 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