List Archive

Thread

Thread Index

Message

From: Remi Collet <remi%fedoraproject.org@localhost>
To: libzip-discuss%nih.at@localhost
Subject: Missing setter for error
Date: Thu, 5 Mar 2020 09:58:40 +0100

Hi,


I we want to save error state we have the needed getters

        zip_error_code_zip()
        zip_error_code_system()

Sadly we cannot properly create a error structure
and zip_error_init_with_code() only allow to set
zip_err, not sys_err.

Which mean we have to use the zip_error_t property directly

        /* Save */
        saved_zip_err = zip_error_code_zip(err);
        saved_sys_err = zip_error_code_system(err);

        /* Restore */
        zip_error_init_with_code(&err, saved_zip_err);
        err.sys_err = saved_sys_err;


So, especially if one day such structure becomes opaque,
will be nice to have something like

  void zip_error_init_with_codes(zip_error_t *error, int ze, int se);


What do you think ?


Regards,
Remi

Attachment: signature.asc
Description: OpenPGP digital signature

Made by MHonArc.