stdd.h revision 95060
1273635Smav/*	$OpenBSD: stdd.h,v 1.4 1999/11/09 18:16:18 deraadt Exp $	*/
2273635Smav/*	$NetBSD: stdd.h,v 1.2 1995/09/28 05:37:50 tls Exp $	*/
3273635Smav
4273635Smav/*-
5273635Smav * Copyright (c) 1991, 1993
6273635Smav *	The Regents of the University of California.  All rights reserved.
7273635Smav *
8273635Smav * This code is derived from software contributed to Berkeley by
9273635Smav * Ozan Yigit at York University.
10273635Smav *
11273635Smav * Redistribution and use in source and binary forms, with or without
12273635Smav * modification, are permitted provided that the following conditions
13273635Smav * are met:
14273635Smav * 1. Redistributions of source code must retain the above copyright
15273635Smav *    notice, this list of conditions and the following disclaimer.
16273635Smav * 2. Redistributions in binary form must reproduce the above copyright
17273635Smav *    notice, this list of conditions and the following disclaimer in the
18273635Smav *    documentation and/or other materials provided with the distribution.
19273635Smav * 3. All advertising materials mentioning features or use of this software
20273635Smav *    must display the following acknowledgement:
21273635Smav *	This product includes software developed by the University of
22273635Smav *	California, Berkeley and its contributors.
23273635Smav * 4. Neither the name of the University nor the names of its contributors
24273635Smav *    may be used to endorse or promote products derived from this software
25273635Smav *    without specific prior written permission.
26273635Smav *
27273635Smav * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28273635Smav * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29273635Smav * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30273635Smav * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31273635Smav * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32273635Smav * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33273635Smav * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34273635Smav * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35273635Smav * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36273635Smav * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37273635Smav * SUCH DAMAGE.
38273635Smav *
39273635Smav *	@(#)stdd.h	8.1 (Berkeley) 6/6/93
40273635Smav * $FreeBSD: head/usr.bin/m4/stdd.h 95060 2002-04-19 17:26:21Z jmallett $
41273635Smav */
42273635Smav
43273635Smav/*
44273635Smav * standard defines
45273635Smav */
46273635Smav
47273635Smav#define max(a,b) ((a) > (b)? (a): (b))
48273635Smav#define min(a,b) ((a) < (b)? (a): (b))
49273635Smav
50273635Smav#define iswhite(c) ((c) == ' ' || (c) == '\t')
51273635Smav
52273635Smav/*
53273635Smav * STREQ is an optimised strcmp(a,b)==0
54273635Smav * STREQN is an optimised strncmp(a,b,n)==0; assumes n > 0
55273635Smav */
56273635Smav#define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0)
57273635Smav#define STREQN(a, b, n) ((a)[0] == (b)[0] && strncmp(a, b, n) == 0)
58273635Smav
59273635Smav#define YES 1
60274797Strasz#define NO 0
61273635Smav