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