Go to the source code of this file.
Macros | |
#define | CONTAINER_OF(memberPtr, type, member) ((type*)(((uint8_t*)(memberPtr))-((size_t)(&(((type*)0)->member))))) |
#define | NUM_ARRAY_MEMBERS(array) (sizeof(array) / sizeof((array)[0])) |
#define | INDEX_OF_ARRAY_MEMBER(array, memberPtr) ((((size_t)memberPtr) - ((size_t)array)) / sizeof(*(memberPtr))) |
#define | STRINGIZE(x) STRINGIZE_EXPAND(x) |
#define | STRINGIZE_EXPAND(x) #x |
#define | LE_SHARED __attribute__((visibility ("default"))) |
Bit Masks | |
Single byte bit definitions that can be used for bit masking. | |
#define | BIT0 0x01 |
#define | BIT1 0x02 |
#define | BIT2 0x04 |
#define | BIT3 0x08 |
#define | BIT4 0x10 |
#define | BIT5 0x20 |
#define | BIT6 0x40 |
#define | BIT7 0x80 |
Enumerations | |
enum | le_result_t { LE_OK = 0, LE_NOT_FOUND = -1, LE_NOT_POSSIBLE = -2, LE_OUT_OF_RANGE = -3, LE_NO_MEMORY = -4, LE_NOT_PERMITTED = -5, LE_FAULT = -6, LE_COMM_ERROR = -7, LE_TIMEOUT = -8, LE_OVERFLOW = -9, LE_UNDERFLOW = -10, LE_WOULD_BLOCK = -11, LE_DEADLOCK = -12, LE_FORMAT_ERROR = -13, LE_DUPLICATE = -14, LE_BAD_PARAMETER = -15, LE_CLOSED = -16, LE_BUSY = -17, LE_UNSUPPORTED = -18, LE_IO_ERROR = -19, LE_NOT_IMPLEMENTED = -20, LE_UNAVAILABLE = -21, LE_TERMINATED = -22 } |
enum | le_onoff_t { LE_OFF = 0, LE_ON = 1 } |
Legato Basic Type and Constant Definitions include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#define CONTAINER_OF | ( | memberPtr, | |
type, | |||
member | |||
) | ((type*)(((uint8_t*)(memberPtr))-((size_t)(&(((type*)0)->member))))) |
#define INDEX_OF_ARRAY_MEMBER | ( | array, | |
memberPtr | |||
) | ((((size_t)memberPtr) - ((size_t)array)) / sizeof(*(memberPtr))) |
Computes the index of a member within an array.
This code sample prints out "The 'w' is at index 6.":
#define LE_SHARED __attribute__((visibility ("default"))) |
Macro used to declare that a symbol should be shared outside the dynamic shared object in which it is defined.
This can be used with either a declaration or a definition.
E.g., with a declaration (perhaps in a header file):
E.g., with a definition (in a .c file):
#define NUM_ARRAY_MEMBERS | ( | array | ) | (sizeof(array) / sizeof((array)[0])) |
Computes number of members in an array at compile time.
Here's a code sample:
Will print 13
on a 32-bit target.
But this example is incorrect:
#define STRINGIZE | ( | x | ) | STRINGIZE_EXPAND(x) |
This function takes the characters as an argument and puts quotes around them.
Code sample:
Is seen by the compiler as
The STRINGIZE() macro function passes names like macro definitions on the compiler's command-line. If the above code were changed to:
then compiling it using the following command line makes it equivalent to the example above:
The -DNAME=foo
defines a macro called NAME
with a value foo
. The C preprocessor then replaces STRINGIZE(NAME)
with "foo"
.
#define STRINGIZE_EXPAND | ( | x | ) | #x |
Helper macro for STRINGIZE(x).
enum le_onoff_t |
ON/OFF type.
enum le_result_t |
Standard result codes.