API change: error -> status for exception handling
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.
Showing
- sefht.geany 25 additions, 25 deletionssefht.geany
- src/lib/Makefile.am 5 additions, 5 deletionssrc/lib/Makefile.am
- src/lib/sefht/cms.c 10 additions, 22 deletionssrc/lib/sefht/cms.c
- src/lib/sefht/cms.h 5 additions, 4 deletionssrc/lib/sefht/cms.h
- src/lib/sefht/data.c 21 additions, 48 deletionssrc/lib/sefht/data.c
- src/lib/sefht/data.h 5 additions, 4 deletionssrc/lib/sefht/data.h
- src/lib/sefht/error.h 0 additions, 47 deletionssrc/lib/sefht/error.h
- src/lib/sefht/fragment.c 7 additions, 8 deletionssrc/lib/sefht/fragment.c
- src/lib/sefht/fragment.h 8 additions, 8 deletionssrc/lib/sefht/fragment.h
- src/lib/sefht/log.h 1 addition, 3 deletionssrc/lib/sefht/log.h
- src/lib/sefht/node_fragment.c 102 additions, 165 deletionssrc/lib/sefht/node_fragment.c
- src/lib/sefht/node_fragment.h 11 additions, 10 deletionssrc/lib/sefht/node_fragment.h
- src/lib/sefht/sefht.h 1 addition, 1 deletionsrc/lib/sefht/sefht.h
- src/lib/sefht/status.h 129 additions, 0 deletionssrc/lib/sefht/status.h
- src/lib/sefht/text.c 67 additions, 179 deletionssrc/lib/sefht/text.c
- src/lib/sefht/text.h 11 additions, 12 deletionssrc/lib/sefht/text.h
- src/lib/sefht/validator.c 18 additions, 44 deletionssrc/lib/sefht/validator.c
- src/lib/sefht/validator.h 4 additions, 5 deletionssrc/lib/sefht/validator.h
- src/main.c 5 additions, 5 deletionssrc/main.c
- tests/Makefile.am 1 addition, 1 deletiontests/Makefile.am
Loading
Please register or sign in to comment