24 #if defined(__riscos__)
25 # include <unixlib/local.h>
43 char *tessdata_prefix = getenv(
"TESSDATA_PREFIX");
48 }
else if (tessdata_prefix) {
55 DWORD length = GetModuleFileName(
nullptr, path,
sizeof(path));
56 if (length > 0 && length <
sizeof(path)) {
57 char *separator = std::strrchr(path,
'\\');
58 if (separator !=
nullptr) {
64 #elif defined(__riscos__)
65 }
else if (
datadir.empty() != 0) {
66 char path[PATH_MAX] =
"<Tesseract$Dir>.tessdata";
68 datadir = __unixify(path, 0, NULL, 0, 0);
70 #if defined(TESSDATA_PREFIX) && !defined(__riscos__)
73 datadir = TESSDATA_PREFIX
"/tessdata";
83 const char *lastchar =
datadir.c_str();
84 lastchar +=
datadir.length() - 1;
85 if ((strcmp(lastchar,
"/") != 0) && (strcmp(lastchar,
"\\") != 0)) {
std::string imagebasename
void main_setup(const std::string &argv0, const std::string &basename)
CCUtil::main_setup - set location of tessdata and name of image.