ZIP_REGISTER_PROGRESS_CALLBACK(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_REGISTER_PROGRESS_CALLBACK πŸ’–

okay bestie, welcome to the Library Functions Manual section of the libzip lore 🌸 this one's a lil vintage, a lil deprecated, but still iconic in its own way. let's get into it ✨


✨ NAME ✨

zip_register_progress_callback β€” provide updates during zip_close (obsolete interface) 🫢

πŸ“š LIBRARY πŸ“š

libzip (-lzip) β€” yeah she lives in libzip, link her in and you're good πŸ’…

🌈 SYNOPSIS 🌈

#include <zip.h>

typedef void (*zip_progress_callback_t)(double);

void
zip_register_progress_callback(zip_t *archive,
    zip_progress_callback_t progress_callback);

no cap, that's the whole signature. copy it exactly, bestie, character for character πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

so zip_register_progress_callback() is the obsolete version of zip_register_progress_callback_with_state(3). she's the older sister, still valid, but the newer one is the main character now πŸ‘‘

what she does: she registers a callback function, progress_callback, for the zip archive archive. that callback gets called during zip_close(3) β€” and the timing is so specific, she calls it after every single zip archive entry that's completely written to disk. like, each one. every one. no skipping ✨

the value she hands your callback is a double in the range from 0.0 to 1.0. zero at the start, one at the end, and everything in between is vibes πŸ“ˆ

and why would you even want this? literally to provide progress indicators for user interfaces. progress bars, spinners, little percentage counters, the whole aesthetic πŸŽ€ if your app makes people wait while zipping, this is how you keep them from spiralling πŸ’€

heads up bestie: this interface is obsolete. not gone, not broken, just old. see HISTORY below for the tea β˜•

πŸ‘€ SEE ALSO πŸ‘€

πŸ“œ HISTORY πŸ“œ

zip_register_progress_callback() was added in libzip 1.2.0 🌱

then it was deprecated in libzip 1.3.0 β€” use zip_register_progress_callback_with_state() instead, fr fr πŸ™

πŸ‘‘ AUTHORS πŸ‘‘

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

two absolute legends, we stan πŸ’œ


and that's the whole page, bestie!! this one came from the fine folks over at Debian, dated December 18, and she's part of the libzip 1.2.0-and-later era (deprecated as of 1.3.0). go forth, register your progress callbacks, and slay πŸ’…βœ¨πŸ¦‹