]>
Commit | Line | Data |
---|---|---|
34cbe514 RN |
1 | #ifndef _REGEX_CUSTOM_H_ |
2 | #define _REGEX_CUSTOM_H_ | |
3 | ||
c0a7edde RN |
4 | /* |
5 | * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. | |
6 | * | |
7 | * Development of this software was funded, in part, by Cray Research Inc., | |
8 | * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics | |
9 | * Corporation, none of whom are responsible for the results. The author | |
10 | * thanks all of them. | |
11 | * | |
12 | * Redistribution and use in source and binary forms -- with or without | |
13 | * modification -- are permitted for any purpose, provided that | |
14 | * redistributions in source form retain this entire copyright notice and | |
15 | * indicate the origin and nature of any modifications. | |
16 | * | |
17 | * I'd appreciate being given credit for this package in the documentation | |
18 | * of software which uses it, but that is not a requirement. | |
19 | * | |
20 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | |
21 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY | |
22 | * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | |
23 | * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
30 | * | |
31 | * $Id$ | |
32 | */ | |
33 | ||
34 | /* headers if any */ | |
04fdd873 | 35 | |
34cbe514 RN |
36 | /* FreeBSD, Watcom and DMars require this, CW doesn't have nor need it. */ |
37 | /* Others also don't seem to need it. If you have an error related to */ | |
38 | /* (not) including <sys/types.h> please report details to */ | |
39 | /* wx-dev@lists.wxwindows.org */ | |
04fdd873 DS |
40 | #if defined(__UNIX__) || defined(__WATCOMC__) || defined(__DIGITALMARS__) |
41 | # include <sys/types.h> | |
42 | #endif | |
43 | ||
c0a7edde RN |
44 | #include <stdio.h> |
45 | #include <stdlib.h> | |
86d35a44 | 46 | #include <string.h> |
c0a7edde RN |
47 | #include <ctype.h> |
48 | #include <limits.h> | |
c0a7edde | 49 | |
539fb7a2 | 50 | #include "wx/wxchar.h" |
34cbe514 RN |
51 | |
52 | /** | |
53 | * | |
54 | * wx_wchar == wxChar | |
55 | * | |
56 | */ | |
57 | #define wx_wchar wxChar | |
c0a7edde RN |
58 | |
59 | /* overrides for regguts.h definitions, if any */ | |
60 | #define FUNCPTR(name, args) (*name) args | |
61 | #define MALLOC(n) malloc(n) | |
62 | #define FREE(p) free(VS(p)) | |
63 | #define REALLOC(p,n) realloc(VS(p),n) | |
64 | ||
65 | /* internal character type and related */ | |
66 | typedef wx_wchar chr; /* the type itself */ | |
80e10e8b RN |
67 | typedef unsigned long uchr; /* unsigned type that will hold a chr */ |
68 | typedef long celt; /* type to hold chr, MCCE number, or | |
c0a7edde RN |
69 | * NOCELT */ |
70 | ||
71 | #define NOCELT (-1) /* celt value which is not valid chr or | |
72 | * MCCE */ | |
73 | #define CHR(c) ((unsigned char) (c)) /* turn char literal into chr | |
74 | * literal */ | |
75 | #define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */ | |
80e10e8b | 76 | |
2f3f4369 RN |
77 | #if wxUSE_WCHAR_T |
78 | # define CHRBITS (SIZEOF_WCHAR_T << 3) /* bits in a chr; must not use sizeof */ | |
79 | # define CHR_MAX ((1 << CHRBITS) - 1) | |
80 | # define CHR_MIN 0x00000000 /* smallest and largest chr; the value */ | |
81 | #else /*ANSI*/ | |
82 | # define CHRBITS 8 | |
83 | # define CHR_MAX 0xFF | |
84 | # define CHR_MIN 0x00 | |
85 | #endif /*wxUSE_WCHAR_T*/ | |
c0a7edde RN |
86 | |
87 | /* functions operating on chr */ | |
88 | #define iscalnum(x) wx_isalnum(x) | |
89 | #define iscalpha(x) wx_isalpha(x) | |
90 | #define iscdigit(x) wx_isdigit(x) | |
91 | #define iscspace(x) wx_isspace(x) | |
92 | ||
b8f896a1 RN |
93 | extern int wx_strlen(const wx_wchar* szString); |
94 | ||
c0a7edde RN |
95 | /* and pick up the standard header */ |
96 | #include "regex.h" | |
34cbe514 | 97 | |
539fb7a2 | 98 | #endif /* _REGEX_CUSTOM_H_ */ |