![]() |
Imaging Control 4 C Library 1.4.0
|
This section describes error handling in this library. More...
Functions | |
| bool | ic4_get_last_error (enum IC4_ERROR *pError, char *message, size_t *message_length) |
| Query information about the error of the previous library function call. | |
This section describes error handling in this library.
Most functions of this library return a bool indicating success. Some have a designated error return value, e.g. as part of an enumeration type.
If a function fails, it sets a thread-local error value and error message. The error value and error message can be retrieved by calling the ic4_get_last_error() function.
If a function succeeds, the error value and message are cleared.
| enum IC4_ERROR |
Contains the possible error codes.
| bool ic4_get_last_error | ( | enum IC4_ERROR * | pError, |
| char * | message, | ||
| size_t * | message_length | ||
| ) |
Query information about the error of the previous library function call.
| [out] | pError | Pointer to a IC4_ERROR value to receive the error code. |
| [out] | message | Pointer to a character array to receive an error message. This parameter is optional and may be NULL. |
| [in,out] | message_length | Pointer to a size_t describing the length of the array pointed to by message.If message is not NULL, this parameter is required.The function always writes the actual number of characters required to store the error message. |
true on success. NULL, the function fails and returns false. NULL and message_length is NULL, the function fails and returns false. false.ic4_get_last_error returns error information about the previous function call that happened on the same thread that ic4_get_last_error is called from.ic4_get_last_error does not update the internally stored last error.