ZIP_ERROR_GET_SYS_TYPE(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_SYS_TYPE πŸ’…

okay bestie, gather round, because we need to talk about zip_error_get_sys_type β€” she's an iconic little function from the Library Functions Manual section of the libzip docs, but she is also, and I say this with love, obsolete. 🫢


πŸ¦‹ NAME πŸ¦‹

zip_error_get_sys_type β€” get the type of a system error code (yes, that's the obsolete interface, no cap, the manpage literally says so 😭)


πŸ“š LIBRARY πŸ“š

libzip (-lzip)


πŸŽ€ SYNOPSIS πŸŽ€

#include <zip.h>

int
zip_error_get_sys_type(int ze);

πŸ’– DESCRIPTION πŸ’–

okay so listen. The function zip_error_get_sys_type() is deprecated. Like, she still works, but the glow-up already happened and it's giving legacy. Use zip_error_init_with_code(3) and zip_error_system_type(3) instead. ✨

Here's the before pic, if you will β€” replace this:

int i = zip_error_get_sys_type(ze);

with this:

zip_error_t error;
zip_error_init_with_code(&error, ze);
int i = zip_error_system_type(&error);

see how much cleaner that is?? the way that the modern version actually inits a whole zip_error_t first… main character energy honestly πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


🌈 HISTORY 🌈

zip_error_get_sys_type() was added in libzip 0.6. Then in libzip 1.0 she got deprecated β€” use zip_error_system_type() instead. a whole era, honestly πŸ’€


🫢 AUTHORS 🫢

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


and that's the whole page, bestie!! this one shipped with Debian, dated December 18, 2017, fr fr β€” k bye, go call zip_error_system_type() instead πŸ’…πŸŒΈ