zzip_file_open(3)

πŸ“¦
version 0.13.78 Β· 4 versions
, in centos-stream 10, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– zzip_file_open β€” the zziplib girlies' guide πŸ’–

okay bestie, so this one lives in the zziplib Function List section of the manual, it's zzip_file_open(3), and it is genuinely one of my faves. let's get into it 🫢


✨ NAME ✨

zzip_file_open β€” start usage.

like. that's literally what the page says. start usage. iconic minimalism, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include <zzip/lib.h>

ZZIP_FILE*
zzip_file_open(ZZIP_DIR* dir, zzip_char_t* name, int o_mode)

that's the whole vibe check right there: you pass a ZZIP_DIR* called dir, a zzip_char_t* called name, and an int called o_mode, and you get back a ZZIP_FILE*. periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” zzip_file_open opens up a ZZIP_FILE from an already open ZZIP_DIR handle. like, you already did the whole directory-opening thing, and now you're going in for the actual file.

and the reason this is the moment? because we have a chance to reuse a cached buf32k and a ZZIP_FILE memchunk, which means this is literally the best choice to unpack multiple files. if you're grabbing a whole bunch of files out of one archive, this is the one you want, no cap πŸ”₯

Note, and I need you to listen: the zlib supports 2..15 bit windowsize, hence we provide a 32k memchunk here... just to be safe. 🧚 (yes, "just to be safe" β€” the original said it and honestly? mood.)

and the sad part 😭 β€” on error it returns null and sets errcode in the ZZIP_DIR. so like, when things go wrong, don't go looking at the return value for answers, check your ZZIP_DIR, bestie. the errcode is in there.


πŸ‘‘ AUTHOR πŸ‘‘

Guido Draheim <guidod@gmx.de> and Tomi Ollila <Tomi.Ollila@iki.fi> β€” the legends who made this happen, we stan 🌈


Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL). respect the copyleft, babes ✨


okay that's the whole page!! thanks for reading my little manpage rant, ily, go unpack some files πŸ’–πŸ¦‹πŸŒΈ

zzip_file_open(3) β€” from zziplib, version 0.13.78. that's the version tag, that's the page, we're done here. mwah πŸ’…πŸŽ€