9 struct long_option_init {
14 ostream &printon(ostream &errorout);
18 /// C++ for version of long_getopt.
19 /** For processing GNU style command line arguments. No pointer
20 (return values, arguments) contents are copied. */
23 /** errorcodes: no error, argument expected, no argument expected,
24 unknown option, illegal argument (eg. int expected). */
25 enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
32 long_option_init *the_opts;
35 /// if doing short option, argv[optind][optindind] is processed next.
39 long_option_init *beet;
41 /// get ready for processing next error.
43 long_option_init *parselong();
44 long_option_init *parseshort();
48 /// report an error and abort
49 void report(Errorcod c);
51 /// what to do with errors
53 report messages on #*os#, and abort.
54 if #os# is null, then do not report nor abort, just set #error#
57 void seterror(ostream *os);
58 /// argument. Set to 0 if not present
62 /// return an integer (with err. detect)
64 /// argv[optind] will be processed next.
73 /// construct: pass arguments and option info.
74 Getopt_long(int c, char **v, long_option_init *lo);
76 /// get the next option
78 @return pointer to next option found.
79 0 if error occurred, or next argument is no option.
81 long_option_init *operator()();
84 char * get_next_arg();