00001 /* $OpenBSD: utils.h,v 1.4 2003/06/02 20:18:36 millert Exp $ */ 00002 00003 /*- 00004 * Copyright (c) 1992, 1993, 1994 Henry Spencer. 00005 * Copyright (c) 1992, 1993, 1994 00006 * The Regents of the University of California. All rights reserved. 00007 * 00008 * This code is derived from software contributed to Berkeley by 00009 * Henry Spencer. 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions 00013 * are met: 00014 * 1. Redistributions of source code must retain the above copyright 00015 * notice, this list of conditions and the following disclaimer. 00016 * 2. Redistributions in binary form must reproduce the above copyright 00017 * notice, this list of conditions and the following disclaimer in the 00018 * documentation and/or other materials provided with the distribution. 00019 * 3. Neither the name of the University nor the names of its contributors 00020 * may be used to endorse or promote products derived from this software 00021 * without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00024 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00025 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00026 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00027 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00028 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00029 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00030 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00032 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00033 * SUCH DAMAGE. 00034 * 00035 * @(#)utils.h 8.3 (Berkeley) 3/20/94 00036 */ 00037 00038 /* utility definitions */ 00039 #define DUPMAX _POSIX2_RE_DUP_MAX /* xxx is this right? */ 00040 #define INFINITY (DUPMAX + 1) 00041 #define NC (CHAR_MAX - CHAR_MIN + 1) 00042 typedef unsigned char uch; 00043 00044 /* switch off assertions (if not already off) if no REDEBUG */ 00045 #ifndef REDEBUG 00046 #ifndef NDEBUG 00047 #define NDEBUG /* no assertions please */ 00048 #endif 00049 #endif 00050 #include <assert.h> 00051 00052 /* for old systems with bcopy() but no memmove() */ 00053 #ifdef USEBCOPY 00054 #define memmove(d, s, c) bcopy(s, d, c) 00055 #endif
1.6.3