shell.h revision 178625
111397Sswallace/*-
211397Sswallace * Copyright (c) 1991, 1993
311397Sswallace *	The Regents of the University of California.  All rights reserved.
411397Sswallace *
560290Sbde * This code is derived from software contributed to Berkeley by
6227692Sed * Kenneth Almquist.
711397Sswallace *
811397Sswallace * Redistribution and use in source and binary forms, with or without
911397Sswallace * modification, are permitted provided that the following conditions
1011397Sswallace * are met:
1111397Sswallace * 1. Redistributions of source code must retain the above copyright
1224384Speter *    notice, this list of conditions and the following disclaimer.
13134267Sjhb * 2. Redistributions in binary form must reproduce the above copyright
14191920Sed *    notice, this list of conditions and the following disclaimer in the
15164184Strhodes *    documentation and/or other materials provided with the distribution.
16123786Speter * 4. Neither the name of the University nor the names of its contributors
17123786Speter *    may be used to endorse or promote products derived from this software
18161330Sjhb *    without specific prior written permission.
19161330Sjhb *
2036735Sdfr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2136735Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2283366Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2383366Sjulian * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2436771Sbde * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2536771Sbde * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2636735Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27123786Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28123786Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29123786Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30123786Speter * SUCH DAMAGE.
31123786Speter *
32123786Speter *	@(#)shell.h	8.2 (Berkeley) 5/4/95
33123786Speter * $FreeBSD: head/bin/sh/shell.h 178625 2008-04-27 20:46:45Z stefanf $
34123786Speter */
35123786Speter
36123786Speter#ifndef SHELL_H_
37123786Speter#define SHELL_H_
38123786Speter
3911397Sswallace#include <inttypes.h>
40123786Speter
41123786Speter/*
42123786Speter * The follow should be set to reflect the type of system you have:
43123786Speter *	JOBS -> 1 if you have Berkeley job control, 0 otherwise.
4411397Sswallace *	define DEBUG=1 to compile in debugging (set global "debug" to turn on)
45123786Speter *	define DEBUG=2 to compile in and turn on debugging.
46123786Speter *
47123786Speter * When debugging is on, debugging info will be written to $HOME/trace and
48123786Speter * a quit signal will generate a core dump.
4911397Sswallace */
50123786Speter
51123786Speter
52123786Speter#define	JOBS 1
5311397Sswallace/* #define DEBUG 1 */
54123786Speter
55123786Speter/*
5611397Sswallace * Type of used arithmetics. SUSv3 requires us to have at least signed long.
57123786Speter */
58123786Spetertypedef intmax_t arith_t;
59123786Speter#define	ARITH_FORMAT_STR  "%" PRIdMAX
6011397Sswallace#define	atoarith_t(arg)  strtoimax(arg, NULL, 0)
61123786Speter#define	strtoarith_t(nptr, endptr, base)  strtoimax(nptr, endptr, base)
62123786Speter
6311397Sswallacetypedef void *pointer;
64123786Speter#define STATIC  static
65123786Speter#define MKINIT  /* empty */
6611397Sswallace
67123786Speter#include <sys/cdefs.h>
68123786Speter
69123786Speterextern char nullstr[1];		/* null string */
70123786Speter
7111397Sswallace#ifdef DEBUG
72123786Speter#define TRACE(param)  sh_trace param
73123786Speter#else
74123786Speter#define TRACE(param)
7511397Sswallace#endif
76123786Speter
77123786Speter#endif /* !SHELL_H_ */
78123786Speter