00001
00054 #if !defined(__IX_ERROR_H__)
00055 #define __IX_ERROR_H__
00056
00057 #include "ix_types.h"
00058 #include "ix_symbols.h"
00059 #include "ix_macros.h"
00060 #if defined(__cplusplus)
00061 extern "C"
00062 {
00063 #endif
00064
00065
00092 typedef ix_uint32 ix_error;
00093
00098 #define IX_ERROR_SUCCESS ((ix_error)0)
00099
00100
00109 typedef enum ix_e_error_group
00110 {
00111 IX_ERROR_GROUP_FIRST = 0,
00112 IX_ERROR_GROUP_RESOURCE_MANAGER = IX_ERROR_GROUP_FIRST,
00113 IX_ERROR_GROUP_OSSL,
00114 IX_ERROR_GROUP_CC_INFRASTRUCTURE,
00115 IX_ERROR_GROUP_LAST
00116 } ix_error_group;
00117
00118
00119
00129 typedef enum ix_e_error_level
00130 {
00131 IX_ERROR_LEVEL_FIRST = 0,
00132
00141 IX_ERROR_LEVEL_NONE = IX_ERROR_LEVEL_FIRST,
00142
00157 IX_ERROR_LEVEL_WARNING,
00158
00176 IX_ERROR_LEVEL_LOCAL,
00177
00188 IX_ERROR_LEVEL_REMOTE,
00189
00205 IX_ERROR_LEVEL_GLOBAL,
00206
00224 IX_ERROR_LEVEL_PANIC,
00225
00226 IX_ERROR_LEVEL_LAST
00227 } ix_error_level;
00228
00229
00230
00241 #define IX_ERROR_GET_CODE( \
00242 arg_Error \
00243 ) \
00244 IX_GET_BIT_FIELD32(arg_Error, 0U, 15U)
00245
00256 #define IX_ERROR_SET_CODE( \
00257 arg_Error, \
00258 arg_ErrorCode \
00259 ) \
00260 (ix_error)IX_SET_BIT_FIELD32(arg_Error, arg_ErrorCode, 0U, 15U)
00261
00262
00273 #define IX_ERROR_GET_GROUP( \
00274 arg_Error \
00275 ) \
00276 IX_GET_BIT_FIELD32(arg_Error, 16U, 23U)
00277
00288 #define IX_ERROR_SET_GROUP( \
00289 arg_Error, \
00290 arg_ErrorGroup \
00291 ) \
00292 (ix_error)IX_SET_BIT_FIELD32(arg_Error, arg_ErrorGroup, 16U, 23U)
00293
00294
00295
00306 #define IX_ERROR_GET_LEVEL( \
00307 arg_Error \
00308 ) \
00309 IX_GET_BIT_FIELD32(arg_Error, 24U, 31U)
00310
00321 #define IX_ERROR_SET_LEVEL( \
00322 arg_Error, \
00323 arg_ErrorLevel \
00324 ) \
00325 (ix_error)IX_SET_BIT_FIELD32(arg_Error, arg_ErrorLevel, 24U, 31U)
00326
00327
00328
00344 #define IX_ERROR_NEW( \
00345 arg_ErrorCode, \
00346 arg_ErrorGroup, \
00347 arg_ErrorLevel \
00348 ) \
00349 ((ix_error) \
00350 IX_MAKE_BIT_FIELD32(arg_ErrorCode, 0U, 15U) | \
00351 IX_MAKE_BIT_FIELD32(arg_ErrorGroup, 16U, 23U) | \
00352 IX_MAKE_BIT_FIELD32(arg_ErrorLevel, 24U, 31U))
00353
00354
00355 #if defined(__cplusplus)
00356 }
00357 #endif
00358
00359 #endif
00360