MCPcopy Create free account
hub / github.com/creatale/node-dv / SetVariablesFromCLArgs

Function SetVariablesFromCLArgs

deps/tesseract/api/tesseractmain.cpp:175–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void SetVariablesFromCLArgs(tesseract::TessBaseAPI* api, int argc,
176 char** argv) {
177 char opt1[256], opt2[255];
178 for (int i = 0; i < argc; i++) {
179 if (strcmp(argv[i], "-c") == 0 && i + 1 < argc) {
180 strncpy(opt1, argv[i + 1], 255);
181 opt1[255] = '\0';
182 char* p = strchr(opt1, '=');
183 if (!p) {
184 fprintf(stderr, "Missing = in configvar assignment\n");
185 exit(1);
186 }
187 *p = 0;
188 strncpy(opt2, strchr(argv[i + 1], '=') + 1, 255);
189 opt2[254] = 0;
190 ++i;
191
192 if (!api->SetVariable(opt1, opt2)) {
193 fprintf(stderr, "Could not set option: %s=%s\n", opt1, opt2);
194 }
195 }
196 }
197}
198
199void PrintLangsList(tesseract::TessBaseAPI* api) {
200 GenericVector<STRING> languages;

Callers 1

mainFunction · 0.85

Calls 1

SetVariableMethod · 0.80

Tested by

no test coverage detected