HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openexr_errors.h
Go to the documentation of this file.
1 /*
2 ** SPDX-License-Identifier: BSD-3-Clause
3 ** Copyright Contributors to the OpenEXR Project.
4 */
5 
6 #ifndef OPENEXR_ERRORS_H
7 #define OPENEXR_ERRORS_H
8 
9 #include "openexr_config.h"
10 
11 #include <stdint.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /** @file */
18 
19 /**
20  * @defgroup ErrorCodes Error Handling
21  * @brief These are a group of definitions related to error handling.
22  *
23  * All functions in the C layer will return a result, which will
24  * correspond to one of these codes. To ensure binary stability, the
25  * return type is separate from the error code, and is a fixed size.
26  *
27  * @{
28  */
29 
30 /** Error codes that may be returned by various functions. */
31 typedef enum
32 {
68 
69 /** Return type for all functions. */
70 typedef int32_t exr_result_t;
71 
72 /** @brief Return a static string corresponding to the specified error code.
73  *
74  * The string should not be freed (it is compiled into the binary).
75  */
76 EXR_EXPORT const char* exr_get_default_error_message (exr_result_t code);
77 
78 /** @brief Return a static string corresponding to the specified error code.
79  *
80  * The string should not be freed (it is compiled into the binary).
81  */
82 EXR_EXPORT const char* exr_get_error_code_as_string (exr_result_t code);
83 
84 /** @} */
85 
86 #ifdef __cplusplus
87 } /* extern "C" */
88 #endif
89 
90 #endif /* OPENEXR_ERRORS_H */
int32_t exr_result_t
#define EXR_EXPORT
exr_error_code_t
EXR_EXPORT const char * exr_get_error_code_as_string(exr_result_t code)
Return a static string corresponding to the specified error code.
EXR_EXPORT const char * exr_get_default_error_message(exr_result_t code)
Return a static string corresponding to the specified error code.