libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_result.h File Reference

Go to the source code of this file.

Macros

#define GBL_META_RESULT_TABLE
 
#define GBL_RESULT_UNKNOWN(value)
 
#define GBL_RESULT_SUCCESS(value)
 
#define GBL_RESULT_PARTIAL(value)
 
#define GBL_RESULT_UNAVAILABLE(value)
 
#define GBL_RESULT_ERROR(value)
 
#define GBL_RESULT_ISSUE(value)
 

Typedefs

typedef GblEnum GBL_RESULT
 

Enumerations

enum  GBL_RESULT
 

Functions

static const char * gblResultString (GBL_RESULT value)
 

Detailed Description

GBL_RESULT values, stringifiers, and utilities.

Author
Falco Girgis

Definition in file gimbal_result.h.

Macro Definition Documentation

◆ GBL_META_RESULT_TABLE

#define GBL_META_RESULT_TABLE

Definition at line 15 of file gimbal_result.h.

15#define GBL_META_RESULT_TABLE ( \
16 ( GBL_RESULT, Result, "C API Return Status Code", gblResultString), \
17 ( \
18 (GBL_RESULT_UNKNOWN, 0x0, Unknown, "Unknown"), \
19 (GBL_RESULT_SUCCESS, 0x1, Success, "Success"), \
20 (GBL_RESULT_EVENT_IGNORED, 0x2, EventIgnored, "Event Ignored"), \
21 (GBL_RESULT_EVENT_ACCEPTED, 0x3, EventAccepted, "Event Accepted"), \
22 (GBL_RESULT_PARTIAL, 0xa, Partial, "Generic Partial Success"), \
23 (GBL_RESULT_TRUNCATED, GBL_RESULT_PARTIAL + 1, Truncated, "Truncated"), \
24 (GBL_RESULT_LOSSY_CONVERSION, GBL_RESULT_PARTIAL + 2, LossyConversion, "Lossy Conversion"), \
25 (GBL_RESULT_TIMEOUT, GBL_RESULT_PARTIAL + 3, Timeout, "Timeout"), \
26 (GBL_RESULT_NOT_READY, GBL_RESULT_PARTIAL + 4, NotReady, "Not Ready"), \
27 (GBL_RESULT_NOT_FOUND, GBL_RESULT_PARTIAL + 5, NotFound, "Not Found"), \
28 (GBL_RESULT_INCOMPLETE, GBL_RESULT_PARTIAL + 6, Incomplete, "Incomplete"), \
29 (GBL_RESULT_UNIMPLEMENTED, GBL_RESULT_PARTIAL + 7, Unimplemented, "Unimplemented"), \
30 (GBL_RESULT_UNSUPPORTED, GBL_RESULT_PARTIAL + 8, Unsupported, "Unsupported"), \
31 (GBL_RESULT_VERSION_MISMATCH, GBL_RESULT_PARTIAL + 9, VersionMismatch, "Version Mismatch"), \
32 (GBL_RESULT_SKIPPED, GBL_RESULT_PARTIAL + 10,Skipped, "Skipped"), \
33 (GBL_RESULT_ERROR, 0xbad00000, Error, "Generic Error"), \
34 (GBL_RESULT_ERROR_UNHANDLED_EXCEPTION, GBL_RESULT_ERROR | 1, ErrorUnhandledException, "Unhandled Exception"), \
35 (GBL_RESULT_ERROR_INTERNAL, GBL_RESULT_ERROR | 2, ErrorInternal, "Internal Error"), \
36 (GBL_RESULT_ERROR_TYPE_MISMATCH, GBL_RESULT_ERROR | 3, ErrorTypeMismatch, "Type Mismatch"), \
37 (GBL_RESULT_ERROR_INVALID_VARIANT_ACCESS, GBL_RESULT_ERROR | 4, ErrorInvalidVariantAccess, "Invalid Variant Access"), \
38 (GBL_RESULT_ERROR_UNDERFLOW, GBL_RESULT_ERROR | 5, ErrorUnderflow, "Underflow"), \
39 (GBL_RESULT_ERROR_OVERFLOW, GBL_RESULT_ERROR | 6, ErrorOverflow, "Overflow"), \
40 (GBL_RESULT_ERROR_OUT_OF_RANGE, GBL_RESULT_ERROR | 7, ErrorOutOfRange, "Out of Range"), \
41 (GBL_RESULT_ERROR_INVALID_HANDLE, GBL_RESULT_ERROR | 8, ErrorInvalidHandle, "Invalid Handle"), \
42 (GBL_RESULT_ERROR_INVALID_POINTER, GBL_RESULT_ERROR | 9, ErrorInvalidPointer, "Invalid Pointer"), \
43 (GBL_RESULT_ERROR_INVALID_ARG, GBL_RESULT_ERROR | 10, ErrorInvalidArg, "Invalid Argument"), \
44 (GBL_RESULT_ERROR_INVALID_CMDLINE_ARG, GBL_RESULT_ERROR | 11, ErrorInvalidCmdLineArg, "Invalid CmdLine Argument"), \
45 (GBL_RESULT_ERROR_INVALID_EXPRESSION, GBL_RESULT_ERROR | 12, ErrorInvalidExpression, "Invalid Expression"), \
46 (GBL_RESULT_ERROR_INVALID_OPERATION, GBL_RESULT_ERROR | 13, ErrorInvalidOperation, "Invalid Operation"), \
47 (GBL_RESULT_ERROR_INVALID_CONVERSION, GBL_RESULT_ERROR | 14, ErrorInvalidConversion, "Invalid Conversion"), \
48 (GBL_RESULT_ERROR_INVALID_VIRTUAL_CALL, GBL_RESULT_ERROR | 15, ErrorInvalidVirtualCall, "Invalid Virtual Function Called"), \
49 (GBL_RESULT_ERROR_INVALID_KEY, GBL_RESULT_ERROR | 16, ErrorInvalidKey, "Invalid Key"), \
50 (GBL_RESULT_ERROR_INVALID_PROPERTY, GBL_RESULT_ERROR | 17, ErrorInvalidProperty, "Invalid Property"), \
51 (GBL_RESULT_ERROR_INVALID_INSTANCE, GBL_RESULT_ERROR | 18, ErrorInvalidInstance, "Invalid Instance"), \
52 (GBL_RESULT_ERROR_INVALID_CLASS, GBL_RESULT_ERROR | 19, ErrorInvalidClass, "Invalid Class"), \
53 (GBL_RESULT_ERROR_INVALID_TYPE, GBL_RESULT_ERROR | 20, ErrorInvalidType, "Invalid Type"), \
54 (GBL_RESULT_ERROR_INVALID_DATE_TIME, GBL_RESULT_ERROR | 21, ErrorInvalidDateTime, "Invalid Date/Time"), \
55 (GBL_RESULT_ERROR_INVALID_THREAD, GBL_RESULT_ERROR | 22, ErrorInvalidThread, "Invalid Thread"), \
56 (GBL_RESULT_ERROR_INVALID_TOKEN, GBL_RESULT_ERROR | 23, ErrorInvalidToken, "Invalid Token"), \
57 (GBL_RESULT_ERROR_MEM_ALLOC, GBL_RESULT_ERROR | 24, ErrorMemAlloc, "Memory Allocation Failed"), \
58 (GBL_RESULT_ERROR_MEM_REALLOC, GBL_RESULT_ERROR | 25, ErrorMemRealloc, "Memory Reallocation Failed"), \
59 (GBL_RESULT_ERROR_MEM_FREE, GBL_RESULT_ERROR | 26, ErrorMemFree, "Memory Free Failed"), \
60 (GBL_RESULT_ERROR_FILE_OPEN, GBL_RESULT_ERROR | 27, ErrorFileOpen, "Failed to Open File Descriptor"), \
61 (GBL_RESULT_ERROR_FILE_CLOSE, GBL_RESULT_ERROR | 28, ErrorFileClose, "Failed to Close File Descriptor"), \
62 (GBL_RESULT_ERROR_FILE_READ, GBL_RESULT_ERROR | 29, ErrorFileRead, "Failed to Read from File Descriptor"), \
63 (GBL_RESULT_ERROR_FILE_WRITE, GBL_RESULT_ERROR | 30, ErrorFileWrite, "Failed to Write to File Descriptor"), \
64 (GBL_RESULT_COUNT, GBL_RESULT_ERROR | 31, Count, "# of Different Error Codes") \
65 ) \
66 )

◆ GBL_RESULT_UNKNOWN

#define GBL_RESULT_UNKNOWN ( value)

Definition at line 70 of file gimbal_result.h.

70#define GBL_RESULT_UNKNOWN(value) \
71 ((GBL_RESULT)value == GBL_RESULT_UNKNOWN)

◆ GBL_RESULT_SUCCESS

#define GBL_RESULT_SUCCESS ( value)

Definition at line 73 of file gimbal_result.h.

73#define GBL_RESULT_SUCCESS(value) \
74 ((GBL_RESULT)value == GBL_RESULT_SUCCESS || (GBL_RESULT)value == GBL_RESULT_EVENT_IGNORED || (GBL_RESULT)value == GBL_RESULT_EVENT_ACCEPTED)

◆ GBL_RESULT_PARTIAL

#define GBL_RESULT_PARTIAL ( value)

Definition at line 76 of file gimbal_result.h.

76#define GBL_RESULT_PARTIAL(value) \
77 (!(GBL_RESULT_SUCCESS(value) || GBL_RESULT_ERROR(value) || GBL_RESULT_UNKNOWN(value)))

◆ GBL_RESULT_UNAVAILABLE

#define GBL_RESULT_UNAVAILABLE ( value)

Definition at line 79 of file gimbal_result.h.

79#define GBL_RESULT_UNAVAILABLE(value) \
80 ((GBL_RESULT)value == GBL_RESULT_UNIMPLEMENTED || (GBL_RESULT)value == GBL_RESULT_UNSUPPORTED || (GBL_RESULT)value == GBL_RESULT_VERSION_MISMATCH)

◆ GBL_RESULT_ERROR

#define GBL_RESULT_ERROR ( value)

Definition at line 82 of file gimbal_result.h.

82#define GBL_RESULT_ERROR(value) \
83 ((GBL_RESULT)((value) & 0xfff00000) == GBL_RESULT_ERROR)

◆ GBL_RESULT_ISSUE

#define GBL_RESULT_ISSUE ( value)

Definition at line 85 of file gimbal_result.h.

85#define GBL_RESULT_ISSUE(value) \
86 (!GBL_RESULT_SUCCESS(value))

Typedef Documentation

◆ GBL_RESULT

Definition at line 68 of file gimbal_result.h.

Enumeration Type Documentation

◆ GBL_RESULT

enum GBL_RESULT
Enumerator
GBL_RESULT_UNKNOWN 

"Unknown"

GBL_RESULT_SUCCESS 

"Success"

Definition at line 68 of file gimbal_result.h.

Function Documentation

◆ gblResultString()

static const char * gblResultString ( GBL_RESULT value)
inlinestatic

Definition at line 68 of file gimbal_result.h.