ZIP_ERROR_TO_DATA(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_TO_DATA(3) πŸ’–

okay bestie, so like β€” this page is ZIP_ERROR_TO_DATA(3) from the Library Functions Manual, and we're gonna get you fluent in it, no cap 🫢


✨ NAME ✨

zip_error_to_data β€” the lil glow-up that turns a zip_error into a return value that's actually suitable for ZIP_SOURCE_ERROR πŸ’…


πŸ“š LIBRARY πŸ“š

libzip (-lzip) β€” yes queen, link against it 🌸


πŸŽ€ SYNOPSIS πŸŽ€

#include <zip.h>

zip_int64_t
zip_error_to_data(const zip_error_t *ze, void *data, zip_uint64_t len);

🌈 DESCRIPTION 🌈

so here's the vibe: zip_error_to_data() takes your zip_error β€” that's ze, the star of the show πŸ‘‘ β€” and converts it into data that's suitable as a return value for ZIP_SOURCE_ERROR. it's giving translator, it's giving middleman, it's giving i gotchu.

the data gets written into the buffer data, which is len big. that's the whole point.

⚠️ but listen β€” if that buffer is not large enough to hold 2 ints, an error is returned. it's literally not big enough, bestie, and it will say so. so make sure your len is eating well before you call this πŸ™ˆ

⭐ RETURN VALUES ⭐

  • on success, zip_error_to_data() returns 2*(sizeof int) β€” iconic, correct, slay πŸ’…
  • on error, it returns -1 β€” we do not love this but it's honest πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

go read those too, iykyk πŸ’œ


πŸ¦‹ HISTORY πŸ¦‹

zip_error_to_data() was added in libzip 1.0. so it's been here a minute, it's a whole veteran, it has tenure ✨


🌸 AUTHORS 🌸

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

two absolute legends, we thank them for their service 🫢


πŸ’Œ ok that's the whole page, mwah πŸ’Œ

this cutie came out of Debian, dated December 18, 2017, and it lives at page ZIP_ERROR_TO_DATA(3). that's the source, that's the version, that's the date β€” periodt. go forth and convert your errors, bestie, you're gonna ate this πŸŽ€βœ¨πŸ¦‹