-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsg.c
135 lines (124 loc) · 2.61 KB
/
msg.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
* UNIX shell
*
* S. R. Bourne
* Bell Telephone Laboratories
*
*/
#include "defs.h"
#include "sym.h"
MSG version = "\nVERSION sys137 DATE 1978 Nov 6 14:29:22\n";
/* error messages */
MSG badopt = "bad option(s)";
MSG mailmsg = "you have mail\n";
MSG nospace = "no space";
MSG synmsg = "syntax error";
MSG badnum = "bad number";
MSG badparam = "parameter not set";
MSG badsub = "bad substitution";
MSG badcreate = "cannot create";
MSG illegal = "illegal io";
MSG restricted = "restricted";
MSG piperr = "cannot make pipe";
MSG badopen = "cannot open";
MSG coredump = " - core dumped";
MSG arglist = "arg list too long";
MSG txtbsy = "text busy";
MSG toobig = "too big";
MSG badexec = "cannot execute";
MSG notfound = "not found";
MSG badfile = "bad file number";
MSG badshift = "cannot shift";
MSG baddir = "bad directory";
MSG badtrap = "bad trap";
MSG wtfailed = "is read only";
MSG notid = "is not an identifier";
/* built in names */
MSG pathname = "PATH";
MSG homename = "HOME";
MSG mailname = "MAIL";
MSG fngname = "FILEMATCH";
MSG ifsname = "IFS";
MSG ps1name = "PS1";
MSG ps2name = "PS2";
/* string constants */
MSG nullstr = "";
MSG sptbnl = " \t\n";
MSG defpath = ":/bin:/usr/bin";
MSG colon = ": ";
MSG minus = "-";
MSG endoffile = "end of file";
MSG unexpected = " unexpected";
MSG atline = " at line ";
MSG devnull = "/dev/null";
MSG execpmsg = "+ ";
MSG readmsg = "> ";
MSG stdprompt = "$ ";
MSG supprompt = "# ";
MSG profile = ".profile";
/* tables */
SYSTAB reserved {
{"in", INSYM},
{"esac", ESSYM},
{"case", CASYM},
{"for", FORSYM},
{"done", ODSYM},
{"if", IFSYM},
{"while", WHSYM},
{"do", DOSYM},
{"then", THSYM},
{"else", ELSYM},
{"elif", EFSYM},
{"fi", FISYM},
{"until", UNSYM},
{ "{", BRSYM},
{ "}", KTSYM},
{0, 0},
};
STRING sysmsg[] {
0,
"Hangup",
0, /* Interrupt */
"Quit",
"Illegal instruction",
"Trace/BPT trap",
"IOT trap",
"EMT trap",
"Floating exception",
"Killed",
"Bus error",
"Memory fault",
"Bad system call",
0, /* Broken pipe */
"Alarm call",
"Terminated",
"Signal 16",
};
MSG export = "export";
MSG readonly = "readonly";
SYSTAB commands {
{"cd", SYSCD},
{"read", SYSREAD},
/*
{"[", SYSTST},
*/
{"set", SYSSET},
{":", SYSNULL},
{"trap", SYSTRAP},
{"login", SYSLOGIN},
{"wait", SYSWAIT},
{"eval", SYSEVAL},
{".", SYSDOT},
{"newgrp", SYSLOGIN},
{readonly, SYSRDONLY},
{export, SYSXPORT},
{"chdir", SYSCD},
{"break", SYSBREAK},
{"continue", SYSCONT},
{"shift", SYSSHFT},
{"exit", SYSEXIT},
{"exec", SYSEXEC},
{"times", SYSTIMES},
{"umask", SYSUMASK},
{0, 0},
};