Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / include / regex / regcustom.h
blob7362c57d9b1d00bcf5fe701ac5d25775dfe19bfd
1 /*
2 * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
4 * Development of this software was funded, in part, by Cray Research Inc.,
5 * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
6 * Corporation, none of whom are responsible for the results. The author
7 * thanks all of them.
9 * Redistribution and use in source and binary forms -- with or without
10 * modification -- are permitted for any purpose, provided that
11 * redistributions in source form retain this entire copyright notice and
12 * indicate the origin and nature of any modifications.
14 * I'd appreciate being given credit for this package in the documentation
15 * of software which uses it, but that is not a requirement.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
19 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20 * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * $PostgreSQL$
31 /* headers if any */
32 #include "postgres.h"
34 #include <ctype.h>
35 #include <limits.h>
37 #include "mb/pg_wchar.h"
40 /* overrides for regguts.h definitions, if any */
41 #define FUNCPTR(name, args) (*name) args
42 #define MALLOC(n) malloc(n)
43 #define FREE(p) free(VS(p))
44 #define REALLOC(p,n) realloc(VS(p),n)
45 #define assert(x) Assert(x)
47 /* internal character type and related */
48 typedef pg_wchar chr; /* the type itself */
49 typedef unsigned uchr; /* unsigned type that will hold a chr */
50 typedef int celt; /* type to hold chr, or NOCELT */
52 #define NOCELT (-1) /* celt value which is not valid chr */
53 #define CHR(c) ((unsigned char) (c)) /* turn char literal into chr literal */
54 #define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */
55 #define CHRBITS 32 /* bits in a chr; must not use sizeof */
56 #define CHR_MIN 0x00000000 /* smallest and largest chr; the value */
57 #define CHR_MAX 0xfffffffe /* CHR_MAX-CHR_MIN+1 should fit in uchr */
59 /* functions operating on chr */
60 #define iscalnum(x) pg_wc_isalnum(x)
61 #define iscalpha(x) pg_wc_isalpha(x)
62 #define iscdigit(x) pg_wc_isdigit(x)
63 #define iscspace(x) pg_wc_isspace(x)
65 /* and pick up the standard header */
66 #include "regex.h"