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_conf.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 {
67 
68 /** Return type for all functions. */
69 typedef int32_t exr_result_t;
70 
71 /** @brief Return a static string corresponding to the specified error code.
72  *
73  * The string should not be freed (it is compiled into the binary).
74  */
75 EXR_EXPORT const char* exr_get_default_error_message (exr_result_t code);
76 
77 /** @brief Return a static string corresponding to the specified error code.
78  *
79  * The string should not be freed (it is compiled into the binary).
80  */
81 EXR_EXPORT const char* exr_get_error_code_as_string (exr_result_t code);
82 
83 /** @} */
84 
85 #ifdef __cplusplus
86 } /* extern "C" */
87 #endif
88 
89 #endif /* OPENEXR_ERRORS_H */
int32_t exr_result_t
#define EXR_EXPORT
Definition: openexr_conf.h:29
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.