1#ifndef ZTH_INDIRECTION_H
2#define ZTH_INDIRECTION_H
29# if defined(ZTH_OS_WINDOWS)
31# elif defined(ZTH_HAVE_DL)
80void zth_logv_indirect_check(
char const* fmt, va_list arg);
81int zth_main_fiber_indirect_check(
int argc,
char** argv);
82void zth_assert_handler_indirect_check(
char const* file,
int line,
char const* expr);
83int zth_postdeinit_indirect_check();
84void zth_preinit_indirect_check();
85void zth_terminate_indirect_check();
94inline void zth_indirect_auto()
131# define ZTH_INDIRECT_PROLOGUE(func, ...) \
132 if(::zth_indirection.func) \
133 return ::zth_indirection.func(__VA_ARGS__);
135# define ZTH_INDIRECT_PROLOGUEV(func, ...) \
136 if(::zth_indirection.func) { \
137 ::zth_indirection.func(__VA_ARGS__); \
int main_fiber(int argc, char **argv)
void zth_logv(char const *fmt, va_list arg)
Prints the given printf()-like formatted string to stdout.
void zth_preinit_indirect(zth_preinit_t *func)
Set the function pointer for zth_preinit.
void zth_postdeinit_indirect(zth_postdeinit_t *func)
Set the function pointer for zth_postdeinit.
void zth_assert_handler_indirect(zth_assert_handler_t *func)
Set the function pointer for zth_assert_handler.
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_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.
int() zth_main_fiber_t(int argc, char **argv)
void() zth_logv_t(char const *fmt, va_list arg)
void() zth_assert_handler_t(char const *file, int line, char const *expr)
zth_indirection_t zth_indirection
#define ZTH_APP_INIT_CALL(f)
int zth_postdeinit()
Initialization function to be called by the default-supplied main(), just before shutting down.
void zth_preinit()
Initialization function to be called by the default-supplied main(), before doing anything else.
zth_main_fiber_t * main_fiber
zth_terminate_t * zth_terminate
zth_assert_handler_t * zth_assert_handler
zth_postdeinit_t * zth_postdeinit
zth_preinit_t * zth_preinit
void zth_assert_handler(char const *file, int line, char const *expr)
void zth_terminate()
Terminate immediately.