#include <tslib.h> int (*ts_error_fn)(const char *fmt, va_list ap);
static int errfn(const char *fmt, va_list ap) { return vfprintf(stderr, fmt, ap); }inside the library. It is exposed to the user and can be replaced by a custom error function. Simply assign your custom implementation to ts_error_fn like
ts_error_fn = my_custom_errfn;It can be used to write the system log files, for example. The ts_print_mt test program has an example.