|
Modules |
| Simplified Error Codes |
Error Type Lookup |
These functions lookup error types by name or by number.
|
GWENHYWFAR_API int | GWEN_Error_FindType (const char *name) |
GWENHYWFAR_API const char * | GWEN_Error_GetTypename (int t) |
Getters And Setters |
These functions get and set parts of an ERRORCODE.
|
GWENHYWFAR_API int | GWEN_Error_GetCode (GWEN_ERRORCODE c) |
GWENHYWFAR_API int | GWEN_Error_GetSeverity (GWEN_ERRORCODE c) |
GWENHYWFAR_API int | GWEN_Error_GetType (GWEN_ERRORCODE c) |
GWENHYWFAR_API int | GWEN_Error_IsCustom (GWEN_ERRORCODE c) |
GWENHYWFAR_API int | GWEN_Error_IsOk (GWEN_ERRORCODE c) |
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_Error_new (int iscustom, int severity, int typ, int code) |
GWENHYWFAR_API void | GWEN_Error_SetCode (GWEN_ERRORCODE *c, int v) |
GWENHYWFAR_API void | GWEN_Error_SetIsCustom (GWEN_ERRORCODE *c, int iscustom) |
GWENHYWFAR_API void | GWEN_Error_SetSeverity (GWEN_ERRORCODE *c, int v) |
GWENHYWFAR_API void | GWEN_Error_SetType (GWEN_ERRORCODE *c, int v) |
Simplified Error Codes |
In most cases you only need a simplified error code (without severity information etc). For those cases the constructed error code can be turned into a simplified code.
|
GWENHYWFAR_API int | GWEN_Error_GetSimpleCode (GWEN_ERRORCODE c) |
Error Type Registration |
These functions are used to allocate error types. Each module should allocate a type to allow descriptive error messages. Since function pointers are involved you should carefully register and unregister the error types.
|
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_Error_RegisterType (GWEN_ERRORTYPEREGISTRATIONFORM *tptr) |
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_Error_UnregisterType (GWEN_ERRORTYPEREGISTRATIONFORM *tptr) |
Verbosity |
Composing error messages.
|
GWENHYWFAR_API int | GWEN_Error_ToString (GWEN_ERRORCODE c, char *buffer, int bsize) |
Error Type Registration Form |
GWENHYWFAR_API void | GWEN_ErrorType_free (GWEN_ERRORTYPEREGISTRATIONFORM *f) |
GWENHYWFAR_API GWEN_ERRORMESSAGEPTR | GWEN_ErrorType_GetMsgPtr (GWEN_ERRORTYPEREGISTRATIONFORM *f) |
GWENHYWFAR_API GWEN_ERRORTYPEREGISTRATIONFORM * | GWEN_ErrorType_new () |
GWENHYWFAR_API void | GWEN_ErrorType_SetMsgPtr (GWEN_ERRORTYPEREGISTRATIONFORM *f, GWEN_ERRORMESSAGEPTR msgptr) |
GWENHYWFAR_API void | GWEN_ErrorType_SetName (GWEN_ERRORTYPEREGISTRATIONFORM *f, const char *name) |
GWENHYWFAR_API void | GWEN_ErrorType_SetType (GWEN_ERRORTYPEREGISTRATIONFORM *f, int c) |
Defines |
#define | GWEN_ERROR_COULD_NOT_REGISTER 2 |
#define | GWEN_ERROR_COULD_NOT_UNREGISTER 3 |
#define | GWEN_ERROR_INVALID_BUFFERSIZE 4 |
#define | GWEN_ERROR_SEVERITY_DEBUG 0 |
#define | GWEN_ERROR_SEVERITY_ERR 3 |
#define | GWEN_ERROR_SEVERITY_INFO 1 |
#define | GWEN_ERROR_SEVERITY_WARN 2 |
#define | GWEN_ERROR_TYPE_ERROR 0 |
#define | GWEN_ERROR_UNSPECIFIED 1 |
Typedefs |
typedef GWEN_TYPE_UINT32 | GWEN_ERRORCODE |
typedef const char *(* | GWEN_ERRORMESSAGEPTR )(int c) |
typedef GWEN_ERRORTYPEREGISTRATIONFORM | GWEN_ERRORTYPEREGISTRATIONFORM |
Functions |
GWENHYWFAR_API int | GWEN_ErrorType_GetType (GWEN_ERRORTYPEREGISTRATIONFORM *f) |