Adapter-side API for constructing and binding logger_t objects.
More...


Go to the source code of this file.
Data Structures | |
| struct | logger_vtbl_t |
Adapter dispatch table bound to a logger_t instance. More... | |
Typedefs | |
| typedef struct logger_vtbl_t | logger_vtbl_t |
Functions | |
| logger_status_t | logger_create (logger_t **out, const logger_vtbl_t *vtbl, void *backend, const logger_env_t *env) |
| Create a generic logger handle from adapter-provided backend bindings. | |
This header exposes the adapter-facing contract used to bind a backend implementation to the generic logger_t port.
It defines:
logger_vtbl_t,logger_create().Typical usage:
logger_vtbl_t,logger_create() to build the public logger handle. Definition in file logger_adapters_api.h.
| typedef struct logger_vtbl_t logger_vtbl_t |
| logger_status_t logger_create | ( | logger_t ** | out, |
| const logger_vtbl_t * | vtbl, | ||
| void * | backend, | ||
| const logger_env_t * | env | ||
| ) |
This function is intended to be called by logger adapters to construct a public logger_t from:
The produced logger handle takes ownership of neither the vtable nor the environment object itself; it only stores the required runtime references. The backend lifetime and destruction semantics are governed by the adapter contract, notably through vtbl->destroy.
| [out] | out | Receives the created logger handle. Must not be NULL. |
| [in] | vtbl | Backend dispatch table. Must not be NULL and must provide non-NULL operations. |
| [in] | backend | Adapter-owned backend instance to bind to the logger. May be NULL only if the resulting semantics are explicitly supported by the caller, though normal adapters are expected to provide a valid backend. |
| [in] | env | Logger environment carrying injected runtime dependencies. Must not be NULL. |
LOGGER_STATUS_OK on successLOGGER_STATUS_INVALID if arguments are invalidLOGGER_STATUS_OOM on allocation failure*out contains a valid logger handle that must later be destroyed via logger_destroy().