ZIP_SOURCE_WIN32HANDLE(3)

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

ZIP_SOURCE_WIN32HANDLE(3) πŸ’…

okay so bestie, this is a Library Functions Manual page for zip_source_win32handle β€” section 3 of the libzip man pages. Windows file handles + zip sources. it's giving niche but iconic. let's GO πŸ¦‹


✨ NAME ✨

zip_source_win32handle, zip_source_win32handle_create β€” create data source from a Windows file handle


πŸ“š LIBRARY πŸ“š

libzip (-lzip)


πŸŽ€ SYNOPSIS πŸŽ€

#include <zip.h>

zip_source_t *
zip_source_win32handle(zip_t *archive, HANDLE h, zip_uint64_t start,
    zip_int64_t len);

zip_source_t *
zip_source_win32handle_create(HANDLE h, zip_uint64_t start,
    zip_int64_t len, zip_error_t *error);

🌸 DESCRIPTION 🌸

so like. the functions zip_source_win32handle() and zip_source_win32handle_create() do the thing where they create a zip source from a Windows file handle πŸͺŸβœ¨

they read len bytes from offset start from it. and if len is 0 or -1, then the whole file (starting from start, obviously, we're not feral) is used. πŸ’–

if the file supports seek, the source can be used to open a zip archive from. lowkey important. πŸ‘‘

and here's the timing tea: the file is opened and read when the data from the source is used β€” usually by zip_close() or zip_open_from_source(). so not right this second, bestie. it's a later thing. πŸ•


πŸ”₯ RETURN VALUES πŸ”₯

upon successful completion, the created source is returned. yay!! πŸŽ‰

otherwise, NULL is returned and the error code in archive or error is set to indicate the error. sad girl hours. 😭


πŸ’€ ERRORS πŸ’€

zip_source_w32handle() and zip_source_w32handle_create() fail if:

  • [ZIP_ER_INVAL] β€” h, start, or len are invalid. πŸ™ˆ
  • [ZIP_ER_MEMORY] β€” Required memory could not be allocated. πŸ’€
not me noticing the names here are spelled zip_source_w32handle() and zip_source_w32handle_create() β€” no in, no 32handle... yeah that's literally what the page says, bestie. that's the error section's own spelling. i am simply relaying it, character for character, because that is the vibe and also the rule. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

libzip(3), zip_file_add(3), zip_file_replace(3), zip_source(5), zip_source_win32a(3), zip_source_win32w(3)


🌈 HISTORY 🌈

zip_source_win32handle() and zip_source_win32handle_create() were added in libzip 1.0. throwback!! 🧚


πŸ’œ AUTHORS πŸ’œ

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at>


and that's the whole page, no cap. this one came from Debian, dated May 14, 2024, and it's the ZIP_SOURCE_WIN32HANDLE(3) page β€” mwah, slay, periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from