2 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley Software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
18 #include "sh.tconst.h"
28 extern int docontin();
38 extern int doforeach();
42 extern int dorehash();
50 extern int dologout();
52 extern int donewgrp();
55 extern int donotify();
57 extern int doonintr();
60 extern int dorepeat();
62 extern int dosetenv();
63 extern int dosource();
65 extern int dosuspend();
67 extern int doswitch();
69 extern int dounlimit();
77 extern int hashstat();
84 extern int dounhash();
86 extern int dounsetenv();
90 struct biltins bfunc
[] = {
92 S_alias
, doalias
, 0, INF
,
94 S_alloc
, showall
, 0, 1,
97 S_break
, dobreak
, 0, 0,
98 S_breaksw
, doswbrk
, 0, 0,
100 S_bye
, goodbye
, 0, 0,
104 S_chdir
, dochngd
, 0, 1,
105 S_continue
, docontin
, 0, 0,
106 S_default
, dozip
, 0, 0,
107 S_dirs
, dodirs
, 0, 1,
108 S_echo
, doecho
, 0, INF
,
109 S_else
, doelse
, 0, INF
,
111 S_endif
, dozip
, 0, 0,
112 S_endsw
, dozip
, 0, 0,
113 S_eval
, doeval
, 0, INF
,
114 S_exec
, execash
, 1, INF
,
115 S_exit
, doexit
, 0, INF
,
117 S_foreach
, doforeach
, 3, INF
,
121 S_glob
, doglob
, 0, INF
,
122 S_goto
, dogoto
, 1, 1,
124 S_hashstat
, hashstat
, 0, 0,
126 S_history
, dohist
, 0, 2,
128 S_jobs
, dojobs
, 0, 1,
129 S_kill
, dokill
, 1, INF
,
130 S_limit
, dolimit
, 0, 3,
131 S_login
, dologin
, 0, 1,
132 S_logout
, dologout
, 0, 0,
134 S_newgrp
, donewgrp
, 1, 1,
136 S_nice
, donice
, 0, INF
,
137 S_nohup
, donohup
, 0, INF
,
138 S_notify
, donotify
, 0, INF
,
139 S_onintr
, doonintr
, 0, 2,
140 S_popd
, dopopd
, 0, 1,
141 S_pushd
, dopushd
, 0, 1,
145 S_rehash
, dorehash
, 0, 0,
146 S_repeat
, dorepeat
, 2, INF
,
147 S_set
, doset
, 0, INF
,
148 S_setenv
, dosetenv
, 0, 2,
149 S_shift
, shift
, 0, 1,
150 S_source
, dosource
, 1, 2,
151 S_stop
, dostop
, 1, INF
,
152 S_suspend
, dosuspend
, 0, 0,
153 S_switch
, doswitch
, 1, INF
,
154 S_time
, dotime
, 0, INF
,
155 S_umask
, doumask
, 0, 1,
156 S_unalias
, unalias
, 1, INF
,
157 S_unhash
, dounhash
, 0, 0,
158 S_unlimit
, dounlimit
, 0, INF
,
159 S_unset
, unset
, 1, INF
,
160 S_unsetenv
, dounsetenv
, 1, INF
,
161 S_wait
, dowait
, 0, 0,
162 S_while
, dowhile
, 1, INF
,
164 int nbfunc
= sizeof bfunc
/ sizeof *bfunc
;
186 struct srch srchn
[] = {
205 int nsrchn
= sizeof srchn
/ sizeof *srchn
;