Go to the source code of this file.
◆ tprintf()
TESS_API void tprintf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Definition at line 37 of file tprintf.cpp.
41 static FILE *debugfp =
nullptr;
46 va_start(args, format);
49 offset += _vsnprintf(msg + offset,
MAX_MSG_LEN - offset, format, args);
50 if (strcmp(debug_file.string(),
"/dev/null") == 0)
51 debug_file.set_value(
"nul");
53 offset += vsnprintf(msg + offset,
MAX_MSG_LEN - offset, format, args);
57 if (debugfp ==
nullptr && strlen(debug_file.string()) > 0) {
58 debugfp = fopen(debug_file.string(),
"wb");
59 }
else if (debugfp !=
nullptr && strlen(debug_file.string()) == 0) {
63 if (debugfp !=
nullptr)
64 fprintf(debugfp,
"%s", msg);
66 fprintf(stderr,
"%s", msg);