/** * Prints the given message and * exits the program with the default exit code. */ void fatal_error(const char* format,...) { va_list list; va_start(list,format); u_vfprintf(U_STDERR,format,list); va_end(list); fatal_error(DEFAULT_ERROR_CODE); }
/** * Prints the given message and * exits the program with the given exit code. */ void fatal_error(int error_code,const char* format,...) { va_list list; va_start(list,format); u_vfprintf(U_STDERR,format,list); va_end(list); fatal_error(error_code); }
void fatal_assert(int assert_condition, const char* format, ...) { if (assert_condition) { va_list list; va_start(list, format); u_vfprintf(U_STDERR, format, list); va_end(list); fatal_error(DEFAULT_ERROR_CODE); } }
/** * Prints the given message on the error stream, but only if * we are in debug mode. */ void debug(const char* format,...) { #ifdef DEBUG if (!DEBUG_ON) return; va_list list; va_start(list,format); u_vfprintf(U_STDERR,format,list); va_end(list); #else DISCARD_UNUSED_PARAMETER(format) #endif }
U_CAPI int32_t U_EXPORT2 u_printf(const char *patternSpecification, ...) { va_list ap; int32_t count; va_start(ap, patternSpecification); count = u_vfprintf(u_get_stdout(), patternSpecification, ap); va_end(ap); return count; }
U_CAPI int32_t U_EXPORT2 u_fprintf(UFILE * f, const char * patternSpecification, ...) { va_list ap; int32_t count; va_start(ap, patternSpecification); count = u_vfprintf(f, patternSpecification, ap); va_end(ap); return count; }
/** * Prints the given message on the error stream. */ void error(const char* format,...) { va_list list; va_start(list,format); u_vfprintf(U_STDERR,format,list); va_end(list); }