|
µEvLoop
A fast and lightweight event loop aimed at embedded platforms in C99.
|
Contains definitions of functional conditionals, structures that act as if-else constructs. More...
#include "uevloop/utils/closure.h"

Go to the source code of this file.
Data Structures | |
| struct | uel_conditional_t |
| Conditionals are constructs that provide functional flow control. More... | |
Functions | |
| void | uel_conditional_init (uel_conditional_t *conditional, uel_closure_t test, uel_closure_t if_true, uel_closure_t if_false) |
| Initialises a conditional structure. More... | |
| void * | uel_conditional_apply (uel_conditional_t *conditional, void *params) |
| Applies a conditional do some input. More... | |
Contains definitions of functional conditionals, structures that act as if-else constructs.
| void* uel_conditional_apply | ( | uel_conditional_t * | conditional, |
| void * | params | ||
| ) |
Applies a conditional do some input.
This function takes some input and submits it to the test closure, whose output will be cast to a boolean value. According to this value, either if_true or if_false closures will be called with the same value as parameters.
| conditional | The conditional to be applied |
| params | The parameter that will be tested and provided to the chosen closure |
| void uel_conditional_init | ( | uel_conditional_t * | conditional, |
| uel_closure_t | test, | ||
| uel_closure_t | if_true, | ||
| uel_closure_t | if_false | ||
| ) |
Initialises a conditional structure.
| conditional | The conditional object to be initialised |
| test | The closure to test the input in order to decide what to do next |
| if_true | The closure to be invoked when the test closure returns true |
| if_false | The closure to be invoked when the test closure returns false |
1.8.17