All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tessopt.h File Reference
#include "host.h"

Go to the source code of this file.

Functions

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

Variables

int tessoptind
 
char * tessoptarg
 

Function Documentation

int tessopt ( inT32  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 == NULL || *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
#define NULL
Definition: host.h:144
int tessoptind
Definition: tessopt.cpp:24

Variable Documentation

char* tessoptarg

Definition at line 25 of file tessopt.cpp.

int tessoptind

Definition at line 24 of file tessopt.cpp.