1198090Srdivacky/*- 2198090Srdivacky * This code is derived from OpenBSD's libc/regex, original license follows: 3198090Srdivacky * 4198090Srdivacky * Copyright (c) 1992, 1993, 1994 Henry Spencer. 5198090Srdivacky * Copyright (c) 1992, 1993, 1994 6198090Srdivacky * The Regents of the University of California. All rights reserved. 7198090Srdivacky * 8198090Srdivacky * This code is derived from software contributed to Berkeley by 9198090Srdivacky * Henry Spencer. 10198090Srdivacky * 11198090Srdivacky * Redistribution and use in source and binary forms, with or without 12198090Srdivacky * modification, are permitted provided that the following conditions 13198090Srdivacky * are met: 14198090Srdivacky * 1. Redistributions of source code must retain the above copyright 15198090Srdivacky * notice, this list of conditions and the following disclaimer. 16198090Srdivacky * 2. Redistributions in binary form must reproduce the above copyright 17198090Srdivacky * notice, this list of conditions and the following disclaimer in the 18198090Srdivacky * documentation and/or other materials provided with the distribution. 19198090Srdivacky * 3. Neither the name of the University nor the names of its contributors 20198090Srdivacky * may be used to endorse or promote products derived from this software 21198090Srdivacky * without specific prior written permission. 22198090Srdivacky * 23198090Srdivacky * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24198090Srdivacky * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25198090Srdivacky * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26198090Srdivacky * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27198090Srdivacky * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28198090Srdivacky * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29198090Srdivacky * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30198090Srdivacky * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31198090Srdivacky * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32198090Srdivacky * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33198090Srdivacky * SUCH DAMAGE. 34198090Srdivacky * 35198090Srdivacky * @(#)utils.h 8.3 (Berkeley) 3/20/94 36198090Srdivacky */ 37198090Srdivacky 38276479Sdim#ifndef LLVM_SUPPORT_REGUTILS_H 39276479Sdim#define LLVM_SUPPORT_REGUTILS_H 40276479Sdim 41198090Srdivacky/* utility definitions */ 42198090Srdivacky#define NC (CHAR_MAX - CHAR_MIN + 1) 43198090Srdivackytypedef unsigned char uch; 44198090Srdivacky 45198090Srdivacky/* switch off assertions (if not already off) if no REDEBUG */ 46198090Srdivacky#ifndef REDEBUG 47198090Srdivacky#ifndef NDEBUG 48198090Srdivacky#define NDEBUG /* no assertions please */ 49198090Srdivacky#endif 50198090Srdivacky#endif 51198090Srdivacky#include <assert.h> 52198090Srdivacky 53198090Srdivacky/* for old systems with bcopy() but no memmove() */ 54198090Srdivacky#ifdef USEBCOPY 55198090Srdivacky#define memmove(d, s, c) bcopy(s, d, c) 56198090Srdivacky#endif 57276479Sdim 58276479Sdim#endif 59