tesseract  5.0.0-alpha-619-ge9db
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 31 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

Variable Documentation

◆ tessoptarg

char* tessoptarg

Definition at line 24 of file tessopt.cpp.

◆ tessoptind

int tessoptind

Definition at line 23 of file tessopt.cpp.

tessoptarg
char * tessoptarg
Definition: tessopt.cpp:24
tessoptind
int tessoptind
Definition: tessopt.cpp:23