LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
Common result types

Functions

 JUNO_MODULE_RESULT (JUNO_RESULT_BOOL_T, bool)
 Result type carrying a bool payload.
 
 JUNO_MODULE_RESULT (JUNO_RESULT_UINT32_T, uint32_t)
 Result type carrying a 32-bit unsigned integer payload.
 
 JUNO_MODULE_RESULT (JUNO_RESULT_F64_T, double)
 Result type carrying a double-precision floating-point payload.
 
 JUNO_MODULE_RESULT (JUNO_RESULT_SIZE_T, size_t)
 Result type carrying a size_t payload.
 
 JUNO_MODULE_RESULT (JUNO_RESULT_VOID_PTR_T, void *)
 Result type carrying a void* payload.
 

Detailed Description

This header provides convenience specializations of the generic JUNO_MODULE_RESULT(NAME_T, OK_T) macro for frequently used payload types. These result types are used to return a status alongside a typed value in a single aggregate, promoting deterministic error handling without exceptions.

Usage example:

JUNO_RESULT_UINT32_T r = ReadRegister();
JUNO_ASSERT_OK(r, return r.tStatus);
uint32_t value = JUNO_OK(r);
#define JUNO_OK(result)
Access the success payload from a result produced by JUNO_MODULE_RESULT.
Definition module.h:204
#define JUNO_ASSERT_OK(result,...)
Execute the provided statements if result.tStatus is not success.
Definition module.h:215

Function Documentation

◆ JUNO_MODULE_RESULT() [1/5]

JUNO_MODULE_RESULT ( JUNO_RESULT_BOOL_T  ,
bool   
)

Result type carrying a bool payload.

◆ JUNO_MODULE_RESULT() [2/5]

JUNO_MODULE_RESULT ( JUNO_RESULT_F64_T  ,
double   
)

Result type carrying a double-precision floating-point payload.

◆ JUNO_MODULE_RESULT() [3/5]

JUNO_MODULE_RESULT ( JUNO_RESULT_SIZE_T  ,
size_t   
)

Result type carrying a size_t payload.

◆ JUNO_MODULE_RESULT() [4/5]

JUNO_MODULE_RESULT ( JUNO_RESULT_UINT32_T  ,
uint32_t   
)

Result type carrying a 32-bit unsigned integer payload.

◆ JUNO_MODULE_RESULT() [5/5]

JUNO_MODULE_RESULT ( JUNO_RESULT_VOID_PTR_T  ,
void *   
)

Result type carrying a void* payload.