1/***********************************************************************
2*                                                                      *
3*               This software is part of the ast package               *
4*          Copyright (c) 1982-2011 AT&T Intellectual Property          *
5*                      and is licensed under the                       *
6*                 Eclipse Public License, Version 1.0                  *
7*                    by AT&T Intellectual Property                     *
8*                                                                      *
9*                A copy of the License is available at                 *
10*          http://www.eclipse.org/org/documents/epl-v10.html           *
11*         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
12*                                                                      *
13*              Information and Software Systems Research               *
14*                            AT&T Research                             *
15*                           Florham Park NJ                            *
16*                                                                      *
17*                  David Korn <dgk@research.att.com>                   *
18*                                                                      *
19***********************************************************************/
20#pragma prototyped
21
22#include	"defs.h"
23#include	"name.h"
24#include	"shtable.h"
25
26#if SHOPT_BASH
27#   define bashopt(a,b)		a,	b|SH_BASHOPT,
28#   define bashextra(a,b)	a,	b|SH_BASHEXTRA,
29#else
30#   define bashopt(a,b)
31#   define bashextra(a,b)
32#endif
33
34/*
35 * This is the list of invocation and set options
36 * This list must be in in ascii sorted order
37 */
38
39const Shtable_t shtab_options[] =
40{
41	"allexport",			SH_ALLEXPORT,
42#if SHOPT_BASH
43	"bash",				(SH_BASH|SH_COMMANDLINE),
44#endif
45	"bgnice",			SH_BGNICE,
46	"braceexpand",			SH_BRACEEXPAND,
47	bashopt("cdable_vars",		SH_CDABLE_VARS)
48	bashopt("cdspell",		SH_CDSPELL)
49	bashopt("checkhash",		SH_CHECKHASH)
50	bashopt("checkwinsize",		SH_CHECKWINSIZE)
51	"noclobber",			SH_NOCLOBBER,
52	bashopt("dotglob",		SH_DOTGLOB)
53	"emacs",			SH_EMACS,
54	"errexit",			SH_ERREXIT,
55	"noexec",			SH_NOEXEC,
56	bashopt("execfail",		SH_EXECFAIL)
57	bashopt("expand_aliases",	SH_EXPAND_ALIASES)
58	bashopt("extglob",		SH_EXTGLOB)
59	"noglob",			SH_NOGLOB,
60	"globstar",			SH_GLOBSTARS,
61	"gmacs",			SH_GMACS,
62	bashextra("hashall",		SH_TRACKALL)
63	bashopt("histappend",		SH_HISTAPPEND)
64#if SHOPT_HISTEXPAND
65	"histexpand",			SH_HISTEXPAND,
66#else
67	bashextra("histexpand",		SH_HISTEXPAND)
68#endif
69	bashextra("history",		SH_HISTORY2)
70	bashopt("histreedit",		SH_HISTREEDIT)
71	bashopt("histverify",		SH_HISTVERIFY)
72	bashopt("hostcomplete",		SH_HOSTCOMPLETE)
73	bashopt("huponexit",		SH_HUPONEXIT)
74	"ignoreeof",			SH_IGNOREEOF,
75	"interactive",			SH_INTERACTIVE|SH_COMMANDLINE,
76	bashextra("interactive_comments",	SH_INTERACTIVE_COMM)
77	"keyword",			SH_KEYWORD,
78	"letoctal",			SH_LETOCTAL,
79	bashopt("lithist",		SH_LITHIST)
80	"nolog",			SH_NOLOG,
81	"login_shell",			SH_LOGIN_SHELL|SH_COMMANDLINE,
82	bashopt("mailwarn",		SH_MAILWARN)
83	"markdirs",			SH_MARKDIRS,
84	"monitor",			SH_MONITOR,
85	"multiline",			SH_MULTILINE,
86	bashopt("no_empty_cmd_completion", SH_NOEMPTYCMDCOMPL)
87	bashopt("nocaseglob",		SH_NOCASEGLOB)
88	"notify",			SH_NOTIFY,
89	bashopt("nullglob",		SH_NULLGLOB)
90	bashextra("onecmd",		SH_TFLAG)
91	"pipefail",			SH_PIPEFAIL,
92	bashextra("physical",		SH_PHYSICAL)
93	bashextra("posix",		SH_POSIX)
94	"privileged",			SH_PRIVILEGED,
95#if SHOPT_BASH
96	"profile",			SH_LOGIN_SHELL|SH_COMMANDLINE,
97#   if SHOPT_PFSH
98	"pfsh",				SH_PFSH|SH_COMMANDLINE,
99#   endif
100#else
101#   if SHOPT_PFSH
102	"profile",			SH_PFSH|SH_COMMANDLINE,
103#   endif
104#endif
105	bashopt("progcomp",		SH_PROGCOMP)
106	bashopt("promptvars",		SH_PROMPTVARS)
107	"rc",				SH_RC|SH_COMMANDLINE,
108	"restricted",			SH_RESTRICTED,
109	bashopt("restricted_shell",	SH_RESTRICTED2|SH_COMMANDLINE)
110	bashopt("shift_verbose",	SH_SHIFT_VERBOSE)
111	"showme",			SH_SHOWME,
112	bashopt("sourcepath",		SH_SOURCEPATH)
113	"trackall",			SH_TRACKALL,
114	"nounset",			SH_NOUNSET,
115	"verbose",			SH_VERBOSE,
116	"vi",				SH_VI,
117	"viraw",			SH_VIRAW,
118	bashopt("xpg_echo",		SH_XPG_ECHO)
119	"xtrace",			SH_XTRACE,
120	"",				0
121};
122
123const Shtable_t shtab_attributes[] =
124{
125	{"-Sshared",	NV_REF|NV_TAGGED},
126	{"-nnameref",	NV_REF},
127	{"-xexport",	NV_EXPORT},
128	{"-rreadonly",	NV_RDONLY},
129	{"-ttagged",	NV_TAGGED},
130	{"-Aassociative array",	NV_ARRAY},
131	{"-aindexed array",	NV_ARRAY},
132	{"-llong",	(NV_DOUBLE|NV_LONG)},
133	{"-Eexponential",(NV_DOUBLE|NV_EXPNOTE)},
134	{"-Xhexfloat",	(NV_DOUBLE|NV_HEXFLOAT)},
135	{"-Ffloat",	NV_DOUBLE},
136	{"-llong",	(NV_INTEGER|NV_LONG)},
137	{"-sshort",	(NV_INTEGER|NV_SHORT)},
138	{"-uunsigned",	(NV_INTEGER|NV_UNSIGN)},
139	{"-iinteger",	NV_INTEGER},
140	{"-Hfilename",	NV_HOST},
141	{"-bbinary",    NV_BINARY},
142	{"-ltolower",	NV_UTOL},
143	{"-utoupper",	NV_LTOU},
144	{"-Zzerofill",	NV_ZFILL},
145	{"-Lleftjust",	NV_LJUST},
146	{"-Rrightjust",	NV_RJUST},
147	{"++namespace",	NV_TABLE},
148	{"",		0}
149};
150