23 #ifndef LEGATO_BASICS_INCLUDE_GUARD
24 #define LEGATO_BASICS_INCLUDE_GUARD
101 #define CONTAINER_OF(memberPtr, type, member) \
102 ((type*)(((uint8_t*)(memberPtr))-((size_t)(&(((type*)0)->member)))))
135 #define NUM_ARRAY_MEMBERS(array) \
136 (sizeof(array) / sizeof((array)[0]))
162 #define INDEX_OF_ARRAY_MEMBER(array, memberPtr) \
163 ((((size_t)memberPtr) - ((size_t)array)) / sizeof(*(memberPtr)))
197 #define STRINGIZE(x) STRINGIZE_EXPAND(x)
204 #define STRINGIZE_EXPAND(x) #x // Needed to expand macros.
207 #endif // LEGATO_BASICS_INCLUDE_GUARD
Format error.
Definition: le_basics.h:49
Current user does not have permission to perform requested action.
Definition: le_basics.h:41
Unspecified internal error.
Definition: le_basics.h:42
Duplicate entry found or operation already performed.
Definition: le_basics.h:50
Insufficient memory is available.
Definition: le_basics.h:40
le_result_t
Definition: le_basics.h:34
Would have caused a deadlock.
Definition: le_basics.h:48
Successful.
Definition: le_basics.h:36
An overflow occurred or would have occurred.
Definition: le_basics.h:45
A time-out occurred.
Definition: le_basics.h:44
An underflow occurred or would have occurred.
Definition: le_basics.h:46
Referenced item does not exist or could not be found.
Definition: le_basics.h:37
The resource is closed.
Definition: le_basics.h:52
It is not possible to perform the requested action.
Definition: le_basics.h:38
The resource is busy or unavailable.
Definition: le_basics.h:53
An index or other value is out of range.
Definition: le_basics.h:39
Parameter is invalid.
Definition: le_basics.h:51
Would have blocked if non-blocking behaviour was not requested.
Definition: le_basics.h:47
Communications error.
Definition: le_basics.h:43
le_onoff_t
Definition: le_basics.h:64