ZIP_GET_NUM_ENTRIES(3)

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

πŸ’– ZIP_GET_NUM_ENTRIES πŸ’–

okay bestie, welcome to ZIP_GET_NUM_ENTRIES(3) β€” a page from the Library Functions Manual, which is just fancy speak for "the docs for the functions in a library." And babes, this one is a whole mood. Let's get into it. πŸŽ€


✨ NAME ✨

zip_get_num_entries β€” get the number of entries in an archive πŸ—‚οΈ


πŸ“š LIBRARY πŸ“š

libzip β€” and you link it with -lzip. yes, that's literally it. slay. πŸ’…


🌸 SYNOPSIS 🌸

here's the vibe, verbatim, no notes:

#include <zip.h>

zip_int64_t
zip_get_num_entries(zip_t *archive, zip_flags_t flags);

two args. one zip_t * and one zip_flags_t. iconic. πŸ¦‹


πŸ’« DESCRIPTION πŸ’«

okay so, zip_get_num_entries() returns the number of entries in archive. periodt. πŸ’–

and "entries" here means all the files that are present in the original archive or that were added while the archive is open. not me counting deleted files too 😭 β€” and yes, that's on purpose! This includes deleted files, because the indices don't get renumbered until the archive is closed. which is lowkey a flex, because (this allows one to refer to deleted files, e.g. to undelete them.) β€” the way that the library literally keeps a seat warm for your deleted file so you can bring it back?? main character energy fr. πŸ‘‘

and if flags is set to ZIP_FL_UNCHANGED, you get the original number of files back. the untouched, pre-chaos count. ✨


🫢 RETURN VALUES 🫢

zip_get_num_entries() returns the number of entries in the zip archive.

or -1 if archive is NULL. that's the "bestie where is your archive" case. πŸ’€


πŸ‘€ SEE ALSO πŸ‘€

the whole friend group, go say hi:


πŸ•°οΈ HISTORY πŸ•°οΈ

the lore, because i know you wanna know:

  • zip_get_num_entries() was added in libzip 0.10.
  • in libzip 0.11 the return type was changed from zip_uint64_t to zip_int64_t.
  • in libzip 0.11 the type of flags was changed from int to zip_flags_t.

growth. evolution. character development. 🌱


🧚 AUTHORS 🧚

the icons themselves: Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at>. thank you for your service. πŸ«‘πŸ’œ


πŸŽ€ one last thing, bestie: this page is the Debian build, dated August 19, 2022. love that for us. now go count some entries, you absolute legend. πŸ’…βœ¨πŸŒˆ