stdd.h revision 100014
195060Sjmallett/* $OpenBSD: stdd.h,v 1.4 1999/11/09 18:16:18 deraadt Exp $ */ 295060Sjmallett/* $NetBSD: stdd.h,v 1.2 1995/09/28 05:37:50 tls Exp $ */ 395060Sjmallett 41590Srgrimes/*- 51590Srgrimes * Copyright (c) 1991, 1993 61590Srgrimes * The Regents of the University of California. All rights reserved. 71590Srgrimes * 81590Srgrimes * This code is derived from software contributed to Berkeley by 91590Srgrimes * Ozan Yigit at York University. 101590Srgrimes * 111590Srgrimes * Redistribution and use in source and binary forms, with or without 121590Srgrimes * modification, are permitted provided that the following conditions 131590Srgrimes * are met: 141590Srgrimes * 1. Redistributions of source code must retain the above copyright 151590Srgrimes * notice, this list of conditions and the following disclaimer. 161590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 171590Srgrimes * notice, this list of conditions and the following disclaimer in the 181590Srgrimes * documentation and/or other materials provided with the distribution. 191590Srgrimes * 3. All advertising materials mentioning features or use of this software 201590Srgrimes * must display the following acknowledgement: 211590Srgrimes * This product includes software developed by the University of 221590Srgrimes * California, Berkeley and its contributors. 231590Srgrimes * 4. Neither the name of the University nor the names of its contributors 241590Srgrimes * may be used to endorse or promote products derived from this software 251590Srgrimes * without specific prior written permission. 261590Srgrimes * 271590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 281590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 291590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 301590Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 311590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 321590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 331590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 341590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 351590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 361590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 371590Srgrimes * SUCH DAMAGE. 381590Srgrimes * 391590Srgrimes * @(#)stdd.h 8.1 (Berkeley) 6/6/93 4095060Sjmallett * $FreeBSD: head/usr.bin/m4/stdd.h 100014 2002-07-15 02:15:12Z jmallett $ 411590Srgrimes */ 421590Srgrimes 431590Srgrimes/* 441590Srgrimes * standard defines 451590Srgrimes */ 461590Srgrimes 471590Srgrimes#define max(a,b) ((a) > (b)? (a): (b)) 481590Srgrimes#define min(a,b) ((a) < (b)? (a): (b)) 491590Srgrimes 501590Srgrimes#define iswhite(c) ((c) == ' ' || (c) == '\t') 511590Srgrimes 52100014Sjmallett/* 53100014Sjmallett * STREQ is an optimised strcmp(a,b)==0 54100014Sjmallett * STREQN is an optimised strncmp(a,b,n)==0; assumes n > 0 551590Srgrimes */ 561590Srgrimes#define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0) 571590Srgrimes#define STREQN(a, b, n) ((a)[0] == (b)[0] && strncmp(a, b, n) == 0) 581590Srgrimes 591590Srgrimes#define YES 1 601590Srgrimes#define NO 0 61