zzip_dir_open(3)
π zzip_dir_open β bestie's guide to opening zip archives π
okay so this is from the zziplib Function List manual (the zzip_dir_open(3) girlies know β¨), and it's literally just three lil functions that let you crack open a zip-archive and read what's inside. no cap. let's get into it π«Ά
β¨ SYNOPSIS β¨
#include <zzip/lib.h>
ZZIP_DIR*
zzip_dir_open(zzip_char_t* filename, zzip_error_t* e)
ZZIP_DIR*
zzip_dir_open_ext_io(zzip_char_t* filename, zzip_error_t* e, zzip_strings_t* ext,
zzip_plugin_io_t io)
int
zzip_dir_read(ZZIP_DIR* dir, ZZIP_DIRENT* d)
like, look at her. three functions. one include. we're so back π₯
πΈ DESCRIPTION πΈ
so zzip_dir_open does exactly what it says on the tin: it opens the zip-archive you handed it (if available, bestie β if available, pls read that part π). and the two ext_io arguments? those will just default to using posix io and a set of default fileext that can atleast add the .zip ext itself. so it's doing the most for you already, no notes π
the zzip_dir_open_ext_io function is the one where you get to be the main character and pass explicit ext and io instead of letting the internal defaults do their thing. and here's the tea: setting these to zero is equivalent to just calling zzip_dir_open. same energy, fr fr.
β οΈ okay important one, don't skip: the referencedext_ioplugin handlers structure must be static, because it is not copied into the returnedZZIP_DIRstructure. it is not copied!! so if you let it go out of scope you're gonna have a bad time π keep it alive, keep it static, keep it iconic.
and then zzip_dir_read β she fills the dirent-argument with the values and increments the read-pointer of the dir-argument. so each call moves you along the archive, one entry at a time, like scrolling a feed but for zip files π¦
and it returns 0 if there's no entry (anymore). that's your little "we're done here, bestie" signal π
π AUTHOR π
Guido Draheim <guidod@gmx.de> and Tomi Ollila <too@iki.fi> β the icons who built this. we stan π
π COPYRIGHT π
Copyright (c) Guido Draheim, use under copyleft (LGPL, MPL). slay, and also legally binding π
and that's the whole page, bestie!! this was zziplib, version 0.13.78, and yes this is me signing off on the zzip_dir_open(3) page specifically β go open some archives, stay static with your plugin handlers, and don't forget to check for that 0 return π«Άβ¨π
π¦ where this page comes from
- centos-stream 10: zziplib-devel 0.13.78-2.el10 Β· LGPL-2.0-or-later OR MPL-1.1
- debian trixie: libzzip-dev 0.13.78+dfsg.1-0.1 Β· ZZIP
- fedora 43: zziplib-devel 0.13.78-2.fc43 Β· LGPL-2.0-or-later OR MPL-1.1
- fedora 43: zziplib-devel 0.13.78-2.fc43 Β· LGPL-2.0-or-later OR MPL-1.1
- fedora 44: zziplib-devel 0.13.78-4.fc44 Β· LGPL-2.0-or-later OR MPL-1.1
- fedora 44: zziplib-devel 0.13.78-4.fc44 Β· LGPL-2.0-or-later OR MPL-1.1
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- ubuntu questing: libzzip-dev 0.13.78+dfsg.1-0.1
- ubuntu resolute: libzzip-dev 0.13.78+dfsg.1-0.2 Β· ZZIP
- ubuntu stonking: libzzip-dev 0.13.78+dfsg.1-0.2 Β· ZZIP
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms