shell.h revision 218626
1159720Syar/*- 2159720Syar * Copyright (c) 1991, 1993 3159720Syar * The Regents of the University of California. All rights reserved. 4159720Syar * 5159720Syar * This code is derived from software contributed to Berkeley by 6159720Syar * Kenneth Almquist. 7159720Syar * 8159720Syar * Redistribution and use in source and binary forms, with or without 9159720Syar * modification, are permitted provided that the following conditions 10159720Syar * are met: 11159720Syar * 1. Redistributions of source code must retain the above copyright 12159720Syar * notice, this list of conditions and the following disclaimer. 13159720Syar * 2. Redistributions in binary form must reproduce the above copyright 14159720Syar * notice, this list of conditions and the following disclaimer in the 15159720Syar * documentation and/or other materials provided with the distribution. 16159720Syar * 4. Neither the name of the University nor the names of its contributors 17159720Syar * may be used to endorse or promote products derived from this software 18159720Syar * without specific prior written permission. 19159720Syar * 20159720Syar * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21159720Syar * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22159720Syar * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23159720Syar * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24159720Syar * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25159720Syar * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26159720Syar * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27159720Syar * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28159720Syar * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29159720Syar * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30159720Syar * SUCH DAMAGE. 31159720Syar * 32159720Syar * @(#)shell.h 8.2 (Berkeley) 5/4/95 33159720Syar * $FreeBSD: head/bin/sh/shell.h 218626 2011-02-12 23:44:05Z jilles $ 34159720Syar */ 35159720Syar 36159720Syar#ifndef SHELL_H_ 37159720Syar#define SHELL_H_ 38159720Syar 39159720Syar#include <inttypes.h> 40159720Syar 41159720Syar/* 42159720Syar * The follow should be set to reflect the type of system you have: 43159720Syar * JOBS -> 1 if you have Berkeley job control, 0 otherwise. 44159720Syar * define DEBUG=1 to compile in debugging (set global "debug" to turn on) 45159720Syar * define DEBUG=2 to compile in and turn on debugging. 46159720Syar * 47159720Syar * When debugging is on, debugging info will be written to ./trace and 48159720Syar * a quit signal will generate a core dump. 49159720Syar */ 50159720Syar 51159720Syar 52159720Syar#define JOBS 1 53159720Syar/* #define DEBUG 1 */ 54159720Syar 55159720Syar/* 56159720Syar * Type of used arithmetics. SUSv3 requires us to have at least signed long. 57159720Syar */ 58159720Syartypedef intmax_t arith_t; 59159720Syar#define ARITH_FORMAT_STR "%" PRIdMAX 60159720Syar#define atoarith_t(arg) strtoimax(arg, NULL, 0) 61159720Syar#define strtoarith_t(nptr, endptr, base) strtoimax(nptr, endptr, base) 62159720Syar#define ARITH_MIN INTMAX_MIN 63159720Syar#define ARITH_MAX INTMAX_MAX 64159720Syar 65159720Syartypedef void *pointer; 66159720Syar#define MKINIT /* empty */ 67159720Syar 68159720Syar#include <sys/cdefs.h> 69159720Syar 70159720Syarextern char nullstr[1]; /* null string */ 71159720Syar 72159720Syar#ifdef DEBUG 73159720Syar#define TRACE(param) sh_trace param 74159720Syar#else 75159720Syar#define TRACE(param) 76159720Syar#endif 77159720Syar 78159720Syar#endif /* !SHELL_H_ */ 79159720Syar