|
LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
|
Implementation of JunoUdp_Init for the udp-threads example. More...

Functions | |
| JUNO_STATUS_T | JunoUdp_Init (JUNO_UDP_ROOT_T *ptRoot, const JUNO_UDP_API_T *ptApi, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, void *pvFailureUserData) |
| Initialise a UDP module root with a concrete vtable and failure handler. | |
Implementation of JunoUdp_Init for the udp-threads example.
This translation unit implements the module initialisation function for the UDP socket module. It is intentionally free of POSIX headers; all platform-specific code lives in linux_udp_impl.cpp.
Including udp_api.h (which wraps its declarations in extern "C") gives JunoUdp_Init C linkage automatically when compiled as C++.
| JUNO_STATUS_T JunoUdp_Init | ( | JUNO_UDP_ROOT_T * | ptRoot, |
| const JUNO_UDP_API_T * | ptApi, | ||
| JUNO_FAILURE_HANDLER_T | pfcnFailureHandler, | ||
| void * | pvFailureUserData | ||
| ) |
Initialise a UDP module root with a concrete vtable and failure handler.
Type-safe polymorphic handle for a UDP module instance.
Wires ptApi into ptRoot->ptApi and stores the optional failure handler and user data. Must be called before any vtable operation on the root. Platform-specific socket state (fd, address) is owned by the derivation (JUNO_UDP_LINUX_T) and initialised in JunoUdp_LinuxInit.
| ptRoot | Caller-owned root storage; must be non-NULL. |
| ptApi | Vtable (Linux implementation or test double); must be non-NULL. |
| pfcnFailureHandler | Diagnostic callback invoked before any error return; may be NULL. |
| pvFailureUserData | Opaque user data pointer threaded to the failure handler; may be NULL. |
JUNO_STATUS_SUCCESS on success; JUNO_STATUS_NULLPTR_ERROR if ptRoot or ptApi is NULL.