exec.h revision 20425
1147072Sbrooks/*-
2147072Sbrooks * Copyright (c) 1991, 1993
3147072Sbrooks *	The Regents of the University of California.  All rights reserved.
4147072Sbrooks *
5147072Sbrooks * This code is derived from software contributed to Berkeley by
6147072Sbrooks * Kenneth Almquist.
7147072Sbrooks *
8147072Sbrooks * Redistribution and use in source and binary forms, with or without
9147072Sbrooks * modification, are permitted provided that the following conditions
10147072Sbrooks * are met:
11147072Sbrooks * 1. Redistributions of source code must retain the above copyright
12147072Sbrooks *    notice, this list of conditions and the following disclaimer.
13147072Sbrooks * 2. Redistributions in binary form must reproduce the above copyright
14147072Sbrooks *    notice, this list of conditions and the following disclaimer in the
15147072Sbrooks *    documentation and/or other materials provided with the distribution.
16147072Sbrooks * 3. All advertising materials mentioning features or use of this software
17147072Sbrooks *    must display the following acknowledgement:
18147072Sbrooks *	This product includes software developed by the University of
19147072Sbrooks *	California, Berkeley and its contributors.
20147072Sbrooks * 4. Neither the name of the University nor the names of its contributors
21147072Sbrooks *    may be used to endorse or promote products derived from this software
22147072Sbrooks *    without specific prior written permission.
23147072Sbrooks *
24147072Sbrooks * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25147072Sbrooks * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26147072Sbrooks * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27147072Sbrooks * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28147072Sbrooks * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29147072Sbrooks * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30147072Sbrooks * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31147072Sbrooks * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32147072Sbrooks * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33147072Sbrooks * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34147072Sbrooks * SUCH DAMAGE.
35147072Sbrooks *
36147072Sbrooks *	@(#)exec.h	8.3 (Berkeley) 6/8/95
37147072Sbrooks *	$Id: exec.h,v 1.3 1996/09/01 10:20:05 peter Exp $
38147072Sbrooks */
39147072Sbrooks
40147072Sbrooks/* values of cmdtype */
41147072Sbrooks#define CMDUNKNOWN -1		/* no entry in table for command */
42147072Sbrooks#define CMDNORMAL 0		/* command is an executable program */
43149399Sbrooks#define CMDBUILTIN 1		/* command is a shell builtin */
44149399Sbrooks#define CMDFUNCTION 2		/* command is a shell function */
45149399Sbrooks
46147072Sbrooks
47147072Sbrooksstruct cmdentry {
48147072Sbrooks	int cmdtype;
49147072Sbrooks	union param {
50147072Sbrooks		int index;
51147072Sbrooks		union node *func;
52147072Sbrooks	} u;
53147072Sbrooks};
54147072Sbrooks
55147072Sbrooks
56147072Sbrooksextern char *pathopt;		/* set by padvance */
57147072Sbrooksextern int exerrno;		/* last exec error */
58147072Sbrooks
59147072Sbrooksvoid shellexec __P((char **, char **, char *, int));
60147072Sbrookschar *padvance __P((char **, char *));
61147072Sbrooksint hashcmd __P((int, char **));
62147072Sbrooksvoid find_command __P((char *, struct cmdentry *, int, char *));
63147072Sbrooksint find_builtin __P((char *));
64147072Sbrooksvoid hashcd __P((void));
65147072Sbrooksvoid changepath __P((const char *));
66147072Sbrooksvoid deletefuncs __P((void));
67147072Sbrooksvoid getcmdentry __P((char *, struct cmdentry *));
68147072Sbrooksvoid addcmdentry __P((char *, struct cmdentry *));
69147072Sbrooksvoid defun __P((char *, union node *));
70147072Sbrooksint unsetfunc __P((char *));
71147072Sbrooks