1 diff -u -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ msg.c.orig msg.c
2 --- msg.c.orig	Fri Jun  4 02:51:02 2004
3 +++ msg.c	Sat Jun 19 18:42:23 2004
4 @@ -10,64 +10,88 @@
5 
6  #include	"defs.h"
7  #include	"sym.h"
8 +#include	"pathnames.h"
9 
10 -MSG		version = "\nVERSION sys137	DATE 1978 Nov 6 14:29:22\n";
11 +CMSG		version = "\nVERSION sys137	DATE 1978 Nov 6 14:29:22\n";
12 
13  /* error messages */
14 -MSG	badopt		= "bad option(s)";
15 -MSG	mailmsg		= "you have mail\n";
16 -MSG	nospace		= "no space";
17 -MSG	synmsg		= "syntax error";
18 -
19 -MSG	badnum		= "bad number";
20 -MSG	badparam	= "parameter not set";
21 -MSG	badsub		= "bad substitution";
22 -MSG	badcreate	= "cannot create";
23 -MSG	illegal		= "illegal io";
24 -MSG	restricted	= "restricted";
25 -MSG	piperr		= "cannot make pipe";
26 -MSG	badopen		= "cannot open";
27 -MSG	coredump	= " - core dumped";
28 -MSG	arglist		= "arg list too long";
29 -MSG	txtbsy		= "text busy";
30 -MSG	toobig		= "too big";
31 -MSG	badexec		= "cannot execute";
32 -MSG	notfound	= "not found";
33 -MSG	badfile		= "bad file number";
34 -MSG	badshift	= "cannot shift";
35 -MSG	baddir		= "bad directory";
36 -MSG	badtrap		= "bad trap";
37 -MSG	wtfailed	= "is read only";
38 -MSG	notid		= "is not an identifier";
39 +CMSG	badopt		= "bad option(s)";
40 +CMSG	mailmsg		= "you have mail\n";
41 +CMSG	nospace		= "no space";
42 +CMSG	synmsg		= "syntax error";
43 +
44 +CMSG	badnum		= "bad number";
45 +#if defined(SYSIII)
46 +CMSG	badparam	= "parameter null or not set";
47 +CMSG	unset		= "parameter not set";
48 +#else /* V7 */
49 +CMSG	badparam	= "parameter not set";
50 +#endif
51 +CMSG	badsub		= "bad substitution";
52 +CMSG	badcreate	= "cannot create";
53 +CMSG	illegal		= "illegal io";
54 +CMSG	restricted	= "restricted";
55 +#if defined(SYSIII)
56 +CMSG	nofork		= "cannot fork: too many processes";
57 +CMSG	noswap		= "cannot fork: no swap space";
58 +#endif
59 +CMSG	piperr		= "cannot make pipe";
60 +CMSG	badopen		= "cannot open";
61 +CMSG	coredump	= " - core dumped";
62 +CMSG	arglist		= "arg list too long";
63 +#if defined(SYSIII)
64 +CMSG	argcount	= "argument count";
65 +#endif
66 +CMSG	txtbsy		= "text busy";
67 +CMSG	toobig		= "too big";
68 +CMSG	badexec		= "cannot execute";
69 +CMSG	notfound	= "not found";
70 +CMSG	badfile		= "bad file number";
71 +CMSG	badshift	= "cannot shift";
72 +CMSG	baddir		= "bad directory";
73 +CMSG	badtrap		= "bad trap";
74 +CMSG	memfault	= "cannot trap 11";
75 +CMSG	wtfailed	= "is read only";
76 +CMSG	notid		= "is not an identifier";
77 +CMSG	badulimit	= "bad ulimit";
78 +
79 +#if defined(SYSIII)
80 +/*	messages for 'builtin' functions	*/
81 +CMSG	btest		= "test";
82 +CMSG	badop		= "unknown operator";
83 +#endif
84 
85  /* built in names */
86 -MSG	pathname	= "PATH";
87 -MSG	homename	= "HOME";
88 -MSG	mailname	= "MAIL";
89 -MSG	fngname		= "FILEMATCH";
90 -MSG	ifsname		= "IFS";
91 -MSG	ps1name		= "PS1";
92 -MSG	ps2name		= "PS2";
93 +CMSG	pathname	= "PATH";
94 +CMSG	homename	= "HOME";
95 +CMSG	mailname	= "MAIL";
96 +CMSG	fngname		= "FILEMATCH";
97 +CMSG	ifsname		= "IFS";
98 +CMSG	ps1name		= "PS1";
99 +CMSG	ps2name		= "PS2";
100 
101  /* string constants */
102 -MSG	nullstr		= "";
103 -MSG	sptbnl		= " \t\n";
104 -MSG	defpath		= ":/bin:/usr/bin";
105 -MSG	colon		= ": ";
106 -MSG	minus		= "-";
107 -MSG	endoffile	= "end of file";
108 -MSG	unexpected 	= " unexpected";
109 -MSG	atline		= " at line ";
110 -MSG	devnull		= "/dev/null";
111 -MSG	execpmsg	= "+ ";
112 -MSG	readmsg		= "> ";
113 -MSG	stdprompt	= "$ ";
114 -MSG	supprompt	= "# ";
115 -MSG	profile		= ".profile";
116 -
117 +CMSG	nullstr		= "";
118 +CMSG	sptbnl		= " \t\n";
119 +CMSG	defpath		= _PATH_DEFPATH;
120 +CMSG	colon		= ": ";
121 +CMSG	minus		= "-";
122 +CMSG	endoffile	= "end of file";
123 +CMSG	endofline	= "newline or ;";
124 +CMSG	unexpected 	= " unexpected";
125 +CMSG	atline		= " at line ";
126 +CMSG	devnull		= _PATH_DEVNULL;
127 +CMSG	execpmsg	= "+ ";
128 +CMSG	readmsg		= "> ";
129 +CMSG	stdprompt	= "$ ";
130 +CMSG	supprompt	= "# ";
131 +CMSG	profile		= _PATH_DOTPROFILE;
132 +#if defined(SYSIII)
133 +CMSG	sysprofile	= _PATH_ETCPROFILE;
134 +#endif
135 
136  /* tables */
137 -SYSTAB reserved {
138 +SYSTAB reserved={
139  		{"in",		INSYM},
140  		{"esac",	ESSYM},
141  		{"case",	CASYM},
142 @@ -83,19 +107,19 @@
143  		{"until",	UNSYM},
144  		{ "{",		BRSYM},
145  		{ "}",		KTSYM},
146 -		{0,	0},
147 +		{0,	0}
148  };
149 
150 -STRING	sysmsg[] {
151 +CSTRING	sysmsg[]={
152  		0,
153  		"Hangup",
154  		0,	/* Interrupt */
155  		"Quit",
156  		"Illegal instruction",
157  		"Trace/BPT trap",
158 -		"IOT trap",
159 +		"Abort trap",	/* IOT trap */
160  		"EMT trap",
161 -		"Floating exception",
162 +		"Floating point exception",
163  		"Killed",
164  		"Bus error",
165  		"Memory fault",
166 @@ -103,25 +127,49 @@
167  		0,	/* Broken pipe */
168  		"Alarm call",
169  		"Terminated",
170 -		"Signal 16",
171 +		"Urgent I/O condition",
172 +		"Stopped",
173 +		"Stopped from terminal",
174 +		"Continued",
175 +		"Child exited",
176 +		"Stopped on terminal input",
177 +		"Stopped on terminal output",
178 +		"Asynchronous I/O",
179 +		"Cputime limit exceeded",
180 +		"Filesize limit exceeded",
181 +		"Virtual timer expired",
182 +		"Profiling timer expired",
183 +		"Window size changed",
184 +		"Information request",
185 +		"User defined signal 1",
186 +		"User defined signal 2",
187 +		"Thread interrupt"
188  };
189 +#if defined(RENO)
190 +INT		num_sysmsg = (sizeof sysmsg / sizeof sysmsg[0]);
191 +#endif
192 +
193 +CMSG		export = "export";
194 +CMSG		readonly = "readonly";
195 
196 -MSG		export = "export";
197 -MSG		readonly = "readonly";
198 -SYSTAB	commands {
199 +SYSTAB	commands={
200  		{"cd",		SYSCD},
201  		{"read",	SYSREAD},
202 -/*
203 -		{"[",		SYSTST},
204 -*/
205  		{"set",		SYSSET},
206  		{":",		SYSNULL},
207  		{"trap",	SYSTRAP},
208 +#if defined(ULTRIX)
209 +		{"ulimit",	SYSULIMIT},
210 +#endif
211  		{"login",	SYSLOGIN},
212  		{"wait",	SYSWAIT},
213  		{"eval",	SYSEVAL},
214  		{".",		SYSDOT},
215 +#if defined(SYSIII)
216 +		{"newgrp",	SYSNEWGRP},
217 +#else /* V7 */
218  		{"newgrp",	SYSLOGIN},
219 +#endif
220  		{readonly,	SYSRDONLY},
221  		{export,	SYSXPORT},
222  		{"chdir",	SYSCD},
223 @@ -132,5 +180,13 @@
224  		{"exec",	SYSEXEC},
225  		{"times",	SYSTIMES},
226  		{"umask",	SYSUMASK},
227 -		{0,	0},
228 +		{0,	0}
229 +};
230 +
231 +#if defined(SYSIII)
232 +SYSTAB	builtins={
233 +		{btest,		TEST},
234 +		{"[",		TEST},
235 +		{0,	0}
236  };
237 +#endif
238