ZIP_SOURCE_WIN32A(3)

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

πŸ’– ZIP_SOURCE_WIN32A πŸ’–

okay bestie, so this is the libzip manual for zip_source_win32a and zip_source_win32a_create β€” the Windows girlies that build a zip source out of a Windows ANSI file name. it's giving "I only speak ANSI, not wide chars, and that's on purpose" πŸ’…


✨ LIBRARY ✨

libzip (-lzip) πŸŽ€ β€” yeah she lives in libzip, link her with -lzip and she's yours.


🌸 SYNOPSIS 🌸

#include <zip.h>

zip_source_t *
zip_source_win32a(zip_t *archive, const char *fname, zip_uint64_t start,
    zip_int64_t len);

zip_source_t *
zip_source_win32a_create(const char *fname, zip_uint64_t start,
    zip_int64_t len, zip_error_t *error);

literally just drop that #include <zip.h> in there and you're set 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so zip_source_win32a() and zip_source_win32a_create() are the twin icons that make a zip source on Windows using a Windows ANSI name. they open fname and read len bytes starting from offset start. periodt ✨

the way that len works? bestie, that's a whole other page β€” go read zip_source_file(3) for the full tea on that argument. πŸ“–

if the file supports seek, then the source can be used to open a zip archive from. cute, right? 😌

heads up though: the file is not opened and read right away. she's lowkey mysterious β€” she opens and reads only when the data from the source actually gets used, usually by zip_close() or zip_open_from_source(). so don't come for her if nothing's happened yet πŸ’€

πŸ‘‘ RETURN VALUES πŸ‘‘

upon successful completion, the created source is returned. slay. 🌟

otherwise? NULL comes back and the error code in archive or error is set to indicate the error. not the vibe, but at least she tells you why 😭


πŸ’œ ERRORS πŸ’œ

zip_source_win32a() and zip_source_win32a_create() fail if:

  • [ZIP_ER_INVAL] β€” fname, start, or len are invalid. πŸ™ˆ check your inputs bestie
  • [ZIP_ER_MEMORY] β€” required memory could not be allocated. the RAM said no πŸ’€
  • [ZIP_ER_OPEN] β€” opening fname failed. the door was locked fr fr πŸšͺ

🌈 SEE ALSO 🌈

the whole friend group, go say hi 🫢✨


πŸŽ€ HISTORY πŸŽ€

zip_source_win32a() and zip_source_win32a_create() were added in libzip 1.0. iconic from the start, no cap πŸ‘‘

and then ZIP_LENGTH_TO_END and ZIP_LENGTH_UNCHECKED were added in libzip 1.10.1. a glow-up era, honestly 🌸


πŸ’– AUTHORS πŸ’–

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the legends, the main characters, the ones who wrote this so you wouldn't have to πŸ«‘πŸ’…


and that's the whole page bestie!! this beauty came out of the Debian side of things, dated June 30, 2023, and she answers to ZIP_SOURCE_WIN32A(3) in the Library Functions Manual. iykyk πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from