Midnight Sun Firmware
Loading...
Searching...
No Matches
status.h
1#pragma once
2
3/************************************************************************************************
4 * @file status.h
5 *
6 * @brief Status Library for more verbose error handling
7 *
8 * @date 2024-10-27
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13
14/* Inter-component Headers */
15
16/* Intra-component Headers */
17
27typedef enum {
28 STATUS_CODE_OK = 0,
29 STATUS_CODE_UNKNOWN,
30 STATUS_CODE_INVALID_ARGS,
31 STATUS_CODE_RESOURCE_EXHAUSTED,
32 STATUS_CODE_UNREACHABLE,
33 STATUS_CODE_TIMEOUT,
34 STATUS_CODE_EMPTY,
35 STATUS_CODE_OUT_OF_RANGE,
36 STATUS_CODE_UNIMPLEMENTED,
37 STATUS_CODE_UNINITIALIZED,
38 STATUS_CODE_INTERNAL_ERROR,
39 STATUS_CODE_INCOMPLETE,
40 NUM_STATUS_CODES,
42
46#define status_ok_or_return(code) \
47 ({ \
48 __typeof__(code) status_expr = (code); \
49 if (status_expr) return status_expr; \
50 })
51
StatusCode
StatusCodes for various errors.
Definition: status.h:27