29 "Warning:explicit path for executable will not be used for configs";
30 static const ERRCODE USAGE =
"Usage";
51 char *tessdata_prefix = getenv(
"TESSDATA_PREFIX");
53 if (argv0 !=
nullptr && *argv0 !=
'\0') {
56 }
else if (tessdata_prefix) {
62 char drive[_MAX_DRIVE];
65 DWORD length = GetModuleFileName(
nullptr, path,
sizeof(path));
66 if (length > 0 && length <
sizeof(path)) {
67 errno_t result = _splitpath_s(path, drive,
sizeof(drive),
68 dir,
sizeof(dir),
nullptr, 0,
nullptr, 0);
69 if (result == ERANGE) {
70 tprintf(
"Error: Path too long: %s\n", path);
78 #if defined(TESSDATA_PREFIX) 82 #define _XSTR(a) _STR(a) 83 datadir = _XSTR(TESSDATA_PREFIX)
"/tessdata";
97 if ((strcmp(lastchar,
"/") != 0) && (strcmp(lastchar,
"\\") != 0))
const char * string() const
DLLSYM void tprintf(const char *format,...)
void main_setup(const char *argv0, const char *basename)
CCUtil::main_setup - set location of tessdata and name of image.