1 /*   -*- buffer-read-only: t -*- vi: set ro:
2  *
3  *  DO NOT EDIT THIS FILE   (options.h)
4  *
5  *  It has been AutoGen-ed
6  *  From the definitions    funcs.def
7  *  and the template file   options_h
8  *
9  *  This file defines all the global structures and special values
10  *  used in the automated option processing library.
11  *
12  *  Automated Options Copyright (C) 1992-2018 by Bruce Korb
13  *
14  *  This file is part of AutoOpts, a companion to AutoGen.
15  *  AutoOpts is free software.
16  *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
17  *
18  *  AutoOpts is available under any one of two licenses.  The license
19  *  in use must be one of these two and the choice is under the control
20  *  of the user of the license.
21  *
22  *   The GNU Lesser General Public License, version 3 or later
23  *      See the files "COPYING.lgplv3" and "COPYING.gplv3"
24  *
25  *   The Modified Berkeley Software Distribution License
26  *      See the file "COPYING.mbsd"
27  *
28  *  These files have the following sha256 sums:
29  *
30  *  8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95  COPYING.gplv3
31  *  4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b  COPYING.lgplv3
32  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
33  */
34 #ifndef AUTOOPTS_OPTIONS_H_GUARD
35 #define AUTOOPTS_OPTIONS_H_GUARD 1
36 /** \file options.h
37  *
38  * @addtogroup autoopts
39  * @{
40  */
41 #include <sys/types.h>
42 #include <stdio.h>
43 
44 #ifndef COMPAT_H_GUARD
45 /*
46  * This is needed for test compilations where the "compat.h"
47  * header is not usually available.
48  */
49 #  if defined(HAVE_STDINT_H)
50 #    include <stdint.h>
51 #  elif defined(HAVE_INTTYPES_H)
52 #    include <inttypes.h>
53 #  endif /* HAVE_STDINT/INTTYPES_H */
54 
55 #  if defined(HAVE_LIMITS_H)
56 #    include <limits.h>
57 #  elif defined(HAVE_SYS_LIMITS_H)
58 #    include <sys/limits.h>
59 #  endif /* HAVE_LIMITS/SYS_LIMITS_H */
60 
61 #  if defined(HAVE_SYSEXITS_H)
62 #    include <sysexits.h>
63 #  endif /* HAVE_SYSEXITS_H */
64 
65 #  if defined(HAVE_STDBOOL_H)
66 #    include <stdbool.h>
67 #  elif ! defined(bool)
68      typedef enum { false = 0, true = 1 } _Bool;
69 #    define bool _Bool
70 
71      /* The other macros must be usable in preprocessor directives.  */
72 #    define false 0
73 #    define true 1
74 #  endif /* HAVE_SYSEXITS_H */
75 #endif /* COMPAT_H_GUARD */
76 // END-CONFIGURED-HEADERS
77 
78 /**
79  * Defined to abnormal value of EX_USAGE.  Used to indicate that paged usage
80  * was requested.  It is used to distinguish a --usage from a --help request.
81  * --usage is abbreviated and --help gives as much help as possible.
82  */
83 #define AO_EXIT_REQ_USAGE 10064
84 
85 #undef  VOIDP
86 /**
87  * Coerce a value into a void pointer with no const or volatile attributes.
88  * Somewhere along the line, the above set of includes need to set up
89  * the "uintptr_t" type.
90  */
91 #define VOIDP(_a)  ((void *)(uintptr_t)(_a))
92 
93 /**
94  *  PUBLIC DEFINES
95  *
96  *  The following defines may be used in applications that need to test the
97  *  state of an option.  To test against these masks and values, a pointer
98  *  to an option descriptor must be obtained.  There are two ways:
99  *
100  *  1. inside an option processing procedure, it is the second argument,
101  *     conventionally "tOptDesc * pOD".
102  *
103  *  2. Outside of an option procedure (or to reference a different option
104  *     descriptor), use either "&DESC( opt_name )" or "&pfx_DESC( opt_name )".
105  *
106  *  See the relevant generated header file to determine which and what
107  *  values for "opt_name" are available.
108  * @group version
109  * @{
110  */
111 /// autoopts structure version
112 #define OPTIONS_STRUCT_VERSION      172033
113 /// autoopts structure version string
114 #define OPTIONS_VERSION_STRING      "42:1:17"
115 /// minimum version the autoopts library supports
116 #define OPTIONS_MINIMUM_VERSION     102400
117 /// minimum version the autoopts library supports as a string
118 #define OPTIONS_MIN_VER_STRING      "25:0:0"
119 /// the display version of the autoopts library, as a string
120 #define OPTIONS_DOTTED_VERSION      "42.1"
121 /// convert a version/release number pair to an integer value
122 #define OPTIONS_VER_TO_NUM(_v, _r)  (((_v) * 4096) + (_r))
123 /// @}
124 
125 /**
126  * Option argument types.  This must fit in the OPTST_ARG_TYPE_MASK
127  * field of the fOptState field of an option descriptor (tOptDesc).
128  * It will be a problem to extend beyond 4 bits.
129  */
130 typedef enum {
131     OPARG_TYPE_NONE         =  0, ///< does not take an argument
132     OPARG_TYPE_STRING       =  1, ///< default type/ vanilla string
133     OPARG_TYPE_ENUMERATION  =  2, ///< opt arg is an enum (keyword list)
134     OPARG_TYPE_BOOLEAN      =  3, ///< opt arg is boolean-valued
135     OPARG_TYPE_MEMBERSHIP   =  4, ///< opt arg sets set membership bits
136     OPARG_TYPE_NUMERIC      =  5, ///< opt arg is a long int
137     OPARG_TYPE_HIERARCHY    =  6, ///< option arg is hierarchical value
138     OPARG_TYPE_FILE         =  7, ///< option arg names a file
139     OPARG_TYPE_TIME         =  8, ///< opt arg is a time duration
140     OPARG_TYPE_FLOAT        =  9, ///< opt arg is a floating point num
141     OPARG_TYPE_DOUBLE       = 10, ///< opt arg is a double prec. float
142     OPARG_TYPE_LONG_DOUBLE  = 11, ///< opt arg is a long double prec.
143     OPARG_TYPE_LONG_LONG    = 12, ///< opt arg is a long long int
144     OPARG_TYPE_STATIC       = 13  ///<
145 } teOptArgType;
146 
147 /**
148  * value descriptor for sub options
149  */
150 typedef struct optionValue {
151     teOptArgType        valType;        ///< which argument type
152     char *              pzName;         ///< name of the sub-option
153     union {
154         char            strVal[1];      ///< OPARG_TYPE_STRING
155         unsigned int    enumVal;        ///< OPARG_TYPE_ENUMERATION
156         unsigned int    boolVal;        ///< OPARG_TYPE_BOOLEAN
157         unsigned long   setVal;         ///< OPARG_TYPE_MEMBERSHIP
158         long            longVal;        ///< OPARG_TYPE_NUMERIC
159         void *          nestVal;        ///< OPARG_TYPE_HIERARCHY
160     } v;
161 } tOptionValue;
162 
163 /**
164  * file argument state and handling.
165  */
166 typedef enum {
167     FTYPE_MODE_MAY_EXIST        = 0x00, ///< may or may not exist
168     FTYPE_MODE_MUST_EXIST       = 0x01, ///< must pre-exist
169     FTYPE_MODE_MUST_NOT_EXIST   = 0x02, ///< must *not* pre-exist
170     FTYPE_MODE_EXIST_MASK       = 0x03, ///< mask for these bits
171     FTYPE_MODE_NO_OPEN          = 0x00, ///< leave file closed
172     FTYPE_MODE_OPEN_FD          = 0x10, ///< call open(2)
173     FTYPE_MODE_FOPEN_FP         = 0x20, ///< call fopen(3)
174     FTYPE_MODE_OPEN_MASK        = 0x30  ///< open/fopen/not open
175 } teOptFileType;
176 
177 /**
178  * the open flag bits or the mode string, depending on the open type.
179  */
180 typedef union {
181     int             file_flags;  ///< open(2) flag bits
182     char const *    file_mode;   ///< fopen(3) mode string
183 } tuFileMode;
184 
185 /// initial number of option argument holders to allocate
186 #define MIN_ARG_ALLOC_CT   6
187 /// amount by which to increment the argument holder allocation.
188 #define INCR_ARG_ALLOC_CT  8
189 /**
190  * an argument list.  When an option appears multiple times and
191  * the values get "stacked".  \a apzArgs  holds 8 pointers initially
192  * and is incremented by \a INCR_ARG_ALLOC_CT as needed.
193  */
194 typedef struct {
195     int             useCt;  ///< elements in use
196 
197     /// allocated elements, mininum \a MIN_ARG_ALLOC_CT
198     /// steps by \a INCR_ARG_ALLOC_CT
199     int             allocCt;
200     char const *    apzArgs[MIN_ARG_ALLOC_CT]; ///< element array
201 } tArgList;
202 
203 /**
204  *  Bits in the fOptState option descriptor field.
205  * @{
206  */
207 
208 /** integral type for holding opt_state masks */
209 typedef uint32_t opt_state_mask_t;
210 
211 #define OPTST_ARG_TYPE_SHIFT 12
212 /** bits defined for opt_state_mask_t */
213 /** Set via the "SET_OPT()" macro */
214 #define OPTST_SET              0x0000001U
215 /** Set via an RC/INI file */
216 #define OPTST_PRESET           0x0000002U
217 /** Set via a command line option */
218 #define OPTST_DEFINED          0x0000004U
219 /** Reset via command line option */
220 #define OPTST_RESET            0x0000008U
221 /** selected by equiv'ed option */
222 #define OPTST_EQUIVALENCE      0x0000010U
223 /** option is in disabled state */
224 #define OPTST_DISABLED         0x0000020U
225 /** pzOptArg was allocated */
226 #define OPTST_ALLOC_ARG        0x0000040U
227 /** option cannot be preset */
228 #define OPTST_NO_INIT          0x0000100U
229 /** opt value (flag) is any digit */
230 #define OPTST_NUMBER_OPT       0x0000200U
231 /** opt uses optionStackArg proc */
232 #define OPTST_STACKED          0x0000400U
233 /** option defaults to enabled */
234 #define OPTST_INITENABLED      0x0000800U
235 /** bit 1 of arg type enum */
236 #define OPTST_ARG_TYPE_1       0x0001000U
237 /** bit 2 of arg type enum */
238 #define OPTST_ARG_TYPE_2       0x0002000U
239 /** bit 3 of arg type enum */
240 #define OPTST_ARG_TYPE_3       0x0004000U
241 /** bit 4 of arg type enum */
242 #define OPTST_ARG_TYPE_4       0x0008000U
243 /** the option arg not required */
244 #define OPTST_ARG_OPTIONAL     0x0010000U
245 /** process opt on first pass */
246 #define OPTST_IMM              0x0020000U
247 /** process disablement immed. */
248 #define OPTST_DISABLE_IMM      0x0040000U
249 /** compiled out of program */
250 #define OPTST_OMITTED          0x0080000U
251 /** must be set or pre-set */
252 #define OPTST_MUST_SET         0x0100000U
253 /** opt is for doc only */
254 #define OPTST_DOCUMENT         0x0200000U
255 /** process opt twice - imm + reg */
256 #define OPTST_TWICE            0x0400000U
257 /** process disabled option twice */
258 #define OPTST_DISABLE_TWICE    0x0800000U
259 /** scaled integer value */
260 #define OPTST_SCALED_NUM       0x1000000U
261 /** disable from cmd line */
262 #define OPTST_NO_COMMAND       0x2000000U
263 /** support is being removed */
264 #define OPTST_DEPRECATED       0x4000000U
265 /** alias for other option */
266 #define OPTST_ALIAS            0x8000000U
267 
268 /** bits in SET mask:
269  *  set     preset  reset   defined */
270 #define OPTST_SET_MASK         0x000000FU
271 
272 /** bits in MUTABLE mask:
273  *  set         preset      reset       defined     equivalence disabled
274  *  alloc_arg */
275 #define OPTST_MUTABLE_MASK     0x000007FU
276 
277 /** bits omitted from PERSISTENT mask:
278  *  mutable_mask */
279 #define OPTST_PERSISTENT_MASK  0xFFFFF00U
280 
281 /** bits in SELECTED mask:
282  *  set     defined */
283 #define OPTST_SELECTED_MASK    0x0000005U
284 
285 /** bits in ARG_TYPE mask:
286  *  arg_type_1 arg_type_2 arg_type_3 arg_type_4 */
287 #define OPTST_ARG_TYPE_MASK    0x000F000U
288 
289 /** bits in NO_USAGE mask:
290  *  omitted    no_command deprecated */
291 #define OPTST_NO_USAGE_MASK    0x6080000U
292 
293 /** bits in IMMUTABLE mask:
294  *  document omitted */
295 #define OPTST_IMMUTABLE_MASK   0x0280000U
296 
297 /** bits in DO_NOT_SAVE mask:
298  *  document omitted  no_init */
299 #define OPTST_DO_NOT_SAVE_MASK 0x0280100U
300 
301 /** bits in NO_OUTPUT mask:
302  *  document omitted  alias */
303 #define OPTST_NO_OUTPUT_MASK   0x8280000U
304 
305 /** all bits in opt_state_mask_t masks */
306 #define OPTST_MASK_ALL         0xFFFFF7FU
307 
308 /** no bits in opt_state_mask_t */
309 #define OPTST_INIT             0x0000000U
310 /** @} */
311 
312 #ifdef NO_OPTIONAL_OPT_ARGS
313 # undef  OPTST_ARG_OPTIONAL
314 # define OPTST_ARG_OPTIONAL   0
315 #endif
316 
317 #define VENDOR_OPTION_VALUE   'W'
318 
319 #define SELECTED_OPT(_od)     ((_od)->fOptState  & OPTST_SELECTED_MASK)
320 #define UNUSED_OPT(  _od)     (((_od)->fOptState & OPTST_SET_MASK) == 0)
321 #define DISABLED_OPT(_od)     ((_od)->fOptState  & OPTST_DISABLED)
322 #define OPTION_STATE(_od)     ((_od)->fOptState)
323 #define OPTST_SET_ARGTYPE(_n) ((_n) << OPTST_ARG_TYPE_SHIFT)
324 #define OPTST_GET_ARGTYPE(_f) \
325     (((_f)&OPTST_ARG_TYPE_MASK) >> OPTST_ARG_TYPE_SHIFT)
326 
327 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
328  *
329  *  PRIVATE INTERFACES
330  *
331  *  The following values are used in the generated code to communicate
332  *  with the option library procedures.  They are not for public use
333  *  and may be subject to change.
334  */
335 
336 /**
337  *  Define the processing state flags
338  * @{
339  */
340 
341 /** integral type for holding proc_state masks */
342 typedef uint32_t proc_state_mask_t;
343 
344 /** bits defined for proc_state_mask_t */
345 /** Process long style options */
346 #define OPTPROC_LONGOPT       0x000001U
347 /** Process short style "flags" */
348 #define OPTPROC_SHORTOPT      0x000002U
349 /** Stop on argument errors */
350 #define OPTPROC_ERRSTOP       0x000004U
351 /** Current option is disabled */
352 #define OPTPROC_DISABLEDOPT   0x000008U
353 /** no options are required */
354 #define OPTPROC_NO_REQ_OPT    0x000010U
355 /** there is a number option */
356 #define OPTPROC_NUM_OPT       0x000020U
357 /** have inits been done? */
358 #define OPTPROC_INITDONE      0x000040U
359 /** any negation options? */
360 #define OPTPROC_NEGATIONS     0x000080U
361 /** check environment? */
362 #define OPTPROC_ENVIRON       0x000100U
363 /** Disallow remaining arguments */
364 #define OPTPROC_NO_ARGS       0x000200U
365 /** Require args after options */
366 #define OPTPROC_ARGS_REQ      0x000400U
367 /** reorder operands after opts */
368 #define OPTPROC_REORDER       0x000800U
369 /** emit usage in GNU style */
370 #define OPTPROC_GNUUSAGE      0x001000U
371 /** Translate strings in tOptions */
372 #define OPTPROC_TRANSLATE     0x002000U
373 /** no usage on usage error */
374 #define OPTPROC_MISUSE        0x004000U
375 /** immediate options active */
376 #define OPTPROC_IMMEDIATE     0x008000U
377 /** suppress for config only */
378 #define OPTPROC_NXLAT_OPT_CFG 0x010000U
379 /** suppress xlation always */
380 #define OPTPROC_NXLAT_OPT     0x020000U
381 /** vendor options active */
382 #define OPTPROC_VENDOR_OPT    0x040000U
383 /** opt processing in preset state */
384 #define OPTPROC_PRESETTING    0x080000U
385 /** Ignore pzFullUsage, compute usage text */
386 #define OPTPROC_COMPUTE       0x100000U
387 /** Program outputs digested option state for shell scripts.  Usage text
388   * always written to stderr */
389 #define OPTPROC_SHELL_OUTPUT  0x200000U
390 
391 /** bits in NO_XLAT mask:
392  *  nxlat_opt_cfg nxlat_opt */
393 #define OPTPROC_NO_XLAT_MASK  0x030000U
394 
395 /** all bits in proc_state_mask_t masks */
396 #define OPTPROC_MASK_ALL      0x3FFFFFU
397 
398 /** no bits in proc_state_mask_t */
399 #define OPTPROC_NONE          0x000000U
400 /** @} */
401 
402 #define STMTS(s)  do { s; } while (false)
403 
404 /**
405  *  Abbreviation for const memory character.
406  */
407 #define tCC         char const
408 
409 /**
410  * Magical values for the program's option pointer
411  * @{
412  */
413 typedef enum {
414     OP_VAL_EMIT_USAGE       = 1,  ///< request for usage
415     OP_VAL_EMIT_SHELL       = 2,  ///< emit value for Bourne shell evaluation
416     OP_VAL_RETURN_VALNAME   = 3,  ///< return the value as a string
417     OP_VAL_EMIT_LIMIT       = 15  ///< limit for magic values
418 } opt_proc_vals_t;
419 
420 /// \a OPT_VAL_EMIT_USAGE cast as a pointer
421 #define OPTPROC_EMIT_USAGE      ((tOptions *)OP_VAL_EMIT_USAGE)
422 
423 /// \a OPT_VAL_EMIT_SHELL cast as a pointer
424 #define OPTPROC_EMIT_SHELL      ((tOptions *)OP_VAL_EMIT_SHELL)
425 
426 /// \a OPT_VAL_RETURN_VALNAME cast as a pointer
427 #define OPTPROC_RETURN_VALNAME  ((tOptions *)OP_VAL_RETURN_VALNAME)
428 
429 /// \a OPT_VAL_EMIT_LIMIT cast as a pointer
430 #define OPTPROC_EMIT_LIMIT      ((tOptions *)OP_VAL_EMIT_LIMIT)
431 /** @} */
432 
433 /** group option processing procedure types
434  * @{
435  */
436 /** forward declaration for tOptDesc */
437 typedef struct opt_desc tOptDesc;
438 /** forward declaration for tOptiond */
439 typedef struct options  tOptions;
440 
441 /**
442  *  The option procedures do the special processing for each
443  *  option flag that needs it.
444  */
445 typedef void (tOptProc)(tOptions * pOpts, tOptDesc * pOptDesc);
446 
447 /**
448  * a pointer to an option processing procedure
449  */
450 typedef tOptProc * tpOptProc;
451 
452 /**
453  *  The usage procedure will never return.  It calls "exit(2)"
454  *  with the "exitCode" argument passed to it.
455  */
456 // coverity[+kill]
457 typedef void (tUsageProc)(tOptions * pOpts, int exitCode);
458 
459 /**
460  * a pointer to a procedure that prints usage and exits.
461  */
462 typedef tUsageProc * tpUsageProc;
463 /** @} */
464 
465 /**
466  *  Special definitions.  "NOLIMIT" is the 'max' value to use when
467  *  a flag may appear multiple times without limit.  "NO_EQUIVALENT"
468  *  is an illegal value for 'optIndex' (option description index).
469  * @{
470  */
471 #define NOLIMIT          USHRT_MAX  ///< no occurrance count limit
472 #define OPTION_LIMIT     SHRT_MAX   ///< maximum number of option types
473 /// option index to indicate no equivalance or alias
474 #define NO_EQUIVALENT    (OPTION_LIMIT+1)
475 /** @} */
476 
477 /**
478  * Option argument value.  Which is valid is determined by:
479  * (fOptState & OPTST_ARG_TYPE_MASK) >> OPTST_ARG_TYPE_SHIFT
480  * which will yield one of the teOptArgType values.
481  */
482 typedef union {
483     char const *    argString;  ///< as a string
484     uintptr_t       argEnum;    ///< as an enumeration value
485     uintptr_t       argIntptr;  ///< as an integer big enough to hold pointer
486     long            argInt;     ///< as a long integer
487     unsigned long   argUint;    ///< as an unsigned long ingeger
488     unsigned int    argBool;    ///< as a boolean value
489     FILE *          argFp;      ///< as a FILE * pointer
490     int             argFd;      ///< as a file descriptor (int)
491 } opt_arg_union_t;
492 
493 /// Compatibility define: \a pzLastArg is now \a optArg.argString
494 #define             pzLastArg       optArg.argString
495 /// The old amorphous argument bucket is now the opt_arg_union_t union.
496 #define             optArgBucket_t  opt_arg_union_t
497 
498 /**
499  * Enumeration of AutoOpts defined options.  The enumeration is used in
500  * marking each option that is defined by AutoOpts so libopts can find
501  * the correct descriptor.  This renders \a option_spec_idx_t redundant.
502  */
503 typedef enum {
504     AOUSE_USER_DEFINED = 0,     ///< user specified option
505     AOUSE_RESET_OPTION,         ///< reset option state option
506     AOUSE_VERSION,              ///< request version
507     AOUSE_HELP,                 ///< request usage help
508     AOUSE_MORE_HELP,            ///< request paged usage
509     AOUSE_USAGE,                ///< request short usage
510     AOUSE_SAVE_OPTS,            ///< save option state
511     AOUSE_LOAD_OPTS,            ///< load options from file
512     AOUSE_VENDOR_OPT            ///< specify a vendor option
513 } opt_usage_t;
514 
515 /**
516  *  Descriptor structure for each option.
517  *  Only the fields marked "PUBLIC" are for public use.
518  */
519 struct opt_desc {
520     /// Public, the index of this descriptor
521     uint16_t const      optIndex;
522     /// Public, the flag character (value)
523     uint16_t const      optValue;
524     /// Public, the index of the option used to activate option
525     uint16_t            optActualIndex;
526     /// Public, the flag character of the activating option
527     uint16_t            optActualValue;
528 
529     /// Public, the index of the equivalenced-to option.
530     /// This is NO_EQUIVALENT unless activated.
531     uint16_t const      optEquivIndex;
532     /// Private, the minimum occurrance count
533     uint16_t const      optMinCt;
534     /// Private, the maximum occurrance count (NOLIMIT, if unlimited)
535     uint16_t const      optMaxCt;
536     /// Public, the actual occurrance count
537     uint16_t            optOccCt;
538 
539     /// Public, the option processing state
540     opt_state_mask_t    fOptState;
541     /// Private, how the option is used (opt_usage_t)
542     uint32_t            optUsage;
543     /// Public, The current option argument value
544     opt_arg_union_t     optArg;
545     /// Public, data that is actually private to the code that handles
546     /// this particular option.  It is public IFF you have your own
547     /// handling function.
548     void *              optCookie;
549 
550     /// Private, a list of options that must be specified when this option
551     /// has been specified
552     int const  * const  pOptMust;
553 
554     /// Private, a list of options that cannot be specified when this option
555     /// has been specified
556     int const  * const  pOptCant;
557 
558     /// Private, the function to call for handling this option
559     tpOptProc    const  pOptProc;
560 
561     /// Private, usage information about this option
562     char const * const  pzText;
563 
564     /// Public, the UPPER CASE, shell variable name syntax name of the option
565     char const * const  pz_NAME;
566 
567     /// the unmodified name of the option
568     char const * const  pz_Name;
569 
570     /// the option name to use to disable the option.  Long options names
571     /// must be active.
572     char const * const  pz_DisableName;
573 
574     /// the special prefix that makes the normal option name become the
575     /// disablement name.
576     char const * const  pz_DisablePfx;
577 };
578 
579 /**
580  *  Some options need special processing, so we store their
581  *  indexes in a known place.
582  */
583 typedef struct {
584     uint16_t const  more_help;      ///< passes help text through pager
585     uint16_t const  save_opts;      ///< stores option state to a file
586     uint16_t const  number_option;  ///< the option "name" is an integer
587     /// all arguments are options, this is the default option that must
588     /// take an argument.  That argument is the unrecognized option.
589     uint16_t const  default_opt;
590 } option_spec_idx_t;
591 
592 /**
593  *  The procedure generated for translating option text
594  */
595 typedef void (tOptionXlateProc)(void);
596 
597 /**
598  * Everything marked "PUBLIC" is also marked "const".  Public access is not
599  * a license to modify.  Other fields are used and modified by the library.
600  * They are also subject to change without any notice.
601  * Do not even look at these outside of libopts.
602  */
603 struct options {
604     int const                   structVersion; ///< The version of this struct
605     unsigned int                origArgCt;     ///< program argument count
606     char **                     origArgVect;   ///< program argument vector
607     proc_state_mask_t           fOptSet;       ///< option proc. state flags
608     unsigned int                curOptIdx;     ///< current option index
609     char *                      pzCurOpt;      ///< current option text
610 
611     /// Public, the full path of the program
612     char const * const          pzProgPath;
613     /// Public, the name of the executable, without any path
614     char const * const          pzProgName;
615     /// Public, the upper-cased, shell variable syntax-ed program name
616     char const * const          pzPROGNAME;
617     /// the name of the "rc file" (configuration file)
618     char const * const          pzRcName;
619     /// the copyright text
620     char const * const          pzCopyright;
621     /// the full copyright notice
622     char const * const          pzCopyNotice;
623     /// a string with the program name, project name and version
624     char const * const          pzFullVersion;
625     /// a list of pointers to directories to search for the config file
626     char const * const *        const papzHomeList;
627     /// the title line for usage
628     char const * const          pzUsageTitle;
629     /// some added explanation for what this program is trying to do
630     char const * const          pzExplain;
631     /// a detailed explanation of the program's purpose, for use when
632     /// full help has been requested
633     char const * const          pzDetail;
634     /// The public array of option descriptors
635     tOptDesc   * const          pOptDesc;
636     /// the email address for reporting bugs
637     char const * const          pzBugAddr;
638 
639     /// Reserved for future use
640     void *                      pExtensions;
641     /// A copy of the option state when optionSaveState was called.
642     void *                      pSavedState;
643 
644     /// The procedure to call to print usage text
645     /* __attribute__((__noreturn__)) */
646     // coverity[+kill]
647     tpUsageProc                 pUsageProc;
648     /// The procedure to call to translate translatable option messages
649     tOptionXlateProc *          pTransProc;
650 
651     /// Special option indexes.
652     option_spec_idx_t           specOptIdx;
653     /// the total number of options for the program
654     int const                   optCt;
655     /// The number of "presettable" options, though some may be marked
656     /// "no-preset".  Includes all user specified options, plus a few
657     /// that are specified by AutoOpts.
658     int const                   presetOptCt;
659     /// user specified full usage text
660     char const *                pzFullUsage;
661     /// user specifed short usage (usage error triggered) message
662     char const *                pzShortUsage;
663     /// The option argument settings active when optionSaveState was called
664     opt_arg_union_t const * const originalOptArgArray;
665     /// any saved cookie value
666     void * const * const        originalOptArgCookie;
667     /// the package data directory (e.g. global configuration files)
668     char const * const          pzPkgDataDir;
669     /// email address of the project packager
670     char const * const          pzPackager;
671 };
672 
673 /*
674  *  Versions where in various fields first appear:
675  *  ($AO_CURRENT * 4096 + $AO_REVISION, but $AO_REVISION must be zero)
676  */
677 /**
678  * The version that first stored the original argument vector
679  */
680 #define originalOptArgArray_STRUCT_VERSION  0x20000 /* AO_CURRENT = 32 */
681 #define HAS_originalOptArgArray(_opt) \
682     ((_opt)->structVersion >= originalOptArgArray_STRUCT_VERSION)
683 
684 /**
685  * The version that first stored the package data directory
686  */
687 #define pzPkgDataDir_STRUCT_VERSION  0x22000 /* AO_CURRENT = 34 */
688 #define HAS_pzPkgDataDir(_opt) \
689     ((_opt)->structVersion >= pzPkgDataDir_STRUCT_VERSION)
690 
691 /**
692  * The version that first stored the option usage in each option descriptor
693  */
694 #define opt_usage_t_STRUCT_VERSION  0x26000 /* AO_CURRENT = 38 */
695 #define HAS_opt_usage_t(_opt) \
696     ((_opt)->structVersion >= opt_usage_t_STRUCT_VERSION)
697 
698 /**
699  *  "token list" structure returned by "string_tokenize()"
700  */
701 typedef struct {
702     unsigned long   tkn_ct;      ///< number of tokens found
703     unsigned char * tkn_list[1]; ///< array of pointers to tokens
704 } token_list_t;
705 
706 /*
707  *  Hide the interface - it pollutes a POSIX claim, but leave it for
708  *  anyone #include-ing this header
709  */
710 #define strneqvcmp      option_strneqvcmp
711 #define streqvcmp       option_streqvcmp
712 #define streqvmap       option_streqvmap
713 #define strequate       option_strequate
714 #define strtransform    option_strtransform
715 
716 /**
717  *  Everything needed to be known about an mmap-ed file.
718  *
719  *  This is an output only structure used by text_mmap and text_munmap.
720  *  Clients must not alter the contents and must provide it to both
721  *  the text_mmap and text_munmap procedures.  BE ADVISED: if you are
722  *  mapping the file with PROT_WRITE the NUL byte at the end MIGHT NOT
723  *  BE WRITABLE.  In any event, that byte is not be written back
724  *  to the source file.  ALSO: if "txt_data" is valid and "txt_errno"
725  *  is not zero, then there *may* not be a terminating NUL.
726  */
727 typedef struct {
728     void *      txt_data;      ///< text file data
729     size_t      txt_size;      ///< actual file size
730     size_t      txt_full_size; ///< mmaped mem size
731     int         txt_fd;        ///< file descriptor
732     int         txt_zero_fd;   ///< fd for /dev/zero
733     int         txt_errno;     ///< warning code
734     int         txt_prot;      ///< "prot" flags
735     int         txt_flags;     ///< mapping type
736 } tmap_info_t;
737 
738 /**
739  * mmap result wrapper that yields "true" when mmap has failed.
740  */
741 #define TEXT_MMAP_FAILED_ADDR(a)  (VOIDP(a) == VOIDP(MAP_FAILED))
742 
743 #ifdef  __cplusplus
744 #define CPLUSPLUS_OPENER extern "C" {
745 CPLUSPLUS_OPENER
746 #define CPLUSPLUS_CLOSER }
747 #else
748 #define CPLUSPLUS_CLOSER
749 #endif
750 
751 /**
752  *  The following routines may be coded into AutoOpts client code:
753  */
754 
755 /**
756  * ao_string_tokenize - tokenize an input string
757  *
758  *  This function will convert one input string into a list of strings.
759  *  The list of strings is derived by separating the input based on
760  *  white space separation.  However, if the input contains either single
761  *  or double quote characters, then the text after that character up to
762  *  a matching quote will become the string in the list.
763  *
764  *  The returned pointer should be deallocated with @code{free(3C)} when
765  *  are done using the data.  The data are placed in a single block of
766  *  allocated memory.  Do not deallocate individual token/strings.
767  *
768  *  The structure pointed to will contain at least these two fields:
769  *  @table @samp
770  *  @item tkn_ct
771  *  The number of tokens found in the input string.
772  *  @item tok_list
773  *  An array of @code{tkn_ct + 1} pointers to substring tokens, with
774  *  the last pointer set to NULL.
775  *  @end table
776  *
777  *  There are two types of quoted strings: single quoted (@code{'}) and
778  *  double quoted (@code{"}).  Singly quoted strings are fairly raw in that
779  *  escape characters (@code{\\}) are simply another character, except when
780  *  preceding the following characters:
781  *  @example
782  *  @code{\\}  double backslashes reduce to one
783  *  @code{'}   incorporates the single quote into the string
784  *  @code{\n}  suppresses both the backslash and newline character
785  *  @end example
786  *
787  *  Double quote strings are formed according to the rules of string
788  *  constants in ANSI-C programs.
789  *
790  * @param string       string to be tokenized
791  *
792  * @return token_list_t * - pointer to a structure that lists each token
793  */
794 extern token_list_t * ao_string_tokenize(char const *);
795 
796 
797 /**
798  * configFileLoad - parse a configuration file
799  *
800  *  This routine will load a named configuration file and parse the
801  *  text as a hierarchically valued option.  The option descriptor
802  *  created from an option definition file is not used via this interface.
803  *  The returned value is "named" with the input file name and is of
804  *  type "@code{OPARG_TYPE_HIERARCHY}".  It may be used in calls to
805  *  @code{optionGetValue()}, @code{optionNextValue()} and
806  *  @code{optionUnloadNested()}.
807  *
808  * @param fname        the file to load
809  *
810  * @return const tOptionValue * - An allocated, compound value structure
811  */
812 extern const tOptionValue * configFileLoad(char const *);
813 
814 
815 /**
816  * optionFileLoad - Load the locatable config files, in order
817  *
818  *  This function looks in all the specified directories for a configuration
819  *  file ("rc" file or "ini" file) and processes any found twice.  The first
820  *  time through, they are processed in reverse order (last file first).  At
821  *  that time, only "immediate action" configurables are processed.  For
822  *  example, if the last named file specifies not processing any more
823  *  configuration files, then no more configuration files will be processed.
824  *  Such an option in the @strong{first} named directory will have no effect.
825  *
826  *  Once the immediate action configurables have been handled, then the
827  *  directories are handled in normal, forward order.  In that way, later
828  *  config files can override the settings of earlier config files.
829  *
830  *  See the AutoOpts documentation for a thorough discussion of the
831  *  config file format.
832  *
833  *  Configuration files not found or not decipherable are simply ignored.
834  *
835  * @param opts         program options descriptor
836  * @param prog         program name
837  *
838  * @return int - 0 -> SUCCESS, -1 -> FAILURE
839  */
840 extern int optionFileLoad(tOptions *, char const *);
841 
842 
843 /**
844  * optionFindNextValue - find a hierarcicaly valued option instance
845  *
846  *  This routine will find the next entry in a nested value option or
847  *  configurable.  It will search through the list and return the next entry
848  *  that matches the criteria.
849  *
850  * @param odesc        an option with a nested arg type
851  * @param pPrevVal     the last entry
852  * @param name         name of value to find
853  * @param value        the matching value
854  *
855  * @return const tOptionValue * - a compound value structure
856  */
857 extern const tOptionValue * optionFindNextValue(const tOptDesc *, const tOptionValue *, char const *, char const *);
858 
859 
860 /**
861  * optionFindValue - find a hierarcicaly valued option instance
862  *
863  *  This routine will find an entry in a nested value option or configurable.
864  *  It will search through the list and return a matching entry.
865  *
866  * @param odesc        an option with a nested arg type
867  * @param name         name of value to find
868  * @param val          the matching value
869  *
870  * @return const tOptionValue * - a compound value structure
871  */
872 extern const tOptionValue * optionFindValue(const tOptDesc *, char const *, char const *);
873 
874 
875 /**
876  * optionFree - free allocated option processing memory
877  *
878  *  AutoOpts sometimes allocates memory and puts pointers to it in the
879  *  option state structures.  This routine deallocates all such memory.
880  *
881  * @param pOpts        program options descriptor
882  */
883 extern void optionFree(tOptions *);
884 
885 
886 /**
887  * optionGetValue - get a specific value from a hierarcical list
888  *
889  *  This routine will find an entry in a nested value option or configurable.
890  *  If "valueName" is NULL, then the first entry is returned.  Otherwise,
891  *  the first entry with a name that exactly matches the argument will be
892  *  returned.  If there is no matching value, NULL is returned and errno is
893  *  set to ENOENT. If the provided option value is not a hierarchical value,
894  *  NULL is also returned and errno is set to EINVAL.
895  *
896  * @param pOptValue    a hierarchcal value
897  * @param valueName    name of value to get
898  *
899  * @return const tOptionValue * - a compound value structure
900  */
901 extern const tOptionValue * optionGetValue(const tOptionValue *, char const *);
902 
903 
904 /**
905  * optionLoadLine - process a string for an option name and value
906  *
907  *  This is a client program callable routine for setting options from, for
908  *  example, the contents of a file that they read in.  Only one option may
909  *  appear in the text.  It will be treated as a normal (non-preset) option.
910  *
911  *  When passed a pointer to the option struct and a string, it will find
912  *  the option named by the first token on the string and set the option
913  *  argument to the remainder of the string.  The caller must NUL terminate
914  *  the string.  The caller need not skip over any introductory hyphens.
915  *  Any embedded new lines will be included in the option
916  *  argument.  If the input looks like one or more quoted strings, then the
917  *  input will be "cooked".  The "cooking" is identical to the string
918  *  formation used in AutoGen definition files (@pxref{basic expression}),
919  *  except that you may not use backquotes.
920  *
921  * @param opts         program options descriptor
922  * @param line         NUL-terminated text
923  */
924 extern void optionLoadLine(tOptions *, char const *);
925 
926 
927 /**
928  * optionMemberList - Get the list of members of a bit mask set
929  *
930  *  This converts the OPT_VALUE_name mask value to a allocated string.
931  *  It is the caller's responsibility to free the string.
932  *
933  * @param od           the set membership option description
934  *
935  * @return char * - the names of the set bits
936  */
937 extern char * optionMemberList(tOptDesc *);
938 
939 
940 /**
941  * optionNextValue - get the next value from a hierarchical list
942  *
943  *  This routine will return the next entry after the entry passed in.  At the
944  *  end of the list, NULL will be returned.  If the entry is not found on the
945  *  list, NULL will be returned and "@var{errno}" will be set to EINVAL.
946  *  The "@var{pOldValue}" must have been gotten from a prior call to this
947  *  routine or to "@code{opitonGetValue()}".
948  *
949  * @param pOptValue    a hierarchcal list value
950  * @param pOldValue    a value from this list
951  *
952  * @return const tOptionValue * - a compound value structure
953  */
954 extern const tOptionValue * optionNextValue(const tOptionValue *, const tOptionValue *);
955 
956 
957 /**
958  * optionOnlyUsage - Print usage text for just the options
959  *
960  *  This routine will print only the usage for each option.
961  *  This function may be used when the emitted usage must incorporate
962  *  information not available to AutoOpts.
963  *
964  * @param pOpts        program options descriptor
965  * @param ex_code      exit code for calling exit(3)
966  */
967 extern void optionOnlyUsage(tOptions *, int);
968 
969 
970 /**
971  * optionPrintVersion - Print the program version
972  *
973  *  This routine will print the version to stdout.
974  *
975  * @param opts         program options descriptor
976  * @param od           the descriptor for this arg
977  */
978 extern void optionPrintVersion(tOptions *, tOptDesc *);
979 
980 
981 /**
982  * optionPrintVersionAndReturn - Print the program version
983  *
984  *  This routine will print the version to stdout and return
985  *  instead of exiting.  Please see the source for the
986  *  @code{print_ver} funtion for details on selecting how
987  *  verbose to be after this function returns.
988  *
989  * @param opts         program options descriptor
990  * @param od           the descriptor for this arg
991  */
992 extern void optionPrintVersionAndReturn(tOptions *, tOptDesc *);
993 
994 
995 /**
996  * optionProcess - this is the main option processing routine
997  *
998  *  This is the main entry point for processing options.  It is intended
999  *  that this procedure be called once at the beginning of the execution of
1000  *  a program.  Depending on options selected earlier, it is sometimes
1001  *  necessary to stop and restart option processing, or to select completely
1002  *  different sets of options.  This can be done easily, but you generally
1003  *  do not want to do this.
1004  *
1005  *  The number of arguments processed always includes the program name.
1006  *  If one of the arguments is "--", then it is counted and the processing
1007  *  stops.  If an error was encountered and errors are to be tolerated, then
1008  *  the returned value is the index of the argument causing the error.
1009  *  A hyphen by itself ("-") will also cause processing to stop and will
1010  *  @emph{not} be counted among the processed arguments.  A hyphen by itself
1011  *  is treated as an operand.  Encountering an operand stops option
1012  *  processing.
1013  *
1014  * @param opts         program options descriptor
1015  * @param a_ct         program arg count
1016  * @param a_v          program arg vector
1017  *
1018  * @return int - the count of the arguments processed
1019  */
1020 extern int optionProcess(tOptions *, int, char **);
1021 
1022 
1023 /**
1024  * optionRestore - restore option state from memory copy
1025  *
1026  *  Copy back the option state from saved memory.
1027  *  The allocated memory is left intact, so this routine can be
1028  *  called repeatedly without having to call optionSaveState again.
1029  *  If you are restoring a state that was saved before the first call
1030  *  to optionProcess(3AO), then you may change the contents of the
1031  *  argc/argv parameters to optionProcess.
1032  *
1033  * @param pOpts        program options descriptor
1034  */
1035 extern void optionRestore(tOptions *);
1036 
1037 
1038 /**
1039  * optionSaveFile - saves the option state to a file
1040  *
1041  *  This routine will save the state of option processing to a file.  The name
1042  *  of that file can be specified with the argument to the @code{--save-opts}
1043  *  option, or by appending the @code{rcfile} attribute to the last
1044  *  @code{homerc} attribute.  If no @code{rcfile} attribute was specified, it
1045  *  will default to @code{.@i{programname}rc}.  If you wish to specify another
1046  *  file, you should invoke the @code{SET_OPT_SAVE_OPTS(@i{filename})} macro.
1047  *
1048  *  The recommend usage is as follows:
1049  *  @example
1050  *  optionProcess(&progOptions, argc, argv);
1051  *  if (i_want_a_non_standard_place_for_this)
1052  *  SET_OPT_SAVE_OPTS("myfilename");
1053  *  optionSaveFile(&progOptions);
1054  *  @end example
1055  *
1056  * @param opts         program options descriptor
1057  */
1058 extern void optionSaveFile(tOptions *);
1059 
1060 
1061 /**
1062  * optionSaveState - saves the option state to memory
1063  *
1064  *  This routine will allocate enough memory to save the current option
1065  *  processing state.  If this routine has been called before, that memory
1066  *  will be reused.  You may only save one copy of the option state.  This
1067  *  routine may be called before optionProcess(3AO).  If you do call it
1068  *  before the first call to optionProcess, then you may also change the
1069  *  contents of argc/argv after you call optionRestore(3AO)
1070  *
1071  *  In fact, more strongly put: it is safest to only use this function
1072  *  before having processed any options.  In particular, the saving and
1073  *  restoring of stacked string arguments and hierarchical values is
1074  *  disabled.  The values are not saved.
1075  *
1076  * @param pOpts        program options descriptor
1077  */
1078 extern void optionSaveState(tOptions *);
1079 
1080 
1081 /**
1082  * optionUnloadNested - Deallocate the memory for a nested value
1083  *
1084  *  A nested value needs to be deallocated.  The pointer passed in should
1085  *  have been gotten from a call to @code{configFileLoad()} (See
1086  *  @pxref{libopts-configFileLoad}).
1087  *
1088  * @param pOptVal      the hierarchical value
1089  */
1090 extern void optionUnloadNested(tOptionValue const *);
1091 
1092 
1093 /**
1094  * optionVersion - return the compiled AutoOpts version number
1095  *
1096  *  Returns the full version string compiled into the library.
1097  *  The returned string cannot be modified.
1098  *
1099  * @return char const * - the version string in constant memory
1100  */
1101 extern char const * optionVersion(void);
1102 
1103 
1104 /**
1105  * strequate - map a list of characters to the same value
1106  *
1107  *  Each character in the input string get mapped to the first character
1108  *  in the string.
1109  *  This function name is mapped to option_strequate so as to not conflict
1110  *  with the POSIX name space.
1111  *
1112  * @param ch_list      characters to equivalence
1113  */
1114 extern void strequate(char const *);
1115 
1116 
1117 /**
1118  * streqvcmp - compare two strings with an equivalence mapping
1119  *
1120  *  Using a character mapping, two strings are compared for "equivalence".
1121  *  Each input character is mapped to a comparison character and the
1122  *  mapped-to characters are compared for the two NUL terminated input strings.
1123  *  This function name is mapped to option_streqvcmp so as to not conflict
1124  *  with the POSIX name space.
1125  *
1126  * @param str1         first string
1127  * @param str2         second string
1128  *
1129  * @return int - the difference between two differing characters
1130  */
1131 extern int streqvcmp(char const *, char const *);
1132 
1133 
1134 /**
1135  * streqvmap - Set the character mappings for the streqv functions
1136  *
1137  *  Set the character mapping.  If the count (@code{ct}) is set to zero, then
1138  *  the map is cleared by setting all entries in the map to their index
1139  *  value.  Otherwise, the "@code{From}" character is mapped to the "@code{To}"
1140  *  character.  If @code{ct} is greater than 1, then @code{From} and @code{To}
1141  *  are incremented and the process repeated until @code{ct} entries have been
1142  *  set. For example,
1143  *  @example
1144  *  streqvmap('a', 'A', 26);
1145  *  @end example
1146  *  @noindent
1147  *  will alter the mapping so that all English lower case letters
1148  *  will map to upper case.
1149  *
1150  *  This function name is mapped to option_streqvmap so as to not conflict
1151  *  with the POSIX name space.
1152  *
1153  * @param from         Input character
1154  * @param to           Mapped-to character
1155  * @param ct           compare length
1156  */
1157 extern void streqvmap(char, char, int);
1158 
1159 
1160 /**
1161  * strneqvcmp - compare two strings with an equivalence mapping
1162  *
1163  *  Using a character mapping, two strings are compared for "equivalence".
1164  *  Each input character is mapped to a comparison character and the
1165  *  mapped-to characters are compared for the two NUL terminated input strings.
1166  *  The comparison is limited to @code{ct} bytes.
1167  *  This function name is mapped to option_strneqvcmp so as to not conflict
1168  *  with the POSIX name space.
1169  *
1170  * @param str1         first string
1171  * @param str2         second string
1172  * @param ct           compare length
1173  *
1174  * @return int - the difference between two differing characters
1175  */
1176 extern int strneqvcmp(char const *, char const *, int);
1177 
1178 
1179 /**
1180  * strtransform - convert a string into its mapped-to value
1181  *
1182  *  Each character in the input string is mapped and the mapped-to
1183  *  character is put into the output.
1184  *  This function name is mapped to option_strtransform so as to not conflict
1185  *  with the POSIX name space.
1186  *
1187  *  The source and destination may be the same.
1188  *
1189  * @param dest         output string
1190  * @param src          input string
1191  */
1192 extern void strtransform(char *, char const *);
1193 
1194 /*  AutoOpts PRIVATE FUNCTIONS:  */
1195 tOptProc optionStackArg, optionUnstackArg, optionBooleanVal, optionNumericVal;
1196 
1197 extern char * ao_string_cook(char *, int *);
1198 
1199 extern unsigned int ao_string_cook_escape_char(char const *, char *, unsigned int);
1200 
1201 extern void genshelloptUsage(tOptions *, int);
1202 
1203 extern int optionAlias(tOptions *, tOptDesc *, unsigned int);
1204 
1205 extern void optionBooleanVal(tOptions *, tOptDesc *);
1206 
1207 extern uintptr_t optionEnumerationVal(tOptions *, tOptDesc *, char const * const *, unsigned int);
1208 
1209 extern void optionFileCheck(tOptions *, tOptDesc *, teOptFileType, tuFileMode);
1210 
1211 extern char const * optionKeywordName(tOptDesc *, unsigned int);
1212 
1213 extern void optionLoadOpt(tOptions *, tOptDesc *);
1214 
1215 extern bool optionMakePath(char *, int, char const *, char const *);
1216 
1217 extern void optionNestedVal(tOptions *, tOptDesc *);
1218 
1219 extern void optionNumericVal(tOptions *, tOptDesc *);
1220 
1221 extern void optionPagedUsage(tOptions *, tOptDesc *);
1222 
1223 extern void optionParseShell(tOptions *);
1224 
1225 extern void optionPrintParagraphs(char const *, bool, FILE *);
1226 
1227 extern void optionPutShell(tOptions *);
1228 
1229 extern char const * optionQuoteString(char const *, char const *);
1230 
1231 extern void optionResetOpt(tOptions *, tOptDesc *);
1232 
1233 extern void optionSetMembers(tOptions *, tOptDesc *, char const * const *, unsigned int);
1234 
1235 extern void optionShowRange(tOptions *, tOptDesc *, void *, int);
1236 
1237 extern void optionStackArg(tOptions *, tOptDesc *);
1238 
1239 extern void optionTimeDate(tOptions *, tOptDesc *);
1240 
1241 extern void optionTimeVal(tOptions *, tOptDesc *);
1242 
1243 extern void optionUnstackArg(tOptions *, tOptDesc *);
1244 
1245 extern void optionUsage(tOptions *, int);
1246 
1247 extern void optionVendorOption(tOptions *, tOptDesc *);
1248 
1249 extern void optionVersionStderr(tOptions *, tOptDesc *);
1250 
1251 extern void * text_mmap(char const *, int, int, tmap_info_t *);
1252 
1253 extern int text_munmap(tmap_info_t *);
1254 
1255 CPLUSPLUS_CLOSER
1256 #endif /* AUTOOPTS_OPTIONS_H_GUARD */
1257 /** @}
1258  *
1259  * Local Variables:
1260  * c-file-style: "stroustrup"
1261  * indent-tabs-mode: nil
1262  * End:
1263  * options.h ends here */
1264