Zth (libzth)
Loading...
Searching...
No Matches
Indirection

Indirection support for C API functions. More...

Functions

void zth_logv_indirect (zth_logv_t *func)
 Set the function pointer for zth_logv.
 
void zth_main_fiber_indirect (zth_main_fiber_t *func)
 Set the function pointer for main_fiber.
 
void zth_assert_handler_indirect (zth_assert_handler_t *func)
 Set the function pointer for zth_assert_handler.
 
void zth_postdeinit_indirect (zth_postdeinit_t *func)
 Set the function pointer for zth_postdeinit.
 
void zth_preinit_indirect (zth_preinit_t *func)
 Set the function pointer for zth_preinit.
 
void zth_terminate_indirect (zth_terminate_t *func)
 Set the function pointer for zth_terminate.
 
void zth_indirect (zth_indirection_t const *indirection)
 Set all function indirection pointers.
 

Detailed Description

Indirection support for C API functions.

Several low-level functions can be overridden. For a static library, these are defined as weak symbols, allowing the application do define its own version. For a shared library, this does not work for all targets. So, this interface allows injecting function pointers to be called for the low-level functions.

Function Documentation

◆ zth_assert_handler_indirect()

void zth_assert_handler_indirect ( zth_assert_handler_t func)

Set the function pointer for zth_assert_handler.

Definition at line 96 of file indirection.cpp.

◆ zth_indirect()

void zth_indirect ( zth_indirection_t const *  indirection)

Set all function indirection pointers.

Parameters
indirectionthe struct with function pointers to set. If nullptr, all pointers are reset.

Definition at line 133 of file indirection.cpp.

◆ zth_logv_indirect()

void zth_logv_indirect ( zth_logv_t func)

Set the function pointer for zth_logv.

Definition at line 78 of file indirection.cpp.

◆ zth_main_fiber_indirect()

void zth_main_fiber_indirect ( zth_main_fiber_t func)

Set the function pointer for main_fiber.

Definition at line 87 of file indirection.cpp.

◆ zth_postdeinit_indirect()

void zth_postdeinit_indirect ( zth_postdeinit_t func)

Set the function pointer for zth_postdeinit.

Definition at line 105 of file indirection.cpp.

◆ zth_preinit_indirect()

void zth_preinit_indirect ( zth_preinit_t func)

Set the function pointer for zth_preinit.

Definition at line 114 of file indirection.cpp.

◆ zth_terminate_indirect()

void zth_terminate_indirect ( zth_terminate_t func)

Set the function pointer for zth_terminate.

Definition at line 123 of file indirection.cpp.