General platform specfic defines and initialization/cleanup for platform layer.
More...
|
#define | UA_BV(x) (1 << (x)) |
| Bit shift macro. More...
|
|
#define | UA_PANIC(msg) ua_p_platform_panic(msg, __FILE__, __LINE__) |
| Panic for stopping applications in fatal error scenarios.
|
|
#define | UA_TEST_ASSERT(condition, msg) |
| This maro is only used for testing and not in production. More...
|
|
General platform specfic defines and initialization/cleanup for platform layer.
◆ UA_BV
#define UA_BV |
( |
|
x | ) |
(1 << (x)) |
◆ UA_TEST_ASSERT
#define UA_TEST_ASSERT |
( |
|
condition, |
|
|
|
msg |
|
) |
| |
This maro is only used for testing and not in production.
It stops the code in certain situations using abort() also when compiled in release mode. In production this macro will be an emtpty define. It can be enabled by compiling with PLATFORM_ENABLE_TEST_ASSERT=on.
◆ ua_platform_cleanup()
PLATFORM_EXPORT int ua_platform_cleanup |
( |
void |
| ) |
|
Cleanup the platform layer.
- Returns
- Zero on success or errorcode on failure.
◆ ua_platform_init()
PLATFORM_EXPORT int ua_platform_init |
( |
void |
| ) |
|
Initialize the platform layer.
- Returns
- Zero on success or errorcode on failure.
◆ ua_trim()
PLATFORM_EXPORT char* ua_trim |
( |
char * |
text | ) |
|
Removes whitespace from the beginning and end of the string.
- Parameters
-
text | String pointer. This gets modified. |
- Returns
- Pointer to new start of the string.
◆ ua_trim_and_unquote()
PLATFORM_EXPORT char* ua_trim_and_unquote |
( |
char * |
text | ) |
|
This function trims and unquotes the given string.
- See also
- ua_trim
-
ua_unquote
- Parameters
-
- Returns
- Transformed string.
◆ ua_unquote()
PLATFORM_EXPORT char* ua_unquote |
( |
char * |
text | ) |
|
Removes quotes from string.
Only if the first and last character is a '"', then this will be removed. For this reason the string should be trimmed already.
- See also
- ua_trim_and_unquote
- Parameters
-
- Returns
- Transformed string.