文档介绍:.
1 / 63
#include <tybs/>
#include <tybs/>
#include <tybs/>
#include <tybs/>
#iion_setcallback<NULL>;
tybs_log_write<ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL,
"%s:%d: %s<%s> failed", file, line,
tybs_assertion_typetotext<type>, cond>;
tybs_log_write<ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL,
"exiting <due to assertion failure>">;
} else {
fprintf<stderr, "%s:%d: %s<%s> failed\n",
file, line, tybs_assertion_typetotext<type>, cond>;
fflush<stderr>;
}
if <ns_g_coreok>
abort<>;
exit<1>;
}
static void
library_fatal_error<const char *file, int line, const char *format,
va_list args> TYBS_FORMAT_PRINTF<3, 0>;
static void
library_fatal_error<const char *file, int line, const char *format,
va_list args>
{
if <ns_g_lctx != NULL> {
tybs_error_setfatal<NULL>;
tybs_log_write<ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL,
"%s:%d: fatal error:", file, line>;
.
3 / 63
tybs_log_vwrite<ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL,
format, args>;
tybs_log_write<ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL,
"exiting <due to fatal error in library>">;
} else {
fprintf<stderr, "%s:%d: fatal error: ", file, line>;
vfprintf<stderr, format, args>;
fprintf<stderr, "\n">;
fflush<stderr>;
}
if <ns_g_coreok>
abort<>;
exit<1>;
}
static void
library_unexpected_error<const char *file, int line, const char *format,
va_list args> TYBS_FORMAT_PRINTF<3, 0>;
static void
library_unexpected_error<const char *file, int line, const char *format,
va_list args>
{
if <ns_g_lctx != NULL> {
tybs_log_write<ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, TYBS_LOG_ERROR,
"%s:%d: unexpected error:", file, line>;
t