23 #ifndef LEGATO_BASICS_INCLUDE_GUARD
24 #define LEGATO_BASICS_INCLUDE_GUARD
106 #define CONTAINER_OF(memberPtr, type, member) \
107 ((type*)(((uint8_t*)(memberPtr))-((size_t)(&(((type*)0)->member)))))
140 #define NUM_ARRAY_MEMBERS(array) \
141 (sizeof(array) / sizeof((array)[0]))
167 #define INDEX_OF_ARRAY_MEMBER(array, memberPtr) \
168 ((((size_t)memberPtr) - ((size_t)array)) / sizeof(*(memberPtr)))
205 #define STRINGIZE(x) STRINGIZE_EXPAND(x)
212 #define STRINGIZE_EXPAND(x) #x // Needed to expand macros.
239 #define LE_SHARED __attribute__((visibility ("default")))
242 #endif // LEGATO_BASICS_INCLUDE_GUARD
Format error.
Definition: le_basics.h:50
The underlying resource does not support this operation.
Definition: le_basics.h:55
Current user does not have permission to perform requested action.
Definition: le_basics.h:42
Unspecified internal error.
Definition: le_basics.h:43
Duplicate entry found or operation already performed.
Definition: le_basics.h:51
Insufficient memory is available.
Definition: le_basics.h:41
le_result_t
Definition: le_basics.h:35
An IO operation failed.
Definition: le_basics.h:56
Would have caused a deadlock.
Definition: le_basics.h:49
Successful.
Definition: le_basics.h:37
Unimplemented functionality.
Definition: le_basics.h:57
An overflow occurred or would have occurred.
Definition: le_basics.h:46
A time-out occurred.
Definition: le_basics.h:45
An underflow occurred or would have occurred.
Definition: le_basics.h:47
Referenced item does not exist or could not be found.
Definition: le_basics.h:38
The resource is closed.
Definition: le_basics.h:53
A transient or temporary loss of a service or resource.
Definition: le_basics.h:58
Definition: le_basics.h:39
The resource is busy.
Definition: le_basics.h:54
An index or other value is out of range.
Definition: le_basics.h:40
Parameter is invalid.
Definition: le_basics.h:52
Would have blocked if non-blocking behaviour was not requested.
Definition: le_basics.h:48
Communications error.
Definition: le_basics.h:44
le_onoff_t
Definition: le_basics.h:69