tesseract 4.1.1
Loading...
Searching...
No Matches
tessopt.cpp File Reference
#include <cstring>
#include <cstdio>
#include "tessopt.h"

Go to the source code of this file.

Functions

int tessopt (int32_t argc, char *argv[], const char *arglist)
 

Variables

int tessoptind
 
char * tessoptarg
 

Function Documentation

◆ tessopt()

int tessopt ( int32_t  argc,
char *  argv[],
const char *  arglist 
)

Definition at line 33 of file tessopt.cpp.

37 {
38 const char *arg; //arg char
39
40 if (tessoptind == 0)
41 tessoptind = 1;
42 if (tessoptind < argc && argv[tessoptind][0] == '-') {
43 arg = strchr (arglist, argv[tessoptind][1]);
44 if (arg == nullptr || *arg == ':')
45 return '?'; //dud option
46 tessoptind++;
47 tessoptarg = argv[tessoptind];
48 if (arg[1] == ':') {
49 if (argv[tessoptind - 1][2] != '\0')
50 //immediately after
51 tessoptarg = argv[tessoptind - 1] + 2;
52 else
53 tessoptind++;
54 }
55 return *arg;
56 }
57 else
58 return EOF;
59}
char * tessoptarg
Definition: tessopt.cpp:25
int tessoptind
Definition: tessopt.cpp:24

Variable Documentation

◆ tessoptarg

char* tessoptarg

Definition at line 25 of file tessopt.cpp.

◆ tessoptind

int tessoptind

Definition at line 24 of file tessopt.cpp.