1f0957ccaSPeter Wemm /* $NetBSD: utils.h,v 1.1.1.2 2008/05/18 14:31:39 aymeric Exp $ */ 2f0957ccaSPeter Wemm 3f0957ccaSPeter Wemm /*- 4f0957ccaSPeter Wemm * Copyright (c) 1992, 1993, 1994 Henry Spencer. 5f0957ccaSPeter Wemm * Copyright (c) 1992, 1993, 1994 6f0957ccaSPeter Wemm * The Regents of the University of California. All rights reserved. 7f0957ccaSPeter Wemm * 8f0957ccaSPeter Wemm * This code is derived from software contributed to Berkeley by 9f0957ccaSPeter Wemm * Henry Spencer of the University of Toronto. 10f0957ccaSPeter Wemm * 11f0957ccaSPeter Wemm * Redistribution and use in source and binary forms, with or without 12f0957ccaSPeter Wemm * modification, are permitted provided that the following conditions 13f0957ccaSPeter Wemm * are met: 14f0957ccaSPeter Wemm * 1. Redistributions of source code must retain the above copyright 15f0957ccaSPeter Wemm * notice, this list of conditions and the following disclaimer. 16f0957ccaSPeter Wemm * 2. Redistributions in binary form must reproduce the above copyright 17f0957ccaSPeter Wemm * notice, this list of conditions and the following disclaimer in the 18f0957ccaSPeter Wemm * documentation and/or other materials provided with the distribution. 19*c271fa92SBaptiste Daroussin * 3. Neither the name of the University nor the names of its contributors 20f0957ccaSPeter Wemm * may be used to endorse or promote products derived from this software 21f0957ccaSPeter Wemm * without specific prior written permission. 22f0957ccaSPeter Wemm * 23f0957ccaSPeter Wemm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24f0957ccaSPeter Wemm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25f0957ccaSPeter Wemm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26f0957ccaSPeter Wemm * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27f0957ccaSPeter Wemm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28f0957ccaSPeter Wemm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29f0957ccaSPeter Wemm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30f0957ccaSPeter Wemm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31f0957ccaSPeter Wemm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32f0957ccaSPeter Wemm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33f0957ccaSPeter Wemm * SUCH DAMAGE. 34f0957ccaSPeter Wemm * 35f0957ccaSPeter Wemm * @(#)utils.h 8.2 (Berkeley) 3/16/94 36f0957ccaSPeter Wemm */ 37f0957ccaSPeter Wemm 38f0957ccaSPeter Wemm /* utility definitions */ 39f0957ccaSPeter Wemm #define DUPMAX _POSIX2_RE_DUP_MAX /* xxx is this right? */ 40f0957ccaSPeter Wemm #define INFINITY (DUPMAX + 1) 41f0957ccaSPeter Wemm #define NC (CHAR_MAX - CHAR_MIN + 1) 42f0957ccaSPeter Wemm typedef unsigned char uch; 43f0957ccaSPeter Wemm 44f0957ccaSPeter Wemm /* switch off assertions (if not already off) if no REDEBUG */ 45f0957ccaSPeter Wemm #ifndef REDEBUG 46f0957ccaSPeter Wemm #ifndef NDEBUG 47f0957ccaSPeter Wemm #define NDEBUG /* no assertions please */ 48f0957ccaSPeter Wemm #endif 49f0957ccaSPeter Wemm #endif 50f0957ccaSPeter Wemm #include <assert.h> 51f0957ccaSPeter Wemm 52f0957ccaSPeter Wemm /* for old systems with bcopy() but no memmove() */ 53f0957ccaSPeter Wemm #ifdef USEBCOPY 54f0957ccaSPeter Wemm #define memmove(d, s, c) bcopy(s, d, c) 55f0957ccaSPeter Wemm #endif 56