IoTivity-Lite
|
Implementation of local continuations based on switch() statement. More...
Macros | |
#define | LC_END(s) } |
#define | LC_INIT(s) s = 0; |
#define | LC_RESUME(s) |
#define | LC_SET(s) |
Typedefs | |
typedef unsigned short | lc_t |
Implementation of local continuations based on switch() statement.
This implementation of local continuations uses the C switch() statement to resume execution of a function somewhere inside the function's body. The implementation is based on the fact that switch() statements are able to jump directly into the bodies of control structures such as if() or while() statements.
This implementation borrows heavily from Simon Tatham's coroutines implementation in C: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html