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

Functions

char const * zth_banner ()
 Returns a banner line with version and configuration information.
 
void zth_abort (char const *fmt,...)
 Aborts the process after printing the given printf() formatted message.
 
void zth_log_color (int color, char const *fmt,...)
 Logs a given printf()-like formatted string using an ANSI color code.
 
void zth_log_colorv (int color, char const *fmt, va_list args)
 Logs a given printf()-like formatted string using an ANSI color code.
 
void zth_log (char const *fmt,...)
 Logs a given printf()-like formatted string.
 
char * zth_err (int e)
 Return a string like strerror() does, but as a zth::string.
 
char const * zth_version () noexcept
 Returns the version of Zth.
 
void zth_logv (char const *fmt, va_list arg)
 Prints the given printf()-like formatted string to stdout.
 

Detailed Description

Function Documentation

◆ zth_abort()

void zth_abort ( char const *  fmt,
  ... 
)

Aborts the process after printing the given printf() formatted message.

This is a C-wrapper for zth::abort().

Definition at line 342 of file util.cpp.

◆ zth_banner()

char const * zth_banner ( )

Returns a banner line with version and configuration information.

This is a C-wrapper for zth::banner().

Definition at line 1675 of file util.h.

◆ zth_err()

char * zth_err ( int  e)

Return a string like strerror() does, but as a zth::string.

The returned string is allocated on the heap. After use, pass it to free().

This is a C-wrapper for zth::err().

Definition at line 1767 of file util.h.

◆ zth_log()

void zth_log ( char const *  fmt,
  ... 
)

Logs a given printf()-like formatted string.

zth_logv() is used for the actual logging.

See also
zth::log_color()

This is a C-wrapper for zth::log().

Definition at line 1735 of file util.h.

◆ zth_log_color()

void zth_log_color ( int  color,
char const *  fmt,
  ... 
)

Logs a given printf()-like formatted string using an ANSI color code.

zth_logv() is used for the actual logging.

This is a C-wrapper for zth::log_color().

Definition at line 1700 of file util.h.

◆ zth_log_colorv()

void zth_log_colorv ( int  color,
char const *  fmt,
va_list  args 
)

Logs a given printf()-like formatted string using an ANSI color code.

zth_logv() is used for the actual logging.

This is a C-wrapper for zth::log_colorv().

Definition at line 1719 of file util.h.

◆ zth_logv()

void zth_logv ( char const *  fmt,
va_list  arg 
)

Prints the given printf()-like formatted string to stdout.

This is a weak symbol. Override when required.

Definition at line 19 of file zth_logv.cpp.

◆ zth_version()

char const * zth_version ( )
noexcept

Returns the version of Zth.

This is a C-wrapper for zth::version().

Definition at line 76 of file version.h.