ZIP_ERROR_GET(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_ERROR_GET(3) πŸ’–

okay bestie, welcome to the Library Functions Manual page for ZIP_ERROR_GET β€” yes that's the manual name, and yes we're doing this together, hand in hand, because you deserve to know what's up 🫢


✨ NAME ✨

zip_error_get, zip_file_error_get β€” grab the error codes for an archive or a file, but like… the obsolete interface way πŸ‘΅πŸ’€


πŸ“š LIBRARY πŸ“š

libzip (-lzip) β€” she's linked, she's loaded, she's ready πŸŽ€


🌸 SYNOPSIS 🌸

#include <zip.h>

void
zip_error_get(zip_t *archive, int *zep, int *sep);

void
zip_file_error_get(zip_file_t *file, int *zep, int *sep);

πŸ’… DESCRIPTION πŸ’…

okay so real talk: zip_error_get() and zip_file_error_get() are deprecated. not like "kinda old" deprecated, like actually deprecated, and the universe has moved on. please use zip_error_code_system(3), zip_error_code_zip(3), zip_file_get_error(3), and zip_get_error(3) instead. no cap. 🧚

for zip_error_get(), you're replacing this:

int ze, se;
zip_error_get(za, &ze, &se);

with this:

int ze, se;
zip_error_t *error = zip_get_error(za);
ze = zip_error_code_zip(error);
se = zip_error_code_system(error);

and for zip_file_error_get(), the glow-up goes like this β€” replace:

int ze, se;
zip_file_error_get(zf, &ze, &se);

with:

int ze, se;
zip_error_t *error = zip_file_get_error(zf);
ze = zip_error_code_zip(error);
se = zip_error_code_system(error);

see how much cleaner that is?? it's giving ✨modern codebase✨, it's giving main character energy, it's giving "my error handling has a type now". obsessed honestly 😭


πŸ‘€ SEE ALSO πŸ‘€

libzip(3), zip_error_code_system(3), zip_error_code_zip(3), zip_file_get_error(3), zip_get_error(3)

go read those, they're the upgrade path and they ate πŸ’…


πŸ“œ HISTORY πŸ“œ

zip_error_get() was added in libzip 0.6. it was deprecated in libzip 1.0 β€” use zip_get_error(), zip_error_code_zip(), / zip_error_code_system() instead. (yes the slash is in the original, i'm not touching it, i'm just the messenger 🫑)

zip_file_error_get() was added in libzip 0.6. it was deprecated in libzip 1.0 β€” use zip_file_get_error(), zip_error_code_zip(), / zip_error_code_system() instead.


πŸ‘‘ AUTHORS πŸ‘‘

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the literal icons who wrote this, we stan 🌈⭐


and that's the whole page bestie!! this one came from the Debian crew, dated December 18, 2017, and it's sitting at the very bottom of ZIP_ERROR_GET(3) like a lil signature πŸ’œ go forth, migrate off the deprecated functions, and slay your error handling πŸ’–βœ¨πŸŽ€