1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
21 ***********************************************************************/
27 * command line option parser and usage formatter private definitions
36 #define OPT_cache 0x01
37 #define OPT_functions 0x02
38 #define OPT_ignore 0x04
40 #define OPT_numeric 0x10
42 #define OPT_minus 0x40
45 #define OPT_cache_flag 0x01
46 #define OPT_cache_invert 0x02
47 #define OPT_cache_numeric 0x04
48 #define OPT_cache_optional 0x08
49 #define OPT_cache_string 0x10
52 #define OPT_FLAGS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
56 typedef struct Optpass_s
62 unsigned char version
;
65 unsigned char section
;
68 typedef struct Optcache_s
70 struct Optcache_s
* next
;
73 unsigned char flags
[sizeof(OPT_FLAGS
)];
76 typedef struct Optstate_s
78 Sfio_t
* mp
; /* opt_info.msg string stream */
79 Sfio_t
* vp
; /* translation string stream */
80 Sfio_t
* xp
; /* translation string stream */
81 Sfio_t
* cp
; /* compatibility string stream */
82 Optpass_t pass
[8]; /* optjoin() list */
83 char* argv
[2]; /* initial argv copy */
84 char* strv
[3]; /* optstr() argv */
85 char* str
; /* optstr() string */
86 Sfio_t
* strp
; /* optstr() stream */
87 int force
; /* force this style */
88 int pindex
; /* prev index for backup */
89 int poffset
; /* prev offset for backup */
90 int npass
; /* # optjoin() passes */
91 int join
; /* optjoin() pass # */
93 int style
; /* default opthelp() style */
94 int width
; /* format line width */
95 int flags
; /* display flags */
96 int emphasis
; /* ansi term emphasis ok */
97 Dtdisc_t msgdisc
; /* msgdict discipline */
98 Dt_t
* msgdict
; /* default ast.id catalog msgs */
99 Optcache_t
* cache
; /* OPT_cache cache */
102 #define _OPT_PRIVATE_ \
103 char pad[2*sizeof(void*)]; \