shell.h revision 218626
1279377Simp/*-
2279377Simp * Copyright (c) 1991, 1993
3279377Simp *	The Regents of the University of California.  All rights reserved.
4279377Simp *
5279377Simp * This code is derived from software contributed to Berkeley by
6279377Simp * Kenneth Almquist.
7279377Simp *
8279377Simp * Redistribution and use in source and binary forms, with or without
9279377Simp * modification, are permitted provided that the following conditions
10279377Simp * are met:
11279377Simp * 1. Redistributions of source code must retain the above copyright
12279377Simp *    notice, this list of conditions and the following disclaimer.
13279377Simp * 2. Redistributions in binary form must reproduce the above copyright
14279377Simp *    notice, this list of conditions and the following disclaimer in the
15279377Simp *    documentation and/or other materials provided with the distribution.
16279377Simp * 4. Neither the name of the University nor the names of its contributors
17279377Simp *    may be used to endorse or promote products derived from this software
18279377Simp *    without specific prior written permission.
19279377Simp *
20279377Simp * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21279377Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22279377Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23279377Simp * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24279377Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25279377Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26279377Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27279377Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28279377Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29279377Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30279377Simp * SUCH DAMAGE.
31279377Simp *
32279377Simp *	@(#)shell.h	8.2 (Berkeley) 5/4/95
33279377Simp * $FreeBSD: head/bin/sh/shell.h 218626 2011-02-12 23:44:05Z jilles $
34279377Simp */
35279377Simp
36279377Simp#ifndef SHELL_H_
37279377Simp#define SHELL_H_
38279377Simp
39279377Simp#include <inttypes.h>
40279377Simp
41279377Simp/*
42279377Simp * The follow should be set to reflect the type of system you have:
43279377Simp *	JOBS -> 1 if you have Berkeley job control, 0 otherwise.
44279377Simp *	define DEBUG=1 to compile in debugging (set global "debug" to turn on)
45279377Simp *	define DEBUG=2 to compile in and turn on debugging.
46279377Simp *
47279377Simp * When debugging is on, debugging info will be written to ./trace and
48279377Simp * a quit signal will generate a core dump.
49279377Simp */
50279377Simp
51279377Simp
52279377Simp#define	JOBS 1
53279377Simp/* #define DEBUG 1 */
54279377Simp
55279377Simp/*
56279377Simp * Type of used arithmetics. SUSv3 requires us to have at least signed long.
57279377Simp */
58279377Simptypedef intmax_t arith_t;
59279377Simp#define	ARITH_FORMAT_STR  "%" PRIdMAX
60279377Simp#define	atoarith_t(arg)  strtoimax(arg, NULL, 0)
61279377Simp#define	strtoarith_t(nptr, endptr, base)  strtoimax(nptr, endptr, base)
62279377Simp#define	ARITH_MIN INTMAX_MIN
63279377Simp#define	ARITH_MAX INTMAX_MAX
64279377Simp
65279377Simptypedef void *pointer;
66279377Simp#define MKINIT  /* empty */
67279377Simp
68279377Simp#include <sys/cdefs.h>
69279377Simp
70279377Simpextern char nullstr[1];		/* null string */
71279377Simp
72279377Simp#ifdef DEBUG
73279377Simp#define TRACE(param)  sh_trace param
74279377Simp#else
75279377Simp#define TRACE(param)
76279377Simp#endif
77279377Simp
78279377Simp#endif /* !SHELL_H_ */
79279377Simp