ifw-odp
2.0.0-alpha
|
#include <cpl.h>
#include <string.h>
Go to the source code of this file.
Functions | |
void | _clipm_priv_error_sprint_messages (char *outstr, const char *msg1, const char *msg2, size_t maxlen) |
#define | _CLIPM_ERROR_SET_WHERE_() |
#define | _CLIPM_ERROR_SET_MSG_(code, object, msg) |
#define | CLIPM_TRY |
Beginning of a TRY-block. More... | |
#define | CLIPM_CATCH |
End of a TRY-block, beginning of a CATCH-block. More... | |
#define | CLIPM_ERROR_GET_NEW_SINCE_TRY(void) |
Return new CPL error code. More... | |
#define | CLIPM_ERROR_RECOVER_TRYSTATE(void) |
Recover the error state which was present during CLIPM_TRY (at the beginning of the try-block). More... | |
#define | CLIPM_ERROR_SET(code) |
Set a new error code. More... | |
#define | CLIPM_ERROR_SET_MSG(code, object, msg) |
Set a new error code together with a custom error message. More... | |
#define | CLIPM_ERROR_SET_MSG_IF_CODE(code, object, msg) |
Set a new custom error message if a certain error code is already set. More... | |
#define | CLIPM_ERROR_IS_SET(void) |
Return if a new CPL error is set. More... | |
#define | CLIPM_ERROR_IS_NONE(void) |
Return if no new CPL error is set. More... | |
#define | CLIPM_TRY_CHECK(condition, code, object, msg) |
Assure the condition is true, else set the respective error code, exit the TRY block, and set an error message using the object name (can be empty string) and a message. More... | |
#define | CLIPM_TRY_CHECK_AUTOMSG(condition, code) |
Assure the condition is true, else set the respective error code, exit the TRY block, and auto-generate an error message (re-using the condition). More... | |
#define | CLIPM_TRY_CHECK_ERROR_STATE(void) |
Check the CPL error state, and exit the try-block if not CPL_ERROR_NONE. More... | |
#define | CLIPM_TRY_ASSERT(condition) |
Assert that the given condition is fulfilled, otherwise set a custom bugreport message and exit the TRY-block with error code CLIPM_ERROR_UNEXPECTED. More... | |
#define | CLIPM_TRY_ASSERT_ERROR_STATE(void) |
Assert that the CPL error state is CPL_ERROR_NONE, otherwise set a custom bugreport message and exit the TRY-block with error code CLIPM_ERROR_UNEXPECTED. More... | |
#define | CLIPM_TRY_EXIT_WITH_ERROR(code) |
Set a new CPL error, and exit the try-block. More... | |
#define | CLIPM_TRY_EXIT_WITH_ERROR_MSG(code, object, msg) |
Set a new CPL error together with a custom error message, and exit the try-block. More... | |
#define | CLIPM_TRY_EXIT_IFN(condition) |
If condition == 0, then the try-block is exited. More... | |
#define | CLIPM_TRY_EXIT(void) |
The try-block is exited. More... | |
enum | _clipm_error_code_ { CLIPM_ERROR_UNEXPECTED = CPL_ERROR_EOL + 0 } |
Extension to CPL error codes. More... | |
typedef enum _clipm_error_code_ | clipm_error_code |
Extension to CPL error codes. More... | |
const char | _CLIPM_MSG_ERR_UNEXPECTED [] |
Internal error. More... | |
const char | _CLIPM_MSG_ERR_HANDLING [] |
Internal error handling bug. More... | |
const char | CLIPM_MSG_ERR_2ROWXY [] |
Location matrix must contain 2 rows. More... | |
const char | CLIPM_MSG_ERR_DIFFSIZES [] |
Location matrices differ in size. More... | |
const char | CLIPM_MSG_ERR_DIFFTYPES [] |
Location matrices differ in size. More... | |
#define _CLIPM_ERROR_SET_MSG_ | ( | code, | |
object, | |||
msg | |||
) |
#define _CLIPM_ERROR_SET_WHERE_ | ( | ) |
#define CLIPM_CATCH |
End of a TRY-block, beginning of a CATCH-block.
Please refer to CLIPM_TRY.
#define CLIPM_ERROR_GET_NEW_SINCE_TRY | ( | void | ) |
Return new CPL error code.
#define CLIPM_ERROR_IS_NONE | ( | void | ) |
Return if no new CPL error is set.
#define CLIPM_ERROR_IS_SET | ( | void | ) |
Return if a new CPL error is set.
#define CLIPM_ERROR_RECOVER_TRYSTATE | ( | void | ) |
Recover the error state which was present during CLIPM_TRY (at the beginning of the try-block).
#define CLIPM_ERROR_SET | ( | code | ) |
Set a new error code.
#define CLIPM_ERROR_SET_MSG | ( | code, | |
object, | |||
msg | |||
) |
Set a new error code together with a custom error message.
#define CLIPM_ERROR_SET_MSG_IF_CODE | ( | code, | |
object, | |||
msg | |||
) |
Set a new custom error message if a certain error code is already set.
#define CLIPM_TRY |
Beginning of a TRY-block.
The macro CLIPM_TRY is to be used like a keyword in front of a deeper scope. This scope has to be followed by the macro CLIPM_CATCH. This means that CLIPM_TRY and CLIPM_CATCH build a frame around a code statement or a code scope, called the try-block.
The CLIPM_CATCH macro is to be followed by a statement or scope, which is only executed if a CPL error is set while reaching the CLIPM_CATCH macro, called the catch-block.
The try-block can be exited by using one of the macros below, for example with CLIPM_TRY_EXIT_WITH_ERROR(). In this case, a jump to CLIPM_CATCH is performed, and the catch-block executed if an error is set.
The following constraints have to be fulfilled:
#define CLIPM_TRY_ASSERT | ( | condition | ) |
Assert that the given condition is fulfilled, otherwise set a custom bugreport message and exit the TRY-block with error code CLIPM_ERROR_UNEXPECTED.
#define CLIPM_TRY_ASSERT_ERROR_STATE | ( | void | ) |
Assert that the CPL error state is CPL_ERROR_NONE, otherwise set a custom bugreport message and exit the TRY-block with error code CLIPM_ERROR_UNEXPECTED.
#define CLIPM_TRY_CHECK | ( | condition, | |
code, | |||
object, | |||
msg | |||
) |
Assure the condition is true, else set the respective error code, exit the TRY block, and set an error message using the object name (can be empty string) and a message.
condition | Condition |
code | Error code to be set |
object | Object name (can be empty or NULL) |
msg | Message (can be empty or NULL) |
#define CLIPM_TRY_CHECK_AUTOMSG | ( | condition, | |
code | |||
) |
Assure the condition is true, else set the respective error code, exit the TRY block, and auto-generate an error message (re-using the condition).
condition | Condition |
code | Error code to be set |
#define CLIPM_TRY_CHECK_ERROR_STATE | ( | void | ) |
Check the CPL error state, and exit the try-block if not CPL_ERROR_NONE.
#define CLIPM_TRY_EXIT | ( | void | ) |
The try-block is exited.
#define CLIPM_TRY_EXIT_IFN | ( | condition | ) |
If condition == 0, then the try-block is exited.
#define CLIPM_TRY_EXIT_WITH_ERROR | ( | code | ) |
Set a new CPL error, and exit the try-block.
#define CLIPM_TRY_EXIT_WITH_ERROR_MSG | ( | code, | |
object, | |||
msg | |||
) |
Set a new CPL error together with a custom error message, and exit the try-block.
typedef enum _clipm_error_code_ clipm_error_code |
Extension to CPL error codes.
enum _clipm_error_code_ |
void _clipm_priv_error_sprint_messages | ( | char * | outstr, |
const char * | msg1, | ||
const char * | msg2, | ||
size_t | maxlen | ||
) |
const char _CLIPM_MSG_ERR_HANDLING[] |
Internal error handling bug.
const char _CLIPM_MSG_ERR_UNEXPECTED[] |
Internal error.
const char CLIPM_MSG_ERR_2ROWXY[] |
Location matrix must contain 2 rows.
const char CLIPM_MSG_ERR_DIFFSIZES[] |
Location matrices differ in size.
const char CLIPM_MSG_ERR_DIFFTYPES[] |
Location matrices differ in size.