Skip to content
Snippets Groups Projects
  • Jonathan Schöbel's avatar
    0e0fa194
    API change: error -> status for exception handling · 0e0fa194
    Jonathan Schöbel authored
    Instead of the trivial structure SH_Error, SH_Status is used. The name
    was chosen, because error/status is set independently whether an error
    has occurred. Beside the error type, it also contains the associated
    errno and an error message. The error message is also printed, when it
    is set. Generating error messages with variadic arguments is now also
    supported.
    There are also macros to check for a set status.
    
    The exception handling was removed for the *_free methods, because they
    can't fail predictably during runtime.
    
    Unfortunately the compiler reports, that inside the macro set_status
    printf may be called with NULL [printf (NULL)], although, this is
    explicitly debarred.
    0e0fa194
    History
    API change: error -> status for exception handling
    Jonathan Schöbel authored
    Instead of the trivial structure SH_Error, SH_Status is used. The name
    was chosen, because error/status is set independently whether an error
    has occurred. Beside the error type, it also contains the associated
    errno and an error message. The error message is also printed, when it
    is set. Generating error messages with variadic arguments is now also
    supported.
    There are also macros to check for a set status.
    
    The exception handling was removed for the *_free methods, because they
    can't fail predictably during runtime.
    
    Unfortunately the compiler reports, that inside the macro set_status
    printf may be called with NULL [printf (NULL)], although, this is
    explicitly debarred.