diff --git a/.gitignore b/.gitignore index f044cf4928..3b18b4ed2b 100644 --- a/.gitignore +++ b/.gitignore @@ -318,11 +318,6 @@ # /src/msw/ /src/msw/Makefile.in -# /src/regex/ -/src/regex/Debug -/src/regex/Release -/src/regex/*.vcl - # /src/zlib/ /src/zlib/zlibM*Data /src/zlib/zlibM5.mcp diff --git a/Makefile.in b/Makefile.in index 6d5cbdf933..d8352bfaa4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -33946,7 +33946,6 @@ PNGDIR = $(WXDIR)/src/png JPEGDIR = $(WXDIR)/src/jpeg TIFFDIR = $(WXDIR)/src/tiff ZLIBDIR = $(WXDIR)/src/zlib -REGEXDIR = $(WXDIR)/src/regex EXPATDIR = $(WXDIR)/src/expat GTKDIR = $(WXDIR)/src/gtk X11DIR = $(WXDIR)/src/x11 @@ -34028,11 +34027,6 @@ ALL_DIST: distrib_clean $(CP_P) $(ZLIBDIR)/*.c $(DISTDIR)/src/zlib $(CP_P) $(ZLIBDIR)/README $(DISTDIR)/src/zlib #$(CP_P) $(ZLIBDIR)/*.mms $(DISTDIR)/src/zlib - mkdir $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/*.h $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/*.c $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/COPYRIGHT $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/README $(DISTDIR)/src/regex $(CP_PR) $(EXPATDIR) $(DISTDIR)/src/expat #(cd $(DISTDIR)/src/expat ; rm -rf `find -name CVS`) # copy some files from include/ that are not installed: diff --git a/build/bakefiles/make_dist.mk b/build/bakefiles/make_dist.mk index abdb67c021..a12644a456 100644 --- a/build/bakefiles/make_dist.mk +++ b/build/bakefiles/make_dist.mk @@ -23,7 +23,6 @@ PNGDIR = $(WXDIR)/src/png JPEGDIR = $(WXDIR)/src/jpeg TIFFDIR = $(WXDIR)/src/tiff ZLIBDIR = $(WXDIR)/src/zlib -REGEXDIR = $(WXDIR)/src/regex EXPATDIR = $(WXDIR)/src/expat GTKDIR = $(WXDIR)/src/gtk X11DIR = $(WXDIR)/src/x11 @@ -105,11 +104,6 @@ ALL_DIST: distrib_clean $(CP_P) $(ZLIBDIR)/*.c $(DISTDIR)/src/zlib $(CP_P) $(ZLIBDIR)/README $(DISTDIR)/src/zlib #$(CP_P) $(ZLIBDIR)/*.mms $(DISTDIR)/src/zlib - mkdir $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/*.h $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/*.c $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/COPYRIGHT $(DISTDIR)/src/regex - $(CP_P) $(REGEXDIR)/README $(DISTDIR)/src/regex $(CP_PR) $(EXPATDIR) $(DISTDIR)/src/expat #(cd $(DISTDIR)/src/expat ; rm -rf `find -name CVS`) # copy some files from include/ that are not installed: diff --git a/build/osx/wx.xcconfig b/build/osx/wx.xcconfig index b588167e91..4f60c8187f 100644 --- a/build/osx/wx.xcconfig +++ b/build/osx/wx.xcconfig @@ -10,7 +10,7 @@ OTHER_CPLUSPLUSFLAGS = $(OTHER_CFLAGS) -fvisibility-inlines-hidden -Wno-deprecat GCC_PREFIX_HEADER = $(WXROOT)/include/wx/wxprec.h GCC_PRECOMPILE_PREFIX_HEADER = YES -HEADER_SEARCH_PATHS = "$(WXROOT)/src/tiff/libtiff" "$(WXROOT)/src/regex" "$(WXROOT)/3rdparty/pcre/src/wx" +HEADER_SEARCH_PATHS = "$(WXROOT)/src/tiff/libtiff" "$(WXROOT)/3rdparty/pcre/src/wx" USER_HEADER_SEARCH_PATHS = "$(WXROOT)/include" "$(WXROOT)/build/osx/setup/$(WXTOOLKIT)/include" "$(WXROOT)/src/zlib" "$(WXROOT)/src/jpeg" "$(WXROOT)/src/png" "$(WXROOT)/src/expat/expat/lib" "$(WXROOT)/src/tiff/libtiff" "$(WXROOT)/src/stc/scintilla/src" "$(WXROOT)/src/stc/scintilla/include" "$(WXROOT)/src/stc/scintilla/lexlib" "$(WXROOT)/3rdparty/pcre/src/wx" ALWAYS_SEARCH_USER_PATHS = NO WX_PREPROCESSOR_DEFINITIONS = WXBUILDING $(WXPLATFORM) __WX__ _FILE_OFFSET_BITS=64 _LARGE_FILES MACOS_CLASSIC __WXMAC_XCODE__=1 SCI_LEXER WX_PRECOMP=1 wxUSE_UNICODE_UTF8=0 wxUSE_UNICODE_WCHAR=1 HAVE_CONFIG_H PNG_NO_CONFIG_H diff --git a/src/regex/COPYRIGHT b/src/regex/COPYRIGHT deleted file mode 100644 index 22cbb2583f..0000000000 --- a/src/regex/COPYRIGHT +++ /dev/null @@ -1,86 +0,0 @@ -This regular expression package was originally developed by Henry Spencer. -It bears the following copyright notice: - -********************************************************************** - -Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - -Development of this software was funded, in part, by Cray Research Inc., -UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics -Corporation, none of whom are responsible for the results. The author -thanks all of them. - -Redistribution and use in source and binary forms -- with or without -modification -- are permitted for any purpose, provided that -redistributions in source form retain this entire copyright notice and -indicate the origin and nature of any modifications. - -I'd appreciate being given credit for this package in the documentation -of software which uses it, but that is not a requirement. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -********************************************************************** - -wxWindows adopted the code out of Tcl 8.4.5. Portions of regc_locale.c -and re_syntax.n were developed by Tcl developers other than Henry Spencer; -these files bear the Tcl copyright and license notice: - -********************************************************************** - -This software is copyrighted by the Regents of the University of -California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState -Corporation and other parties. The following terms apply to all files -associated with the software unless explicitly disclaimed in -individual files. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -MODIFICATIONS. - -GOVERNMENT USE: If you are acquiring this software on behalf of the -U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal -Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -are acquiring the software on behalf of the Department of Defense, the -software shall be classified as "Commercial Computer Software" and the -Government shall have only "Restricted Rights" as defined in Clause -252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -authors grant the U.S. Government and others acting in its behalf -permission to use and distribute the software in accordance with the -terms specified in this license. - -********************************************************************** - -The wxWindows licence applies to further modifications to regcustom.h -and regc_locale.c. - -**************************************************************************** diff --git a/src/regex/README b/src/regex/README deleted file mode 100644 index 6c763a5556..0000000000 --- a/src/regex/README +++ /dev/null @@ -1,41 +0,0 @@ -wxWindows regex ---------------- -This is a version of Henry Spencer's regex, which was taken from the -source of TCL (Toolkit Command Language). It implements POSIX regular -expressions and also supports Unicode and some Perl5 extensions. - -The modifications made by the wxWindows team are as follows: - -regcustom.h ------------ -Types and constants appropriate for our use of the library are defined -here. - -regex.h -------- -This is unmodified. Note though, that a portion of it (clearly marked) -is copied from regcustom.h as part of the build process. - -regc_locale.c -------------- -This module provides character classifications. - -The current version from Tcl supports only a Unicode build. The -original code from Henry Spencer, on the other hand, was ASCII only. -Therefore, in order to support both, code from the ASCII version has been -incorporated into the Unicode version, conditionally compiled depending -on wxUSE_UNICODE. - -The only non-trivial dependencies were: Tcl_UniCharToUpper, -Tcl_UniCharToLower and Tcl_UniCharToTitle. The implementations of these -have also been incorporated (from Tcl). These in turn depend only the data -tables in tclUniData.c (which is unmodified). At some point wxWindows -may have it's own Unicode character classification code, at which point -these should be used instead. - -Other dependencies (on Tcl_DString) have been eliminated using wxWindows -wxChar functions. - -The ASCII version has also been extended to support character -classifications based on the current locale rather than ASCII only. - diff --git a/src/regex/descrip.mms b/src/regex/descrip.mms deleted file mode 100644 index 07b3dcae6e..0000000000 --- a/src/regex/descrip.mms +++ /dev/null @@ -1,80 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 4 March 2020 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /define=(__WXMOTIF__=1,WXBUILDING=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new)/include=[] -CC_DEFINE = /define=(__WXMOTIF__=1,WXBUILDING=1)/name=(as_is,short)/include=[] -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1,WXBUILDING=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new)/include=[] -CC_DEFINE = /define=(__WXGTK__=1,WXBUILDING=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /include=[] -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1,WXBUILDING=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new)/include=[] -CC_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1,WXBUILDING=1)/float=ieee/name=(as_is,short)\ - /ieee=denorm/include=[] -.else -.ifdef __WXX11__ -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1,WXBUILDING=1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new)/include=[] -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1,WXBUILDING=1)/float=ieee\ - /name=(as_is,short)/include=[] -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS=regcomp.obj,regerror.obj,regexec.obj,regfree.obj,\ - regfronts.obj,tclUniData.obj - -SOURCES=regcomp.c,regc_color.c,regc_cvec.c,regc_lex.c,regc_locale.c,\ - regc_nfa.c,regerror.c,regexec.c,rege_dfa.c,regfree.c,regfronts.c,\ - tclUniData.c - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) -.ifdef __WXMOTIF__ - library [--.lib]libwx_motif.olb $(OBJECTS) -.else -.ifdef __WXGTK__ - library [--.lib]libwx_gtk.olb $(OBJECTS) -.else -.ifdef __WXGTK2__ - library [--.lib]libwx_gtk2.olb $(OBJECTS) -.else -.ifdef __WXX11__ - library [--.lib]libwx_x11_univ.olb $(OBJECTS) -.endif -.endif -.endif -.endif - -$(OBJECTS) : [--.include.wx]setup.h - -regcomp.obj : regcomp.c -regerror.obj : regerror.c -regexec.obj : regexec.c -regfree.obj : regfree.c -regfronts.obj : regfronts.c -tclUniData.obj : tclUniData.c diff --git a/src/regex/re_syntax.n b/src/regex/re_syntax.n deleted file mode 100644 index f37bb85abd..0000000000 --- a/src/regex/re_syntax.n +++ /dev/null @@ -1,970 +0,0 @@ -'\" -'\" Copyright (c) 1998 Sun Microsystems, Inc. -'\" Copyright (c) 1999 Scriptics Corporation -'\" -'\" This software is copyrighted by the Regents of the University of -'\" California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState -'\" Corporation and other parties. The following terms apply to all files -'\" associated with the software unless explicitly disclaimed in -'\" individual files. -'\" -'\" The authors hereby grant permission to use, copy, modify, distribute, -'\" and license this software and its documentation for any purpose, provided -'\" that existing copyright notices are retained in all copies and that this -'\" notice is included verbatim in any distributions. No written agreement, -'\" license, or royalty fee is required for any of the authorized uses. -'\" Modifications to this software may be copyrighted by their authors -'\" and need not follow the licensing terms described here, provided that -'\" the new terms are clearly indicated on the first page of each file where -'\" they apply. -'\" -'\" IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -'\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -'\" ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -'\" DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -'\" POSSIBILITY OF SUCH DAMAGE. -'\" -'\" THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -'\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -'\" FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -'\" IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -'\" NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -'\" MODIFICATIONS. -'\" -'\" GOVERNMENT USE: If you are acquiring this software on behalf of the -'\" U.S. government, the Government shall have only "Restricted Rights" -'\" in the software and related documentation as defined in the Federal -'\" Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -'\" are acquiring the software on behalf of the Department of Defense, the -'\" software shall be classified as "Commercial Computer Software" and the -'\" Government shall have only "Restricted Rights" as defined in Clause -'\" 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -'\" authors grant the U.S. Government and others acting in its behalf -'\" permission to use and distribute the software in accordance with the -'\" terms specified in this license. -'\" -'\" RCS: @(#) Id: re_syntax.n,v 1.3 1999/07/14 19:09:36 jpeek Exp -'\" -.so man.macros -.TH re_syntax n "8.1" Tcl "Tcl Built-In Commands" -.BS -.SH NAME -re_syntax \- Syntax of Tcl regular expressions. -.BE - -.SH DESCRIPTION -.PP -A \fIregular expression\fR describes strings of characters. -It's a pattern that matches certain strings and doesn't match others. - -.SH "DIFFERENT FLAVORS OF REs" -Regular expressions (``RE''s), as defined by POSIX, come in two -flavors: \fIextended\fR REs (``EREs'') and \fIbasic\fR REs (``BREs''). -EREs are roughly those of the traditional \fIegrep\fR, while BREs are -roughly those of the traditional \fIed\fR. This implementation adds -a third flavor, \fIadvanced\fR REs (``AREs''), basically EREs with -some significant extensions. -.PP -This manual page primarily describes AREs. BREs mostly exist for -backward compatibility in some old programs; they will be discussed at -the end. POSIX EREs are almost an exact subset of AREs. Features of -AREs that are not present in EREs will be indicated. - -.SH "REGULAR EXPRESSION SYNTAX" -.PP -Tcl regular expressions are implemented using the package written by -Henry Spencer, based on the 1003.2 spec and some (not quite all) of -the Perl5 extensions (thanks, Henry!). Much of the description of -regular expressions below is copied verbatim from his manual entry. -.PP -An ARE is one or more \fIbranches\fR, -separated by `\fB|\fR', -matching anything that matches any of the branches. -.PP -A branch is zero or more \fIconstraints\fR or \fIquantified atoms\fR, -concatenated. -It matches a match for the first, followed by a match for the second, etc; -an empty branch matches the empty string. -.PP -A quantified atom is an \fIatom\fR possibly followed -by a single \fIquantifier\fR. -Without a quantifier, it matches a match for the atom. -The quantifiers, -and what a so-quantified atom matches, are: -.RS 2 -.TP 6 -\fB*\fR -a sequence of 0 or more matches of the atom -.TP -\fB+\fR -a sequence of 1 or more matches of the atom -.TP -\fB?\fR -a sequence of 0 or 1 matches of the atom -.TP -\fB{\fIm\fB}\fR -a sequence of exactly \fIm\fR matches of the atom -.TP -\fB{\fIm\fB,}\fR -a sequence of \fIm\fR or more matches of the atom -.TP -\fB{\fIm\fB,\fIn\fB}\fR -a sequence of \fIm\fR through \fIn\fR (inclusive) matches of the atom; -\fIm\fR may not exceed \fIn\fR -.TP -\fB*? +? ?? {\fIm\fB}? {\fIm\fB,}? {\fIm\fB,\fIn\fB}?\fR -\fInon-greedy\fR quantifiers, -which match the same possibilities, -but prefer the smallest number rather than the largest number -of matches (see MATCHING) -.RE -.PP -The forms using -\fB{\fR and \fB}\fR -are known as \fIbound\fRs. -The numbers -\fIm\fR and \fIn\fR are unsigned decimal integers -with permissible values from 0 to 255 inclusive. -.PP -An atom is one of: -.RS 2 -.TP 6 -\fB(\fIre\fB)\fR -(where \fIre\fR is any regular expression) -matches a match for -\fIre\fR, with the match noted for possible reporting -.TP -\fB(?:\fIre\fB)\fR -as previous, -but does no reporting -(a ``non-capturing'' set of parentheses) -.TP -\fB()\fR -matches an empty string, -noted for possible reporting -.TP -\fB(?:)\fR -matches an empty string, -without reporting -.TP -\fB[\fIchars\fB]\fR -a \fIbracket expression\fR, -matching any one of the \fIchars\fR (see BRACKET EXPRESSIONS for more detail) -.TP - \fB.\fR -matches any single character -.TP -\fB\e\fIk\fR -(where \fIk\fR is a non-alphanumeric character) -matches that character taken as an ordinary character, -e.g. \e\e matches a backslash character -.TP -\fB\e\fIc\fR -where \fIc\fR is alphanumeric -(possibly followed by other characters), -an \fIescape\fR (AREs only), -see ESCAPES below -.TP -\fB{\fR -when followed by a character other than a digit, -matches the left-brace character `\fB{\fR'; -when followed by a digit, it is the beginning of a -\fIbound\fR (see above) -.TP -\fIx\fR -where \fIx\fR is -a single character with no other significance, matches that character. -.RE -.PP -A \fIconstraint\fR matches an empty string when specific conditions -are met. -A constraint may not be followed by a quantifier. -The simple constraints are as follows; some more constraints are -described later, under ESCAPES. -.RS 2 -.TP 8 -\fB^\fR -matches at the beginning of a line -.TP -\fB$\fR -matches at the end of a line -.TP -\fB(?=\fIre\fB)\fR -\fIpositive lookahead\fR (AREs only), matches at any point -where a substring matching \fIre\fR begins -.TP -\fB(?!\fIre\fB)\fR -\fInegative lookahead\fR (AREs only), matches at any point -where no substring matching \fIre\fR begins -.RE -.PP -The lookahead constraints may not contain back references (see later), -and all parentheses within them are considered non-capturing. -.PP -An RE may not end with `\fB\e\fR'. - -.SH "BRACKET EXPRESSIONS" -A \fIbracket expression\fR is a list of characters enclosed in `\fB[\|]\fR'. -It normally matches any single character from the list (but see below). -If the list begins with `\fB^\fR', -it matches any single character -(but see below) \fInot\fR from the rest of the list. -.PP -If two characters in the list are separated by `\fB\-\fR', -this is shorthand -for the full \fIrange\fR of characters between those two (inclusive) in the -collating sequence, -e.g. -\fB[0\-9]\fR -in ASCII matches any decimal digit. -Two ranges may not share an -endpoint, so e.g. -\fBa\-c\-e\fR -is illegal. -Ranges are very collating-sequence-dependent, -and portable programs should avoid relying on them. -.PP -To include a literal -\fB]\fR -or -\fB\-\fR -in the list, -the simplest method is to -enclose it in -\fB[.\fR and \fB.]\fR -to make it a collating element (see below). -Alternatively, -make it the first character -(following a possible `\fB^\fR'), -or (AREs only) precede it with `\fB\e\fR'. -Alternatively, for `\fB\-\fR', -make it the last character, -or the second endpoint of a range. -To use a literal -\fB\-\fR -as the first endpoint of a range, -make it a collating element -or (AREs only) precede it with `\fB\e\fR'. -With the exception of these, some combinations using -\fB[\fR -(see next -paragraphs), and escapes, -all other special characters lose their -special significance within a bracket expression. -.PP -Within a bracket expression, a collating element (a character, -a multi-character sequence that collates as if it were a single character, -or a collating-sequence name for either) -enclosed in -\fB[.\fR and \fB.]\fR -stands for the -sequence of characters of that collating element. -The sequence is a single element of the bracket expression's list. -A bracket expression in a locale that has -multi-character collating elements -can thus match more than one character. -.VS 8.2 -So (insidiously), a bracket expression that starts with \fB^\fR -can match multi-character collating elements even if none of them -appear in the bracket expression! -(\fINote:\fR Tcl currently has no multi-character collating elements. -This information is only for illustration.) -.PP -For example, assume the collating sequence includes a \fBch\fR -multi-character collating element. -Then the RE \fB[[.ch.]]*c\fR (zero or more \fBch\fP's followed by \fBc\fP) -matches the first five characters of `\fBchchcc\fR'. -Also, the RE \fB[^c]b\fR matches all of `\fBchb\fR' -(because \fB[^c]\fR matches the multi-character \fBch\fR). -.VE 8.2 -.PP -Within a bracket expression, a collating element enclosed in -\fB[=\fR -and -\fB=]\fR -is an equivalence class, standing for the sequences of characters -of all collating elements equivalent to that one, including itself. -(If there are no other equivalent collating elements, -the treatment is as if the enclosing delimiters were `\fB[.\fR'\& -and `\fB.]\fR'.) -For example, if -\fBo\fR -and -\fB\o'o^'\fR -are the members of an equivalence class, -then `\fB[[=o=]]\fR', `\fB[[=\o'o^'=]]\fR', -and `\fB[o\o'o^']\fR'\& -are all synonymous. -An equivalence class may not be an endpoint -of a range. -.VS 8.2 -(\fINote:\fR -Tcl currently implements only the Unicode locale. -It doesn't define any equivalence classes. -The examples above are just illustrations.) -.VE 8.2 -.PP -Within a bracket expression, the name of a \fIcharacter class\fR enclosed -in -\fB[:\fR -and -\fB:]\fR -stands for the list of all characters -(not all collating elements!) -belonging to that -class. -Standard character classes are: -.PP -.RS -.ne 5 -.nf -.ta 3c -\fBalpha\fR A letter. -\fBupper\fR An upper-case letter. -\fBlower\fR A lower-case letter. -\fBdigit\fR A decimal digit. -\fBxdigit\fR A hexadecimal digit. -\fBalnum\fR An alphanumeric (letter or digit). -\fBprint\fR An alphanumeric (same as alnum). -\fBblank\fR A space or tab character. -\fBspace\fR A character producing white space in displayed text. -\fBpunct\fR A punctuation character. -\fBgraph\fR A character with a visible representation. -\fBcntrl\fR A control character. -.fi -.RE -.PP -A locale may provide others. -.VS 8.2 -(Note that the current Tcl implementation has only one locale: -the Unicode locale.) -.VE 8.2 -A character class may not be used as an endpoint of a range. -.PP -There are two special cases of bracket expressions: -the bracket expressions -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -are constraints, matching empty strings at -the beginning and end of a word respectively. -'\" note, discussion of escapes below references this definition of word -A word is defined as a sequence of -word characters -that is neither preceded nor followed by -word characters. -A word character is an -\fIalnum\fR -character -or an underscore -(\fB_\fR). -These special bracket expressions are deprecated; -users of AREs should use constraint escapes instead (see below). -.SH ESCAPES -Escapes (AREs only), which begin with a -\fB\e\fR -followed by an alphanumeric character, -come in several varieties: -character entry, class shorthands, constraint escapes, and back references. -A -\fB\e\fR -followed by an alphanumeric character but not constituting -a valid escape is illegal in AREs. -In EREs, there are no escapes: -outside a bracket expression, -a -\fB\e\fR -followed by an alphanumeric character merely stands for that -character as an ordinary character, -and inside a bracket expression, -\fB\e\fR -is an ordinary character. -(The latter is the one actual incompatibility between EREs and AREs.) -.PP -Character-entry escapes (AREs only) exist to make it easier to specify -non-printing and otherwise inconvenient characters in REs: -.RS 2 -.TP 5 -\fB\ea\fR -alert (bell) character, as in C -.TP -\fB\eb\fR -backspace, as in C -.TP -\fB\eB\fR -synonym for -\fB\e\fR -to help reduce backslash doubling in some -applications where there are multiple levels of backslash processing -.TP -\fB\ec\fIX\fR -(where X is any character) the character whose -low-order 5 bits are the same as those of -\fIX\fR, -and whose other bits are all zero -.TP -\fB\ee\fR -the character whose collating-sequence name -is `\fBESC\fR', -or failing that, the character with octal value 033 -.TP -\fB\ef\fR -formfeed, as in C -.TP -\fB\en\fR -newline, as in C -.TP -\fB\er\fR -carriage return, as in C -.TP -\fB\et\fR -horizontal tab, as in C -.TP -\fB\eu\fIwxyz\fR -(where -\fIwxyz\fR -is exactly four hexadecimal digits) -the Unicode character -\fBU+\fIwxyz\fR -in the local byte ordering -.TP -\fB\eU\fIstuvwxyz\fR -(where -\fIstuvwxyz\fR -is exactly eight hexadecimal digits) -reserved for a somewhat-hypothetical Unicode extension to 32 bits -.TP -\fB\ev\fR -vertical tab, as in C -are all available. -.TP -\fB\ex\fIhhh\fR -(where -\fIhhh\fR -is any sequence of hexadecimal digits) -the character whose hexadecimal value is -\fB0x\fIhhh\fR -(a single character no matter how many hexadecimal digits are used). -.TP -\fB\e0\fR -the character whose value is -\fB0\fR -.TP -\fB\e\fIxy\fR -(where -\fIxy\fR -is exactly two octal digits, -and is not a -\fIback reference\fR (see below)) -the character whose octal value is -\fB0\fIxy\fR -.TP -\fB\e\fIxyz\fR -(where -\fIxyz\fR -is exactly three octal digits, -and is not a -back reference (see below)) -the character whose octal value is -\fB0\fIxyz\fR -.RE -.PP -Hexadecimal digits are `\fB0\fR'-`\fB9\fR', `\fBa\fR'-`\fBf\fR', -and `\fBA\fR'-`\fBF\fR'. -Octal digits are `\fB0\fR'-`\fB7\fR'. -.PP -The character-entry escapes are always taken as ordinary characters. -For example, -\fB\e135\fR -is -\fB]\fR -in ASCII, -but -\fB\e135\fR -does not terminate a bracket expression. -Beware, however, that some applications (e.g., C compilers) interpret -such sequences themselves before the regular-expression package -gets to see them, which may require doubling (quadrupling, etc.) the `\fB\e\fR'. -.PP -Class-shorthand escapes (AREs only) provide shorthands for certain commonly-used -character classes: -.RS 2 -.TP 10 -\fB\ed\fR -\fB[[:digit:]]\fR -.TP -\fB\es\fR -\fB[[:space:]]\fR -.TP -\fB\ew\fR -\fB[[:alnum:]_]\fR -(note underscore) -.TP -\fB\eD\fR -\fB[^[:digit:]]\fR -.TP -\fB\eS\fR -\fB[^[:space:]]\fR -.TP -\fB\eW\fR -\fB[^[:alnum:]_]\fR -(note underscore) -.RE -.PP -Within bracket expressions, `\fB\ed\fR', `\fB\es\fR', -and `\fB\ew\fR'\& -lose their outer brackets, -and `\fB\eD\fR', `\fB\eS\fR', -and `\fB\eW\fR'\& -are illegal. -.VS 8.2 -(So, for example, \fB[a-c\ed]\fR is equivalent to \fB[a-c[:digit:]]\fR. -Also, \fB[a-c\eD]\fR, which is equivalent to \fB[a-c^[:digit:]]\fR, is illegal.) -.VE 8.2 -.PP -A constraint escape (AREs only) is a constraint, -matching the empty string if specific conditions are met, -written as an escape: -.RS 2 -.TP 6 -\fB\eA\fR -matches only at the beginning of the string -(see MATCHING, below, for how this differs from `\fB^\fR') -.TP -\fB\em\fR -matches only at the beginning of a word -.TP -\fB\eM\fR -matches only at the end of a word -.TP -\fB\ey\fR -matches only at the beginning or end of a word -.TP -\fB\eY\fR -matches only at a point that is not the beginning or end of a word -.TP -\fB\eZ\fR -matches only at the end of the string -(see MATCHING, below, for how this differs from `\fB$\fR') -.TP -\fB\e\fIm\fR -(where -\fIm\fR -is a nonzero digit) a \fIback reference\fR, see below -.TP -\fB\e\fImnn\fR -(where -\fIm\fR -is a nonzero digit, and -\fInn\fR -is some more digits, -and the decimal value -\fImnn\fR -is not greater than the number of closing capturing parentheses seen so far) -a \fIback reference\fR, see below -.RE -.PP -A word is defined as in the specification of -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -above. -Constraint escapes are illegal within bracket expressions. -.PP -A back reference (AREs only) matches the same string matched by the parenthesized -subexpression specified by the number, -so that (e.g.) -\fB([bc])\e1\fR -matches -\fBbb\fR -or -\fBcc\fR -but not `\fBbc\fR'. -The subexpression must entirely precede the back reference in the RE. -Subexpressions are numbered in the order of their leading parentheses. -Non-capturing parentheses do not define subexpressions. -.PP -There is an inherent historical ambiguity between octal character-entry -escapes and back references, which is resolved by heuristics, -as hinted at above. -A leading zero always indicates an octal escape. -A single non-zero digit, not followed by another digit, -is always taken as a back reference. -A multi-digit sequence not starting with a zero is taken as a back -reference if it comes after a suitable subexpression -(i.e. the number is in the legal range for a back reference), -and otherwise is taken as octal. -.SH "METASYNTAX" -In addition to the main syntax described above, there are some special -forms and miscellaneous syntactic facilities available. -.PP -Normally the flavor of RE being used is specified by -application-dependent means. -However, this can be overridden by a \fIdirector\fR. -If an RE of any flavor begins with `\fB***:\fR', -the rest of the RE is an ARE. -If an RE of any flavor begins with `\fB***=\fR', -the rest of the RE is taken to be a literal string, -with all characters considered ordinary characters. -.PP -An ARE may begin with \fIembedded options\fR: -a sequence -\fB(?\fIxyz\fB)\fR -(where -\fIxyz\fR -is one or more alphabetic characters) -specifies options affecting the rest of the RE. -These supplement, and can override, -any options specified by the application. -The available option letters are: -.RS 2 -.TP 3 -\fBb\fR -rest of RE is a BRE -.TP 3 -\fBc\fR -case-sensitive matching (usual default) -.TP 3 -\fBe\fR -rest of RE is an ERE -.TP 3 -\fBi\fR -case-insensitive matching (see MATCHING, below) -.TP 3 -\fBm\fR -historical synonym for -\fBn\fR -.TP 3 -\fBn\fR -newline-sensitive matching (see MATCHING, below) -.TP 3 -\fBp\fR -partial newline-sensitive matching (see MATCHING, below) -.TP 3 -\fBq\fR -rest of RE is a literal (``quoted'') string, all ordinary characters -.TP 3 -\fBs\fR -non-newline-sensitive matching (usual default) -.TP 3 -\fBt\fR -tight syntax (usual default; see below) -.TP 3 -\fBw\fR -inverse partial newline-sensitive (``weird'') matching (see MATCHING, below) -.TP 3 -\fBx\fR -expanded syntax (see below) -.RE -.PP -Embedded options take effect at the -\fB)\fR -terminating the sequence. -They are available only at the start of an ARE, -and may not be used later within it. -.PP -In addition to the usual (\fItight\fR) RE syntax, in which all characters are -significant, there is an \fIexpanded\fR syntax, -available in all flavors of RE -with the \fB-expanded\fR switch, or in AREs with the embedded x option. -In the expanded syntax, -white-space characters are ignored -and all characters between a -\fB#\fR -and the following newline (or the end of the RE) are ignored, -permitting paragraphing and commenting a complex RE. -There are three exceptions to that basic rule: -.RS 2 -.PP -a white-space character or `\fB#\fR' preceded by `\fB\e\fR' is retained -.PP -white space or `\fB#\fR' within a bracket expression is retained -.PP -white space and comments are illegal within multi-character symbols -like the ARE `\fB(?:\fR' or the BRE `\fB\e(\fR' -.RE -.PP -Expanded-syntax white-space characters are blank, tab, newline, and -.VS 8.2 -any character that belongs to the \fIspace\fR character class. -.VE 8.2 -.PP -Finally, in an ARE, -outside bracket expressions, the sequence `\fB(?#\fIttt\fB)\fR' -(where -\fIttt\fR -is any text not containing a `\fB)\fR') -is a comment, -completely ignored. -Again, this is not allowed between the characters of -multi-character symbols like `\fB(?:\fR'. -Such comments are more a historical artifact than a useful facility, -and their use is deprecated; -use the expanded syntax instead. -.PP -\fINone\fR of these metasyntax extensions is available if the application -(or an initial -\fB***=\fR -director) -has specified that the user's input be treated as a literal string -rather than as an RE. -.SH MATCHING -In the event that an RE could match more than one substring of a given -string, -the RE matches the one starting earliest in the string. -If the RE could match more than one substring starting at that point, -its choice is determined by its \fIpreference\fR: -either the longest substring, or the shortest. -.PP -Most atoms, and all constraints, have no preference. -A parenthesized RE has the same preference (possibly none) as the RE. -A quantified atom with quantifier -\fB{\fIm\fB}\fR -or -\fB{\fIm\fB}?\fR -has the same preference (possibly none) as the atom itself. -A quantified atom with other normal quantifiers (including -\fB{\fIm\fB,\fIn\fB}\fR -with -\fIm\fR -equal to -\fIn\fR) -prefers longest match. -A quantified atom with other non-greedy quantifiers (including -\fB{\fIm\fB,\fIn\fB}?\fR -with -\fIm\fR -equal to -\fIn\fR) -prefers shortest match. -A branch has the same preference as the first quantified atom in it -which has a preference. -An RE consisting of two or more branches connected by the -\fB|\fR -operator prefers longest match. -.PP -Subject to the constraints imposed by the rules for matching the whole RE, -subexpressions also match the longest or shortest possible substrings, -based on their preferences, -with subexpressions starting earlier in the RE taking priority over -ones starting later. -Note that outer subexpressions thus take priority over -their component subexpressions. -.PP -Note that the quantifiers -\fB{1,1}\fR -and -\fB{1,1}?\fR -can be used to force longest and shortest preference, respectively, -on a subexpression or a whole RE. -.PP -Match lengths are measured in characters, not collating elements. -An empty string is considered longer than no match at all. -For example, -\fBbb*\fR -matches the three middle characters of `\fBabbbc\fR', -\fB(week|wee)(night|knights)\fR -matches all ten characters of `\fBweeknights\fR', -when -\fB(.*).*\fR -is matched against -\fBabc\fR -the parenthesized subexpression -matches all three characters, and -when -\fB(a*)*\fR -is matched against -\fBbc\fR -both the whole RE and the parenthesized -subexpression match an empty string. -.PP -If case-independent matching is specified, -the effect is much as if all case distinctions had vanished from the -alphabet. -When an alphabetic that exists in multiple cases appears as an -ordinary character outside a bracket expression, it is effectively -transformed into a bracket expression containing both cases, -so that -\fBx\fR -becomes `\fB[xX]\fR'. -When it appears inside a bracket expression, all case counterparts -of it are added to the bracket expression, so that -\fB[x]\fR -becomes -\fB[xX]\fR -and -\fB[^x]\fR -becomes `\fB[^xX]\fR'. -.PP -If newline-sensitive matching is specified, \fB.\fR -and bracket expressions using -\fB^\fR -will never match the newline character -(so that matches will never cross newlines unless the RE -explicitly arranges it) -and -\fB^\fR -and -\fB$\fR -will match the empty string after and before a newline -respectively, in addition to matching at beginning and end of string -respectively. -ARE -\fB\eA\fR -and -\fB\eZ\fR -continue to match beginning or end of string \fIonly\fR. -.PP -If partial newline-sensitive matching is specified, -this affects \fB.\fR -and bracket expressions -as with newline-sensitive matching, but not -\fB^\fR -and `\fB$\fR'. -.PP -If inverse partial newline-sensitive matching is specified, -this affects -\fB^\fR -and -\fB$\fR -as with -newline-sensitive matching, -but not \fB.\fR -and bracket expressions. -This isn't very useful but is provided for symmetry. -.SH "LIMITS AND COMPATIBILITY" -No particular limit is imposed on the length of REs. -Programs intended to be highly portable should not employ REs longer -than 256 bytes, -as a POSIX-compliant implementation can refuse to accept such REs. -.PP -The only feature of AREs that is actually incompatible with -POSIX EREs is that -\fB\e\fR -does not lose its special -significance inside bracket expressions. -All other ARE features use syntax which is illegal or has -undefined or unspecified effects in POSIX EREs; -the -\fB***\fR -syntax of directors likewise is outside the POSIX -syntax for both BREs and EREs. -.PP -Many of the ARE extensions are borrowed from Perl, but some have -been changed to clean them up, and a few Perl extensions are not present. -Incompatibilities of note include `\fB\eb\fR', `\fB\eB\fR', -the lack of special treatment for a trailing newline, -the addition of complemented bracket expressions to the things -affected by newline-sensitive matching, -the restrictions on parentheses and back references in lookahead constraints, -and the longest/shortest-match (rather than first-match) matching semantics. -.PP -The matching rules for REs containing both normal and non-greedy quantifiers -have changed since early beta-test versions of this package. -(The new rules are much simpler and cleaner, -but don't work as hard at guessing the user's real intentions.) -.PP -Henry Spencer's original 1986 \fIregexp\fR package, -still in widespread use (e.g., in pre-8.1 releases of Tcl), -implemented an early version of today's EREs. -There are four incompatibilities between \fIregexp\fR's near-EREs -(`RREs' for short) and AREs. -In roughly increasing order of significance: -.PP -.RS -In AREs, -\fB\e\fR -followed by an alphanumeric character is either an -escape or an error, -while in RREs, it was just another way of writing the -alphanumeric. -This should not be a problem because there was no reason to write -such a sequence in RREs. -.PP -\fB{\fR -followed by a digit in an ARE is the beginning of a bound, -while in RREs, -\fB{\fR -was always an ordinary character. -Such sequences should be rare, -and will often result in an error because following characters -will not look like a valid bound. -.PP -In AREs, -\fB\e\fR -remains a special character within `\fB[\|]\fR', -so a literal -\fB\e\fR -within -\fB[\|]\fR -must be written `\fB\e\e\fR'. -\fB\e\e\fR -also gives a literal -\fB\e\fR -within -\fB[\|]\fR -in RREs, -but only truly paranoid programmers routinely doubled the backslash. -.PP -AREs report the longest/shortest match for the RE, -rather than the first found in a specified search order. -This may affect some RREs which were written in the expectation that -the first match would be reported. -(The careful crafting of RREs to optimize the search order for fast -matching is obsolete (AREs examine all possible matches -in parallel, and their performance is largely insensitive to their -complexity) but cases where the search order was exploited to deliberately -find a match which was \fInot\fR the longest/shortest will need rewriting.) -.RE - -.SH "BASIC REGULAR EXPRESSIONS" -BREs differ from EREs in several respects. `\fB|\fR', `\fB+\fR', -and -\fB?\fR -are ordinary characters and there is no equivalent -for their functionality. -The delimiters for bounds are -\fB\e{\fR -and `\fB\e}\fR', -with -\fB{\fR -and -\fB}\fR -by themselves ordinary characters. -The parentheses for nested subexpressions are -\fB\e(\fR -and `\fB\e)\fR', -with -\fB(\fR -and -\fB)\fR -by themselves ordinary characters. -\fB^\fR -is an ordinary character except at the beginning of the -RE or the beginning of a parenthesized subexpression, -\fB$\fR -is an ordinary character except at the end of the -RE or the end of a parenthesized subexpression, -and -\fB*\fR -is an ordinary character if it appears at the beginning of the -RE or the beginning of a parenthesized subexpression -(after a possible leading `\fB^\fR'). -Finally, -single-digit back references are available, -and -\fB\e<\fR -and -\fB\e>\fR -are synonyms for -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -respectively; -no other escapes are available. - -.SH "SEE ALSO" -RegExp(3), regexp(n), regsub(n), lsearch(n), switch(n), text(n) - -.SH KEYWORDS -match, regular expression, string diff --git a/src/regex/regc_color.c b/src/regex/regc_color.c deleted file mode 100644 index 6a07d3e7a5..0000000000 --- a/src/regex/regc_color.c +++ /dev/null @@ -1,778 +0,0 @@ -/* - * colorings of characters - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * Note that there are some incestuous relationships between this code and - * NFA arc maintenance, which perhaps ought to be cleaned up sometime. - */ - - - -#define CISERR() VISERR(cm->v) -#define CERR(e) (void)VERR(cm->v, (e)) - - - -/* - - initcm - set up new colormap - ^ static VOID initcm(struct vars *, struct colormap *); - */ -static VOID -initcm(v, cm) -struct vars *v; -struct colormap *cm; -{ - int i; - int j; - union tree *t; - union tree *nextt; - struct colordesc *cd; - - cm->magic = CMMAGIC; - cm->v = v; - - cm->ncds = NINLINECDS; - cm->cd = cm->cdspace; - cm->max = 0; - cm->free = 0; - - cd = cm->cd; /* cm->cd[WHITE] */ - cd->sub = NOSUB; - cd->arcs = NULL; - cd->flags = 0; - cd->nchrs = CHR_MAX - CHR_MIN + 1; - - /* upper levels of tree */ - for (t = &cm->tree[0], j = NBYTS-1; j > 0; t = nextt, j--) { - nextt = t + 1; - for (i = BYTTAB-1; i >= 0; i--) - t->tptr[i] = nextt; - } - /* bottom level is solid white */ - t = &cm->tree[NBYTS-1]; - for (i = BYTTAB-1; i >= 0; i--) - t->tcolor[i] = WHITE; - cd->block = t; -} - -/* - - freecm - free dynamically-allocated things in a colormap - ^ static VOID freecm(struct colormap *); - */ -static VOID -freecm(cm) -struct colormap *cm; -{ - size_t i; - union tree *cb; - - cm->magic = 0; - if (NBYTS > 1) - cmtreefree(cm, cm->tree, 0); - for (i = 1; i <= cm->max; i++) /* skip WHITE */ - if (!UNUSEDCOLOR(&cm->cd[i])) { - cb = cm->cd[i].block; - if (cb != NULL) - FREE(cb); - } - if (cm->cd != cm->cdspace) - FREE(cm->cd); -} - -/* - - cmtreefree - free a non-terminal part of a colormap tree - ^ static VOID cmtreefree(struct colormap *, union tree *, int); - */ -static VOID -cmtreefree(cm, tree, level) -struct colormap *cm; -union tree *tree; -int level; /* level number (top == 0) of this block */ -{ - int i; - union tree *t; - union tree *fillt = &cm->tree[level+1]; - union tree *cb; - - assert(level < NBYTS-1); /* this level has pointers */ - for (i = BYTTAB-1; i >= 0; i--) { - t = tree->tptr[i]; - assert(t != NULL); - if (t != fillt) { - if (level < NBYTS-2) { /* more pointer blocks below */ - cmtreefree(cm, t, level+1); - FREE(t); - } else { /* color block below */ - cb = cm->cd[t->tcolor[0]].block; - if (t != cb) /* not a solid block */ - FREE(t); - } - } - } -} - -/* - - setcolor - set the color of a character in a colormap - ^ static color setcolor(struct colormap *, pchr, pcolor); - */ -static color /* previous color */ -setcolor(cm, c, co) -struct colormap *cm; -pchr c; -pcolor co; -{ - uchr uc = c; - int shift; - int level; - int b; - int bottom; - union tree *t; - union tree *newt; - union tree *fillt; - union tree *lastt; - union tree *cb; - color prev; - - assert(cm->magic == CMMAGIC); - if (CISERR() || co == COLORLESS) - return COLORLESS; - - t = cm->tree; - for (level = 0, shift = BYTBITS * (NBYTS - 1); shift > 0; - level++, shift -= BYTBITS) { - b = (uc >> shift) & BYTMASK; - lastt = t; - t = lastt->tptr[b]; - assert(t != NULL); - fillt = &cm->tree[level+1]; - bottom = (shift <= BYTBITS) ? 1 : 0; - cb = (bottom) ? cm->cd[t->tcolor[0]].block : fillt; - if (t == fillt || t == cb) { /* must allocate a new block */ - newt = (union tree *)MALLOC((bottom) ? - sizeof(struct colors) : sizeof(struct ptrs)); - if (newt == NULL) { - CERR(REG_ESPACE); - return COLORLESS; - } - if (bottom) - memcpy(VS(newt->tcolor), VS(t->tcolor), - BYTTAB*sizeof(color)); - else - memcpy(VS(newt->tptr), VS(t->tptr), - BYTTAB*sizeof(union tree *)); - t = newt; - lastt->tptr[b] = t; - } - } - - b = uc & BYTMASK; - prev = t->tcolor[b]; - t->tcolor[b] = (color)co; - return prev; -} - -/* - - maxcolor - report largest color number in use - ^ static color maxcolor(struct colormap *); - */ -static color -maxcolor(cm) -struct colormap *cm; -{ - if (CISERR()) - return COLORLESS; - - return (color)cm->max; -} - -/* - - newcolor - find a new color (must be subject of setcolor at once) - * Beware: may relocate the colordescs. - ^ static color newcolor(struct colormap *); - */ -static color /* COLORLESS for error */ -newcolor(cm) -struct colormap *cm; -{ - struct colordesc *cd; - struct colordesc *new; - size_t n; - - if (CISERR()) - return COLORLESS; - - if (cm->free != 0) { - assert(cm->free > 0); - assert((size_t)cm->free < cm->ncds); - cd = &cm->cd[cm->free]; - assert(UNUSEDCOLOR(cd)); - assert(cd->arcs == NULL); - cm->free = cd->sub; - } else if (cm->max < cm->ncds - 1) { - cm->max++; - cd = &cm->cd[cm->max]; - } else { - /* oops, must allocate more */ - n = cm->ncds * 2; - if (cm->cd == cm->cdspace) { - new = (struct colordesc *)MALLOC(n * - sizeof(struct colordesc)); - if (new != NULL) - memcpy(VS(new), VS(cm->cdspace), cm->ncds * - sizeof(struct colordesc)); - } else - new = (struct colordesc *)REALLOC(cm->cd, - n * sizeof(struct colordesc)); - if (new == NULL) { - CERR(REG_ESPACE); - return COLORLESS; - } - cm->cd = new; - cm->ncds = n; - assert(cm->max < cm->ncds - 1); - cm->max++; - cd = &cm->cd[cm->max]; - } - - cd->nchrs = 0; - cd->sub = NOSUB; - cd->arcs = NULL; - cd->flags = 0; - cd->block = NULL; - - return (color)(cd - cm->cd); -} - -/* - - freecolor - free a color (must have no arcs or subcolor) - ^ static VOID freecolor(struct colormap *, pcolor); - */ -static VOID -freecolor(cm, co) -struct colormap *cm; -pcolor co; -{ - struct colordesc *cd = &cm->cd[co]; - color pco, nco; /* for freelist scan */ - - assert(co >= 0); - if (co == WHITE) - return; - - assert(cd->arcs == NULL); - assert(cd->sub == NOSUB); - assert(cd->nchrs == 0); - cd->flags = FREECOL; - if (cd->block != NULL) { - FREE(cd->block); - cd->block = NULL; /* just paranoia */ - } - - if ((size_t)co == cm->max) { - while (cm->max > WHITE && UNUSEDCOLOR(&cm->cd[cm->max])) - cm->max--; - assert(cm->free >= 0); - while ((size_t)cm->free > cm->max) - cm->free = cm->cd[cm->free].sub; - if (cm->free > 0) { - assert(cm->free < cm->max); - pco = cm->free; - nco = cm->cd[pco].sub; - while (nco > 0) - if ((size_t)nco > cm->max) { - /* take this one out of freelist */ - nco = cm->cd[nco].sub; - cm->cd[pco].sub = nco; - } else { - assert(nco < cm->max); - pco = nco; - nco = cm->cd[pco].sub; - } - } - } else { - cd->sub = cm->free; - cm->free = (color)(cd - cm->cd); - } -} - -/* - - pseudocolor - allocate a false color, to be managed by other means - ^ static color pseudocolor(struct colormap *); - */ -static color -pseudocolor(cm) -struct colormap *cm; -{ - color co; - - co = newcolor(cm); - if (CISERR()) - return COLORLESS; - cm->cd[co].nchrs = 1; - cm->cd[co].flags = PSEUDO; - return co; -} - -/* - - subcolor - allocate a new subcolor (if necessary) to this chr - ^ static color subcolor(struct colormap *, pchr c); - */ -static color -subcolor(cm, c) -struct colormap *cm; -pchr c; -{ - color co; /* current color of c */ - color sco; /* new subcolor */ - - co = GETCOLOR(cm, c); - sco = newsub(cm, co); - if (CISERR()) - return COLORLESS; - assert(sco != COLORLESS); - - if (co == sco) /* already in an open subcolor */ - return co; /* rest is redundant */ - cm->cd[co].nchrs--; - cm->cd[sco].nchrs++; - setcolor(cm, c, sco); - return sco; -} - -/* - - newsub - allocate a new subcolor (if necessary) for a color - ^ static color newsub(struct colormap *, pcolor); - */ -static color -newsub(cm, co) -struct colormap *cm; -pcolor co; -{ - color sco; /* new subcolor */ - - sco = cm->cd[co].sub; - if (sco == NOSUB) { /* color has no open subcolor */ - if (cm->cd[co].nchrs == 1) /* optimization */ - return co; - sco = newcolor(cm); /* must create subcolor */ - if (sco == COLORLESS) { - assert(CISERR()); - return COLORLESS; - } - cm->cd[co].sub = sco; - cm->cd[sco].sub = sco; /* open subcolor points to self */ - } - assert(sco != NOSUB); - - return sco; -} - -/* - - subrange - allocate new subcolors to this range of chrs, fill in arcs - ^ static VOID subrange(struct vars *, pchr, pchr, struct state *, - ^ struct state *); - */ -static VOID -subrange(v, from, to, lp, rp) -struct vars *v; -pchr from; -pchr to; -struct state *lp; -struct state *rp; -{ - uchr uf; - int i; - - assert(from <= to); - - /* first, align "from" on a tree-block boundary */ - uf = (uchr)from; - i = (int)( ((uf + BYTTAB-1) & (uchr)~BYTMASK) - uf ); - for (; from <= to && i > 0; i--, from++) - newarc(v->nfa, PLAIN, subcolor(v->cm, from), lp, rp); - if (from > to) /* didn't reach a boundary */ - return; - - /* deal with whole blocks */ - for (; to - from >= BYTTAB; from += BYTTAB) - subblock(v, from, lp, rp); - - /* clean up any remaining partial table */ - for (; from <= to; from++) - newarc(v->nfa, PLAIN, subcolor(v->cm, from), lp, rp); -} - -/* - - subblock - allocate new subcolors for one tree block of chrs, fill in arcs - ^ static VOID subblock(struct vars *, pchr, struct state *, struct state *); - */ -static VOID -subblock(v, start, lp, rp) -struct vars *v; -pchr start; /* first of BYTTAB chrs */ -struct state *lp; -struct state *rp; -{ - uchr uc = start; - struct colormap *cm = v->cm; - int shift; - int level; - int i; - int b = 0; - union tree *t; - union tree *cb; - union tree *fillt; - union tree *lastt = NULL; - int previ; - int ndone; - color co; - color sco; - - assert((uc % BYTTAB) == 0); - - /* find its color block, making new pointer blocks as needed */ - t = cm->tree; - fillt = NULL; - for (level = 0, shift = BYTBITS * (NBYTS - 1); shift > 0; - level++, shift -= BYTBITS) { - b = (uc >> shift) & BYTMASK; - lastt = t; - t = lastt->tptr[b]; - assert(t != NULL); - fillt = &cm->tree[level+1]; - if (t == fillt && shift > BYTBITS) { /* need new ptr block */ - t = (union tree *)MALLOC(sizeof(struct ptrs)); - if (t == NULL) { - CERR(REG_ESPACE); - return; - } - memcpy(VS(t->tptr), VS(fillt->tptr), - BYTTAB*sizeof(union tree *)); - lastt->tptr[b] = t; - } - } - - /* special cases: fill block or solid block */ - co = t->tcolor[0]; - cb = cm->cd[co].block; - if (t == fillt || t == cb) { - /* either way, we want a subcolor solid block */ - sco = newsub(cm, co); - t = cm->cd[sco].block; - if (t == NULL) { /* must set it up */ - t = (union tree *)MALLOC(sizeof(struct colors)); - if (t == NULL) { - CERR(REG_ESPACE); - return; - } - for (i = 0; i < BYTTAB; i++) - t->tcolor[i] = sco; - cm->cd[sco].block = t; - } - /* find loop must have run at least once */ - lastt->tptr[b] = t; - newarc(v->nfa, PLAIN, sco, lp, rp); - cm->cd[co].nchrs -= BYTTAB; - cm->cd[sco].nchrs += BYTTAB; - return; - } - - /* general case, a mixed block to be altered */ - i = 0; - while (i < BYTTAB) { - co = t->tcolor[i]; - sco = newsub(cm, co); - newarc(v->nfa, PLAIN, sco, lp, rp); - previ = i; - do { - t->tcolor[i++] = sco; - } while (i < BYTTAB && t->tcolor[i] == co); - ndone = i - previ; - cm->cd[co].nchrs -= ndone; - cm->cd[sco].nchrs += ndone; - } -} - -/* - - okcolors - promote subcolors to full colors - ^ static VOID okcolors(struct nfa *, struct colormap *); - */ -static VOID -okcolors(nfa, cm) -struct nfa *nfa; -struct colormap *cm; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - struct colordesc *scd; - struct arc *a; - color co; - color sco; - - for (cd = cm->cd, co = 0; cd < end; cd++, co++) { - sco = cd->sub; - if (UNUSEDCOLOR(cd) || sco == NOSUB) { - /* has no subcolor, no further action */ - } else if (sco == co) { - /* is subcolor, let parent deal with it */ - } else if (cd->nchrs == 0) { - /* parent empty, its arcs change color to subcolor */ - cd->sub = NOSUB; - scd = &cm->cd[sco]; - assert(scd->nchrs > 0); - assert(scd->sub == sco); - scd->sub = NOSUB; - while ((a = cd->arcs) != NULL) { - assert(a->co == co); - /* uncolorchain(cm, a); */ - cd->arcs = a->colorchain; - a->co = sco; - /* colorchain(cm, a); */ - a->colorchain = scd->arcs; - scd->arcs = a; - } - freecolor(cm, co); - } else { - /* parent's arcs must gain parallel subcolor arcs */ - cd->sub = NOSUB; - scd = &cm->cd[sco]; - assert(scd->nchrs > 0); - assert(scd->sub == sco); - scd->sub = NOSUB; - for (a = cd->arcs; a != NULL; a = a->colorchain) { - assert(a->co == co); - newarc(nfa, a->type, sco, a->from, a->to); - } - } - } -} - -/* - - colorchain - add this arc to the color chain of its color - ^ static VOID colorchain(struct colormap *, struct arc *); - */ -static VOID -colorchain(cm, a) -struct colormap *cm; -struct arc *a; -{ - struct colordesc *cd = &cm->cd[a->co]; - - a->colorchain = cd->arcs; - cd->arcs = a; -} - -/* - - uncolorchain - delete this arc from the color chain of its color - ^ static VOID uncolorchain(struct colormap *, struct arc *); - */ -static VOID -uncolorchain(cm, a) -struct colormap *cm; -struct arc *a; -{ - struct colordesc *cd = &cm->cd[a->co]; - struct arc *aa; - - aa = cd->arcs; - if (aa == a) /* easy case */ - cd->arcs = a->colorchain; - else { - for (; aa != NULL && aa->colorchain != a; aa = aa->colorchain) - continue; - assert(aa != NULL); - aa->colorchain = a->colorchain; - } - a->colorchain = NULL; /* paranoia */ -} - -/* - - singleton - is this character in its own color? - ^ static int singleton(struct colormap *, pchr c); - */ -static int /* predicate */ -singleton(cm, c) -struct colormap *cm; -pchr c; -{ - color co; /* color of c */ - - co = GETCOLOR(cm, c); - if (cm->cd[co].nchrs == 1 && cm->cd[co].sub == NOSUB) - return 1; - return 0; -} - -/* - - rainbow - add arcs of all full colors (but one) between specified states - ^ static VOID rainbow(struct nfa *, struct colormap *, int, pcolor, - ^ struct state *, struct state *); - */ -static VOID -rainbow(nfa, cm, type, but, from, to) -struct nfa *nfa; -struct colormap *cm; -int type; -pcolor but; /* COLORLESS if no exceptions */ -struct state *from; -struct state *to; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - color co; - - for (cd = cm->cd, co = 0; cd < end && !CISERR(); cd++, co++) - if (!UNUSEDCOLOR(cd) && cd->sub != co && co != but && - !(cd->flags&PSEUDO)) - newarc(nfa, type, co, from, to); -} - -/* - - colorcomplement - add arcs of complementary colors - * The calling sequence ought to be reconciled with cloneouts(). - ^ static VOID colorcomplement(struct nfa *, struct colormap *, int, - ^ struct state *, struct state *, struct state *); - */ -static VOID -colorcomplement(nfa, cm, type, of, from, to) -struct nfa *nfa; -struct colormap *cm; -int type; -struct state *of; /* complements of this guy's PLAIN outarcs */ -struct state *from; -struct state *to; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - color co; - - assert(of != from); - for (cd = cm->cd, co = 0; cd < end && !CISERR(); cd++, co++) - if (!UNUSEDCOLOR(cd) && !(cd->flags&PSEUDO)) - if (findarc(of, PLAIN, co) == NULL) - newarc(nfa, type, co, from, to); -} - - - -#ifdef REG_DEBUG -/* - ^ #ifdef REG_DEBUG - */ - -/* - - dumpcolors - debugging output - ^ static VOID dumpcolors(struct colormap *, FILE *); - */ -static VOID -dumpcolors(cm, f) -struct colormap *cm; -FILE *f; -{ - struct colordesc *cd; - struct colordesc *end; - color co; - chr c; - char *has; - - fprintf(f, "max %ld\n", (long)cm->max); - if (NBYTS > 1) - fillcheck(cm, cm->tree, 0, f); - end = CDEND(cm); - for (cd = cm->cd + 1, co = 1; cd < end; cd++, co++) /* skip 0 */ - if (!UNUSEDCOLOR(cd)) { - assert(cd->nchrs > 0); - has = (cd->block != NULL) ? "#" : ""; - if (cd->flags&PSEUDO) - fprintf(f, "#%2ld%s(ps): ", (long)co, has); - else - fprintf(f, "#%2ld%s(%2d): ", (long)co, - has, cd->nchrs); - /* it's hard to do this more efficiently */ - for (c = CHR_MIN; c < CHR_MAX; c++) - if (GETCOLOR(cm, c) == co) - dumpchr(c, f); - assert(c == CHR_MAX); - if (GETCOLOR(cm, c) == co) - dumpchr(c, f); - fprintf(f, "\n"); - } -} - -/* - - fillcheck - check proper filling of a tree - ^ static VOID fillcheck(struct colormap *, union tree *, int, FILE *); - */ -static VOID -fillcheck(cm, tree, level, f) -struct colormap *cm; -union tree *tree; -int level; /* level number (top == 0) of this block */ -FILE *f; -{ - int i; - union tree *t; - union tree *fillt = &cm->tree[level+1]; - - assert(level < NBYTS-1); /* this level has pointers */ - for (i = BYTTAB-1; i >= 0; i--) { - t = tree->tptr[i]; - if (t == NULL) - fprintf(f, "NULL found in filled tree!\n"); - else if (t == fillt) - {} - else if (level < NBYTS-2) /* more pointer blocks below */ - fillcheck(cm, t, level+1, f); - } -} - -/* - - dumpchr - print a chr - * Kind of char-centric but works well enough for debug use. - ^ static VOID dumpchr(pchr, FILE *); - */ -static VOID -dumpchr(c, f) -pchr c; -FILE *f; -{ - if (c == '\\') - fprintf(f, "\\\\"); - else if (c > ' ' && c <= '~') - putc((char)c, f); - else - fprintf(f, "\\u%04lx", (long)c); -} - -/* - ^ #endif - */ -#endif /* ifdef REG_DEBUG */ diff --git a/src/regex/regc_cvec.c b/src/regex/regc_cvec.c deleted file mode 100644 index d2d56fc70a..0000000000 --- a/src/regex/regc_cvec.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Utility functions for handling cvecs - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/* - - newcvec - allocate a new cvec - ^ static struct cvec *newcvec(int, int, int); - */ -static struct cvec * -newcvec(nchrs, nranges, nmcces) - int nchrs; /* to hold this many chrs... */ - int nranges; /* ... and this many ranges... */ - int nmcces; /* ... and this many MCCEs */ -{ - size_t n; - size_t nc; - struct cvec *cv; - - nc = (size_t)nchrs + (size_t)nmcces*(MAXMCCE+1) + (size_t)nranges*2; - n = sizeof(struct cvec) + (size_t)(nmcces-1)*sizeof(chr *) - + nc*sizeof(chr); - cv = (struct cvec *)MALLOC(n); - if (cv == NULL) { - return NULL; - } - cv->chrspace = nchrs; - cv->chrs = (chr *)&cv->mcces[nmcces]; /* chrs just after MCCE ptrs */ - cv->mccespace = nmcces; - cv->ranges = cv->chrs + nchrs + nmcces*(MAXMCCE+1); - cv->rangespace = nranges; - return clearcvec(cv); -} - -/* - - clearcvec - clear a possibly-new cvec - * Returns pointer as convenience. - ^ static struct cvec *clearcvec(struct cvec *); - */ -static struct cvec * -clearcvec(cv) - struct cvec *cv; /* character vector */ -{ - int i; - - assert(cv != NULL); - cv->nchrs = 0; - assert(cv->chrs == (chr *)&cv->mcces[cv->mccespace]); - cv->nmcces = 0; - cv->nmccechrs = 0; - cv->nranges = 0; - for (i = 0; i < cv->mccespace; i++) { - cv->mcces[i] = NULL; - } - - return cv; -} - -/* - - addchr - add a chr to a cvec - ^ static VOID addchr(struct cvec *, pchr); - */ -static VOID -addchr(cv, c) - struct cvec *cv; /* character vector */ - pchr c; /* character to add */ -{ - assert(cv->nchrs < cv->chrspace - cv->nmccechrs); - cv->chrs[cv->nchrs++] = (chr)c; -} - -/* - - addrange - add a range to a cvec - ^ static VOID addrange(struct cvec *, pchr, pchr); - */ -static VOID -addrange(cv, from, to) - struct cvec *cv; /* character vector */ - pchr from; /* first character of range */ - pchr to; /* last character of range */ -{ - assert(cv->nranges < cv->rangespace); - cv->ranges[cv->nranges*2] = (chr)from; - cv->ranges[cv->nranges*2 + 1] = (chr)to; - cv->nranges++; -} - -/* - - addmcce - add an MCCE to a cvec - ^ static VOID addmcce(struct cvec *, chr *, chr *); - */ -static VOID -addmcce(cv, startp, endp) - struct cvec *cv; /* character vector */ - chr *startp; /* beginning of text */ - chr *endp; /* just past end of text */ -{ - int len; - int i; - chr *s; - chr *d; - - if (startp == NULL && endp == NULL) { - return; - } - len = endp - startp; - assert(len > 0); - assert(cv->nchrs + len < cv->chrspace - cv->nmccechrs); - assert(cv->nmcces < cv->mccespace); - d = &cv->chrs[cv->chrspace - cv->nmccechrs - len - 1]; - cv->mcces[cv->nmcces++] = d; - for (s = startp, i = len; i > 0; s++, i--) { - *d++ = *s; - } - *d++ = 0; /* endmarker */ - assert(d == &cv->chrs[cv->chrspace - cv->nmccechrs]); - cv->nmccechrs += len + 1; -} - -/* - - haschr - does a cvec contain this chr? - ^ static int haschr(struct cvec *, pchr); - */ -static int /* predicate */ -haschr(cv, c) - struct cvec *cv; /* character vector */ - pchr c; /* character to test for */ -{ - int i; - chr *p; - - for (p = cv->chrs, i = cv->nchrs; i > 0; p++, i--) { - if (*p == c) { - return 1; - } - } - for (p = cv->ranges, i = cv->nranges; i > 0; p += 2, i--) { - if ((*p <= c) && (c <= *(p+1))) { - return 1; - } - } - return 0; -} - -/* - - getcvec - get a cvec, remembering it as v->cv - ^ static struct cvec *getcvec(struct vars *, int, int, int); - */ -static struct cvec * -getcvec(v, nchrs, nranges, nmcces) - struct vars *v; /* context */ - int nchrs; /* to hold this many chrs... */ - int nranges; /* ... and this many ranges... */ - int nmcces; /* ... and this many MCCEs */ -{ - if (v->cv != NULL && nchrs <= v->cv->chrspace && - nranges <= v->cv->rangespace && nmcces <= v->cv->mccespace) { - return clearcvec(v->cv); - } - - if (v->cv != NULL) { - freecvec(v->cv); - } - v->cv = newcvec(nchrs, nranges, nmcces); - if (v->cv == NULL) { - ERR(REG_ESPACE); - } - - return v->cv; -} - -/* - - freecvec - free a cvec - ^ static VOID freecvec(struct cvec *); - */ -static VOID -freecvec(cv) - struct cvec *cv; /* character vector */ -{ - FREE(cv); -} diff --git a/src/regex/regc_lex.c b/src/regex/regc_lex.c deleted file mode 100644 index 1acc3f4cae..0000000000 --- a/src/regex/regc_lex.c +++ /dev/null @@ -1,1061 +0,0 @@ -/* - * lexical analyzer - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/* scanning macros (know about v) */ -#define ATEOS() (v->now >= v->stop) -#define HAVE(n) (v->stop - v->now >= (n)) -#define NEXT1(c) (!ATEOS() && *v->now == CHR(c)) -#define NEXT2(a,b) (HAVE(2) && *v->now == CHR(a) && *(v->now+1) == CHR(b)) -#define NEXT3(a,b,c) (HAVE(3) && *v->now == CHR(a) && \ - *(v->now+1) == CHR(b) && \ - *(v->now+2) == CHR(c)) -#define SET(c) (v->nexttype = (c)) -#define SETV(c, n) (v->nexttype = (c), v->nextvalue = (n)) -#define RET(c) return (SET(c), 1) -#define RETV(c, n) return (SETV(c, n), 1) -#define FAILW(e) return (ERR(e), 0) /* ERR does SET(EOS) */ -#define LASTTYPE(t) (v->lasttype == (t)) - -/* lexical contexts */ -#define L_ERE 1 /* mainline ERE/ARE */ -#define L_BRE 2 /* mainline BRE */ -#define L_Q 3 /* REG_QUOTE */ -#define L_EBND 4 /* ERE/ARE bound */ -#define L_BBND 5 /* BRE bound */ -#define L_BRACK 6 /* brackets */ -#define L_CEL 7 /* collating element */ -#define L_ECL 8 /* equivalence class */ -#define L_CCL 9 /* character class */ -#define INTOCON(c) (v->lexcon = (c)) -#define INCON(con) (v->lexcon == (con)) - -/* construct pointer past end of chr array */ -#define ENDOF(array) ((array) + sizeof(array)/sizeof(chr)) - -/* - - lexstart - set up lexical stuff, scan leading options - ^ static VOID lexstart(struct vars *); - */ -static VOID -lexstart(v) -struct vars *v; -{ - prefixes(v); /* may turn on new type bits etc. */ - NOERR(); - - if (v->cflags®_QUOTE) { - assert(!(v->cflags&(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE))); - INTOCON(L_Q); - } else if (v->cflags®_EXTENDED) { - assert(!(v->cflags®_QUOTE)); - INTOCON(L_ERE); - } else { - assert(!(v->cflags&(REG_QUOTE|REG_ADVF))); - INTOCON(L_BRE); - } - - v->nexttype = EMPTY; /* remember we were at the start */ - next(v); /* set up the first token */ -} - -/* - - prefixes - implement various special prefixes - ^ static VOID prefixes(struct vars *); - */ -static VOID -prefixes(v) -struct vars *v; -{ - /* literal string doesn't get any of this stuff */ - if (v->cflags®_QUOTE) - return; - - /* initial "***" gets special things */ - if (HAVE(4) && NEXT3('*', '*', '*')) - switch (*(v->now + 3)) { - case CHR('?'): /* "***?" error, msg shows version */ - ERR(REG_BADPAT); - return; /* proceed no further */ - break; - case CHR('='): /* "***=" shifts to literal string */ - NOTE(REG_UNONPOSIX); - v->cflags |= REG_QUOTE; - v->cflags &= ~(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE); - v->now += 4; - return; /* and there can be no more prefixes */ - break; - case CHR(':'): /* "***:" shifts to AREs */ - NOTE(REG_UNONPOSIX); - v->cflags |= REG_ADVANCED; - v->now += 4; - break; - default: /* otherwise *** is just an error */ - ERR(REG_BADRPT); - return; - break; - } - - /* BREs and EREs don't get embedded options */ - if ((v->cflags®_ADVANCED) != REG_ADVANCED) - return; - - /* embedded options (AREs only) */ - if (HAVE(3) && NEXT2('(', '?') && iscalpha(*(v->now + 2))) { - NOTE(REG_UNONPOSIX); - v->now += 2; - for (; !ATEOS() && iscalpha(*v->now); v->now++) - switch (*v->now) { - case CHR('b'): /* BREs (but why???) */ - v->cflags &= ~(REG_ADVANCED|REG_QUOTE); - break; - case CHR('c'): /* case sensitive */ - v->cflags &= ~REG_ICASE; - break; - case CHR('e'): /* plain EREs */ - v->cflags |= REG_EXTENDED; - v->cflags &= ~(REG_ADVF|REG_QUOTE); - break; - case CHR('i'): /* case insensitive */ - v->cflags |= REG_ICASE; - break; - case CHR('m'): /* Perloid synonym for n */ - case CHR('n'): /* \n affects ^ $ . [^ */ - v->cflags |= REG_NEWLINE; - break; - case CHR('p'): /* ~Perl, \n affects . [^ */ - v->cflags |= REG_NLSTOP; - v->cflags &= ~REG_NLANCH; - break; - case CHR('q'): /* literal string */ - v->cflags |= REG_QUOTE; - v->cflags &= ~REG_ADVANCED; - break; - case CHR('s'): /* single line, \n ordinary */ - v->cflags &= ~REG_NEWLINE; - break; - case CHR('t'): /* tight syntax */ - v->cflags &= ~REG_EXPANDED; - break; - case CHR('w'): /* weird, \n affects ^ $ only */ - v->cflags &= ~REG_NLSTOP; - v->cflags |= REG_NLANCH; - break; - case CHR('x'): /* expanded syntax */ - v->cflags |= REG_EXPANDED; - break; - default: - ERR(REG_BADOPT); - return; - } - if (!NEXT1(')')) { - ERR(REG_BADOPT); - return; - } - v->now++; - if (v->cflags®_QUOTE) - v->cflags &= ~(REG_EXPANDED|REG_NEWLINE); - } -} - -/* - - lexnest - "call a subroutine", interpolating string at the lexical level - * Note, this is not a very general facility. There are a number of - * implicit assumptions about what sorts of strings can be subroutines. - ^ static VOID lexnest(struct vars *, chr *, chr *); - */ -static VOID -lexnest(v, beginp, endp) -struct vars *v; -chr *beginp; /* start of interpolation */ -chr *endp; /* one past end of interpolation */ -{ - assert(v->savenow == NULL); /* only one level of nesting */ - v->savenow = v->now; - v->savestop = v->stop; - v->now = beginp; - v->stop = endp; -} - -/* - * string constants to interpolate as expansions of things like \d - */ -static chr backd[] = { /* \d */ - CHR('['), CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr backD[] = { /* \D */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr brbackd[] = { /* \d within brackets */ - CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']') -}; -static chr backs[] = { /* \s */ - CHR('['), CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr backS[] = { /* \S */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr brbacks[] = { /* \s within brackets */ - CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']') -}; -static chr backw[] = { /* \w */ - CHR('['), CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_'), CHR(']') -}; -static chr backW[] = { /* \W */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_'), CHR(']') -}; -static chr brbackw[] = { /* \w within brackets */ - CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_') -}; - -/* - - lexword - interpolate a bracket expression for word characters - * Possibly ought to inquire whether there is a "word" character class. - ^ static VOID lexword(struct vars *); - */ -static VOID -lexword(v) -struct vars *v; -{ - lexnest(v, backw, ENDOF(backw)); -} - -/* - - next - get next token - ^ static int next(struct vars *); - */ -static int /* 1 normal, 0 failure */ -next(v) -struct vars *v; -{ - chr c; - - /* errors yield an infinite sequence of failures */ - if (ISERR()) - return 0; /* the error has set nexttype to EOS */ - - /* remember flavor of last token */ - v->lasttype = v->nexttype; - - /* REG_BOSONLY */ - if (v->nexttype == EMPTY && (v->cflags®_BOSONLY)) { - /* at start of a REG_BOSONLY RE */ - RETV(SBEGIN, 0); /* same as \A */ - } - - /* if we're nested and we've hit end, return to outer level */ - if (v->savenow != NULL && ATEOS()) { - v->now = v->savenow; - v->stop = v->savestop; - v->savenow = v->savestop = NULL; - } - - /* skip white space etc. if appropriate (not in literal or []) */ - if (v->cflags®_EXPANDED) - switch (v->lexcon) { - case L_ERE: - case L_BRE: - case L_EBND: - case L_BBND: - skip(v); - break; - } - - /* handle EOS, depending on context */ - if (ATEOS()) { - switch (v->lexcon) { - case L_ERE: - case L_BRE: - case L_Q: - RET(EOS); - break; - case L_EBND: - case L_BBND: - FAILW(REG_EBRACE); - break; - case L_BRACK: - case L_CEL: - case L_ECL: - case L_CCL: - FAILW(REG_EBRACK); - break; - } - assert(NOTREACHED); - } - - /* okay, time to actually get a character */ - c = *v->now++; - - /* deal with the easy contexts, punt EREs to code below */ - switch (v->lexcon) { - case L_BRE: /* punt BREs to separate function */ - return brenext(v, c); - break; - case L_ERE: /* see below */ - break; - case L_Q: /* literal strings are easy */ - RETV(PLAIN, c); - break; - case L_BBND: /* bounds are fairly simple */ - case L_EBND: - switch (c) { - case CHR('0'): case CHR('1'): case CHR('2'): case CHR('3'): - case CHR('4'): case CHR('5'): case CHR('6'): case CHR('7'): - case CHR('8'): case CHR('9'): - RETV(DIGIT, (chr)DIGITVAL(c)); - break; - case CHR(','): - RET(','); - break; - case CHR('}'): /* ERE bound ends with } */ - if (INCON(L_EBND)) { - INTOCON(L_ERE); - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('}', 0); - } - RETV('}', 1); - } else - FAILW(REG_BADBR); - break; - case CHR('\\'): /* BRE bound ends with \} */ - if (INCON(L_BBND) && NEXT1('}')) { - v->now++; - INTOCON(L_BRE); - RET('}'); - } else - FAILW(REG_BADBR); - break; - default: - FAILW(REG_BADBR); - break; - } - assert(NOTREACHED); - break; - case L_BRACK: /* brackets are not too hard */ - switch (c) { - case CHR(']'): - if (LASTTYPE('[')) - RETV(PLAIN, c); - else { - INTOCON((v->cflags®_EXTENDED) ? - L_ERE : L_BRE); - RET(']'); - } - break; - case CHR('\\'): - NOTE(REG_UBBS); - if (!(v->cflags®_ADVF)) - RETV(PLAIN, c); - NOTE(REG_UNONPOSIX); - if (ATEOS()) - FAILW(REG_EESCAPE); - (DISCARD)lexescape(v); - switch (v->nexttype) { /* not all escapes okay here */ - case PLAIN: - return 1; - break; - case CCLASS: - switch (v->nextvalue) { - case 'd': - lexnest(v, brbackd, ENDOF(brbackd)); - break; - case 's': - lexnest(v, brbacks, ENDOF(brbacks)); - break; - case 'w': - lexnest(v, brbackw, ENDOF(brbackw)); - break; - default: - FAILW(REG_EESCAPE); - break; - } - /* lexnest done, back up and try again */ - v->nexttype = v->lasttype; - return next(v); - break; - } - /* not one of the acceptable escapes */ - FAILW(REG_EESCAPE); - break; - case CHR('-'): - if (LASTTYPE('[') || NEXT1(']')) - RETV(PLAIN, c); - else - RETV(RANGE, c); - break; - case CHR('['): - if (ATEOS()) - FAILW(REG_EBRACK); - switch (*v->now++) { - case CHR('.'): - INTOCON(L_CEL); - /* might or might not be locale-specific */ - RET(COLLEL); - break; - case CHR('='): - INTOCON(L_ECL); - NOTE(REG_ULOCALE); - RET(ECLASS); - break; - case CHR(':'): - INTOCON(L_CCL); - NOTE(REG_ULOCALE); - RET(CCLASS); - break; - default: /* oops */ - v->now--; - RETV(PLAIN, c); - break; - } - assert(NOTREACHED); - break; - default: - RETV(PLAIN, c); - break; - } - assert(NOTREACHED); - break; - case L_CEL: /* collating elements are easy */ - if (c == CHR('.') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, '.'); - } else - RETV(PLAIN, c); - break; - case L_ECL: /* ditto equivalence classes */ - if (c == CHR('=') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, '='); - } else - RETV(PLAIN, c); - break; - case L_CCL: /* ditto character classes */ - if (c == CHR(':') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, ':'); - } else - RETV(PLAIN, c); - break; - default: - assert(NOTREACHED); - break; - } - - /* that got rid of everything except EREs and AREs */ - assert(INCON(L_ERE)); - - /* deal with EREs and AREs, except for backslashes */ - switch (c) { - case CHR('|'): - RET('|'); - break; - case CHR('*'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('*', 0); - } - RETV('*', 1); - break; - case CHR('+'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('+', 0); - } - RETV('+', 1); - break; - case CHR('?'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('?', 0); - } - RETV('?', 1); - break; - case CHR('{'): /* bounds start or plain character */ - if (v->cflags®_EXPANDED) - skip(v); - if (ATEOS() || !iscdigit(*v->now)) { - NOTE(REG_UBRACES); - NOTE(REG_UUNSPEC); - RETV(PLAIN, c); - } else { - NOTE(REG_UBOUNDS); - INTOCON(L_EBND); - RET('{'); - } - assert(NOTREACHED); - break; - case CHR('('): /* parenthesis, or advanced extension */ - if ((v->cflags®_ADVF) && NEXT1('?')) { - NOTE(REG_UNONPOSIX); - v->now++; - switch (*v->now++) { - case CHR(':'): /* non-capturing paren */ - RETV('(', 0); - break; - case CHR('#'): /* comment */ - while (!ATEOS() && *v->now != CHR(')')) - v->now++; - if (!ATEOS()) - v->now++; - assert(v->nexttype == v->lasttype); - return next(v); - break; - case CHR('='): /* positive lookahead */ - NOTE(REG_ULOOKAHEAD); - RETV(LACON, 1); - break; - case CHR('!'): /* negative lookahead */ - NOTE(REG_ULOOKAHEAD); - RETV(LACON, 0); - break; - default: - FAILW(REG_BADRPT); - break; - } - assert(NOTREACHED); - } - if (v->cflags®_NOSUB) - RETV('(', 0); /* all parens non-capturing */ - else - RETV('(', 1); - break; - case CHR(')'): - if (LASTTYPE('(')) { - NOTE(REG_UUNSPEC); - } - RETV(')', c); - break; - case CHR('['): /* easy except for [[:<:]] and [[:>:]] */ - if (HAVE(6) && *(v->now+0) == CHR('[') && - *(v->now+1) == CHR(':') && - (*(v->now+2) == CHR('<') || - *(v->now+2) == CHR('>')) && - *(v->now+3) == CHR(':') && - *(v->now+4) == CHR(']') && - *(v->now+5) == CHR(']')) { - c = *(v->now+2); - v->now += 6; - NOTE(REG_UNONPOSIX); - RET((c == CHR('<')) ? '<' : '>'); - } - INTOCON(L_BRACK); - if (NEXT1('^')) { - v->now++; - RETV('[', 0); - } - RETV('[', 1); - break; - case CHR('.'): - RET('.'); - break; - case CHR('^'): - RET('^'); - break; - case CHR('$'): - RET('$'); - break; - case CHR('\\'): /* mostly punt backslashes to code below */ - if (ATEOS()) - FAILW(REG_EESCAPE); - break; - default: /* ordinary character */ - RETV(PLAIN, c); - break; - } - - /* ERE/ARE backslash handling; backslash already eaten */ - assert(!ATEOS()); - if (!(v->cflags®_ADVF)) { /* only AREs have non-trivial escapes */ - if (iscalnum(*v->now)) { - NOTE(REG_UBSALNUM); - NOTE(REG_UUNSPEC); - } - RETV(PLAIN, *v->now++); - } - (DISCARD)lexescape(v); - if (ISERR()) - FAILW(REG_EESCAPE); - if (v->nexttype == CCLASS) { /* fudge at lexical level */ - switch (v->nextvalue) { - case 'd': lexnest(v, backd, ENDOF(backd)); break; - case 'D': lexnest(v, backD, ENDOF(backD)); break; - case 's': lexnest(v, backs, ENDOF(backs)); break; - case 'S': lexnest(v, backS, ENDOF(backS)); break; - case 'w': lexnest(v, backw, ENDOF(backw)); break; - case 'W': lexnest(v, backW, ENDOF(backW)); break; - default: - assert(NOTREACHED); - FAILW(REG_ASSERT); - break; - } - /* lexnest done, back up and try again */ - v->nexttype = v->lasttype; - return next(v); - } - /* otherwise, lexescape has already done the work */ - return !ISERR(); -} - -/* - - lexescape - parse an ARE backslash escape (backslash already eaten) - * Note slightly nonstandard use of the CCLASS type code. - ^ static int lexescape(struct vars *); - */ -static int /* not actually used, but convenient for RETV */ -lexescape(v) -struct vars *v; -{ - chr c; - static chr alert[] = { - CHR('a'), CHR('l'), CHR('e'), CHR('r'), CHR('t') - }; - static chr esc[] = { - CHR('E'), CHR('S'), CHR('C') - }; - chr *save; - - assert(v->cflags®_ADVF); - - assert(!ATEOS()); - c = *v->now++; - if (!iscalnum(c)) - RETV(PLAIN, c); - - NOTE(REG_UNONPOSIX); - switch (c) { - case CHR('a'): - RETV(PLAIN, chrnamed(v, alert, ENDOF(alert), CHR('\007'))); - break; - case CHR('A'): - RETV(SBEGIN, 0); - break; - case CHR('b'): - RETV(PLAIN, CHR('\b')); - break; - case CHR('B'): - RETV(PLAIN, CHR('\\')); - break; - case CHR('c'): - NOTE(REG_UUNPORT); - if (ATEOS()) - FAILW(REG_EESCAPE); - RETV(PLAIN, (chr)(*v->now++ & 037)); - break; - case CHR('d'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'd'); - break; - case CHR('D'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'D'); - break; - case CHR('e'): - NOTE(REG_UUNPORT); - RETV(PLAIN, chrnamed(v, esc, ENDOF(esc), CHR('\033'))); - break; - case CHR('f'): - RETV(PLAIN, CHR('\f')); - break; - case CHR('m'): - RET('<'); - break; - case CHR('M'): - RET('>'); - break; - case CHR('n'): - RETV(PLAIN, CHR('\n')); - break; - case CHR('r'): - RETV(PLAIN, CHR('\r')); - break; - case CHR('s'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 's'); - break; - case CHR('S'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'S'); - break; - case CHR('t'): - RETV(PLAIN, CHR('\t')); - break; - case CHR('u'): - c = lexdigits(v, 16, 4, 4); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('U'): - c = lexdigits(v, 16, 8, 8); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('v'): - RETV(PLAIN, CHR('\v')); - break; - case CHR('w'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'w'); - break; - case CHR('W'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'W'); - break; - case CHR('x'): - NOTE(REG_UUNPORT); - c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */ - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('y'): - NOTE(REG_ULOCALE); - RETV(WBDRY, 0); - break; - case CHR('Y'): - NOTE(REG_ULOCALE); - RETV(NWBDRY, 0); - break; - case CHR('Z'): - RETV(SEND, 0); - break; - case CHR('1'): case CHR('2'): case CHR('3'): case CHR('4'): - case CHR('5'): case CHR('6'): case CHR('7'): case CHR('8'): - case CHR('9'): - save = v->now; - v->now--; /* put first digit back */ - c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */ - if (ISERR()) - FAILW(REG_EESCAPE); - /* ugly heuristic (first test is "exactly 1 digit?") */ - if (v->now - save == 0 || (int)c <= v->nsubexp) { - NOTE(REG_UBACKREF); - RETV(BACKREF, (chr)c); - } - /* oops, doesn't look like it's a backref after all... */ - v->now = save; - /* and fall through into octal number */ - case CHR('0'): - NOTE(REG_UUNPORT); - v->now--; /* put first digit back */ - c = lexdigits(v, 8, 1, 3); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - default: - assert(iscalpha(c)); - FAILW(REG_EESCAPE); /* unknown alphabetic escape */ - break; - } - assert(NOTREACHED); -} - -/* - - lexdigits - slurp up digits and return chr value - ^ static chr lexdigits(struct vars *, int, int, int); - */ -static chr /* chr value; errors signalled via ERR */ -lexdigits(v, base, minlen, maxlen) -struct vars *v; -int base; -int minlen; -int maxlen; -{ - uchr n; /* unsigned to avoid overflow misbehavior */ - int len; - chr c; - int d; - CONST uchr ub = (uchr) base; - - n = 0; - for (len = 0; len < maxlen && !ATEOS(); len++) { - c = *v->now++; - switch (c) { - case CHR('0'): case CHR('1'): case CHR('2'): case CHR('3'): - case CHR('4'): case CHR('5'): case CHR('6'): case CHR('7'): - case CHR('8'): case CHR('9'): - d = DIGITVAL(c); - break; - case CHR('a'): case CHR('A'): d = 10; break; - case CHR('b'): case CHR('B'): d = 11; break; - case CHR('c'): case CHR('C'): d = 12; break; - case CHR('d'): case CHR('D'): d = 13; break; - case CHR('e'): case CHR('E'): d = 14; break; - case CHR('f'): case CHR('F'): d = 15; break; - default: - v->now--; /* oops, not a digit at all */ - d = -1; - break; - } - - if (d >= base) { /* not a plausible digit */ - v->now--; - d = -1; - } - if (d < 0) - break; /* NOTE BREAK OUT */ - n = n*ub + (uchr)d; - } - if (len < minlen) - ERR(REG_EESCAPE); - - return (chr)n; -} - -/* - - brenext - get next BRE token - * This is much like EREs except for all the stupid backslashes and the - * context-dependency of some things. - ^ static int brenext(struct vars *, pchr); - */ -static int /* 1 normal, 0 failure */ -brenext(v, pc) -struct vars *v; -pchr pc; -{ - chr c = (chr)pc; - - switch (c) { - case CHR('*'): - if (LASTTYPE(EMPTY) || LASTTYPE('(') || LASTTYPE('^')) - RETV(PLAIN, c); - RET('*'); - break; - case CHR('['): - if (HAVE(6) && *(v->now+0) == CHR('[') && - *(v->now+1) == CHR(':') && - (*(v->now+2) == CHR('<') || - *(v->now+2) == CHR('>')) && - *(v->now+3) == CHR(':') && - *(v->now+4) == CHR(']') && - *(v->now+5) == CHR(']')) { - c = *(v->now+2); - v->now += 6; - NOTE(REG_UNONPOSIX); - RET((c == CHR('<')) ? '<' : '>'); - } - INTOCON(L_BRACK); - if (NEXT1('^')) { - v->now++; - RETV('[', 0); - } - RETV('[', 1); - break; - case CHR('.'): - RET('.'); - break; - case CHR('^'): - if (LASTTYPE(EMPTY)) - RET('^'); - if (LASTTYPE('(')) { - NOTE(REG_UUNSPEC); - RET('^'); - } - RETV(PLAIN, c); - break; - case CHR('$'): - if (v->cflags®_EXPANDED) - skip(v); - if (ATEOS()) - RET('$'); - if (NEXT2('\\', ')')) { - NOTE(REG_UUNSPEC); - RET('$'); - } - RETV(PLAIN, c); - break; - case CHR('\\'): - break; /* see below */ - default: - RETV(PLAIN, c); - break; - } - - assert(c == CHR('\\')); - - if (ATEOS()) - FAILW(REG_EESCAPE); - - c = *v->now++; - switch (c) { - case CHR('{'): - INTOCON(L_BBND); - NOTE(REG_UBOUNDS); - RET('{'); - break; - case CHR('('): - RETV('(', 1); - break; - case CHR(')'): - RETV(')', c); - break; - case CHR('<'): - NOTE(REG_UNONPOSIX); - RET('<'); - break; - case CHR('>'): - NOTE(REG_UNONPOSIX); - RET('>'); - break; - case CHR('1'): case CHR('2'): case CHR('3'): case CHR('4'): - case CHR('5'): case CHR('6'): case CHR('7'): case CHR('8'): - case CHR('9'): - NOTE(REG_UBACKREF); - RETV(BACKREF, (chr)DIGITVAL(c)); - break; - default: - if (iscalnum(c)) { - NOTE(REG_UBSALNUM); - NOTE(REG_UUNSPEC); - } - RETV(PLAIN, c); - break; - } - - assert(NOTREACHED); -} - -/* - - skip - skip white space and comments in expanded form - ^ static VOID skip(struct vars *); - */ -static VOID -skip(v) -struct vars *v; -{ - chr *start = v->now; - - assert(v->cflags®_EXPANDED); - - for (;;) { - while (!ATEOS() && iscspace(*v->now)) - v->now++; - if (ATEOS() || *v->now != CHR('#')) - break; /* NOTE BREAK OUT */ - assert(NEXT1('#')); - while (!ATEOS() && *v->now != CHR('\n')) - v->now++; - /* leave the newline to be picked up by the iscspace loop */ - } - - if (v->now != start) - NOTE(REG_UNONPOSIX); -} - -/* - - newline - return the chr for a newline - * This helps confine use of CHR to this source file. - ^ static chr newline(NOPARMS); - */ -static chr -newline() -{ - return CHR('\n'); -} - -/* - - ch - return the chr sequence for regc_locale.c's fake collating element ch - * This helps confine use of CHR to this source file. Beware that the caller - * knows how long the sequence is. - ^ #ifdef REG_DEBUG - ^ static chr *ch(NOPARMS); - ^ #endif - */ -#ifdef REG_DEBUG -static chr * -ch() -{ - static chr chstr[] = { CHR('c'), CHR('h'), CHR('\0') }; - - return chstr; -} -#endif - -/* - - chrnamed - return the chr known by a given (chr string) name - * The code is a bit clumsy, but this routine gets only such specialized - * use that it hardly matters. - ^ static chr chrnamed(struct vars *, chr *, chr *, pchr); - */ -static chr -chrnamed(v, startp, endp, lastresort) -struct vars *v; -chr *startp; /* start of name */ -chr *endp; /* just past end of name */ -pchr lastresort; /* what to return if name lookup fails */ -{ - celt c; - int errsave; - int e; - struct cvec *cv; - - errsave = v->err; - v->err = 0; - c = element(v, startp, endp); - e = v->err; - v->err = errsave; - - if (e != 0) - return (chr)lastresort; - - cv = range(v, c, c, 0); - if (cv->nchrs == 0) - return (chr)lastresort; - return cv->chrs[0]; -} diff --git a/src/regex/regc_locale.c b/src/regex/regc_locale.c deleted file mode 100644 index b583bb43e2..0000000000 --- a/src/regex/regc_locale.c +++ /dev/null @@ -1,1051 +0,0 @@ -/* - * regc_locale.c -- - * - * This file contains the Unicode locale specific regexp routines. - * This file is #included by regcomp.c. - * - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * - * wxWidgets: - * The Scriptics license can be found in the file COPYRIGHT. Modifications - * for wxWidgets are under the wxWindows licence, see README for details. - */ - -#ifndef CONST -#define CONST const -#endif - -/* ASCII character-name table */ - -static struct cname { - chr *name; - char code; -} cnames[] = { - {wxT("NUL"), '\0'}, - {wxT("SOH"), '\001'}, - {wxT("STX"), '\002'}, - {wxT("ETX"), '\003'}, - {wxT("EOT"), '\004'}, - {wxT("ENQ"), '\005'}, - {wxT("ACK"), '\006'}, - {wxT("BEL"), '\007'}, - {wxT("alert"), '\007'}, - {wxT("BS"), '\010'}, - {wxT("backspace"), '\b'}, - {wxT("HT"), '\011'}, - {wxT("tab"), '\t'}, - {wxT("LF"), '\012'}, - {wxT("newline"), '\n'}, - {wxT("VT"), '\013'}, - {wxT("vertical-tab"), '\v'}, - {wxT("FF"), '\014'}, - {wxT("form-feed"), '\f'}, - {wxT("CR"), '\015'}, - {wxT("carriage-return"), '\r'}, - {wxT("SO"), '\016'}, - {wxT("SI"), '\017'}, - {wxT("DLE"), '\020'}, - {wxT("DC1"), '\021'}, - {wxT("DC2"), '\022'}, - {wxT("DC3"), '\023'}, - {wxT("DC4"), '\024'}, - {wxT("NAK"), '\025'}, - {wxT("SYN"), '\026'}, - {wxT("ETB"), '\027'}, - {wxT("CAN"), '\030'}, - {wxT("EM"), '\031'}, - {wxT("SUB"), '\032'}, - {wxT("ESC"), '\033'}, - {wxT("IS4"), '\034'}, - {wxT("FS"), '\034'}, - {wxT("IS3"), '\035'}, - {wxT("GS"), '\035'}, - {wxT("IS2"), '\036'}, - {wxT("RS"), '\036'}, - {wxT("IS1"), '\037'}, - {wxT("US"), '\037'}, - {wxT("space"), ' '}, - {wxT("exclamation-mark"), '!'}, - {wxT("quotation-mark"), '"'}, - {wxT("number-sign"), '#'}, - {wxT("dollar-sign"), '$'}, - {wxT("percent-sign"), '%'}, - {wxT("ampersand"), '&'}, - {wxT("apostrophe"), '\''}, - {wxT("left-parenthesis"), '('}, - {wxT("right-parenthesis"), ')'}, - {wxT("asterisk"), '*'}, - {wxT("plus-sign"), '+'}, - {wxT("comma"), ','}, - {wxT("hyphen"), '-'}, - {wxT("hyphen-minus"), '-'}, - {wxT("period"), '.'}, - {wxT("full-stop"), '.'}, - {wxT("slash"), '/'}, - {wxT("solidus"), '/'}, - {wxT("zero"), '0'}, - {wxT("one"), '1'}, - {wxT("two"), '2'}, - {wxT("three"), '3'}, - {wxT("four"), '4'}, - {wxT("five"), '5'}, - {wxT("six"), '6'}, - {wxT("seven"), '7'}, - {wxT("eight"), '8'}, - {wxT("nine"), '9'}, - {wxT("colon"), ':'}, - {wxT("semicolon"), ';'}, - {wxT("less-than-sign"), '<'}, - {wxT("equals-sign"), '='}, - {wxT("greater-than-sign"), '>'}, - {wxT("question-mark"), '?'}, - {wxT("commercial-at"), '@'}, - {wxT("left-square-bracket"), '['}, - {wxT("backslash"), '\\'}, - {wxT("reverse-solidus"), '\\'}, - {wxT("right-square-bracket"), ']'}, - {wxT("circumflex"), '^'}, - {wxT("circumflex-accent"), '^'}, - {wxT("underscore"), '_'}, - {wxT("low-line"), '_'}, - {wxT("grave-accent"), '`'}, - {wxT("left-brace"), '{'}, - {wxT("left-curly-bracket"), '{'}, - {wxT("vertical-line"), '|'}, - {wxT("right-brace"), '}'}, - {wxT("right-curly-bracket"), '}'}, - {wxT("tilde"), '~'}, - {wxT("DEL"), '\177'}, - {NULL, 0} -}; - -/* Unicode character-class tables */ - -typedef struct crange { - chr start; - chr end; -} crange; - -/* - * Declarations of Unicode character ranges. This code - * is automatically generated by the tools/uniClass.tcl script - * and used in generic/regc_locale.c. Do not modify by hand. - */ - -/* Unicode: alphabetic characters */ - -static crange alphaRangeTable[] = { - {0x0041, 0x005a}, {0x0061, 0x007a}, {0x00c0, 0x00d6}, {0x00d8, 0x00f6}, - {0x00f8, 0x021f}, {0x0222, 0x0233}, {0x0250, 0x02ad}, {0x02b0, 0x02b8}, - {0x02bb, 0x02c1}, {0x02e0, 0x02e4}, {0x0388, 0x038a}, {0x038e, 0x03a1}, - {0x03a3, 0x03ce}, {0x03d0, 0x03d7}, {0x03da, 0x03f5}, {0x0400, 0x0481}, - {0x048c, 0x04c4}, {0x04d0, 0x04f5}, {0x0531, 0x0556}, {0x0561, 0x0587}, - {0x05d0, 0x05ea}, {0x05f0, 0x05f2}, {0x0621, 0x063a}, {0x0640, 0x064a}, - {0x0671, 0x06d3}, {0x06fa, 0x06fc}, {0x0712, 0x072c}, {0x0780, 0x07a5}, - {0x0905, 0x0939}, {0x0958, 0x0961}, {0x0985, 0x098c}, {0x0993, 0x09a8}, - {0x09aa, 0x09b0}, {0x09b6, 0x09b9}, {0x09df, 0x09e1}, {0x0a05, 0x0a0a}, - {0x0a13, 0x0a28}, {0x0a2a, 0x0a30}, {0x0a59, 0x0a5c}, {0x0a72, 0x0a74}, - {0x0a85, 0x0a8b}, {0x0a8f, 0x0a91}, {0x0a93, 0x0aa8}, {0x0aaa, 0x0ab0}, - {0x0ab5, 0x0ab9}, {0x0b05, 0x0b0c}, {0x0b13, 0x0b28}, {0x0b2a, 0x0b30}, - {0x0b36, 0x0b39}, {0x0b5f, 0x0b61}, {0x0b85, 0x0b8a}, {0x0b8e, 0x0b90}, - {0x0b92, 0x0b95}, {0x0ba8, 0x0baa}, {0x0bae, 0x0bb5}, {0x0bb7, 0x0bb9}, - {0x0c05, 0x0c0c}, {0x0c0e, 0x0c10}, {0x0c12, 0x0c28}, {0x0c2a, 0x0c33}, - {0x0c35, 0x0c39}, {0x0c85, 0x0c8c}, {0x0c8e, 0x0c90}, {0x0c92, 0x0ca8}, - {0x0caa, 0x0cb3}, {0x0cb5, 0x0cb9}, {0x0d05, 0x0d0c}, {0x0d0e, 0x0d10}, - {0x0d12, 0x0d28}, {0x0d2a, 0x0d39}, {0x0d85, 0x0d96}, {0x0d9a, 0x0db1}, - {0x0db3, 0x0dbb}, {0x0dc0, 0x0dc6}, {0x0e01, 0x0e30}, {0x0e40, 0x0e46}, - {0x0e94, 0x0e97}, {0x0e99, 0x0e9f}, {0x0ea1, 0x0ea3}, {0x0ead, 0x0eb0}, - {0x0ec0, 0x0ec4}, {0x0f40, 0x0f47}, {0x0f49, 0x0f6a}, {0x0f88, 0x0f8b}, - {0x1000, 0x1021}, {0x1023, 0x1027}, {0x1050, 0x1055}, {0x10a0, 0x10c5}, - {0x10d0, 0x10f6}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, - {0x1200, 0x1206}, {0x1208, 0x1246}, {0x124a, 0x124d}, {0x1250, 0x1256}, - {0x125a, 0x125d}, {0x1260, 0x1286}, {0x128a, 0x128d}, {0x1290, 0x12ae}, - {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12ce}, - {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, {0x1312, 0x1315}, - {0x1318, 0x131e}, {0x1320, 0x1346}, {0x1348, 0x135a}, {0x13a0, 0x13f4}, - {0x1401, 0x166c}, {0x166f, 0x1676}, {0x1681, 0x169a}, {0x16a0, 0x16ea}, - {0x1780, 0x17b3}, {0x1820, 0x1877}, {0x1880, 0x18a8}, {0x1e00, 0x1e9b}, - {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, - {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, - {0x1fb6, 0x1fbc}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, - {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, - {0x210a, 0x2113}, {0x2119, 0x211d}, {0x212a, 0x212d}, {0x212f, 0x2131}, - {0x2133, 0x2139}, {0x3031, 0x3035}, {0x3041, 0x3094}, {0x30a1, 0x30fa}, - {0x30fc, 0x30fe}, {0x3105, 0x312c}, {0x3131, 0x318e}, {0x31a0, 0x31b7}, - {0x3400, 0x4db5}, {0x4e00, 0x9fa5}, {0xa000, 0xa48c}, {0xac00, 0xd7a3}, - {0xf900, 0xfa2d}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1f, 0xfb28}, - {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d}, - {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe72}, - {0xfe76, 0xfefc}, {0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe}, - {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc} -}; - -const int NUM_ALPHA_RANGE = (sizeof(alphaRangeTable)/sizeof(crange)); - -static chr alphaCharTable[] = { - 0x00aa, 0x00b5, 0x00ba, 0x02d0, 0x02d1, 0x02ee, 0x037a, 0x0386, 0x038c, - 0x04c7, 0x04c8, 0x04cb, 0x04cc, 0x04f8, 0x04f9, 0x0559, 0x06d5, 0x06e5, - 0x06e6, 0x0710, 0x093d, 0x0950, 0x098f, 0x0990, 0x09b2, 0x09dc, 0x09dd, - 0x09f0, 0x09f1, 0x0a0f, 0x0a10, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, - 0x0a39, 0x0a5e, 0x0a8d, 0x0ab2, 0x0ab3, 0x0abd, 0x0ad0, 0x0ae0, 0x0b0f, - 0x0b10, 0x0b32, 0x0b33, 0x0b3d, 0x0b5c, 0x0b5d, 0x0b99, 0x0b9a, 0x0b9c, - 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0c60, 0x0c61, 0x0cde, 0x0ce0, 0x0ce1, - 0x0d60, 0x0d61, 0x0dbd, 0x0e32, 0x0e33, 0x0e81, 0x0e82, 0x0e84, 0x0e87, - 0x0e88, 0x0e8a, 0x0e8d, 0x0ea5, 0x0ea7, 0x0eaa, 0x0eab, 0x0eb2, 0x0eb3, - 0x0ebd, 0x0ec6, 0x0edc, 0x0edd, 0x0f00, 0x1029, 0x102a, 0x1248, 0x1258, - 0x1288, 0x12b0, 0x12c0, 0x1310, 0x1f59, 0x1f5b, 0x1f5d, 0x1fbe, 0x207f, - 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x3005, 0x3006, 0x309d, - 0x309e, 0xfb1d, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfe74, 0xfffe -}; - -const int NUM_ALPHA_CHAR = (sizeof(alphaCharTable)/sizeof(chr)); - -/* Unicode: decimal digit characters */ - -static crange digitRangeTable[] = { - {0x0030, 0x0039}, {0x0660, 0x0669}, {0x06f0, 0x06f9}, {0x0966, 0x096f}, - {0x09e6, 0x09ef}, {0x0a66, 0x0a6f}, {0x0ae6, 0x0aef}, {0x0b66, 0x0b6f}, - {0x0be7, 0x0bef}, {0x0c66, 0x0c6f}, {0x0ce6, 0x0cef}, {0x0d66, 0x0d6f}, - {0x0e50, 0x0e59}, {0x0ed0, 0x0ed9}, {0x0f20, 0x0f29}, {0x1040, 0x1049}, - {0x1369, 0x1371}, {0x17e0, 0x17e9}, {0x1810, 0x1819}, {0xff10, 0xff19} -}; - -const int NUM_DIGIT_RANGE = (sizeof(digitRangeTable)/sizeof(crange)); - -/* no singletons of digit characters */ - -/* Unicode: punctuation characters */ - -static crange punctRangeTable[] = { - {0x0021, 0x0023}, {0x0025, 0x002a}, {0x002c, 0x002f}, {0x005b, 0x005d}, - {0x055a, 0x055f}, {0x066a, 0x066d}, {0x0700, 0x070d}, {0x0f04, 0x0f12}, - {0x0f3a, 0x0f3d}, {0x104a, 0x104f}, {0x1361, 0x1368}, {0x16eb, 0x16ed}, - {0x17d4, 0x17da}, {0x1800, 0x180a}, {0x2010, 0x2027}, {0x2030, 0x2043}, - {0x2048, 0x204d}, {0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, - {0xfe30, 0xfe44}, {0xfe49, 0xfe52}, {0xfe54, 0xfe61}, {0xff01, 0xff03}, - {0xff05, 0xff0a}, {0xff0c, 0xff0f}, {0xff3b, 0xff3d}, {0xff61, 0xff65} -}; - -const int NUM_PUNCT_RANGE = (sizeof(punctRangeTable)/sizeof(crange)); - -static chr punctCharTable[] = { - 0x003a, 0x003b, 0x003f, 0x0040, 0x005f, 0x007b, 0x007d, 0x00a1, 0x00ab, - 0x00ad, 0x00b7, 0x00bb, 0x00bf, 0x037e, 0x0387, 0x0589, 0x058a, 0x05be, - 0x05c0, 0x05c3, 0x05f3, 0x05f4, 0x060c, 0x061b, 0x061f, 0x06d4, 0x0964, - 0x0965, 0x0970, 0x0df4, 0x0e4f, 0x0e5a, 0x0e5b, 0x0f85, 0x10fb, 0x166d, - 0x166e, 0x169b, 0x169c, 0x17dc, 0x2045, 0x2046, 0x207d, 0x207e, 0x208d, - 0x208e, 0x2329, 0x232a, 0x3030, 0x30fb, 0xfd3e, 0xfd3f, 0xfe63, 0xfe68, - 0xfe6a, 0xfe6b, 0xff1a, 0xff1b, 0xff1f, 0xff20, 0xff3f, 0xff5b, 0xff5d -}; - -const int NUM_PUNCT_CHAR = (sizeof(punctCharTable)/sizeof(chr)); - -/* Unicode: white space characters */ - -static crange spaceRangeTable[] = { - {0x0009, 0x000d}, {0x2000, 0x200b} -}; - -const int NUM_SPACE_RANGE = (sizeof(spaceRangeTable)/sizeof(crange)); - -static chr spaceCharTable[] = { - 0x0020, 0x00a0, 0x1680, 0x2028, 0x2029, 0x202f, 0x3000 -}; - -const int NUM_SPACE_CHAR = (sizeof(spaceCharTable)/sizeof(chr)); - -/* Unicode: lowercase characters */ - -static crange lowerRangeTable[] = { - {0x0061, 0x007a}, {0x00df, 0x00f6}, {0x00f8, 0x00ff}, {0x017e, 0x0180}, - {0x0199, 0x019b}, {0x01bd, 0x01bf}, {0x0250, 0x02ad}, {0x03ac, 0x03ce}, - {0x03d5, 0x03d7}, {0x03ef, 0x03f3}, {0x0430, 0x045f}, {0x0561, 0x0587}, - {0x1e95, 0x1e9b}, {0x1f00, 0x1f07}, {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, - {0x1f30, 0x1f37}, {0x1f40, 0x1f45}, {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, - {0x1f70, 0x1f7d}, {0x1f80, 0x1f87}, {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, - {0x1fb0, 0x1fb4}, {0x1fc2, 0x1fc4}, {0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, - {0x1ff2, 0x1ff4}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xff41, 0xff5a} -}; - -const int NUM_LOWER_RANGE = (sizeof(lowerRangeTable)/sizeof(crange)); - -static chr lowerCharTable[] = { - 0x00aa, 0x00b5, 0x00ba, 0x0101, 0x0103, 0x0105, 0x0107, 0x0109, 0x010b, - 0x010d, 0x010f, 0x0111, 0x0113, 0x0115, 0x0117, 0x0119, 0x011b, 0x011d, - 0x011f, 0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0x012b, 0x012d, 0x012f, - 0x0131, 0x0133, 0x0135, 0x0137, 0x0138, 0x013a, 0x013c, 0x013e, 0x0140, - 0x0142, 0x0144, 0x0146, 0x0148, 0x0149, 0x014b, 0x014d, 0x014f, 0x0151, - 0x0153, 0x0155, 0x0157, 0x0159, 0x015b, 0x015d, 0x015f, 0x0161, 0x0163, - 0x0165, 0x0167, 0x0169, 0x016b, 0x016d, 0x016f, 0x0171, 0x0173, 0x0175, - 0x0177, 0x017a, 0x017c, 0x0183, 0x0185, 0x0188, 0x018c, 0x018d, 0x0192, - 0x0195, 0x019e, 0x01a1, 0x01a3, 0x01a5, 0x01a8, 0x01aa, 0x01ab, 0x01ad, - 0x01b0, 0x01b4, 0x01b6, 0x01b9, 0x01ba, 0x01c6, 0x01c9, 0x01cc, 0x01ce, - 0x01d0, 0x01d2, 0x01d4, 0x01d6, 0x01d8, 0x01da, 0x01dc, 0x01dd, 0x01df, - 0x01e1, 0x01e3, 0x01e5, 0x01e7, 0x01e9, 0x01eb, 0x01ed, 0x01ef, 0x01f0, - 0x01f3, 0x01f5, 0x01f9, 0x01fb, 0x01fd, 0x01ff, 0x0201, 0x0203, 0x0205, - 0x0207, 0x0209, 0x020b, 0x020d, 0x020f, 0x0211, 0x0213, 0x0215, 0x0217, - 0x0219, 0x021b, 0x021d, 0x021f, 0x0223, 0x0225, 0x0227, 0x0229, 0x022b, - 0x022d, 0x022f, 0x0231, 0x0233, 0x0390, 0x03d0, 0x03d1, 0x03db, 0x03dd, - 0x03df, 0x03e1, 0x03e3, 0x03e5, 0x03e7, 0x03e9, 0x03eb, 0x03ed, 0x03f5, - 0x0461, 0x0463, 0x0465, 0x0467, 0x0469, 0x046b, 0x046d, 0x046f, 0x0471, - 0x0473, 0x0475, 0x0477, 0x0479, 0x047b, 0x047d, 0x047f, 0x0481, 0x048d, - 0x048f, 0x0491, 0x0493, 0x0495, 0x0497, 0x0499, 0x049b, 0x049d, 0x049f, - 0x04a1, 0x04a3, 0x04a5, 0x04a7, 0x04a9, 0x04ab, 0x04ad, 0x04af, 0x04b1, - 0x04b3, 0x04b5, 0x04b7, 0x04b9, 0x04bb, 0x04bd, 0x04bf, 0x04c2, 0x04c4, - 0x04c8, 0x04cc, 0x04d1, 0x04d3, 0x04d5, 0x04d7, 0x04d9, 0x04db, 0x04dd, - 0x04df, 0x04e1, 0x04e3, 0x04e5, 0x04e7, 0x04e9, 0x04eb, 0x04ed, 0x04ef, - 0x04f1, 0x04f3, 0x04f5, 0x04f9, 0x1e01, 0x1e03, 0x1e05, 0x1e07, 0x1e09, - 0x1e0b, 0x1e0d, 0x1e0f, 0x1e11, 0x1e13, 0x1e15, 0x1e17, 0x1e19, 0x1e1b, - 0x1e1d, 0x1e1f, 0x1e21, 0x1e23, 0x1e25, 0x1e27, 0x1e29, 0x1e2b, 0x1e2d, - 0x1e2f, 0x1e31, 0x1e33, 0x1e35, 0x1e37, 0x1e39, 0x1e3b, 0x1e3d, 0x1e3f, - 0x1e41, 0x1e43, 0x1e45, 0x1e47, 0x1e49, 0x1e4b, 0x1e4d, 0x1e4f, 0x1e51, - 0x1e53, 0x1e55, 0x1e57, 0x1e59, 0x1e5b, 0x1e5d, 0x1e5f, 0x1e61, 0x1e63, - 0x1e65, 0x1e67, 0x1e69, 0x1e6b, 0x1e6d, 0x1e6f, 0x1e71, 0x1e73, 0x1e75, - 0x1e77, 0x1e79, 0x1e7b, 0x1e7d, 0x1e7f, 0x1e81, 0x1e83, 0x1e85, 0x1e87, - 0x1e89, 0x1e8b, 0x1e8d, 0x1e8f, 0x1e91, 0x1e93, 0x1ea1, 0x1ea3, 0x1ea5, - 0x1ea7, 0x1ea9, 0x1eab, 0x1ead, 0x1eaf, 0x1eb1, 0x1eb3, 0x1eb5, 0x1eb7, - 0x1eb9, 0x1ebb, 0x1ebd, 0x1ebf, 0x1ec1, 0x1ec3, 0x1ec5, 0x1ec7, 0x1ec9, - 0x1ecb, 0x1ecd, 0x1ecf, 0x1ed1, 0x1ed3, 0x1ed5, 0x1ed7, 0x1ed9, 0x1edb, - 0x1edd, 0x1edf, 0x1ee1, 0x1ee3, 0x1ee5, 0x1ee7, 0x1ee9, 0x1eeb, 0x1eed, - 0x1eef, 0x1ef1, 0x1ef3, 0x1ef5, 0x1ef7, 0x1ef9, 0x1fb6, 0x1fb7, 0x1fbe, - 0x1fc6, 0x1fc7, 0x1fd6, 0x1fd7, 0x1ff6, 0x1ff7, 0x207f, 0x210a, 0x210e, - 0x210f, 0x2113, 0x212f, 0x2134, 0x2139 -}; - -const int NUM_LOWER_CHAR = (sizeof(lowerCharTable)/sizeof(chr)); - -/* Unicode: uppercase characters */ - -static crange upperRangeTable[] = { - {0x0041, 0x005a}, {0x00c0, 0x00d6}, {0x00d8, 0x00de}, {0x0189, 0x018b}, - {0x018e, 0x0191}, {0x0196, 0x0198}, {0x01b1, 0x01b3}, {0x01f6, 0x01f8}, - {0x0388, 0x038a}, {0x0391, 0x03a1}, {0x03a3, 0x03ab}, {0x03d2, 0x03d4}, - {0x0400, 0x042f}, {0x0531, 0x0556}, {0x10a0, 0x10c5}, {0x1f08, 0x1f0f}, - {0x1f18, 0x1f1d}, {0x1f28, 0x1f2f}, {0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, - {0x1f68, 0x1f6f}, {0x1fb8, 0x1fbb}, {0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, - {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb}, {0x210b, 0x210d}, {0x2110, 0x2112}, - {0x2119, 0x211d}, {0x212a, 0x212d}, {0xff21, 0xff3a} -}; - -const int NUM_UPPER_RANGE = (sizeof(upperRangeTable)/sizeof(crange)); - -static chr upperCharTable[] = { - 0x0100, 0x0102, 0x0104, 0x0106, 0x0108, 0x010a, 0x010c, 0x010e, 0x0110, - 0x0112, 0x0114, 0x0116, 0x0118, 0x011a, 0x011c, 0x011e, 0x0120, 0x0122, - 0x0124, 0x0126, 0x0128, 0x012a, 0x012c, 0x012e, 0x0130, 0x0132, 0x0134, - 0x0136, 0x0139, 0x013b, 0x013d, 0x013f, 0x0141, 0x0143, 0x0145, 0x0147, - 0x014a, 0x014c, 0x014e, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, 0x015a, - 0x015c, 0x015e, 0x0160, 0x0162, 0x0164, 0x0166, 0x0168, 0x016a, 0x016c, - 0x016e, 0x0170, 0x0172, 0x0174, 0x0176, 0x0178, 0x0179, 0x017b, 0x017d, - 0x0181, 0x0182, 0x0184, 0x0186, 0x0187, 0x0193, 0x0194, 0x019c, 0x019d, - 0x019f, 0x01a0, 0x01a2, 0x01a4, 0x01a6, 0x01a7, 0x01a9, 0x01ac, 0x01ae, - 0x01af, 0x01b5, 0x01b7, 0x01b8, 0x01bc, 0x01c4, 0x01c7, 0x01ca, 0x01cd, - 0x01cf, 0x01d1, 0x01d3, 0x01d5, 0x01d7, 0x01d9, 0x01db, 0x01de, 0x01e0, - 0x01e2, 0x01e4, 0x01e6, 0x01e8, 0x01ea, 0x01ec, 0x01ee, 0x01f1, 0x01f4, - 0x01fa, 0x01fc, 0x01fe, 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020a, - 0x020c, 0x020e, 0x0210, 0x0212, 0x0214, 0x0216, 0x0218, 0x021a, 0x021c, - 0x021e, 0x0222, 0x0224, 0x0226, 0x0228, 0x022a, 0x022c, 0x022e, 0x0230, - 0x0232, 0x0386, 0x038c, 0x038e, 0x038f, 0x03da, 0x03dc, 0x03de, 0x03e0, - 0x03e2, 0x03e4, 0x03e6, 0x03e8, 0x03ea, 0x03ec, 0x03ee, 0x03f4, 0x0460, - 0x0462, 0x0464, 0x0466, 0x0468, 0x046a, 0x046c, 0x046e, 0x0470, 0x0472, - 0x0474, 0x0476, 0x0478, 0x047a, 0x047c, 0x047e, 0x0480, 0x048c, 0x048e, - 0x0490, 0x0492, 0x0494, 0x0496, 0x0498, 0x049a, 0x049c, 0x049e, 0x04a0, - 0x04a2, 0x04a4, 0x04a6, 0x04a8, 0x04aa, 0x04ac, 0x04ae, 0x04b0, 0x04b2, - 0x04b4, 0x04b6, 0x04b8, 0x04ba, 0x04bc, 0x04be, 0x04c0, 0x04c1, 0x04c3, - 0x04c7, 0x04cb, 0x04d0, 0x04d2, 0x04d4, 0x04d6, 0x04d8, 0x04da, 0x04dc, - 0x04de, 0x04e0, 0x04e2, 0x04e4, 0x04e6, 0x04e8, 0x04ea, 0x04ec, 0x04ee, - 0x04f0, 0x04f2, 0x04f4, 0x04f8, 0x1e00, 0x1e02, 0x1e04, 0x1e06, 0x1e08, - 0x1e0a, 0x1e0c, 0x1e0e, 0x1e10, 0x1e12, 0x1e14, 0x1e16, 0x1e18, 0x1e1a, - 0x1e1c, 0x1e1e, 0x1e20, 0x1e22, 0x1e24, 0x1e26, 0x1e28, 0x1e2a, 0x1e2c, - 0x1e2e, 0x1e30, 0x1e32, 0x1e34, 0x1e36, 0x1e38, 0x1e3a, 0x1e3c, 0x1e3e, - 0x1e40, 0x1e42, 0x1e44, 0x1e46, 0x1e48, 0x1e4a, 0x1e4c, 0x1e4e, 0x1e50, - 0x1e52, 0x1e54, 0x1e56, 0x1e58, 0x1e5a, 0x1e5c, 0x1e5e, 0x1e60, 0x1e62, - 0x1e64, 0x1e66, 0x1e68, 0x1e6a, 0x1e6c, 0x1e6e, 0x1e70, 0x1e72, 0x1e74, - 0x1e76, 0x1e78, 0x1e7a, 0x1e7c, 0x1e7e, 0x1e80, 0x1e82, 0x1e84, 0x1e86, - 0x1e88, 0x1e8a, 0x1e8c, 0x1e8e, 0x1e90, 0x1e92, 0x1e94, 0x1ea0, 0x1ea2, - 0x1ea4, 0x1ea6, 0x1ea8, 0x1eaa, 0x1eac, 0x1eae, 0x1eb0, 0x1eb2, 0x1eb4, - 0x1eb6, 0x1eb8, 0x1eba, 0x1ebc, 0x1ebe, 0x1ec0, 0x1ec2, 0x1ec4, 0x1ec6, - 0x1ec8, 0x1eca, 0x1ecc, 0x1ece, 0x1ed0, 0x1ed2, 0x1ed4, 0x1ed6, 0x1ed8, - 0x1eda, 0x1edc, 0x1ede, 0x1ee0, 0x1ee2, 0x1ee4, 0x1ee6, 0x1ee8, 0x1eea, - 0x1eec, 0x1eee, 0x1ef0, 0x1ef2, 0x1ef4, 0x1ef6, 0x1ef8, 0x1f59, 0x1f5b, - 0x1f5d, 0x1f5f, 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x2130, - 0x2131, 0x2133 -}; - -const int NUM_UPPER_CHAR = (sizeof(upperCharTable)/sizeof(chr)); - -/* Unicode: unicode print characters excluding space */ - -static crange graphRangeTable[] = { - {0x0021, 0x007e}, {0x00a0, 0x011f}, {0x0121, 0x021f}, {0x0222, 0x0233}, - {0x0250, 0x02ad}, {0x02b0, 0x02ee}, {0x0300, 0x031f}, {0x0321, 0x034e}, - {0x0360, 0x0362}, {0x0384, 0x038a}, {0x038e, 0x03a1}, {0x03a3, 0x03ce}, - {0x03d0, 0x03d7}, {0x03da, 0x03f5}, {0x0400, 0x041f}, {0x0421, 0x0486}, - {0x048c, 0x04c4}, {0x04d0, 0x04f5}, {0x0531, 0x0556}, {0x0559, 0x055f}, - {0x0561, 0x0587}, {0x0591, 0x05a1}, {0x05a3, 0x05b9}, {0x05bb, 0x05c4}, - {0x05d0, 0x05ea}, {0x05f0, 0x05f4}, {0x0621, 0x063a}, {0x0640, 0x0655}, - {0x0660, 0x066d}, {0x0670, 0x06ed}, {0x06f0, 0x06fe}, {0x0700, 0x070d}, - {0x0710, 0x071f}, {0x0721, 0x072c}, {0x0730, 0x074a}, {0x0780, 0x07b0}, - {0x0901, 0x0903}, {0x0905, 0x091f}, {0x0921, 0x0939}, {0x093c, 0x094d}, - {0x0950, 0x0954}, {0x0958, 0x0970}, {0x0981, 0x0983}, {0x0985, 0x098c}, - {0x0993, 0x09a8}, {0x09aa, 0x09b0}, {0x09b6, 0x09b9}, {0x09be, 0x09c4}, - {0x09cb, 0x09cd}, {0x09df, 0x09e3}, {0x09e6, 0x09fa}, {0x0a05, 0x0a0a}, - {0x0a13, 0x0a1f}, {0x0a21, 0x0a28}, {0x0a2a, 0x0a30}, {0x0a3e, 0x0a42}, - {0x0a4b, 0x0a4d}, {0x0a59, 0x0a5c}, {0x0a66, 0x0a74}, {0x0a81, 0x0a83}, - {0x0a85, 0x0a8b}, {0x0a8f, 0x0a91}, {0x0a93, 0x0aa8}, {0x0aaa, 0x0ab0}, - {0x0ab5, 0x0ab9}, {0x0abc, 0x0ac5}, {0x0ac7, 0x0ac9}, {0x0acb, 0x0acd}, - {0x0ae6, 0x0aef}, {0x0b01, 0x0b03}, {0x0b05, 0x0b0c}, {0x0b13, 0x0b1f}, - {0x0b21, 0x0b28}, {0x0b2a, 0x0b30}, {0x0b36, 0x0b39}, {0x0b3c, 0x0b43}, - {0x0b4b, 0x0b4d}, {0x0b5f, 0x0b61}, {0x0b66, 0x0b70}, {0x0b85, 0x0b8a}, - {0x0b8e, 0x0b90}, {0x0b92, 0x0b95}, {0x0ba8, 0x0baa}, {0x0bae, 0x0bb5}, - {0x0bb7, 0x0bb9}, {0x0bbe, 0x0bc2}, {0x0bc6, 0x0bc8}, {0x0bca, 0x0bcd}, - {0x0be7, 0x0bf2}, {0x0c01, 0x0c03}, {0x0c05, 0x0c0c}, {0x0c0e, 0x0c10}, - {0x0c12, 0x0c1f}, {0x0c21, 0x0c28}, {0x0c2a, 0x0c33}, {0x0c35, 0x0c39}, - {0x0c3e, 0x0c44}, {0x0c46, 0x0c48}, {0x0c4a, 0x0c4d}, {0x0c66, 0x0c6f}, - {0x0c85, 0x0c8c}, {0x0c8e, 0x0c90}, {0x0c92, 0x0ca8}, {0x0caa, 0x0cb3}, - {0x0cb5, 0x0cb9}, {0x0cbe, 0x0cc4}, {0x0cc6, 0x0cc8}, {0x0cca, 0x0ccd}, - {0x0ce6, 0x0cef}, {0x0d05, 0x0d0c}, {0x0d0e, 0x0d10}, {0x0d12, 0x0d1f}, - {0x0d21, 0x0d28}, {0x0d2a, 0x0d39}, {0x0d3e, 0x0d43}, {0x0d46, 0x0d48}, - {0x0d4a, 0x0d4d}, {0x0d66, 0x0d6f}, {0x0d85, 0x0d96}, {0x0d9a, 0x0db1}, - {0x0db3, 0x0dbb}, {0x0dc0, 0x0dc6}, {0x0dcf, 0x0dd4}, {0x0dd8, 0x0ddf}, - {0x0df2, 0x0df4}, {0x0e01, 0x0e1f}, {0x0e21, 0x0e3a}, {0x0e3f, 0x0e5b}, - {0x0e94, 0x0e97}, {0x0e99, 0x0e9f}, {0x0ea1, 0x0ea3}, {0x0ead, 0x0eb9}, - {0x0ebb, 0x0ebd}, {0x0ec0, 0x0ec4}, {0x0ec8, 0x0ecd}, {0x0ed0, 0x0ed9}, - {0x0f00, 0x0f1f}, {0x0f21, 0x0f47}, {0x0f49, 0x0f6a}, {0x0f71, 0x0f8b}, - {0x0f90, 0x0f97}, {0x0f99, 0x0fbc}, {0x0fbe, 0x0fcc}, {0x1000, 0x101f}, - {0x1023, 0x1027}, {0x102c, 0x1032}, {0x1036, 0x1039}, {0x1040, 0x1059}, - {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x111f}, {0x1121, 0x1159}, - {0x115f, 0x11a2}, {0x11a8, 0x11f9}, {0x1200, 0x1206}, {0x1208, 0x121f}, - {0x1221, 0x1246}, {0x124a, 0x124d}, {0x1250, 0x1256}, {0x125a, 0x125d}, - {0x1260, 0x1286}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b2, 0x12b5}, - {0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, - {0x12d8, 0x12ee}, {0x12f0, 0x130e}, {0x1312, 0x1315}, {0x1318, 0x131e}, - {0x1321, 0x1346}, {0x1348, 0x135a}, {0x1361, 0x137c}, {0x13a0, 0x13f4}, - {0x1401, 0x141f}, {0x1421, 0x151f}, {0x1521, 0x161f}, {0x1621, 0x1676}, - {0x1680, 0x169c}, {0x16a0, 0x16f0}, {0x1780, 0x17dc}, {0x17e0, 0x17e9}, - {0x1800, 0x180a}, {0x1810, 0x1819}, {0x1821, 0x1877}, {0x1880, 0x18a9}, - {0x1e00, 0x1e1f}, {0x1e21, 0x1e9b}, {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, - {0x1f18, 0x1f1d}, {0x1f21, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, - {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fc4}, {0x1fc6, 0x1fd3}, - {0x1fd6, 0x1fdb}, {0x1fdd, 0x1fef}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffe}, - {0x2000, 0x200b}, {0x2010, 0x201f}, {0x2021, 0x2029}, {0x202f, 0x2046}, - {0x2048, 0x204d}, {0x2074, 0x208e}, {0x20a0, 0x20af}, {0x20d0, 0x20e3}, - {0x2100, 0x211f}, {0x2121, 0x213a}, {0x2153, 0x2183}, {0x2190, 0x21f3}, - {0x2200, 0x221f}, {0x2221, 0x22f1}, {0x2300, 0x231f}, {0x2321, 0x237b}, - {0x237d, 0x239a}, {0x2400, 0x241f}, {0x2421, 0x2426}, {0x2440, 0x244a}, - {0x2460, 0x24ea}, {0x2500, 0x251f}, {0x2521, 0x2595}, {0x25a0, 0x25f7}, - {0x2600, 0x2613}, {0x2619, 0x261f}, {0x2621, 0x2671}, {0x2701, 0x2704}, - {0x2706, 0x2709}, {0x270c, 0x271f}, {0x2721, 0x2727}, {0x2729, 0x274b}, - {0x274f, 0x2752}, {0x2758, 0x275e}, {0x2761, 0x2767}, {0x2776, 0x2794}, - {0x2798, 0x27af}, {0x27b1, 0x27be}, {0x2800, 0x281f}, {0x2821, 0x28ff}, - {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2f1f}, {0x2f21, 0x2fd5}, - {0x2ff0, 0x2ffb}, {0x3000, 0x301f}, {0x3021, 0x303a}, {0x3041, 0x3094}, - {0x3099, 0x309e}, {0x30a1, 0x30fe}, {0x3105, 0x311f}, {0x3121, 0x312c}, - {0x3131, 0x318e}, {0x3190, 0x31b7}, {0x3200, 0x321c}, {0x3221, 0x3243}, - {0x3260, 0x327b}, {0x327f, 0x32b0}, {0x32c0, 0x32cb}, {0x32d0, 0x32fe}, - {0x3300, 0x331f}, {0x3321, 0x3376}, {0x337b, 0x33dd}, {0x33e0, 0x33fe}, - {0x3400, 0x341f}, {0x3421, 0x351f}, {0x3521, 0x361f}, {0x3621, 0x371f}, - {0x3721, 0x381f}, {0x3821, 0x391f}, {0x3921, 0x3a1f}, {0x3a21, 0x3b1f}, - {0x3b21, 0x3c1f}, {0x3c21, 0x3d1f}, {0x3d21, 0x3e1f}, {0x3e21, 0x3f1f}, - {0x3f21, 0x401f}, {0x4021, 0x411f}, {0x4121, 0x421f}, {0x4221, 0x431f}, - {0x4321, 0x441f}, {0x4421, 0x451f}, {0x4521, 0x461f}, {0x4621, 0x471f}, - {0x4721, 0x481f}, {0x4821, 0x491f}, {0x4921, 0x4a1f}, {0x4a21, 0x4b1f}, - {0x4b21, 0x4c1f}, {0x4c21, 0x4d1f}, {0x4d21, 0x4db5}, {0x4e00, 0x4e1f}, - {0x4e21, 0x4f1f}, {0x4f21, 0x501f}, {0x5021, 0x511f}, {0x5121, 0x521f}, - {0x5221, 0x531f}, {0x5321, 0x541f}, {0x5421, 0x551f}, {0x5521, 0x561f}, - {0x5621, 0x571f}, {0x5721, 0x581f}, {0x5821, 0x591f}, {0x5921, 0x5a1f}, - {0x5a21, 0x5b1f}, {0x5b21, 0x5c1f}, {0x5c21, 0x5d1f}, {0x5d21, 0x5e1f}, - {0x5e21, 0x5f1f}, {0x5f21, 0x601f}, {0x6021, 0x611f}, {0x6121, 0x621f}, - {0x6221, 0x631f}, {0x6321, 0x641f}, {0x6421, 0x651f}, {0x6521, 0x661f}, - {0x6621, 0x671f}, {0x6721, 0x681f}, {0x6821, 0x691f}, {0x6921, 0x6a1f}, - {0x6a21, 0x6b1f}, {0x6b21, 0x6c1f}, {0x6c21, 0x6d1f}, {0x6d21, 0x6e1f}, - {0x6e21, 0x6f1f}, {0x6f21, 0x701f}, {0x7021, 0x711f}, {0x7121, 0x721f}, - {0x7221, 0x731f}, {0x7321, 0x741f}, {0x7421, 0x751f}, {0x7521, 0x761f}, - {0x7621, 0x771f}, {0x7721, 0x781f}, {0x7821, 0x791f}, {0x7921, 0x7a1f}, - {0x7a21, 0x7b1f}, {0x7b21, 0x7c1f}, {0x7c21, 0x7d1f}, {0x7d21, 0x7e1f}, - {0x7e21, 0x7f1f}, {0x7f21, 0x801f}, {0x8021, 0x811f}, {0x8121, 0x821f}, - {0x8221, 0x831f}, {0x8321, 0x841f}, {0x8421, 0x851f}, {0x8521, 0x861f}, - {0x8621, 0x871f}, {0x8721, 0x881f}, {0x8821, 0x891f}, {0x8921, 0x8a1f}, - {0x8a21, 0x8b1f}, {0x8b21, 0x8c1f}, {0x8c21, 0x8d1f}, {0x8d21, 0x8e1f}, - {0x8e21, 0x8f1f}, {0x8f21, 0x901f}, {0x9021, 0x911f}, {0x9121, 0x921f}, - {0x9221, 0x931f}, {0x9321, 0x941f}, {0x9421, 0x951f}, {0x9521, 0x961f}, - {0x9621, 0x971f}, {0x9721, 0x981f}, {0x9821, 0x991f}, {0x9921, 0x9a1f}, - {0x9a21, 0x9b1f}, {0x9b21, 0x9c1f}, {0x9c21, 0x9d1f}, {0x9d21, 0x9e1f}, - {0x9e21, 0x9f1f}, {0x9f21, 0x9fa5}, {0xa000, 0xa01f}, {0xa021, 0xa11f}, - {0xa121, 0xa21f}, {0xa221, 0xa31f}, {0xa321, 0xa41f}, {0xa421, 0xa48c}, - {0xa490, 0xa4a1}, {0xa4a4, 0xa4b3}, {0xa4b5, 0xa4c0}, {0xa4c2, 0xa4c4}, - {0xac00, 0xac1f}, {0xac21, 0xad1f}, {0xad21, 0xae1f}, {0xae21, 0xaf1f}, - {0xaf21, 0xb01f}, {0xb021, 0xb11f}, {0xb121, 0xb21f}, {0xb221, 0xb31f}, - {0xb321, 0xb41f}, {0xb421, 0xb51f}, {0xb521, 0xb61f}, {0xb621, 0xb71f}, - {0xb721, 0xb81f}, {0xb821, 0xb91f}, {0xb921, 0xba1f}, {0xba21, 0xbb1f}, - {0xbb21, 0xbc1f}, {0xbc21, 0xbd1f}, {0xbd21, 0xbe1f}, {0xbe21, 0xbf1f}, - {0xbf21, 0xc01f}, {0xc021, 0xc11f}, {0xc121, 0xc21f}, {0xc221, 0xc31f}, - {0xc321, 0xc41f}, {0xc421, 0xc51f}, {0xc521, 0xc61f}, {0xc621, 0xc71f}, - {0xc721, 0xc81f}, {0xc821, 0xc91f}, {0xc921, 0xca1f}, {0xca21, 0xcb1f}, - {0xcb21, 0xcc1f}, {0xcc21, 0xcd1f}, {0xcd21, 0xce1f}, {0xce21, 0xcf1f}, - {0xcf21, 0xd01f}, {0xd021, 0xd11f}, {0xd121, 0xd21f}, {0xd221, 0xd31f}, - {0xd321, 0xd41f}, {0xd421, 0xd51f}, {0xd521, 0xd61f}, {0xd621, 0xd71f}, - {0xd721, 0xd7a3}, {0xf900, 0xf91f}, {0xf921, 0xfa1f}, {0xfa21, 0xfa2d}, - {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1d, 0xfb1f}, {0xfb21, 0xfb36}, - {0xfb38, 0xfb3c}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfc1f}, {0xfc21, 0xfd1f}, - {0xfd21, 0xfd3f}, {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, - {0xfe21, 0xfe23}, {0xfe30, 0xfe44}, {0xfe49, 0xfe52}, {0xfe54, 0xfe66}, - {0xfe68, 0xfe6b}, {0xfe70, 0xfe72}, {0xfe76, 0xfefc}, {0xff01, 0xff1f}, - {0xff21, 0xff5e}, {0xff61, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, - {0xffd2, 0xffd7}, {0xffda, 0xffdc}, {0xffe0, 0xffe6}, {0xffe8, 0xffee}, - {0xfffc, 0xffff} -}; - -const int NUM_GRAPH_RANGE = (sizeof(graphRangeTable)/sizeof(crange)); - -static chr graphCharTable[] = { - 0x0374, 0x0375, 0x037a, 0x037e, 0x038c, 0x0488, 0x0489, 0x04c7, 0x04c8, - 0x04cb, 0x04cc, 0x04f8, 0x04f9, 0x0589, 0x058a, 0x060c, 0x061b, 0x061f, - 0x098f, 0x0990, 0x09b2, 0x09bc, 0x09c7, 0x09c8, 0x09d7, 0x09dc, 0x09dd, - 0x0a02, 0x0a0f, 0x0a10, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, - 0x0a3c, 0x0a47, 0x0a48, 0x0a5e, 0x0a8d, 0x0ab2, 0x0ab3, 0x0ad0, 0x0ae0, - 0x0b0f, 0x0b10, 0x0b32, 0x0b33, 0x0b47, 0x0b48, 0x0b56, 0x0b57, 0x0b5c, - 0x0b5d, 0x0b82, 0x0b83, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, - 0x0ba4, 0x0bd7, 0x0c55, 0x0c56, 0x0c60, 0x0c61, 0x0c82, 0x0c83, 0x0cd5, - 0x0cd6, 0x0cde, 0x0ce0, 0x0ce1, 0x0d02, 0x0d03, 0x0d57, 0x0d60, 0x0d61, - 0x0d82, 0x0d83, 0x0dbd, 0x0dca, 0x0dd6, 0x0e81, 0x0e82, 0x0e84, 0x0e87, - 0x0e88, 0x0e8a, 0x0e8d, 0x0ea5, 0x0ea7, 0x0eaa, 0x0eab, 0x0ec6, 0x0edc, - 0x0edd, 0x0fcf, 0x1021, 0x1029, 0x102a, 0x10fb, 0x1248, 0x1258, 0x1288, - 0x12b0, 0x12c0, 0x1310, 0x1f59, 0x1f5b, 0x1f5d, 0x2070, 0x274d, 0x2756, - 0x303e, 0x303f, 0xa4c6, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfe74 -}; - -const int NUM_GRAPH_CHAR = (sizeof(graphCharTable)/sizeof(chr)); - -/* - * End of auto-generated Unicode character ranges declarations. - */ - -/* - * Supply implementations for some tcl functions that this module depends on - * to make it self contained - */ - -#include "tclUniData.c" -#define Tcl_UniChar wxChar - -/* - * Compute the uppercase equivalent of the given Unicode character. - * Taken from tcl. - */ - -Tcl_UniChar Tcl_UniCharToUpper(int ch) -{ - int info = GetUniCharInfo(ch); - - if (GetCaseType(info) & 0x04) { - return (Tcl_UniChar) (ch - GetDelta(info)); - } else { - return ch; - } -} - -/* - * Compute the lowercase equivalent of the given Unicode character. - * Taken from tcl. - */ - -Tcl_UniChar Tcl_UniCharToLower(int ch) -{ - int info = GetUniCharInfo(ch); - - if (GetCaseType(info) & 0x02) { - return (Tcl_UniChar) (ch + GetDelta(info)); - } else { - return ch; - } -} - -/* - * Compute the titlecase equivalent of the given Unicode character. - * Taken from tcl. - */ - -Tcl_UniChar Tcl_UniCharToTitle(int ch) -{ - int info = GetUniCharInfo(ch); - int mode = GetCaseType(info); - - if (mode & 0x1) { - /* - * Subtract or add one depending on the original case. - */ - - return (Tcl_UniChar) (ch + ((mode & 0x4) ? -1 : 1)); - } else if (mode == 0x4) { - return (Tcl_UniChar) (ch - GetDelta(info)); - } else { - return ch; - } -} - -#define CH NOCELT - -/* - - nmcces - how many distinct MCCEs are there? - ^ static int nmcces(struct vars *); - */ -static int -nmcces(v) - struct vars *v; /* context */ -{ - /* - * No multi-character collating elements defined at the moment. - */ - return 0; -} - -/* - - nleaders - how many chrs can be first chrs of MCCEs? - ^ static int nleaders(struct vars *); - */ -static int -nleaders(v) - struct vars *v; /* context */ -{ - return 0; -} - -/* - - allmcces - return a cvec with all the MCCEs of the locale - ^ static struct cvec *allmcces(struct vars *, struct cvec *); - */ -static struct cvec * -allmcces(v, cv) - struct vars *v; /* context */ - struct cvec *cv; /* this is supposed to have enough room */ -{ - return clearcvec(cv); -} - -/* - - element - map collating-element name to celt - ^ static celt element(struct vars *, chr *, chr *); - */ -static celt -element(v, startp, endp) - struct vars *v; /* context */ - chr *startp; /* points to start of name */ - chr *endp; /* points just past end of name */ -{ - struct cname *cn; - size_t len; - - /* generic: one-chr names stand for themselves */ - assert(startp < endp); - len = endp - startp; - if (len == 1) { - return *startp; - } - - NOTE(REG_ULOCALE); - - /* search table */ - for (cn=cnames; cn->name!=NULL; cn++) { - if (wxCRT_StrlenNative(cn->name)==len && wxCRT_StrncmpNative(cn->name, startp, len)==0) { - break; /* NOTE BREAK OUT */ - } - } - if (cn->name != NULL) { - return CHR(cn->code); - } - - /* couldn't find it */ - ERR(REG_ECOLLATE); - return 0; -} - -/* - - range - supply cvec for a range, including legality check - ^ static struct cvec *range(struct vars *, celt, celt, int); - */ -static struct cvec * -range(v, a, b, cases) - struct vars *v; /* context */ - celt a; /* range start */ - celt b; /* range end, might equal a */ - int cases; /* case-independent? */ -{ - int nchrs; - struct cvec *cv; - celt c, lc, uc, tc; - - if (a != b && !before(a, b)) { - ERR(REG_ERANGE); - return NULL; - } - - if (!cases) { /* easy version */ - cv = getcvec(v, 0, 1, 0); - NOERRN(); - addrange(cv, a, b); - return cv; - } - - /* - * When case-independent, it's hard to decide when cvec ranges are - * usable, so for now at least, we won't try. We allocate enough - * space for two case variants plus a little extra for the two - * title case variants. - */ - - nchrs = (b - a + 1)*2 + 4; - - cv = getcvec(v, nchrs, 0, 0); - NOERRN(); - - for (c=a; c<=b; c++) { - addchr(cv, c); - lc = Tcl_UniCharToLower((chr)c); - uc = Tcl_UniCharToUpper((chr)c); - tc = Tcl_UniCharToTitle((chr)c); - if (c != lc) { - addchr(cv, lc); - } - if (c != uc) { - addchr(cv, uc); - } - if (c != tc && tc != uc) { - addchr(cv, tc); - } - } - - return cv; -} - -/* - - before - is celt x before celt y, for purposes of range legality? - ^ static int before(celt, celt); - */ -static int /* predicate */ -before(x, y) - celt x, y; /* collating elements */ -{ - /* trivial because no MCCEs */ - if (x < y) { - return 1; - } - return 0; -} - -/* - - eclass - supply cvec for an equivalence class - * Must include case counterparts on request. - ^ static struct cvec *eclass(struct vars *, celt, int); - */ -static struct cvec * -eclass(v, c, cases) - struct vars *v; /* context */ - celt c; /* Collating element representing - * the equivalence class. */ - int cases; /* all cases? */ -{ - struct cvec *cv; - - /* crude fake equivalence class for testing */ - if ((v->cflags®_FAKE) && c == 'x') { - cv = getcvec(v, 4, 0, 0); - addchr(cv, (chr)'x'); - addchr(cv, (chr)'y'); - if (cases) { - addchr(cv, (chr)'X'); - addchr(cv, (chr)'Y'); - } - return cv; - } - - /* otherwise, none */ - if (cases) { - return allcases(v, c); - } - cv = getcvec(v, 1, 0, 0); - assert(cv != NULL); - addchr(cv, (chr)c); - return cv; -} - -/* - - cclass - supply cvec for a character class - * Must include case counterparts on request. - ^ static struct cvec *cclass(struct vars *, chr *, chr *, int); - */ -static struct cvec * -cclass(v, startp, endp, cases) - struct vars *v; /* context */ - chr *startp; /* where the name starts */ - chr *endp; /* just past the end of the name */ - int cases; /* case-independent? */ -{ - size_t len; - struct cvec *cv = NULL; - CONST chr *np; - chr **namePtr; - int i, index; - - /* - * The following arrays define the valid character class names. - */ - - static chr *classNames[] = { - wxT("alnum"), wxT("alpha"), wxT("ascii"), wxT("blank"), wxT("cntrl"), wxT("digit"), wxT("graph"), - wxT("lower"), wxT("print"), wxT("punct"), wxT("space"), wxT("upper"), wxT("xdigit"), NULL - }; - - enum classes { - CC_ALNUM, CC_ALPHA, CC_ASCII, CC_BLANK, CC_CNTRL, CC_DIGIT, CC_GRAPH, - CC_LOWER, CC_PRINT, CC_PUNCT, CC_SPACE, CC_UPPER, CC_XDIGIT - }; - - - /* - * Extract the class name - */ - - len = endp - startp; - np = startp; - - /* - * Remap lower and upper to alpha if the match is case insensitive. - */ - - if (cases && len == 5 && (wxCRT_StrncmpNative(wxT("lower"), np, 5) == 0 - || wxCRT_StrncmpNative(wxT("upper"), np, 5) == 0)) { - np = wxT("alpha"); - } - - /* - * Map the name to the corresponding enumerated value. - */ - - index = -1; - for (namePtr=classNames,i=0 ; *namePtr!=NULL ; namePtr++,i++) { - if ((wxCRT_StrlenNative(*namePtr) == len) && (wxCRT_StrncmpNative(*namePtr, np, len) == 0)) { - index = i; - break; - } - } - if (index == -1) { - ERR(REG_ECTYPE); - return NULL; - } - - /* - * Now compute the character class contents. - */ - - switch((enum classes) index) { - case CC_PRINT: - case CC_ALNUM: - cv = getcvec(v, NUM_ALPHA_CHAR, NUM_DIGIT_RANGE + NUM_ALPHA_RANGE, 0); - if (cv) { - for (i=0 ; i 0; len--, x++, y++) { - if ((*x!=*y) && (Tcl_UniCharToLower(*x) != Tcl_UniCharToLower(*y))) { - return 1; - } - } - return 0; -} diff --git a/src/regex/regc_nfa.c b/src/regex/regc_nfa.c deleted file mode 100644 index 2db51bc7b9..0000000000 --- a/src/regex/regc_nfa.c +++ /dev/null @@ -1,1582 +0,0 @@ -/* - * NFA utilities. - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * One or two things that technically ought to be in here - * are actually in color.c, thanks to some incestuous relationships in - * the color chains. - */ - -#define NISERR() VISERR(nfa->v) -#define NERR(e) (void)VERR(nfa->v, (e)) - - -/* - - newnfa - set up an NFA - ^ static struct nfa *newnfa(struct vars *, struct colormap *, struct nfa *); - */ -static struct nfa * /* the NFA, or NULL */ -newnfa(v, cm, parent) -struct vars *v; -struct colormap *cm; -struct nfa *parent; /* NULL if primary NFA */ -{ - struct nfa *nfa; - - nfa = (struct nfa *)MALLOC(sizeof(struct nfa)); - if (nfa == NULL) - return NULL; - - nfa->states = NULL; - nfa->slast = NULL; - nfa->free = NULL; - nfa->nstates = 0; - nfa->cm = cm; - nfa->v = v; - nfa->bos[0] = nfa->bos[1] = COLORLESS; - nfa->eos[0] = nfa->eos[1] = COLORLESS; - nfa->post = newfstate(nfa, '@'); /* number 0 */ - nfa->pre = newfstate(nfa, '>'); /* number 1 */ - nfa->parent = parent; - - nfa->init = newstate(nfa); /* may become invalid later */ - nfa->final = newstate(nfa); - if (ISERR()) { - freenfa(nfa); - return NULL; - } - rainbow(nfa, nfa->cm, PLAIN, COLORLESS, nfa->pre, nfa->init); - newarc(nfa, '^', 1, nfa->pre, nfa->init); - newarc(nfa, '^', 0, nfa->pre, nfa->init); - rainbow(nfa, nfa->cm, PLAIN, COLORLESS, nfa->final, nfa->post); - newarc(nfa, '$', 1, nfa->final, nfa->post); - newarc(nfa, '$', 0, nfa->final, nfa->post); - - if (ISERR()) { - freenfa(nfa); - return NULL; - } - return nfa; -} - -/* - - freenfa - free an entire NFA - ^ static VOID freenfa(struct nfa *); - */ -static VOID -freenfa(nfa) -struct nfa *nfa; -{ - struct state *s; - - while ((s = nfa->states) != NULL) { - s->nins = s->nouts = 0; /* don't worry about arcs */ - freestate(nfa, s); - } - while ((s = nfa->free) != NULL) { - nfa->free = s->next; - destroystate(nfa, s); - } - - nfa->slast = NULL; - nfa->nstates = -1; - nfa->pre = NULL; - nfa->post = NULL; - FREE(nfa); -} - -/* - - newstate - allocate an NFA state, with zero flag value - ^ static struct state *newstate(struct nfa *); - */ -static struct state * /* NULL on error */ -newstate(nfa) -struct nfa *nfa; -{ - struct state *s; - - if (nfa->free != NULL) { - s = nfa->free; - nfa->free = s->next; - } else { - s = (struct state *)MALLOC(sizeof(struct state)); - if (s == NULL) { - NERR(REG_ESPACE); - return NULL; - } - s->oas.next = NULL; - s->free = NULL; - s->noas = 0; - } - - assert(nfa->nstates >= 0); - s->no = nfa->nstates++; - s->flag = 0; - if (nfa->states == NULL) - nfa->states = s; - s->nins = 0; - s->ins = NULL; - s->nouts = 0; - s->outs = NULL; - s->tmp = NULL; - s->next = NULL; - if (nfa->slast != NULL) { - assert(nfa->slast->next == NULL); - nfa->slast->next = s; - } - s->prev = nfa->slast; - nfa->slast = s; - return s; -} - -/* - - newfstate - allocate an NFA state with a specified flag value - ^ static struct state *newfstate(struct nfa *, int flag); - */ -static struct state * /* NULL on error */ -newfstate(nfa, flag) -struct nfa *nfa; -int flag; -{ - struct state *s; - - s = newstate(nfa); - if (s != NULL) - s->flag = (char)flag; - return s; -} - -/* - - dropstate - delete a state's inarcs and outarcs and free it - ^ static VOID dropstate(struct nfa *, struct state *); - */ -static VOID -dropstate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - - while ((a = s->ins) != NULL) - freearc(nfa, a); - while ((a = s->outs) != NULL) - freearc(nfa, a); - freestate(nfa, s); -} - -/* - - freestate - free a state, which has no in-arcs or out-arcs - ^ static VOID freestate(struct nfa *, struct state *); - */ -static VOID -freestate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - assert(s != NULL); - assert(s->nins == 0 && s->nouts == 0); - - s->no = FREESTATE; - s->flag = 0; - if (s->next != NULL) - s->next->prev = s->prev; - else { - assert(s == nfa->slast); - nfa->slast = s->prev; - } - if (s->prev != NULL) - s->prev->next = s->next; - else { - assert(s == nfa->states); - nfa->states = s->next; - } - s->prev = NULL; - s->next = nfa->free; /* don't delete it, put it on the free list */ - nfa->free = s; -} - -/* - - destroystate - really get rid of an already-freed state - ^ static VOID destroystate(struct nfa *, struct state *); - */ -static VOID -destroystate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arcbatch *ab; - struct arcbatch *abnext; - - assert(s->no == FREESTATE); - for (ab = s->oas.next; ab != NULL; ab = abnext) { - abnext = ab->next; - FREE(ab); - } - s->ins = NULL; - s->outs = NULL; - s->next = NULL; - FREE(s); -} - -/* - - newarc - set up a new arc within an NFA - ^ static VOID newarc(struct nfa *, int, pcolor, struct state *, - ^ struct state *); - */ -static VOID -newarc(nfa, t, co, from, to) -struct nfa *nfa; -int t; -pcolor co; -struct state *from; -struct state *to; -{ - struct arc *a; - - assert(from != NULL && to != NULL); - - /* check for duplicates */ - for (a = from->outs; a != NULL; a = a->outchain) - if (a->to == to && a->co == co && a->type == t) - return; - - a = allocarc(nfa, from); - if (NISERR()) - return; - assert(a != NULL); - - a->type = t; - a->co = (color)co; - a->to = to; - a->from = from; - - /* - * Put the new arc on the beginning, not the end, of the chains. - * Not only is this easier, it has the very useful side effect that - * deleting the most-recently-added arc is the cheapest case rather - * than the most expensive one. - */ - a->inchain = to->ins; - to->ins = a; - a->outchain = from->outs; - from->outs = a; - - from->nouts++; - to->nins++; - - if (COLORED(a) && nfa->parent == NULL) - colorchain(nfa->cm, a); - - return; -} - -/* - - allocarc - allocate a new out-arc within a state - ^ static struct arc *allocarc(struct nfa *, struct state *); - */ -static struct arc * /* NULL for failure */ -allocarc(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - struct arcbatch *new; - int i; - - /* shortcut */ - if (s->free == NULL && s->noas < ABSIZE) { - a = &s->oas.a[s->noas]; - s->noas++; - return a; - } - - /* if none at hand, get more */ - if (s->free == NULL) { - new = (struct arcbatch *)MALLOC(sizeof(struct arcbatch)); - if (new == NULL) { - NERR(REG_ESPACE); - return NULL; - } - new->next = s->oas.next; - s->oas.next = new; - - for (i = 0; i < ABSIZE; i++) { - new->a[i].type = 0; - new->a[i].freechain = &new->a[i+1]; - } - new->a[ABSIZE-1].freechain = NULL; - s->free = &new->a[0]; - } - assert(s->free != NULL); - - a = s->free; - s->free = a->freechain; - return a; -} - -/* - - freearc - free an arc - ^ static VOID freearc(struct nfa *, struct arc *); - */ -static VOID -freearc(nfa, victim) -struct nfa *nfa; -struct arc *victim; -{ - struct state *from = victim->from; - struct state *to = victim->to; - struct arc *a; - - assert(victim->type != 0); - - /* take it off color chain if necessary */ - if (COLORED(victim) && nfa->parent == NULL) - uncolorchain(nfa->cm, victim); - - /* take it off source's out-chain */ - assert(from != NULL); - assert(from->outs != NULL); - a = from->outs; - if (a == victim) /* simple case: first in chain */ - from->outs = victim->outchain; - else { - for (; a != NULL && a->outchain != victim; a = a->outchain) - continue; - assert(a != NULL); - a->outchain = victim->outchain; - } - from->nouts--; - - /* take it off target's in-chain */ - assert(to != NULL); - assert(to->ins != NULL); - a = to->ins; - if (a == victim) /* simple case: first in chain */ - to->ins = victim->inchain; - else { - for (; a != NULL && a->inchain != victim; a = a->inchain) - continue; - assert(a != NULL); - a->inchain = victim->inchain; - } - to->nins--; - - /* clean up and place on free list */ - victim->type = 0; - victim->from = NULL; /* precautions... */ - victim->to = NULL; - victim->inchain = NULL; - victim->outchain = NULL; - victim->freechain = from->free; - from->free = victim; -} - -/* - - findarc - find arc, if any, from given source with given type and color - * If there is more than one such arc, the result is random. - ^ static struct arc *findarc(struct state *, int, pcolor); - */ -static struct arc * -findarc(s, type, co) -struct state *s; -int type; -pcolor co; -{ - struct arc *a; - - for (a = s->outs; a != NULL; a = a->outchain) - if (a->type == type && a->co == co) - return a; - return NULL; -} - -/* - - cparc - allocate a new arc within an NFA, copying details from old one - ^ static VOID cparc(struct nfa *, struct arc *, struct state *, - ^ struct state *); - */ -static VOID -cparc(nfa, oa, from, to) -struct nfa *nfa; -struct arc *oa; -struct state *from; -struct state *to; -{ - newarc(nfa, oa->type, oa->co, from, to); -} - -/* - - moveins - move all in arcs of a state to another state - * You might think this could be done better by just updating the - * existing arcs, and you would be right if it weren't for the desire - * for duplicate suppression, which makes it easier to just make new - * ones to exploit the suppression built into newarc. - ^ static VOID moveins(struct nfa *, struct state *, struct state *); - */ -static VOID -moveins(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - while ((a = old->ins) != NULL) { - cparc(nfa, a, a->from, new); - freearc(nfa, a); - } - assert(old->nins == 0); - assert(old->ins == NULL); -} - -/* - - copyins - copy all in arcs of a state to another state - ^ static VOID copyins(struct nfa *, struct state *, struct state *); - */ -static VOID -copyins(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - for (a = old->ins; a != NULL; a = a->inchain) - cparc(nfa, a, a->from, new); -} - -/* - - moveouts - move all out arcs of a state to another state - ^ static VOID moveouts(struct nfa *, struct state *, struct state *); - */ -static VOID -moveouts(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - while ((a = old->outs) != NULL) { - cparc(nfa, a, new, a->to); - freearc(nfa, a); - } -} - -/* - - copyouts - copy all out arcs of a state to another state - ^ static VOID copyouts(struct nfa *, struct state *, struct state *); - */ -static VOID -copyouts(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - for (a = old->outs; a != NULL; a = a->outchain) - cparc(nfa, a, new, a->to); -} - -/* - - cloneouts - copy out arcs of a state to another state pair, modifying type - ^ static VOID cloneouts(struct nfa *, struct state *, struct state *, - ^ struct state *, int); - */ -static VOID -cloneouts(nfa, old, from, to, type) -struct nfa *nfa; -struct state *old; -struct state *from; -struct state *to; -int type; -{ - struct arc *a; - - assert(old != from); - - for (a = old->outs; a != NULL; a = a->outchain) - newarc(nfa, type, a->co, from, to); -} - -/* - - delsub - delete a sub-NFA, updating subre pointers if necessary - * This uses a recursive traversal of the sub-NFA, marking already-seen - * states using their tmp pointer. - ^ static VOID delsub(struct nfa *, struct state *, struct state *); - */ -static VOID -delsub(nfa, lp, rp) -struct nfa *nfa; -struct state *lp; /* the sub-NFA goes from here... */ -struct state *rp; /* ...to here, *not* inclusive */ -{ - assert(lp != rp); - - rp->tmp = rp; /* mark end */ - - deltraverse(nfa, lp, lp); - assert(lp->nouts == 0 && rp->nins == 0); /* did the job */ - assert(lp->no != FREESTATE && rp->no != FREESTATE); /* no more */ - - rp->tmp = NULL; /* unmark end */ - lp->tmp = NULL; /* and begin, marked by deltraverse */ -} - -/* - - deltraverse - the recursive heart of delsub - * This routine's basic job is to destroy all out-arcs of the state. - ^ static VOID deltraverse(struct nfa *, struct state *, struct state *); - */ -static VOID -deltraverse(nfa, leftend, s) -struct nfa *nfa; -struct state *leftend; -struct state *s; -{ - struct arc *a; - struct state *to; - - if (s->nouts == 0) - return; /* nothing to do */ - if (s->tmp != NULL) - return; /* already in progress */ - - s->tmp = s; /* mark as in progress */ - - while ((a = s->outs) != NULL) { - to = a->to; - deltraverse(nfa, leftend, to); - assert(to->nouts == 0 || to->tmp != NULL); - freearc(nfa, a); - if (to->nins == 0 && to->tmp == NULL) { - assert(to->nouts == 0); - freestate(nfa, to); - } - } - - assert(s->no != FREESTATE); /* we're still here */ - assert(s == leftend || s->nins != 0); /* and still reachable */ - assert(s->nouts == 0); /* but have no outarcs */ - - s->tmp = NULL; /* we're done here */ -} - -/* - - dupnfa - duplicate sub-NFA - * Another recursive traversal, this time using tmp to point to duplicates - * as well as mark already-seen states. (You knew there was a reason why - * it's a state pointer, didn't you? :-)) - ^ static VOID dupnfa(struct nfa *, struct state *, struct state *, - ^ struct state *, struct state *); - */ -static VOID -dupnfa(nfa, start, stop, from, to) -struct nfa *nfa; -struct state *start; /* duplicate of subNFA starting here */ -struct state *stop; /* and stopping here */ -struct state *from; /* stringing duplicate from here */ -struct state *to; /* to here */ -{ - if (start == stop) { - newarc(nfa, EMPTY, 0, from, to); - return; - } - - stop->tmp = to; - duptraverse(nfa, start, from); - /* done, except for clearing out the tmp pointers */ - - stop->tmp = NULL; - cleartraverse(nfa, start); -} - -/* - - duptraverse - recursive heart of dupnfa - ^ static VOID duptraverse(struct nfa *, struct state *, struct state *); - */ -static VOID -duptraverse(nfa, s, stmp) -struct nfa *nfa; -struct state *s; -struct state *stmp; /* s's duplicate, or NULL */ -{ - struct arc *a; - - if (s->tmp != NULL) - return; /* already done */ - - s->tmp = (stmp == NULL) ? newstate(nfa) : stmp; - if (s->tmp == NULL) { - assert(NISERR()); - return; - } - - for (a = s->outs; a != NULL && !NISERR(); a = a->outchain) { - duptraverse(nfa, a->to, (struct state *)NULL); - assert(a->to->tmp != NULL); - cparc(nfa, a, s->tmp, a->to->tmp); - } -} - -/* - - cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set - ^ static VOID cleartraverse(struct nfa *, struct state *); - */ -static VOID -cleartraverse(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - - if (s->tmp == NULL) - return; - s->tmp = NULL; - - for (a = s->outs; a != NULL; a = a->outchain) - cleartraverse(nfa, a->to); -} - -/* - - specialcolors - fill in special colors for an NFA - ^ static VOID specialcolors(struct nfa *); - */ -static VOID -specialcolors(nfa) -struct nfa *nfa; -{ - /* false colors for BOS, BOL, EOS, EOL */ - if (nfa->parent == NULL) { - nfa->bos[0] = pseudocolor(nfa->cm); - nfa->bos[1] = pseudocolor(nfa->cm); - nfa->eos[0] = pseudocolor(nfa->cm); - nfa->eos[1] = pseudocolor(nfa->cm); - } else { - assert(nfa->parent->bos[0] != COLORLESS); - nfa->bos[0] = nfa->parent->bos[0]; - assert(nfa->parent->bos[1] != COLORLESS); - nfa->bos[1] = nfa->parent->bos[1]; - assert(nfa->parent->eos[0] != COLORLESS); - nfa->eos[0] = nfa->parent->eos[0]; - assert(nfa->parent->eos[1] != COLORLESS); - nfa->eos[1] = nfa->parent->eos[1]; - } -} - -/* - - optimize - optimize an NFA - ^ static long optimize(struct nfa *, FILE *); - */ -static long /* re_info bits */ -optimize(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - int verbose = (f != NULL) ? 1 : 0; - - if (verbose) - fprintf(f, "\ninitial cleanup:\n"); - cleanup(nfa); /* may simplify situation */ - if (verbose) - dumpnfa(nfa, f); - if (verbose) - fprintf(f, "\nempties:\n"); - fixempties(nfa, f); /* get rid of EMPTY arcs */ - if (verbose) - fprintf(f, "\nconstraints:\n"); - pullback(nfa, f); /* pull back constraints backward */ - pushfwd(nfa, f); /* push fwd constraints forward */ - if (verbose) - fprintf(f, "\nfinal cleanup:\n"); - cleanup(nfa); /* final tidying */ - return analyze(nfa); /* and analysis */ -} - -/* - - pullback - pull back constraints backward to (with luck) eliminate them - ^ static VOID pullback(struct nfa *, FILE *); - */ -static VOID -pullback(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and pull until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->outs; a != NULL && !NISERR(); a = nexta) { - nexta = a->outchain; - if (a->type == '^' || a->type == BEHIND) - if (pull(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); - if (NISERR()) - return; - - for (a = nfa->pre->outs; a != NULL; a = nexta) { - nexta = a->outchain; - if (a->type == '^') { - assert(a->co == 0 || a->co == 1); - newarc(nfa, PLAIN, nfa->bos[a->co], a->from, a->to); - freearc(nfa, a); - } - } -} - -/* - - pull - pull a back constraint backward past its source state - * A significant property of this function is that it deletes at most - * one state -- the constraint's from state -- and only if the constraint - * was that state's last outarc. - ^ static int pull(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -pull(nfa, con) -struct nfa *nfa; -struct arc *con; -{ - struct state *from = con->from; - struct state *to = con->to; - struct arc *a; - struct arc *nexta; - struct state *s; - - if (from == to) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } - if (from->flag) /* can't pull back beyond start */ - return 0; - if (from->nins == 0) { /* unreachable */ - freearc(nfa, con); - return 1; - } - - /* first, clone from state if necessary to avoid other outarcs */ - if (from->nouts > 1) { - s = newstate(nfa); - if (NISERR()) - return 0; - assert(to != from); /* con is not an inarc */ - copyins(nfa, from, s); /* duplicate inarcs */ - cparc(nfa, con, s, to); /* move constraint arc */ - freearc(nfa, con); - from = s; - con = from->outs; - } - assert(from->nouts == 1); - - /* propagate the constraint into the from state's inarcs */ - for (a = from->ins; a != NULL; a = nexta) { - nexta = a->inchain; - switch (combine(con, a)) { - case INCOMPATIBLE: /* destroy the arc */ - freearc(nfa, a); - break; - case SATISFIED: /* no action needed */ - break; - case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) - return 0; - cparc(nfa, a, s, to); /* anticipate move */ - cparc(nfa, con, a->from, s); - if (NISERR()) - return 0; - freearc(nfa, a); - break; - default: - assert(NOTREACHED); - break; - } - } - - /* remaining inarcs, if any, incorporate the constraint */ - moveins(nfa, from, to); - dropstate(nfa, from); /* will free the constraint */ - return 1; -} - -/* - - pushfwd - push forward constraints forward to (with luck) eliminate them - ^ static VOID pushfwd(struct nfa *, FILE *); - */ -static VOID -pushfwd(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and push until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->ins; a != NULL && !NISERR(); a = nexta) { - nexta = a->inchain; - if (a->type == '$' || a->type == AHEAD) - if (push(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); - if (NISERR()) - return; - - for (a = nfa->post->ins; a != NULL; a = nexta) { - nexta = a->inchain; - if (a->type == '$') { - assert(a->co == 0 || a->co == 1); - newarc(nfa, PLAIN, nfa->eos[a->co], a->from, a->to); - freearc(nfa, a); - } - } -} - -/* - - push - push a forward constraint forward past its destination state - * A significant property of this function is that it deletes at most - * one state -- the constraint's to state -- and only if the constraint - * was that state's last inarc. - ^ static int push(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -push(nfa, con) -struct nfa *nfa; -struct arc *con; -{ - struct state *from = con->from; - struct state *to = con->to; - struct arc *a; - struct arc *nexta; - struct state *s; - - if (to == from) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } - if (to->flag) /* can't push forward beyond end */ - return 0; - if (to->nouts == 0) { /* dead end */ - freearc(nfa, con); - return 1; - } - - /* first, clone to state if necessary to avoid other inarcs */ - if (to->nins > 1) { - s = newstate(nfa); - if (NISERR()) - return 0; - copyouts(nfa, to, s); /* duplicate outarcs */ - cparc(nfa, con, from, s); /* move constraint */ - freearc(nfa, con); - to = s; - con = to->ins; - } - assert(to->nins == 1); - - /* propagate the constraint into the to state's outarcs */ - for (a = to->outs; a != NULL; a = nexta) { - nexta = a->outchain; - switch (combine(con, a)) { - case INCOMPATIBLE: /* destroy the arc */ - freearc(nfa, a); - break; - case SATISFIED: /* no action needed */ - break; - case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) - return 0; - cparc(nfa, con, s, a->to); /* anticipate move */ - cparc(nfa, a, from, s); - if (NISERR()) - return 0; - freearc(nfa, a); - break; - default: - assert(NOTREACHED); - break; - } - } - - /* remaining outarcs, if any, incorporate the constraint */ - moveouts(nfa, to, from); - dropstate(nfa, to); /* will free the constraint */ - return 1; -} - -/* - - combine - constraint lands on an arc, what happens? - ^ #def INCOMPATIBLE 1 // destroys arc - ^ #def SATISFIED 2 // constraint satisfied - ^ #def COMPATIBLE 3 // compatible but not satisfied yet - ^ static int combine(struct arc *, struct arc *); - */ - -/* FIXME Required for CW 8 on Mac since it's not in limits.h */ -#ifndef __CHAR_BIT__ -#define __CHAR_BIT__ 8 -#endif - - -static int -combine(con, a) -struct arc *con; -struct arc *a; -{ -# define CA(ct,at) (((ct)<type, a->type)) { - case CA('^', PLAIN): /* newlines are handled separately */ - case CA('$', PLAIN): - return INCOMPATIBLE; - break; - case CA(AHEAD, PLAIN): /* color constraints meet colors */ - case CA(BEHIND, PLAIN): - if (con->co == a->co) - return SATISFIED; - return INCOMPATIBLE; - break; - case CA('^', '^'): /* collision, similar constraints */ - case CA('$', '$'): - case CA(AHEAD, AHEAD): - case CA(BEHIND, BEHIND): - if (con->co == a->co) /* true duplication */ - return SATISFIED; - return INCOMPATIBLE; - break; - case CA('^', BEHIND): /* collision, dissimilar constraints */ - case CA(BEHIND, '^'): - case CA('$', AHEAD): - case CA(AHEAD, '$'): - return INCOMPATIBLE; - break; - case CA('^', '$'): /* constraints passing each other */ - case CA('^', AHEAD): - case CA(BEHIND, '$'): - case CA(BEHIND, AHEAD): - case CA('$', '^'): - case CA('$', BEHIND): - case CA(AHEAD, '^'): - case CA(AHEAD, BEHIND): - case CA('^', LACON): - case CA(BEHIND, LACON): - case CA('$', LACON): - case CA(AHEAD, LACON): - return COMPATIBLE; - break; - } - assert(NOTREACHED); - return INCOMPATIBLE; /* for benefit of blind compilers */ -} - -/* - - fixempties - get rid of EMPTY arcs - ^ static VOID fixempties(struct nfa *, FILE *); - */ -static VOID -fixempties(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and eliminate empties until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->outs; a != NULL && !NISERR(); a = nexta) { - nexta = a->outchain; - if (a->type == EMPTY && unempty(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); -} - -/* - - unempty - optimize out an EMPTY arc, if possible - * Actually, as it stands this function always succeeds, but the return - * value is kept with an eye on possible future changes. - ^ static int unempty(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -unempty(nfa, a) -struct nfa *nfa; -struct arc *a; -{ - struct state *from = a->from; - struct state *to = a->to; - int usefrom; /* work on from, as opposed to to? */ - - assert(a->type == EMPTY); - assert(from != nfa->pre && to != nfa->post); - - if (from == to) { /* vacuous loop */ - freearc(nfa, a); - return 1; - } - - /* decide which end to work on */ - usefrom = 1; /* default: attack from */ - if (from->nouts > to->nins) - usefrom = 0; - else if (from->nouts == to->nins) { - /* decide on secondary issue: move/copy fewest arcs */ - if (from->nins > to->nouts) - usefrom = 0; - } - - freearc(nfa, a); - if (usefrom) { - if (from->nouts == 0) { - /* was the state's only outarc */ - moveins(nfa, from, to); - freestate(nfa, from); - } else - copyins(nfa, from, to); - } else { - if (to->nins == 0) { - /* was the state's only inarc */ - moveouts(nfa, to, from); - freestate(nfa, to); - } else - copyouts(nfa, to, from); - } - - return 1; -} - -/* - - cleanup - clean up NFA after optimizations - ^ static VOID cleanup(struct nfa *); - */ -static VOID -cleanup(nfa) -struct nfa *nfa; -{ - struct state *s; - struct state *nexts; - int n; - - /* clear out unreachable or dead-end states */ - /* use pre to mark reachable, then post to mark can-reach-post */ - markreachable(nfa, nfa->pre, (struct state *)NULL, nfa->pre); - markcanreach(nfa, nfa->post, nfa->pre, nfa->post); - for (s = nfa->states; s != NULL; s = nexts) { - nexts = s->next; - if (s->tmp != nfa->post && !s->flag) - dropstate(nfa, s); - } - assert(nfa->post->nins == 0 || nfa->post->tmp == nfa->post); - cleartraverse(nfa, nfa->pre); - assert(nfa->post->nins == 0 || nfa->post->tmp == NULL); - /* the nins==0 (final unreachable) case will be caught later */ - - /* renumber surviving states */ - n = 0; - for (s = nfa->states; s != NULL; s = s->next) - s->no = n++; - nfa->nstates = n; -} - -/* - - markreachable - recursive marking of reachable states - ^ static VOID markreachable(struct nfa *, struct state *, struct state *, - ^ struct state *); - */ -static VOID -markreachable(nfa, s, okay, mark) -struct nfa *nfa; -struct state *s; -struct state *okay; /* consider only states with this mark */ -struct state *mark; /* the value to mark with */ -{ - struct arc *a; - - if (s->tmp != okay) - return; - s->tmp = mark; - - for (a = s->outs; a != NULL; a = a->outchain) - markreachable(nfa, a->to, okay, mark); -} - -/* - - markcanreach - recursive marking of states which can reach here - ^ static VOID markcanreach(struct nfa *, struct state *, struct state *, - ^ struct state *); - */ -static VOID -markcanreach(nfa, s, okay, mark) -struct nfa *nfa; -struct state *s; -struct state *okay; /* consider only states with this mark */ -struct state *mark; /* the value to mark with */ -{ - struct arc *a; - - if (s->tmp != okay) - return; - s->tmp = mark; - - for (a = s->ins; a != NULL; a = a->inchain) - markcanreach(nfa, a->from, okay, mark); -} - -/* - - analyze - ascertain potentially-useful facts about an optimized NFA - ^ static long analyze(struct nfa *); - */ -static long /* re_info bits to be ORed in */ -analyze(nfa) -struct nfa *nfa; -{ - struct arc *a; - struct arc *aa; - - if (nfa->pre->outs == NULL) - return REG_UIMPOSSIBLE; - for (a = nfa->pre->outs; a != NULL; a = a->outchain) - for (aa = a->to->outs; aa != NULL; aa = aa->outchain) - if (aa->to == nfa->post) - return REG_UEMPTYMATCH; - return 0; -} - -/* - - compact - compact an NFA - ^ static VOID compact(struct nfa *, struct cnfa *); - */ -static VOID -compact(nfa, cnfa) -struct nfa *nfa; -struct cnfa *cnfa; -{ - struct state *s; - struct arc *a; - size_t nstates; - size_t narcs; - struct carc *ca; - struct carc *first; - - assert (!NISERR()); - - nstates = 0; - narcs = 0; - for (s = nfa->states; s != NULL; s = s->next) { - nstates++; - narcs += 1 + s->nouts + 1; - /* 1 as a fake for flags, nouts for arcs, 1 as endmarker */ - } - - cnfa->states = (struct carc **)MALLOC(nstates * sizeof(struct carc *)); - cnfa->arcs = (struct carc *)MALLOC(narcs * sizeof(struct carc)); - if (cnfa->states == NULL || cnfa->arcs == NULL) { - if (cnfa->states != NULL) - FREE(cnfa->states); - if (cnfa->arcs != NULL) - FREE(cnfa->arcs); - NERR(REG_ESPACE); - return; - } - cnfa->nstates = nstates; - cnfa->pre = nfa->pre->no; - cnfa->post = nfa->post->no; - cnfa->bos[0] = nfa->bos[0]; - cnfa->bos[1] = nfa->bos[1]; - cnfa->eos[0] = nfa->eos[0]; - cnfa->eos[1] = nfa->eos[1]; - cnfa->ncolors = maxcolor(nfa->cm) + 1; - cnfa->flags = 0; - - ca = cnfa->arcs; - for (s = nfa->states; s != NULL; s = s->next) { - assert((size_t)s->no < nstates); - cnfa->states[s->no] = ca; - ca->co = 0; /* clear and skip flags "arc" */ - ca++; - first = ca; - for (a = s->outs; a != NULL; a = a->outchain) - switch (a->type) { - case PLAIN: - ca->co = a->co; - ca->to = a->to->no; - ca++; - break; - case LACON: - assert(s->no != cnfa->pre); - ca->co = (color)(cnfa->ncolors + a->co); - ca->to = a->to->no; - ca++; - cnfa->flags |= HASLACONS; - break; - default: - assert(NOTREACHED); - break; - } - carcsort(first, ca-1); - ca->co = COLORLESS; - ca->to = 0; - ca++; - } - assert(ca == &cnfa->arcs[narcs]); - assert(cnfa->nstates != 0); - - /* mark no-progress states */ - for (a = nfa->pre->outs; a != NULL; a = a->outchain) - cnfa->states[a->to->no]->co = 1; - cnfa->states[nfa->pre->no]->co = 1; -} - -/* - - carcsort - sort compacted-NFA arcs by color - * Really dumb algorithm, but if the list is long enough for that to matter, - * you're in real trouble anyway. - ^ static VOID carcsort(struct carc *, struct carc *); - */ -static VOID -carcsort(first, last) -struct carc *first; -struct carc *last; -{ - struct carc *p; - struct carc *q; - struct carc tmp; - - if (last - first <= 1) - return; - - for (p = first; p <= last; p++) - for (q = p; q <= last; q++) - if (p->co > q->co || - (p->co == q->co && p->to > q->to)) { - assert(p != q); - tmp = *p; - *p = *q; - *q = tmp; - } -} - -/* - - freecnfa - free a compacted NFA - ^ static VOID freecnfa(struct cnfa *); - */ -static VOID -freecnfa(cnfa) -struct cnfa *cnfa; -{ - assert(cnfa->nstates != 0); /* not empty already */ - cnfa->nstates = 0; - FREE(cnfa->states); - FREE(cnfa->arcs); -} - -/* - - dumpnfa - dump an NFA in human-readable form - ^ static VOID dumpnfa(struct nfa *, FILE *); - */ -static VOID -dumpnfa(nfa, f) -struct nfa *nfa; -FILE *f; -{ -#ifdef REG_DEBUG - struct state *s; - - fprintf(f, "pre %d, post %d", nfa->pre->no, nfa->post->no); - if (nfa->bos[0] != COLORLESS) - fprintf(f, ", bos [%ld]", (long)nfa->bos[0]); - if (nfa->bos[1] != COLORLESS) - fprintf(f, ", bol [%ld]", (long)nfa->bos[1]); - if (nfa->eos[0] != COLORLESS) - fprintf(f, ", eos [%ld]", (long)nfa->eos[0]); - if (nfa->eos[1] != COLORLESS) - fprintf(f, ", eol [%ld]", (long)nfa->eos[1]); - fprintf(f, "\n"); - for (s = nfa->states; s != NULL; s = s->next) - dumpstate(s, f); - if (nfa->parent == NULL) - dumpcolors(nfa->cm, f); - fflush(f); -#endif -} - -#ifdef REG_DEBUG /* subordinates of dumpnfa */ -/* - ^ #ifdef REG_DEBUG - */ - -/* - - dumpstate - dump an NFA state in human-readable form - ^ static VOID dumpstate(struct state *, FILE *); - */ -static VOID -dumpstate(s, f) -struct state *s; -FILE *f; -{ - struct arc *a; - - fprintf(f, "%d%s%c", s->no, (s->tmp != NULL) ? "T" : "", - (s->flag) ? s->flag : '.'); - if (s->prev != NULL && s->prev->next != s) - fprintf(f, "\tstate chain bad\n"); - if (s->nouts == 0) - fprintf(f, "\tno out arcs\n"); - else - dumparcs(s, f); - fflush(f); - for (a = s->ins; a != NULL; a = a->inchain) { - if (a->to != s) - fprintf(f, "\tlink from %d to %d on %d's in-chain\n", - a->from->no, a->to->no, s->no); - } -} - -/* - - dumparcs - dump out-arcs in human-readable form - ^ static VOID dumparcs(struct state *, FILE *); - */ -static VOID -dumparcs(s, f) -struct state *s; -FILE *f; -{ - int pos; - - assert(s->nouts > 0); - /* printing arcs in reverse order is usually clearer */ - pos = dumprarcs(s->outs, s, f, 1); - if (pos != 1) - fprintf(f, "\n"); -} - -/* - - dumprarcs - dump remaining outarcs, recursively, in reverse order - ^ static int dumprarcs(struct arc *, struct state *, FILE *, int); - */ -static int /* resulting print position */ -dumprarcs(a, s, f, pos) -struct arc *a; -struct state *s; -FILE *f; -int pos; /* initial print position */ -{ - if (a->outchain != NULL) - pos = dumprarcs(a->outchain, s, f, pos); - dumparc(a, s, f); - if (pos == 5) { - fprintf(f, "\n"); - pos = 1; - } else - pos++; - return pos; -} - -/* - - dumparc - dump one outarc in readable form, including prefixing tab - ^ static VOID dumparc(struct arc *, struct state *, FILE *); - */ -static VOID -dumparc(a, s, f) -struct arc *a; -struct state *s; -FILE *f; -{ - struct arc *aa; - struct arcbatch *ab; - - fprintf(f, "\t"); - switch (a->type) { - case PLAIN: - fprintf(f, "[%ld]", (long)a->co); - break; - case AHEAD: - fprintf(f, ">%ld>", (long)a->co); - break; - case BEHIND: - fprintf(f, "<%ld<", (long)a->co); - break; - case LACON: - fprintf(f, ":%ld:", (long)a->co); - break; - case '^': - case '$': - fprintf(f, "%c%d", a->type, (int)a->co); - break; - case EMPTY: - break; - default: - fprintf(f, "0x%x/0%lo", a->type, (long)a->co); - break; - } - if (a->from != s) - fprintf(f, "?%d?", a->from->no); - for (ab = &a->from->oas; ab != NULL; ab = ab->next) { - for (aa = &ab->a[0]; aa < &ab->a[ABSIZE]; aa++) - if (aa == a) - break; /* NOTE BREAK OUT */ - if (aa < &ab->a[ABSIZE]) /* propagate break */ - break; /* NOTE BREAK OUT */ - } - if (ab == NULL) - fprintf(f, "?!?"); /* not in allocated space */ - fprintf(f, "->"); - if (a->to == NULL) { - fprintf(f, "NULL"); - return; - } - fprintf(f, "%d", a->to->no); - for (aa = a->to->ins; aa != NULL; aa = aa->inchain) - if (aa == a) - break; /* NOTE BREAK OUT */ - if (aa == NULL) - fprintf(f, "?!?"); /* missing from in-chain */ -} - -/* - ^ #endif - */ -#endif /* ifdef REG_DEBUG */ - -/* - - dumpcnfa - dump a compacted NFA in human-readable form - ^ static VOID dumpcnfa(struct cnfa *, FILE *); - */ -static VOID -dumpcnfa(cnfa, f) -struct cnfa *cnfa; -FILE *f; -{ -#ifdef REG_DEBUG - int st; - - fprintf(f, "pre %d, post %d", cnfa->pre, cnfa->post); - if (cnfa->bos[0] != COLORLESS) - fprintf(f, ", bos [%ld]", (long)cnfa->bos[0]); - if (cnfa->bos[1] != COLORLESS) - fprintf(f, ", bol [%ld]", (long)cnfa->bos[1]); - if (cnfa->eos[0] != COLORLESS) - fprintf(f, ", eos [%ld]", (long)cnfa->eos[0]); - if (cnfa->eos[1] != COLORLESS) - fprintf(f, ", eol [%ld]", (long)cnfa->eos[1]); - if (cnfa->flags&HASLACONS) - fprintf(f, ", haslacons"); - fprintf(f, "\n"); - for (st = 0; st < cnfa->nstates; st++) - dumpcstate(st, cnfa->states[st], cnfa, f); - fflush(f); -#endif -} - -#ifdef REG_DEBUG /* subordinates of dumpcnfa */ -/* - ^ #ifdef REG_DEBUG - */ - -/* - - dumpcstate - dump a compacted-NFA state in human-readable form - ^ static VOID dumpcstate(int, struct carc *, struct cnfa *, FILE *); - */ -static VOID -dumpcstate(st, ca, cnfa, f) -int st; -struct carc *ca; -struct cnfa *cnfa; -FILE *f; -{ - int i; - int pos; - - fprintf(f, "%d%s", st, (ca[0].co) ? ":" : "."); - pos = 1; - for (i = 1; ca[i].co != COLORLESS; i++) { - if (ca[i].co < cnfa->ncolors) - fprintf(f, "\t[%ld]->%d", (long)ca[i].co, ca[i].to); - else - fprintf(f, "\t:%ld:->%d", (long)ca[i].co-cnfa->ncolors, - ca[i].to); - if (pos == 5) { - fprintf(f, "\n"); - pos = 1; - } else - pos++; - } - if (i == 1 || pos != 1) - fprintf(f, "\n"); - fflush(f); -} - -/* - ^ #endif - */ -#endif /* ifdef REG_DEBUG */ diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c deleted file mode 100644 index 83edc37b34..0000000000 --- a/src/regex/regcomp.c +++ /dev/null @@ -1,2179 +0,0 @@ -/* - * re_*comp and friends - compile REs - * This file #includes several others (see the bottom). - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - -/* - * forward declarations, up here so forward datatypes etc. are defined early - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regcomp.c === */ -int compile _ANSI_ARGS_((regex_t *, CONST chr *, size_t, int)); -static VOID moresubs _ANSI_ARGS_((struct vars *, int)); -static int freev _ANSI_ARGS_((struct vars *, int)); -static VOID makesearch _ANSI_ARGS_((struct vars *, struct nfa *)); -static struct subre *parse _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *)); -static struct subre *parsebranch _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, int)); -static VOID parseqatom _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, struct subre *)); -static VOID nonword _ANSI_ARGS_((struct vars *, int, struct state *, struct state *)); -static VOID word _ANSI_ARGS_((struct vars *, int, struct state *, struct state *)); -static int scannum _ANSI_ARGS_((struct vars *)); -static VOID repeat _ANSI_ARGS_((struct vars *, struct state *, struct state *, int, int)); -static VOID bracket _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static VOID cbracket _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static VOID brackpart _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static chr *scanplain _ANSI_ARGS_((struct vars *)); -static VOID leaders _ANSI_ARGS_((struct vars *, struct cvec *)); -static VOID onechr _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *)); -static VOID dovec _ANSI_ARGS_((struct vars *, struct cvec *, struct state *, struct state *)); -static celt nextleader _ANSI_ARGS_((struct vars *, pchr, pchr)); -static VOID wordchrs _ANSI_ARGS_((struct vars *)); -static struct subre *subre _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *)); -static VOID freesubre _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID freesrnode _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID optst _ANSI_ARGS_((struct vars *, struct subre *)); -static int numst _ANSI_ARGS_((struct subre *, int)); -static VOID markst _ANSI_ARGS_((struct subre *)); -static VOID cleanst _ANSI_ARGS_((struct vars *)); -static long nfatree _ANSI_ARGS_((struct vars *, struct subre *, FILE *)); -static long nfanode _ANSI_ARGS_((struct vars *, struct subre *, FILE *)); -static int newlacon _ANSI_ARGS_((struct vars *, struct state *, struct state *, int)); -static VOID freelacons _ANSI_ARGS_((struct subre *, int)); -static VOID rfree _ANSI_ARGS_((regex_t *)); -static VOID dump _ANSI_ARGS_((regex_t *, FILE *)); -static VOID dumpst _ANSI_ARGS_((struct subre *, FILE *, int)); -static VOID stdump _ANSI_ARGS_((struct subre *, FILE *, int)); -static char *stid _ANSI_ARGS_((struct subre *, char *, size_t)); -/* === regc_lex.c === */ -static VOID lexstart _ANSI_ARGS_((struct vars *)); -static VOID prefixes _ANSI_ARGS_((struct vars *)); -static VOID lexnest _ANSI_ARGS_((struct vars *, chr *, chr *)); -static VOID lexword _ANSI_ARGS_((struct vars *)); -static int next _ANSI_ARGS_((struct vars *)); -static int lexescape _ANSI_ARGS_((struct vars *)); -static chr lexdigits _ANSI_ARGS_((struct vars *, int, int, int)); -static int brenext _ANSI_ARGS_((struct vars *, pchr)); -static VOID skip _ANSI_ARGS_((struct vars *)); -static chr newline _ANSI_ARGS_((NOPARMS)); -#ifdef REG_DEBUG -static chr *ch _ANSI_ARGS_((NOPARMS)); -#endif -static chr chrnamed _ANSI_ARGS_((struct vars *, chr *, chr *, pchr)); -/* === regc_color.c === */ -static VOID initcm _ANSI_ARGS_((struct vars *, struct colormap *)); -static VOID freecm _ANSI_ARGS_((struct colormap *)); -static VOID cmtreefree _ANSI_ARGS_((struct colormap *, union tree *, int)); -static color setcolor _ANSI_ARGS_((struct colormap *, pchr, pcolor)); -static color maxcolor _ANSI_ARGS_((struct colormap *)); -static color newcolor _ANSI_ARGS_((struct colormap *)); -static VOID freecolor _ANSI_ARGS_((struct colormap *, pcolor)); -static color pseudocolor _ANSI_ARGS_((struct colormap *)); -static color subcolor _ANSI_ARGS_((struct colormap *, pchr c)); -static color newsub _ANSI_ARGS_((struct colormap *, pcolor)); -static VOID subrange _ANSI_ARGS_((struct vars *, pchr, pchr, struct state *, struct state *)); -static VOID subblock _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *)); -static VOID okcolors _ANSI_ARGS_((struct nfa *, struct colormap *)); -static VOID colorchain _ANSI_ARGS_((struct colormap *, struct arc *)); -static VOID uncolorchain _ANSI_ARGS_((struct colormap *, struct arc *)); -static int singleton _ANSI_ARGS_((struct colormap *, pchr c)); -static VOID rainbow _ANSI_ARGS_((struct nfa *, struct colormap *, int, pcolor, struct state *, struct state *)); -static VOID colorcomplement _ANSI_ARGS_((struct nfa *, struct colormap *, int, struct state *, struct state *, struct state *)); -#ifdef REG_DEBUG -static VOID dumpcolors _ANSI_ARGS_((struct colormap *, FILE *)); -static VOID fillcheck _ANSI_ARGS_((struct colormap *, union tree *, int, FILE *)); -static VOID dumpchr _ANSI_ARGS_((pchr, FILE *)); -#endif -/* === regc_nfa.c === */ -static struct nfa *newnfa _ANSI_ARGS_((struct vars *, struct colormap *, struct nfa *)); -static VOID freenfa _ANSI_ARGS_((struct nfa *)); -static struct state *newstate _ANSI_ARGS_((struct nfa *)); -static struct state *newfstate _ANSI_ARGS_((struct nfa *, int flag)); -static VOID dropstate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID freestate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID destroystate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID newarc _ANSI_ARGS_((struct nfa *, int, pcolor, struct state *, struct state *)); -static struct arc *allocarc _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID freearc _ANSI_ARGS_((struct nfa *, struct arc *)); -static struct arc *findarc _ANSI_ARGS_((struct state *, int, pcolor)); -static VOID cparc _ANSI_ARGS_((struct nfa *, struct arc *, struct state *, struct state *)); -static VOID moveins _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID copyins _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID moveouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID copyouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID cloneouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, int)); -static VOID delsub _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID deltraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID dupnfa _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, struct state *)); -static VOID duptraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID cleartraverse _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID specialcolors _ANSI_ARGS_((struct nfa *)); -static long optimize _ANSI_ARGS_((struct nfa *, FILE *)); -static VOID pullback _ANSI_ARGS_((struct nfa *, FILE *)); -static int pull _ANSI_ARGS_((struct nfa *, struct arc *)); -static VOID pushfwd _ANSI_ARGS_((struct nfa *, FILE *)); -static int push _ANSI_ARGS_((struct nfa *, struct arc *)); -#define INCOMPATIBLE 1 /* destroys arc */ -#define SATISFIED 2 /* constraint satisfied */ -#define COMPATIBLE 3 /* compatible but not satisfied yet */ -static int combine _ANSI_ARGS_((struct arc *, struct arc *)); -static VOID fixempties _ANSI_ARGS_((struct nfa *, FILE *)); -static int unempty _ANSI_ARGS_((struct nfa *, struct arc *)); -static VOID cleanup _ANSI_ARGS_((struct nfa *)); -static VOID markreachable _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *)); -static VOID markcanreach _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *)); -static long analyze _ANSI_ARGS_((struct nfa *)); -static VOID compact _ANSI_ARGS_((struct nfa *, struct cnfa *)); -static VOID carcsort _ANSI_ARGS_((struct carc *, struct carc *)); -static VOID freecnfa _ANSI_ARGS_((struct cnfa *)); -static VOID dumpnfa _ANSI_ARGS_((struct nfa *, FILE *)); -#ifdef REG_DEBUG -static VOID dumpstate _ANSI_ARGS_((struct state *, FILE *)); -static VOID dumparcs _ANSI_ARGS_((struct state *, FILE *)); -static int dumprarcs _ANSI_ARGS_((struct arc *, struct state *, FILE *, int)); -static VOID dumparc _ANSI_ARGS_((struct arc *, struct state *, FILE *)); -#endif -static VOID dumpcnfa _ANSI_ARGS_((struct cnfa *, FILE *)); -#ifdef REG_DEBUG -static VOID dumpcstate _ANSI_ARGS_((int, struct carc *, struct cnfa *, FILE *)); -#endif -/* === regc_cvec.c === */ -static struct cvec *newcvec _ANSI_ARGS_((int, int, int)); -static struct cvec *clearcvec _ANSI_ARGS_((struct cvec *)); -static VOID addchr _ANSI_ARGS_((struct cvec *, pchr)); -static VOID addrange _ANSI_ARGS_((struct cvec *, pchr, pchr)); -static VOID addmcce _ANSI_ARGS_((struct cvec *, chr *, chr *)); -static int haschr _ANSI_ARGS_((struct cvec *, pchr)); -static struct cvec *getcvec _ANSI_ARGS_((struct vars *, int, int, int)); -static VOID freecvec _ANSI_ARGS_((struct cvec *)); -/* === regc_locale.c === */ -static int nmcces _ANSI_ARGS_((struct vars *)); -static int nleaders _ANSI_ARGS_((struct vars *)); -static struct cvec *allmcces _ANSI_ARGS_((struct vars *, struct cvec *)); -static celt element _ANSI_ARGS_((struct vars *, chr *, chr *)); -static struct cvec *range _ANSI_ARGS_((struct vars *, celt, celt, int)); -static int before _ANSI_ARGS_((celt, celt)); -static struct cvec *eclass _ANSI_ARGS_((struct vars *, celt, int)); -static struct cvec *cclass _ANSI_ARGS_((struct vars *, chr *, chr *, int)); -static struct cvec *allcases _ANSI_ARGS_((struct vars *, pchr)); -static int cmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t)); -static int casecmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* internal variables, bundled for easy passing around */ -struct vars { - regex_t *re; - chr *now; /* scan pointer into string */ - chr *stop; /* end of string */ - chr *savenow; /* saved now and stop for "subroutine call" */ - chr *savestop; - int err; /* error code (0 if none) */ - int cflags; /* copy of compile flags */ - int lasttype; /* type of previous token */ - int nexttype; /* type of next token */ - chr nextvalue; /* value (if any) of next token */ - int lexcon; /* lexical context type (see lex.c) */ - int nsubexp; /* subexpression count */ - struct subre **subs; /* subRE pointer vector */ - size_t nsubs; /* length of vector */ - struct subre *sub10[10]; /* initial vector, enough for most */ - struct nfa *nfa; /* the NFA */ - struct colormap *cm; /* character color map */ - color nlcolor; /* color of newline */ - struct state *wordchrs; /* state in nfa holding word-char outarcs */ - struct subre *tree; /* subexpression tree */ - struct subre *treechain; /* all tree nodes allocated */ - struct subre *treefree; /* any free tree nodes */ - int ntree; /* number of tree nodes */ - struct cvec *cv; /* interface cvec */ - struct cvec *cv2; /* utility cvec */ - struct cvec *mcces; /* collating-element information */ -# define ISCELEADER(v,c) (v->mcces != NULL && haschr(v->mcces, (c))) - struct state *mccepbegin; /* in nfa, start of MCCE prototypes */ - struct state *mccepend; /* in nfa, end of MCCE prototypes */ - struct subre *lacons; /* lookahead-constraint vector */ - int nlacons; /* size of lacons */ -}; - -/* parsing macros; most know that `v' is the struct vars pointer */ -#define NEXT() (next(v)) /* advance by one token */ -#define SEE(t) (v->nexttype == (t)) /* is next token this? */ -#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */ -#define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ -#define ISERR() VISERR(v) -#define VERR(vv,e) ((vv)->nexttype = EOS, ((vv)->err) ? (vv)->err :\ - ((vv)->err = (e))) -#define ERR(e) (void)VERR(v, e) /* record an error */ -#define NOERR() {if (ISERR()) return;} /* if error seen, return */ -#define NOERRN() {if (ISERR()) return NULL;} /* NOERR with retval */ -#define NOERRZ() {if (ISERR()) return 0;} /* NOERR with retval */ -#define INSIST(c, e) (void)((c) ? (void)0 : ERR(e)) /* if condition false, error */ -#define NOTE(b) (v->re->re_info |= (b)) /* note visible condition */ -#define EMPTYARC(x, y) newarc(v->nfa, EMPTY, 0, x, y) - -/* token type codes, some also used as NFA arc types */ -#define EMPTY 'n' /* no token present */ -#define EOS 'e' /* end of string */ -#define PLAIN 'p' /* ordinary character */ -#define DIGIT 'd' /* digit (in bound) */ -#define BACKREF 'b' /* back reference */ -#define COLLEL 'I' /* start of [. */ -#define ECLASS 'E' /* start of [= */ -#define CCLASS 'C' /* start of [: */ -#define END 'X' /* end of [. [= [: */ -#define RANGE 'R' /* - within [] which might be range delim. */ -#define LACON 'L' /* lookahead constraint subRE */ -#define AHEAD 'a' /* color-lookahead arc */ -#define BEHIND 'r' /* color-lookbehind arc */ -#define WBDRY 'w' /* word boundary constraint */ -#define NWBDRY 'W' /* non-word-boundary constraint */ -#define SBEGIN 'A' /* beginning of string (even if not BOL) */ -#define SEND 'Z' /* end of string (even if not EOL) */ -#define PREFER 'P' /* length preference */ - -/* is an arc colored, and hence on a color chain? */ -#define COLORED(a) ((a)->type == PLAIN || (a)->type == AHEAD || \ - (a)->type == BEHIND) - - - -/* static function list */ -static struct fns functions = { - rfree, /* regfree insides */ -}; - - - -/* - - compile - compile regular expression - ^ int compile(regex_t *, CONST chr *, size_t, int); - */ -int -compile(re, string, len, flags) -regex_t *re; -CONST chr *string; -size_t len; -int flags; -{ - struct vars var; - struct vars *v = &var; - struct guts *g; - int i; - size_t j; - FILE *debug = (flags®_PROGRESS) ? stdout : (FILE *)NULL; -# define CNOERR() { if (ISERR()) return freev(v, v->err); } - - /* sanity checks */ - - if (re == NULL || string == NULL) - return REG_INVARG; - if ((flags®_QUOTE) && - (flags&(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE))) - return REG_INVARG; - if (!(flags®_EXTENDED) && (flags®_ADVF)) - return REG_INVARG; - - /* initial setup (after which freev() is callable) */ - v->re = re; - v->now = (chr *)string; - v->stop = v->now + len; - v->savenow = v->savestop = NULL; - v->err = 0; - v->cflags = flags; - v->nsubexp = 0; - v->subs = v->sub10; - v->nsubs = 10; - for (j = 0; j < v->nsubs; j++) - v->subs[j] = NULL; - v->nfa = NULL; - v->cm = NULL; - v->nlcolor = COLORLESS; - v->wordchrs = NULL; - v->tree = NULL; - v->treechain = NULL; - v->treefree = NULL; - v->cv = NULL; - v->cv2 = NULL; - v->mcces = NULL; - v->lacons = NULL; - v->nlacons = 0; - re->re_magic = REMAGIC; - re->re_info = 0; /* bits get set during parse */ - re->re_csize = sizeof(chr); - re->re_guts = NULL; - re->re_fns = VS(&functions); - - /* more complex setup, malloced things */ - re->re_guts = VS(MALLOC(sizeof(struct guts))); - if (re->re_guts == NULL) - return freev(v, REG_ESPACE); - g = (struct guts *)re->re_guts; - g->tree = NULL; - initcm(v, &g->cmap); - v->cm = &g->cmap; - g->lacons = NULL; - g->nlacons = 0; - ZAPCNFA(g->search); - v->nfa = newnfa(v, v->cm, (struct nfa *)NULL); - CNOERR(); - v->cv = newcvec(100, 20, 10); - if (v->cv == NULL) - return freev(v, REG_ESPACE); - i = nmcces(v); - if (i > 0) { - v->mcces = newcvec(nleaders(v), 0, i); - CNOERR(); - v->mcces = allmcces(v, v->mcces); - leaders(v, v->mcces); - addmcce(v->mcces, (chr *)NULL, (chr *)NULL); /* dummy */ - } - CNOERR(); - - /* parsing */ - lexstart(v); /* also handles prefixes */ - if ((v->cflags®_NLSTOP) || (v->cflags®_NLANCH)) { - /* assign newline a unique color */ - v->nlcolor = subcolor(v->cm, newline()); - okcolors(v->nfa, v->cm); - } - CNOERR(); - v->tree = parse(v, EOS, PLAIN, v->nfa->init, v->nfa->final); - assert(SEE(EOS)); /* even if error; ISERR() => SEE(EOS) */ - CNOERR(); - assert(v->tree != NULL); - - /* finish setup of nfa and its subre tree */ - specialcolors(v->nfa); - CNOERR(); - if (debug != NULL) { - fprintf(debug, "\n\n\n========= RAW ==========\n"); - dumpnfa(v->nfa, debug); - dumpst(v->tree, debug, 1); - } - optst(v, v->tree); - v->ntree = numst(v->tree, 1); - markst(v->tree); - cleanst(v); - if (debug != NULL) { - fprintf(debug, "\n\n\n========= TREE FIXED ==========\n"); - dumpst(v->tree, debug, 1); - } - - /* build compacted NFAs for tree and lacons */ - re->re_info |= nfatree(v, v->tree, debug); - CNOERR(); - assert(v->nlacons == 0 || v->lacons != NULL); - for (i = 1; i < v->nlacons; i++) { - if (debug != NULL) - fprintf(debug, "\n\n\n========= LA%d ==========\n", i); - nfanode(v, &v->lacons[i], debug); - } - CNOERR(); - if (v->tree->flags&SHORTER) - NOTE(REG_USHORTEST); - - /* build compacted NFAs for tree, lacons, fast search */ - if (debug != NULL) - fprintf(debug, "\n\n\n========= SEARCH ==========\n"); - /* can sacrifice main NFA now, so use it as work area */ - (DISCARD)optimize(v->nfa, debug); - CNOERR(); - makesearch(v, v->nfa); - CNOERR(); - compact(v->nfa, &g->search); - CNOERR(); - - /* looks okay, package it up */ - re->re_nsub = v->nsubexp; - v->re = NULL; /* freev no longer frees re */ - g->magic = GUTSMAGIC; - g->cflags = v->cflags; - g->info = re->re_info; - g->nsub = re->re_nsub; - g->tree = v->tree; - v->tree = NULL; - g->ntree = v->ntree; - g->compare = (v->cflags®_ICASE) ? casecmp : cmp; - g->lacons = v->lacons; - v->lacons = NULL; - g->nlacons = v->nlacons; - - if (flags®_DUMP) - dump(re, stdout); - - assert(v->err == 0); - return freev(v, 0); -} - -/* - - moresubs - enlarge subRE vector - ^ static VOID moresubs(struct vars *, int); - */ -static VOID -moresubs(v, wanted) -struct vars *v; -int wanted; /* want enough room for this one */ -{ - struct subre **p; - size_t n; - - assert(wanted > 0 && (size_t)wanted >= v->nsubs); - n = (size_t)wanted * 3 / 2 + 1; - if (v->subs == v->sub10) { - p = (struct subre **)MALLOC(n * sizeof(struct subre *)); - if (p != NULL) - memcpy(VS(p), VS(v->subs), - v->nsubs * sizeof(struct subre *)); - } else - p = (struct subre **)REALLOC(v->subs, n*sizeof(struct subre *)); - if (p == NULL) { - ERR(REG_ESPACE); - return; - } - v->subs = p; - for (p = &v->subs[v->nsubs]; v->nsubs < n; p++, v->nsubs++) - *p = NULL; - assert(v->nsubs == n); - assert((size_t)wanted < v->nsubs); -} - -/* - - freev - free vars struct's substructures where necessary - * Optionally does error-number setting, and always returns error code - * (if any), to make error-handling code terser. - ^ static int freev(struct vars *, int); - */ -static int -freev(v, err) -struct vars *v; -int err; -{ - if (v->re != NULL) - rfree(v->re); - if (v->subs != v->sub10) - FREE(v->subs); - if (v->nfa != NULL) - freenfa(v->nfa); - if (v->tree != NULL) - freesubre(v, v->tree); - if (v->treechain != NULL) - cleanst(v); - if (v->cv != NULL) - freecvec(v->cv); - if (v->cv2 != NULL) - freecvec(v->cv2); - if (v->mcces != NULL) - freecvec(v->mcces); - if (v->lacons != NULL) - freelacons(v->lacons, v->nlacons); - ERR(err); /* nop if err==0 */ - - return v->err; -} - -/* - - makesearch - turn an NFA into a search NFA (implicit prepend of .*?) - * NFA must have been optimize()d already. - ^ static VOID makesearch(struct vars *, struct nfa *); - */ -static VOID -makesearch(v, nfa) -struct vars *v; -struct nfa *nfa; -{ - struct arc *a; - struct arc *b; - struct state *pre = nfa->pre; - struct state *s; - struct state *s2; - struct state *slist; - - /* no loops are needed if it's anchored */ - for (a = pre->outs; a != NULL; a = a->outchain) { - assert(a->type == PLAIN); - if (a->co != nfa->bos[0] && a->co != nfa->bos[1]) - break; - } - if (a != NULL) { - /* add implicit .* in front */ - rainbow(nfa, v->cm, PLAIN, COLORLESS, pre, pre); - - /* and ^* and \A* too -- not always necessary, but harmless */ - newarc(nfa, PLAIN, nfa->bos[0], pre, pre); - newarc(nfa, PLAIN, nfa->bos[1], pre, pre); - } - - /* - * Now here's the subtle part. Because many REs have no lookback - * constraints, often knowing when you were in the pre state tells - * you little; it's the next state(s) that are informative. But - * some of them may have other inarcs, i.e. it may be possible to - * make actual progress and then return to one of them. We must - * de-optimize such cases, splitting each such state into progress - * and no-progress states. - */ - - /* first, make a list of the states */ - slist = NULL; - for (a = pre->outs; a != NULL; a = a->outchain) { - s = a->to; - for (b = s->ins; b != NULL; b = b->inchain) - if (b->from != pre) - break; - if (b != NULL) { /* must be split */ - if (s->tmp == NULL) { /* if not already in the list */ - /* (fixes bugs 505048, 230589, */ - /* 840258, 504785) */ - s->tmp = slist; - slist = s; - } - } - } - - /* do the splits */ - for (s = slist; s != NULL; s = s2) { - s2 = newstate(nfa); - copyouts(nfa, s, s2); - for (a = s->ins; a != NULL; a = b) { - b = a->inchain; - if (a->from != pre) { - cparc(nfa, a, a->from, s2); - freearc(nfa, a); - } - } - s2 = s->tmp; - s->tmp = NULL; /* clean up while we're at it */ - } -} - -/* - - parse - parse an RE - * This is actually just the top level, which parses a bunch of branches - * tied together with '|'. They appear in the tree as the left children - * of a chain of '|' subres. - ^ static struct subre *parse(struct vars *, int, int, struct state *, - ^ struct state *); - */ -static struct subre * -parse(v, stopper, type, init, final) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *init; /* initial state */ -struct state *final; /* final state */ -{ - struct state *left; /* scaffolding for branch */ - struct state *right; - struct subre *branches; /* top level */ - struct subre *branch; /* current branch */ - struct subre *t; /* temporary */ - int firstbranch; /* is this the first branch? */ - - assert(stopper == ')' || stopper == EOS); - - branches = subre(v, '|', LONGER, init, final); - NOERRN(); - branch = branches; - firstbranch = 1; - do { /* a branch */ - if (!firstbranch) { - /* need a place to hang it */ - branch->right = subre(v, '|', LONGER, init, final); - NOERRN(); - branch = branch->right; - } - firstbranch = 0; - left = newstate(v->nfa); - right = newstate(v->nfa); - NOERRN(); - EMPTYARC(init, left); - EMPTYARC(right, final); - NOERRN(); - branch->left = parsebranch(v, stopper, type, left, right, 0); - NOERRN(); - branch->flags |= UP(branch->flags | branch->left->flags); - if ((branch->flags &~ branches->flags) != 0) /* new flags */ - for (t = branches; t != branch; t = t->right) - t->flags |= branch->flags; - } while (EAT('|')); - assert(SEE(stopper) || SEE(EOS)); - - if (!SEE(stopper)) { - assert(stopper == ')' && SEE(EOS)); - ERR(REG_EPAREN); - } - - /* optimize out simple cases */ - if (branch == branches) { /* only one branch */ - assert(branch->right == NULL); - t = branch->left; - branch->left = NULL; - freesubre(v, branches); - branches = t; - } else if (!MESSY(branches->flags)) { /* no interesting innards */ - freesubre(v, branches->left); - branches->left = NULL; - freesubre(v, branches->right); - branches->right = NULL; - branches->op = '='; - } - - return branches; -} - -/* - - parsebranch - parse one branch of an RE - * This mostly manages concatenation, working closely with parseqatom(). - * Concatenated things are bundled up as much as possible, with separate - * ',' nodes introduced only when necessary due to substructure. - ^ static struct subre *parsebranch(struct vars *, int, int, struct state *, - ^ struct state *, int); - */ -static struct subre * -parsebranch(v, stopper, type, left, right, partial) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *left; /* leftmost state */ -struct state *right; /* rightmost state */ -int partial; /* is this only part of a branch? */ -{ - struct state *lp; /* left end of current construct */ - int seencontent; /* is there anything in this branch yet? */ - struct subre *t; - - lp = left; - seencontent = 0; - t = subre(v, '=', 0, left, right); /* op '=' is tentative */ - NOERRN(); - while (!SEE('|') && !SEE(stopper) && !SEE(EOS)) { - if (seencontent) { /* implicit concat operator */ - lp = newstate(v->nfa); - NOERRN(); - moveins(v->nfa, right, lp); - } - seencontent = 1; - - /* NB, recursion in parseqatom() may swallow rest of branch */ - parseqatom(v, stopper, type, lp, right, t); - } - - if (!seencontent) { /* empty branch */ - if (!partial) - NOTE(REG_UUNSPEC); - assert(lp == left); - EMPTYARC(left, right); - } - - return t; -} - -/* - - parseqatom - parse one quantified atom or constraint of an RE - * The bookkeeping near the end cooperates very closely with parsebranch(); - * in particular, it contains a recursion that can involve parsing the rest - * of the branch, making this function's name somewhat inaccurate. - ^ static VOID parseqatom(struct vars *, int, int, struct state *, - ^ struct state *, struct subre *); - */ -static VOID -parseqatom(v, stopper, type, lp, rp, top) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *lp; /* left state to hang it on */ -struct state *rp; /* right state to hang it on */ -struct subre *top; /* subtree top */ -{ - struct state *s; /* temporaries for new states */ - struct state *s2; -# define ARCV(t, val) newarc(v->nfa, t, val, lp, rp) - int m, n; - struct subre *atom; /* atom's subtree */ - struct subre *t; - int cap; /* capturing parens? */ - int pos; /* positive lookahead? */ - int subno; /* capturing-parens or backref number */ - int atomtype; - int qprefer; /* quantifier short/long preference */ - int f; - struct subre **atomp; /* where the pointer to atom is */ - - /* initial bookkeeping */ - atom = NULL; - assert(lp->nouts == 0); /* must string new code */ - assert(rp->nins == 0); /* between lp and rp */ - subno = 0; /* just to shut lint up */ - - /* an atom or constraint... */ - atomtype = v->nexttype; - switch (atomtype) { - /* first, constraints, which end by returning */ - case '^': - ARCV('^', 1); - if (v->cflags®_NLANCH) - ARCV(BEHIND, v->nlcolor); - NEXT(); - return; - break; - case '$': - ARCV('$', 1); - if (v->cflags®_NLANCH) - ARCV(AHEAD, v->nlcolor); - NEXT(); - return; - break; - case SBEGIN: - ARCV('^', 1); /* BOL */ - ARCV('^', 0); /* or BOS */ - NEXT(); - return; - break; - case SEND: - ARCV('$', 1); /* EOL */ - ARCV('$', 0); /* or EOS */ - NEXT(); - return; - break; - case '<': - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - return; - break; - case '>': - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case WBDRY: - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case NWBDRY: - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case LACON: /* lookahead constraint */ - pos = v->nextvalue; - NEXT(); - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - t = parse(v, ')', LACON, s, s2); - freesubre(v, t); /* internal structure irrelevant */ - assert(SEE(')') || ISERR()); - NEXT(); - n = newlacon(v, s, s2, pos); - NOERR(); - ARCV(LACON, n); - return; - break; - /* then errors, to get them out of the way */ - case '*': - case '+': - case '?': - case '{': - ERR(REG_BADRPT); - return; - break; - default: - ERR(REG_ASSERT); - return; - break; - /* then plain characters, and minor variants on that theme */ - case ')': /* unbalanced paren */ - if ((v->cflags®_ADVANCED) != REG_EXTENDED) { - ERR(REG_EPAREN); - return; - } - /* legal in EREs due to specification botch */ - NOTE(REG_UPBOTCH); - /* fallthrough into case PLAIN */ - case PLAIN: - onechr(v, v->nextvalue, lp, rp); - okcolors(v->nfa, v->cm); - NOERR(); - NEXT(); - break; - case '[': - if (v->nextvalue == 1) - bracket(v, lp, rp); - else - cbracket(v, lp, rp); - assert(SEE(']') || ISERR()); - NEXT(); - break; - case '.': - rainbow(v->nfa, v->cm, PLAIN, - (v->cflags®_NLSTOP) ? v->nlcolor : COLORLESS, - lp, rp); - NEXT(); - break; - /* and finally the ugly stuff */ - case '(': /* value flags as capturing or non */ - cap = (type == LACON) ? 0 : v->nextvalue; - if (cap) { - v->nsubexp++; - subno = v->nsubexp; - if ((size_t)subno >= v->nsubs) - moresubs(v, subno); - assert((size_t)subno < v->nsubs); - } else - atomtype = PLAIN; /* something that's not '(' */ - NEXT(); - /* need new endpoints because tree will contain pointers */ - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - EMPTYARC(lp, s); - EMPTYARC(s2, rp); - NOERR(); - atom = parse(v, ')', PLAIN, s, s2); - assert(SEE(')') || ISERR()); - NEXT(); - NOERR(); - if (cap) { - v->subs[subno] = atom; - t = subre(v, '(', atom->flags|CAP, lp, rp); - NOERR(); - t->subno = subno; - t->left = atom; - atom = t; - } - /* postpone everything else pending possible {0} */ - break; - case BACKREF: /* the Feature From The Black Lagoon */ - INSIST(type != LACON, REG_ESUBREG); - INSIST(v->nextvalue < v->nsubs, REG_ESUBREG); - INSIST(v->subs[(int)v->nextvalue] != NULL, REG_ESUBREG); - NOERR(); - assert(v->nextvalue > 0); - atom = subre(v, 'b', BACKR, lp, rp); - subno = v->nextvalue; - atom->subno = subno; - EMPTYARC(lp, rp); /* temporarily, so there's something */ - NEXT(); - break; - } - - /* ...and an atom may be followed by a quantifier */ - switch (v->nexttype) { - case '*': - m = 0; - n = INFINITY; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '+': - m = 1; - n = INFINITY; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '?': - m = 0; - n = 1; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '{': - NEXT(); - m = scannum(v); - if (EAT(',')) { - if (SEE(DIGIT)) - n = scannum(v); - else - n = INFINITY; - if (m > n) { - ERR(REG_BADBR); - return; - } - /* {m,n} exercises preference, even if it's {m,m} */ - qprefer = (v->nextvalue) ? LONGER : SHORTER; - } else { - n = m; - /* {m} passes operand's preference through */ - qprefer = 0; - } - if (!SEE('}')) { /* catches errors too */ - ERR(REG_BADBR); - return; - } - NEXT(); - break; - default: /* no quantifier */ - m = n = 1; - qprefer = 0; - break; - } - - /* annoying special case: {0} or {0,0} cancels everything */ - if (m == 0 && n == 0) { - if (atom != NULL) - freesubre(v, atom); - if (atomtype == '(') - v->subs[subno] = NULL; - delsub(v->nfa, lp, rp); - EMPTYARC(lp, rp); - return; - } - - /* if not a messy case, avoid hard part */ - assert(!MESSY(top->flags)); - f = top->flags | qprefer | ((atom != NULL) ? atom->flags : 0); - if (atomtype != '(' && atomtype != BACKREF && !MESSY(UP(f))) { - if (!(m == 1 && n == 1)) - repeat(v, lp, rp, m, n); - if (atom != NULL) - freesubre(v, atom); - top->flags = f; - return; - } - - /* - * hard part: something messy - * That is, capturing parens, back reference, short/long clash, or - * an atom with substructure containing one of those. - */ - - /* now we'll need a subre for the contents even if they're boring */ - if (atom == NULL) { - atom = subre(v, '=', 0, lp, rp); - NOERR(); - } - - /* - * prepare a general-purpose state skeleton - * - * ---> [s] ---prefix---> [begin] ---atom---> [end] ----rest---> [rp] - * / / - * [lp] ----> [s2] ----bypass--------------------- - * - * where bypass is an empty, and prefix is some repetitions of atom - */ - s = newstate(v->nfa); /* first, new endpoints for the atom */ - s2 = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s2); - NOERR(); - atom->begin = s; - atom->end = s2; - s = newstate(v->nfa); /* and spots for prefix and bypass */ - s2 = newstate(v->nfa); - NOERR(); - EMPTYARC(lp, s); - EMPTYARC(lp, s2); - NOERR(); - - /* break remaining subRE into x{...} and what follows */ - t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp); - t->left = atom; - atomp = &t->left; - /* here we should recurse... but we must postpone that to the end */ - - /* split top into prefix and remaining */ - assert(top->op == '=' && top->left == NULL && top->right == NULL); - top->left = subre(v, '=', top->flags, top->begin, lp); - top->op = '.'; - top->right = t; - - /* if it's a backref, now is the time to replicate the subNFA */ - if (atomtype == BACKREF) { - assert(atom->begin->nouts == 1); /* just the EMPTY */ - delsub(v->nfa, atom->begin, atom->end); - assert(v->subs[subno] != NULL); - /* and here's why the recursion got postponed: it must */ - /* wait until the skeleton is filled in, because it may */ - /* hit a backref that wants to copy the filled-in skeleton */ - dupnfa(v->nfa, v->subs[subno]->begin, v->subs[subno]->end, - atom->begin, atom->end); - NOERR(); - } - - /* it's quantifier time; first, turn x{0,...} into x{1,...}|empty */ - if (m == 0) { - EMPTYARC(s2, atom->end); /* the bypass */ - assert(PREF(qprefer) != 0); - f = COMBINE(qprefer, atom->flags); - t = subre(v, '|', f, lp, atom->end); - NOERR(); - t->left = atom; - t->right = subre(v, '|', PREF(f), s2, atom->end); - NOERR(); - t->right->left = subre(v, '=', 0, s2, atom->end); - NOERR(); - *atomp = t; - atomp = &t->left; - m = 1; - } - - /* deal with the rest of the quantifier */ - if (atomtype == BACKREF) { - /* special case: backrefs have internal quantifiers */ - EMPTYARC(s, atom->begin); /* empty prefix */ - /* just stuff everything into atom */ - repeat(v, atom->begin, atom->end, m, n); - atom->min = (short)m; - atom->max = (short)n; - atom->flags |= COMBINE(qprefer, atom->flags); - } else if (m == 1 && n == 1) { - /* no/vacuous quantifier: done */ - EMPTYARC(s, atom->begin); /* empty prefix */ - } else { - /* turn x{m,n} into x{m-1,n-1}x, with capturing */ - /* parens in only second x */ - dupnfa(v->nfa, atom->begin, atom->end, s, atom->begin); - assert(m >= 1 && m != INFINITY && n >= 1); - repeat(v, s, atom->begin, m-1, (n == INFINITY) ? n : n-1); - f = COMBINE(qprefer, atom->flags); - t = subre(v, '.', f, s, atom->end); /* prefix and atom */ - NOERR(); - t->left = subre(v, '=', PREF(f), s, atom->begin); - NOERR(); - t->right = atom; - *atomp = t; - } - - /* and finally, look after that postponed recursion */ - t = top->right; - if (!(SEE('|') || SEE(stopper) || SEE(EOS))) - t->right = parsebranch(v, stopper, type, atom->end, rp, 1); - else { - EMPTYARC(atom->end, rp); - t->right = subre(v, '=', 0, atom->end, rp); - } - assert(SEE('|') || SEE(stopper) || SEE(EOS)); - t->flags |= COMBINE(t->flags, t->right->flags); - top->flags |= COMBINE(top->flags, t->flags); -} - -/* - - nonword - generate arcs for non-word-character ahead or behind - ^ static VOID nonword(struct vars *, int, struct state *, struct state *); - */ -static VOID -nonword(v, dir, lp, rp) -struct vars *v; -int dir; /* AHEAD or BEHIND */ -struct state *lp; -struct state *rp; -{ - int anchor = (dir == AHEAD) ? '$' : '^'; - - assert(dir == AHEAD || dir == BEHIND); - newarc(v->nfa, anchor, 1, lp, rp); - newarc(v->nfa, anchor, 0, lp, rp); - colorcomplement(v->nfa, v->cm, dir, v->wordchrs, lp, rp); - /* (no need for special attention to \n) */ -} - -/* - - word - generate arcs for word character ahead or behind - ^ static VOID word(struct vars *, int, struct state *, struct state *); - */ -static VOID -word(v, dir, lp, rp) -struct vars *v; -int dir; /* AHEAD or BEHIND */ -struct state *lp; -struct state *rp; -{ - assert(dir == AHEAD || dir == BEHIND); - cloneouts(v->nfa, v->wordchrs, lp, rp, dir); - /* (no need for special attention to \n) */ -} - -/* - - scannum - scan a number - ^ static int scannum(struct vars *); - */ -static int /* value, <= DUPMAX */ -scannum(v) -struct vars *v; -{ - int n = 0; - - while (SEE(DIGIT) && n < DUPMAX) { - n = n*10 + v->nextvalue; - NEXT(); - } - if (SEE(DIGIT) || n > DUPMAX) { - ERR(REG_BADBR); - return 0; - } - return n; -} - -/* - - repeat - replicate subNFA for quantifiers - * The duplication sequences used here are chosen carefully so that any - * pointers starting out pointing into the subexpression end up pointing into - * the last occurrence. (Note that it may not be strung between the same - * left and right end states, however!) This used to be important for the - * subRE tree, although the important bits are now handled by the in-line - * code in parse(), and when this is called, it doesn't matter any more. - ^ static VOID repeat(struct vars *, struct state *, struct state *, int, int); - */ -static VOID -repeat(v, lp, rp, m, n) -struct vars *v; -struct state *lp; -struct state *rp; -int m; -int n; -{ -# define SOME 2 -# define INF 3 -# define PAIR(x, y) ((x)*4 + (y)) -# define REDUCE(x) ( ((x) == INFINITY) ? INF : (((x) > 1) ? SOME : (x)) ) - CONST int rm = REDUCE(m); - CONST int rn = REDUCE(n); - struct state *s; - struct state *s2; - - switch (PAIR(rm, rn)) { - case PAIR(0, 0): /* empty string */ - delsub(v->nfa, lp, rp); - EMPTYARC(lp, rp); - break; - case PAIR(0, 1): /* do as x| */ - EMPTYARC(lp, rp); - break; - case PAIR(0, SOME): /* do as x{1,n}| */ - repeat(v, lp, rp, 1, n); - NOERR(); - EMPTYARC(lp, rp); - break; - case PAIR(0, INF): /* loop x around */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s); - EMPTYARC(lp, s); - EMPTYARC(s, rp); - break; - case PAIR(1, 1): /* no action required */ - break; - case PAIR(1, SOME): /* do as x{0,n-1}x = (x{1,n-1}|)x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, 1, n-1); - NOERR(); - EMPTYARC(lp, s); - break; - case PAIR(1, INF): /* add loopback arc */ - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s2); - EMPTYARC(lp, s); - EMPTYARC(s2, rp); - EMPTYARC(s2, s); - break; - case PAIR(SOME, SOME): /* do as x{m-1,n-1}x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, m-1, n-1); - break; - case PAIR(SOME, INF): /* do as x{m-1,}x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, m-1, n); - break; - default: - ERR(REG_ASSERT); - break; - } -} - -/* - - bracket - handle non-complemented bracket expression - * Also called from cbracket for complemented bracket expressions. - ^ static VOID bracket(struct vars *, struct state *, struct state *); - */ -static VOID -bracket(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - assert(SEE('[')); - NEXT(); - while (!SEE(']') && !SEE(EOS)) - brackpart(v, lp, rp); - assert(SEE(']') || ISERR()); - okcolors(v->nfa, v->cm); -} - -/* - - cbracket - handle complemented bracket expression - * We do it by calling bracket() with dummy endpoints, and then complementing - * the result. The alternative would be to invoke rainbow(), and then delete - * arcs as the b.e. is seen... but that gets messy. - ^ static VOID cbracket(struct vars *, struct state *, struct state *); - */ -static VOID -cbracket(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - struct state *left = newstate(v->nfa); - struct state *right = newstate(v->nfa); - struct state *s; - struct arc *a; /* arc from lp */ - struct arc *ba; /* arc from left, from bracket() */ - struct arc *pa; /* MCCE-prototype arc */ - color co; - chr *p; - int i; - - NOERR(); - bracket(v, left, right); - if (v->cflags®_NLSTOP) - newarc(v->nfa, PLAIN, v->nlcolor, left, right); - NOERR(); - - assert(lp->nouts == 0); /* all outarcs will be ours */ - - /* easy part of complementing */ - colorcomplement(v->nfa, v->cm, PLAIN, left, lp, rp); - NOERR(); - if (v->mcces == NULL) { /* no MCCEs -- we're done */ - dropstate(v->nfa, left); - assert(right->nins == 0); - freestate(v->nfa, right); - return; - } - - /* but complementing gets messy in the presence of MCCEs... */ - NOTE(REG_ULOCALE); - for (p = v->mcces->chrs, i = v->mcces->nchrs; i > 0; p++, i--) { - co = GETCOLOR(v->cm, *p); - a = findarc(lp, PLAIN, co); - ba = findarc(left, PLAIN, co); - if (ba == NULL) { - assert(a != NULL); - freearc(v->nfa, a); - } else { - assert(a == NULL); - } - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - pa = findarc(v->mccepbegin, PLAIN, co); - assert(pa != NULL); - if (ba == NULL) { /* easy case, need all of them */ - cloneouts(v->nfa, pa->to, s, rp, PLAIN); - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, pa->to, s, rp); - } else { /* must be selective */ - if (findarc(ba->to, '$', 1) == NULL) { - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, pa->to, - s, rp); - } - for (pa = pa->to->outs; pa != NULL; pa = pa->outchain) - if (findarc(ba->to, PLAIN, pa->co) == NULL) - newarc(v->nfa, PLAIN, pa->co, s, rp); - if (s->nouts == 0) /* limit of selectivity: none */ - dropstate(v->nfa, s); /* frees arc too */ - } - NOERR(); - } - - delsub(v->nfa, left, right); - assert(left->nouts == 0); - freestate(v->nfa, left); - assert(right->nins == 0); - freestate(v->nfa, right); -} - -/* - - brackpart - handle one item (or range) within a bracket expression - ^ static VOID brackpart(struct vars *, struct state *, struct state *); - */ -static VOID -brackpart(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - celt startc; - celt endc; - struct cvec *cv; - chr *startp; - chr *endp; - chr c[1]; - - /* parse something, get rid of special cases, take shortcuts */ - switch (v->nexttype) { - case RANGE: /* a-b-c or other botch */ - ERR(REG_ERANGE); - return; - break; - case PLAIN: - c[0] = v->nextvalue; - NEXT(); - /* shortcut for ordinary chr (not range, not MCCE leader) */ - if (!SEE(RANGE) && !ISCELEADER(v, c[0])) { - onechr(v, c[0], lp, rp); - return; - } - startc = element(v, c, c+1); - NOERR(); - break; - case COLLEL: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - startc = element(v, startp, endp); - NOERR(); - break; - case ECLASS: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - startc = element(v, startp, endp); - NOERR(); - cv = eclass(v, startc, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); - return; - break; - case CCLASS: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECTYPE); - NOERR(); - cv = cclass(v, startp, endp, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); - return; - break; - default: - ERR(REG_ASSERT); - return; - break; - } - - if (SEE(RANGE)) { - NEXT(); - switch (v->nexttype) { - case PLAIN: - case RANGE: - c[0] = v->nextvalue; - NEXT(); - endc = element(v, c, c+1); - NOERR(); - break; - case COLLEL: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - endc = element(v, startp, endp); - NOERR(); - break; - default: - ERR(REG_ERANGE); - return; - break; - } - } else - endc = startc; - - /* - * Ranges are unportable. Actually, standard C does - * guarantee that digits are contiguous, but making - * that an exception is just too complicated. - */ - if (startc != endc) - NOTE(REG_UUNPORT); - cv = range(v, startc, endc, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); -} - -/* - - scanplain - scan PLAIN contents of [. etc. - * Certain bits of trickery in lex.c know that this code does not try - * to look past the final bracket of the [. etc. - ^ static chr *scanplain(struct vars *); - */ -static chr * /* just after end of sequence */ -scanplain(v) -struct vars *v; -{ - chr *endp; - - assert(SEE(COLLEL) || SEE(ECLASS) || SEE(CCLASS)); - NEXT(); - - endp = v->now; - while (SEE(PLAIN)) { - endp = v->now; - NEXT(); - } - - assert(SEE(END) || ISERR()); - NEXT(); - - return endp; -} - -/* - - leaders - process a cvec of collating elements to also include leaders - * Also gives all characters involved their own colors, which is almost - * certainly necessary, and sets up little disconnected subNFA. - ^ static VOID leaders(struct vars *, struct cvec *); - */ -static VOID -leaders(v, cv) -struct vars *v; -struct cvec *cv; -{ - int mcce; - chr *p; - chr leader; - struct state *s; - struct arc *a; - - v->mccepbegin = newstate(v->nfa); - v->mccepend = newstate(v->nfa); - NOERR(); - - for (mcce = 0; mcce < cv->nmcces; mcce++) { - p = cv->mcces[mcce]; - leader = *p; - if (!haschr(cv, leader)) { - addchr(cv, leader); - s = newstate(v->nfa); - newarc(v->nfa, PLAIN, subcolor(v->cm, leader), - v->mccepbegin, s); - okcolors(v->nfa, v->cm); - } else { - a = findarc(v->mccepbegin, PLAIN, - GETCOLOR(v->cm, leader)); - assert(a != NULL); - s = a->to; - assert(s != v->mccepend); - } - p++; - assert(*p != 0 && *(p+1) == 0); /* only 2-char MCCEs for now */ - newarc(v->nfa, PLAIN, subcolor(v->cm, *p), s, v->mccepend); - okcolors(v->nfa, v->cm); - } -} - -/* - - onechr - fill in arcs for a plain character, and possible case complements - * This is mostly a shortcut for efficient handling of the common case. - ^ static VOID onechr(struct vars *, pchr, struct state *, struct state *); - */ -static VOID -onechr(v, c, lp, rp) -struct vars *v; -pchr c; -struct state *lp; -struct state *rp; -{ - if (!(v->cflags®_ICASE)) { - newarc(v->nfa, PLAIN, subcolor(v->cm, c), lp, rp); - return; - } - - /* rats, need general case anyway... */ - dovec(v, allcases(v, c), lp, rp); -} - -/* - - dovec - fill in arcs for each element of a cvec - * This one has to handle the messy cases, like MCCEs and MCCE leaders. - ^ static VOID dovec(struct vars *, struct cvec *, struct state *, - ^ struct state *); - */ -static VOID -dovec(v, cv, lp, rp) -struct vars *v; -struct cvec *cv; -struct state *lp; -struct state *rp; -{ - chr ch, from, to; - celt ce; - chr *p; - int i; - color co; - struct cvec *leads; - struct arc *a; - struct arc *pa; /* arc in prototype */ - struct state *s; - struct state *ps; /* state in prototype */ - - /* need a place to store leaders, if any */ - if (nmcces(v) > 0) { - assert(v->mcces != NULL); - if (v->cv2 == NULL || v->cv2->nchrs < v->mcces->nchrs) { - if (v->cv2 != NULL) - free(v->cv2); - v->cv2 = newcvec(v->mcces->nchrs, 0, v->mcces->nmcces); - NOERR(); - leads = v->cv2; - } else - leads = clearcvec(v->cv2); - } else - leads = NULL; - - /* first, get the ordinary characters out of the way */ - for (p = cv->chrs, i = cv->nchrs; i > 0; p++, i--) { - ch = *p; - if (!ISCELEADER(v, ch)) - newarc(v->nfa, PLAIN, subcolor(v->cm, ch), lp, rp); - else { - assert(singleton(v->cm, ch)); - assert(leads != NULL); - if (!haschr(leads, ch)) - addchr(leads, ch); - } - } - - /* and the ranges */ - for (p = cv->ranges, i = cv->nranges; i > 0; p += 2, i--) { - from = *p; - to = *(p+1); - while (from <= to && (ce = nextleader(v, from, to)) != NOCELT) { - if (from < ce) - subrange(v, from, ce - 1, lp, rp); - assert(singleton(v->cm, ce)); - assert(leads != NULL); - if (!haschr(leads, ce)) - addchr(leads, ce); - from = ce + 1; - } - if (from <= to) - subrange(v, from, to, lp, rp); - } - - if ((leads == NULL || leads->nchrs == 0) && cv->nmcces == 0) - return; - - /* deal with the MCCE leaders */ - NOTE(REG_ULOCALE); - for (p = leads->chrs, i = leads->nchrs; i > 0; p++, i--) { - co = GETCOLOR(v->cm, *p); - a = findarc(lp, PLAIN, co); - if (a != NULL) - s = a->to; - else { - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - } - pa = findarc(v->mccepbegin, PLAIN, co); - assert(pa != NULL); - ps = pa->to; - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, ps, s, rp); - NOERR(); - } - - /* and the MCCEs */ - for (i = 0; i < cv->nmcces; i++) { - p = cv->mcces[i]; - assert(singleton(v->cm, *p)); - if (!singleton(v->cm, *p)) { - ERR(REG_ASSERT); - return; - } - ch = *p++; - co = GETCOLOR(v->cm, ch); - a = findarc(lp, PLAIN, co); - if (a != NULL) - s = a->to; - else { - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - } - assert(*p != 0); /* at least two chars */ - assert(singleton(v->cm, *p)); - ch = *p++; - co = GETCOLOR(v->cm, ch); - assert(*p == 0); /* and only two, for now */ - newarc(v->nfa, PLAIN, co, s, rp); - NOERR(); - } -} - -/* - - nextleader - find next MCCE leader within range - ^ static celt nextleader(struct vars *, pchr, pchr); - */ -static celt /* NOCELT means none */ -nextleader(v, from, to) -struct vars *v; -pchr from; -pchr to; -{ - int i; - chr *p; - chr ch; - celt it = NOCELT; - - if (v->mcces == NULL) - return it; - - for (i = v->mcces->nchrs, p = v->mcces->chrs; i > 0; i--, p++) { - ch = *p; - if (from <= ch && ch <= to) - if (it == NOCELT || ch < it) - it = ch; - } - return it; -} - -/* - - wordchrs - set up word-chr list for word-boundary stuff, if needed - * The list is kept as a bunch of arcs between two dummy states; it's - * disposed of by the unreachable-states sweep in NFA optimization. - * Does NEXT(). Must not be called from any unusual lexical context. - * This should be reconciled with the \w etc. handling in lex.c, and - * should be cleaned up to reduce dependencies on input scanning. - ^ static VOID wordchrs(struct vars *); - */ -static VOID -wordchrs(v) -struct vars *v; -{ - struct state *left; - struct state *right; - - if (v->wordchrs != NULL) { - NEXT(); /* for consistency */ - return; - } - - left = newstate(v->nfa); - right = newstate(v->nfa); - NOERR(); - /* fine point: implemented with [::], and lexer will set REG_ULOCALE */ - lexword(v); - NEXT(); - assert(v->savenow != NULL && SEE('[')); - bracket(v, left, right); - assert((v->savenow != NULL && SEE(']')) || ISERR()); - NEXT(); - NOERR(); - v->wordchrs = left; -} - -/* - - subre - allocate a subre - ^ static struct subre *subre(struct vars *, int, int, struct state *, - ^ struct state *); - */ -static struct subre * -subre(v, op, flags, begin, end) -struct vars *v; -int op; -int flags; -struct state *begin; -struct state *end; -{ - struct subre *ret; - - ret = v->treefree; - if (ret != NULL) - v->treefree = ret->left; - else { - ret = (struct subre *)MALLOC(sizeof(struct subre)); - if (ret == NULL) { - ERR(REG_ESPACE); - return NULL; - } - ret->chain = v->treechain; - v->treechain = ret; - } - - assert(strchr("|.b(=", op) != NULL); - - ret->op = op; - ret->flags = flags; - ret->retry = 0; - ret->subno = 0; - ret->min = ret->max = 1; - ret->left = NULL; - ret->right = NULL; - ret->begin = begin; - ret->end = end; - ZAPCNFA(ret->cnfa); - - return ret; -} - -/* - - freesubre - free a subRE subtree - ^ static VOID freesubre(struct vars *, struct subre *); - */ -static VOID -freesubre(v, sr) -struct vars *v; /* might be NULL */ -struct subre *sr; -{ - if (sr == NULL) - return; - - if (sr->left != NULL) - freesubre(v, sr->left); - if (sr->right != NULL) - freesubre(v, sr->right); - - freesrnode(v, sr); -} - -/* - - freesrnode - free one node in a subRE subtree - ^ static VOID freesrnode(struct vars *, struct subre *); - */ -static VOID -freesrnode(v, sr) -struct vars *v; /* might be NULL */ -struct subre *sr; -{ - if (sr == NULL) - return; - - if (!NULLCNFA(sr->cnfa)) - freecnfa(&sr->cnfa); - sr->flags = 0; - - if (v != NULL) { - sr->left = v->treefree; - v->treefree = sr; - } else - FREE(sr); -} - -/* - - optst - optimize a subRE subtree - ^ static VOID optst(struct vars *, struct subre *); - */ -static VOID -optst(v, t) -struct vars *v; -struct subre *t; -{ - if (t == NULL) - return; - - /* recurse through children */ - if (t->left != NULL) - optst(v, t->left); - if (t->right != NULL) - optst(v, t->right); -} - -/* - - numst - number tree nodes (assigning retry indexes) - ^ static int numst(struct subre *, int); - */ -static int /* next number */ -numst(t, start) -struct subre *t; -int start; /* starting point for subtree numbers */ -{ - int i; - - assert(t != NULL); - - i = start; - t->retry = (short)i++; - if (t->left != NULL) - i = numst(t->left, i); - if (t->right != NULL) - i = numst(t->right, i); - return i; -} - -/* - - markst - mark tree nodes as INUSE - ^ static VOID markst(struct subre *); - */ -static VOID -markst(t) -struct subre *t; -{ - assert(t != NULL); - - t->flags |= INUSE; - if (t->left != NULL) - markst(t->left); - if (t->right != NULL) - markst(t->right); -} - -/* - - cleanst - free any tree nodes not marked INUSE - ^ static VOID cleanst(struct vars *); - */ -static VOID -cleanst(v) -struct vars *v; -{ - struct subre *t; - struct subre *next; - - for (t = v->treechain; t != NULL; t = next) { - next = t->chain; - if (!(t->flags&INUSE)) - FREE(t); - } - v->treechain = NULL; - v->treefree = NULL; /* just on general principles */ -} - -/* - - nfatree - turn a subRE subtree into a tree of compacted NFAs - ^ static long nfatree(struct vars *, struct subre *, FILE *); - */ -static long /* optimize results from top node */ -nfatree(v, t, f) -struct vars *v; -struct subre *t; -FILE *f; /* for debug output */ -{ - assert(t != NULL && t->begin != NULL); - - if (t->left != NULL) - (DISCARD)nfatree(v, t->left, f); - if (t->right != NULL) - (DISCARD)nfatree(v, t->right, f); - - return nfanode(v, t, f); -} - -/* - - nfanode - do one NFA for nfatree - ^ static long nfanode(struct vars *, struct subre *, FILE *); - */ -static long /* optimize results */ -nfanode(v, t, f) -struct vars *v; -struct subre *t; -FILE *f; /* for debug output */ -{ - struct nfa *nfa; - long ret = 0; - char idbuf[50]; - - assert(t->begin != NULL); - - if (f != NULL) - fprintf(f, "\n\n\n========= TREE NODE %s ==========\n", - stid(t, idbuf, sizeof(idbuf))); - nfa = newnfa(v, v->cm, v->nfa); - NOERRZ(); - dupnfa(nfa, t->begin, t->end, nfa->init, nfa->final); - if (!ISERR()) { - specialcolors(nfa); - ret = optimize(nfa, f); - } - if (!ISERR()) - compact(nfa, &t->cnfa); - - freenfa(nfa); - return ret; -} - -/* - - newlacon - allocate a lookahead-constraint subRE - ^ static int newlacon(struct vars *, struct state *, struct state *, int); - */ -static int /* lacon number */ -newlacon(v, begin, end, pos) -struct vars *v; -struct state *begin; -struct state *end; -int pos; -{ - int n; - struct subre *sub; - - if (v->nlacons == 0) { - v->lacons = (struct subre *)MALLOC(2 * sizeof(struct subre)); - n = 1; /* skip 0th */ - v->nlacons = 2; - } else { - v->lacons = (struct subre *)REALLOC(v->lacons, - (v->nlacons+1)*sizeof(struct subre)); - n = v->nlacons++; - } - if (v->lacons == NULL) { - ERR(REG_ESPACE); - return 0; - } - sub = &v->lacons[n]; - sub->begin = begin; - sub->end = end; - sub->subno = pos; - ZAPCNFA(sub->cnfa); - return n; -} - -/* - - freelacons - free lookahead-constraint subRE vector - ^ static VOID freelacons(struct subre *, int); - */ -static VOID -freelacons(subs, n) -struct subre *subs; -int n; -{ - struct subre *sub; - int i; - - assert(n > 0); - for (sub = subs + 1, i = n - 1; i > 0; sub++, i--) /* no 0th */ - if (!NULLCNFA(sub->cnfa)) - freecnfa(&sub->cnfa); - FREE(subs); -} - -/* - - rfree - free a whole RE (insides of regfree) - ^ static VOID rfree(regex_t *); - */ -static VOID -rfree(re) -regex_t *re; -{ - struct guts *g; - - if (re == NULL || re->re_magic != REMAGIC) - return; - - re->re_magic = 0; /* invalidate RE */ - g = (struct guts *)re->re_guts; - re->re_guts = NULL; - re->re_fns = NULL; - g->magic = 0; - freecm(&g->cmap); - if (g->tree != NULL) - freesubre((struct vars *)NULL, g->tree); - if (g->lacons != NULL) - freelacons(g->lacons, g->nlacons); - if (!NULLCNFA(g->search)) - freecnfa(&g->search); - FREE(g); -} - -/* - - dump - dump an RE in human-readable form - ^ static VOID dump(regex_t *, FILE *); - */ -static VOID -dump(re, f) -regex_t *re; -FILE *f; -{ -#ifdef REG_DEBUG - struct guts *g; - int i; - - if (re->re_magic != REMAGIC) - fprintf(f, "bad magic number (0x%x not 0x%x)\n", re->re_magic, - REMAGIC); - if (re->re_guts == NULL) { - fprintf(f, "NULL guts!!!\n"); - return; - } - g = (struct guts *)re->re_guts; - if (g->magic != GUTSMAGIC) - fprintf(f, "bad guts magic number (0x%x not 0x%x)\n", g->magic, - GUTSMAGIC); - - fprintf(f, "\n\n\n========= DUMP ==========\n"); - fprintf(f, "nsub %d, info 0%lo, csize %d, ntree %d\n", - re->re_nsub, re->re_info, re->re_csize, g->ntree); - - dumpcolors(&g->cmap, f); - if (!NULLCNFA(g->search)) { - printf("\nsearch:\n"); - dumpcnfa(&g->search, f); - } - for (i = 1; i < g->nlacons; i++) { - fprintf(f, "\nla%d (%s):\n", i, - (g->lacons[i].subno) ? "positive" : "negative"); - dumpcnfa(&g->lacons[i].cnfa, f); - } - fprintf(f, "\n"); - dumpst(g->tree, f, 0); -#endif -} - -/* - - dumpst - dump a subRE tree - ^ static VOID dumpst(struct subre *, FILE *, int); - */ -static VOID -dumpst(t, f, nfapresent) -struct subre *t; -FILE *f; -int nfapresent; /* is the original NFA still around? */ -{ - if (t == NULL) - fprintf(f, "null tree\n"); - else - stdump(t, f, nfapresent); - fflush(f); -} - -/* - - stdump - recursive guts of dumpst - ^ static VOID stdump(struct subre *, FILE *, int); - */ -static VOID -stdump(t, f, nfapresent) -struct subre *t; -FILE *f; -int nfapresent; /* is the original NFA still around? */ -{ - char idbuf[50]; - - fprintf(f, "%s. `%c'", stid(t, idbuf, sizeof(idbuf)), t->op); - if (t->flags&LONGER) - fprintf(f, " longest"); - if (t->flags&SHORTER) - fprintf(f, " shortest"); - if (t->flags&MIXED) - fprintf(f, " hasmixed"); - if (t->flags&CAP) - fprintf(f, " hascapture"); - if (t->flags&BACKR) - fprintf(f, " hasbackref"); - if (!(t->flags&INUSE)) - fprintf(f, " UNUSED"); - if (t->subno != 0) - fprintf(f, " (#%d)", t->subno); - if (t->min != 1 || t->max != 1) { - fprintf(f, " {%d,", t->min); - if (t->max != INFINITY) - fprintf(f, "%d", t->max); - fprintf(f, "}"); - } - if (nfapresent) - fprintf(f, " %ld-%ld", (long)t->begin->no, (long)t->end->no); - if (t->left != NULL) - fprintf(f, " L:%s", stid(t->left, idbuf, sizeof(idbuf))); - if (t->right != NULL) - fprintf(f, " R:%s", stid(t->right, idbuf, sizeof(idbuf))); - if (!NULLCNFA(t->cnfa)) { - fprintf(f, "\n"); - dumpcnfa(&t->cnfa, f); - fprintf(f, "\n"); - } - if (t->left != NULL) - stdump(t->left, f, nfapresent); - if (t->right != NULL) - stdump(t->right, f, nfapresent); -} - -/* - - stid - identify a subtree node for dumping - ^ static char *stid(struct subre *, char *, size_t); - */ -static char * /* points to buf or constant string */ -stid(t, buf, bufsize) -struct subre *t; -char *buf; -size_t bufsize; -{ - /* big enough for hex int or decimal t->retry? */ - if (bufsize < sizeof(int)*2 + 3 || bufsize < sizeof(t->retry)*3 + 1) - return "unable"; - if (t->retry != 0) - sprintf(buf, "%d", t->retry); - else - sprintf(buf, "0x%x", (int)(wxUIntPtr)(t)); /* may lose bits, that's okay */ - return buf; -} - -#include "regc_lex.c" -#include "regc_color.c" -#include "regc_nfa.c" -#include "regc_cvec.c" -#include "regc_locale.c" diff --git a/src/regex/regcustom.h b/src/regex/regcustom.h deleted file mode 100644 index d7fa0ab5e2..0000000000 --- a/src/regex/regcustom.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* overrides for regguts.h definitions, if any */ -/* regguts only includes standard headers if NULL is not defined, so do it - * ourselves here */ -#include -#include -#include -#include -#include - -/* must include this after ctype.h inclusion for CodeWarrior/Mac */ -#include "wx/defs.h" -#include "wx/chartype.h" -#include "wx/wxcrtbase.h" - -/* - * Do not insert extras between the "begin" and "end" lines -- this - * chunk is automatically extracted to be fitted into regex.h. - */ -/* --- begin --- */ -/* ensure certain things don't sneak in from system headers */ -#ifdef __REG_WIDE_T -#undef __REG_WIDE_T -#endif -#ifdef __REG_WIDE_COMPILE -#undef __REG_WIDE_COMPILE -#endif -#ifdef __REG_WIDE_EXEC -#undef __REG_WIDE_EXEC -#endif -#ifdef __REG_REGOFF_T -#undef __REG_REGOFF_T -#endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif -#ifdef __REG_NOFRONT -#undef __REG_NOFRONT -#endif -#ifdef __REG_NOCHAR -#undef __REG_NOCHAR -#endif -#define __REG_WIDE_T wxChar -#define __REG_WIDE_COMPILE wx_re_comp -#define __REG_WIDE_EXEC wx_re_exec -#define __REG_NOCHAR /* don't want the char versions */ -#define __REG_NOFRONT /* don't want regcomp() and regexec() */ -#define _ANSI_ARGS_(x) x -/* --- end --- */ - -/* internal character type and related */ -typedef wxChar chr; /* the type itself */ -typedef int pchr; /* what it promotes to */ -typedef unsigned uchr; /* unsigned type that will hold a chr */ -typedef int celt; /* type to hold chr, MCCE number, or NOCELT */ -#define NOCELT (-1) /* celt value which is not valid chr or MCCE */ -#define UCHAR(c) ((unsigned char) (c)) -#define CHR(c) (UCHAR(c)) /* turn char literal into chr literal */ -#define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */ -#if SIZEOF_WCHAR_T == 4 -# define CHRBITS 32 /* bits in a chr; must not use sizeof */ -# define CHR_MIN 0x00000000 /* smallest and largest chr; the value */ -# define CHR_MAX 0xffffffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#else -# define CHRBITS 16 /* bits in a chr; must not use sizeof */ -# define CHR_MIN 0x0000 /* smallest and largest chr; the value */ -# define CHR_MAX 0xffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#endif - -/* - * I'm using isalpha et al. instead of wxIsalpha since BCC 5.5's iswalpha - * seems not to work on Windows 9x? Note that these are only used by the - * lexer, and although they must work for wxChars, they need only return - * true for characters within the ascii range. - */ -#define iscalnum(x) ((wxUChar)(x) < 128 && isalnum(x)) -#define iscalpha(x) ((wxUChar)(x) < 128 && isalpha(x)) -#define iscdigit(x) ((wxUChar)(x) < 128 && isdigit(x)) -#define iscspace(x) ((wxUChar)(x) < 128 && isspace(x)) - -/* name the external functions */ -#define compile wx_re_comp -#define exec wx_re_exec - -/* enable/disable debugging code (by whether REG_DEBUG is defined or not) */ -#if 0 /* no debug unless requested by makefile */ -#define REG_DEBUG /* */ -#endif - -/* and pick up the standard header */ -#include "regex.h" diff --git a/src/regex/rege_dfa.c b/src/regex/rege_dfa.c deleted file mode 100644 index deac9125ae..0000000000 --- a/src/regex/rege_dfa.c +++ /dev/null @@ -1,683 +0,0 @@ -/* - * DFA routines - * This file is #included by regexec.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/* - - longest - longest-preferred matching engine - ^ static chr *longest(struct vars *, struct dfa *, chr *, chr *, int *); - */ -static chr * /* endpoint, or NULL */ -longest(v, d, start, stop, hitstopp) -struct vars *v; /* used only for debug and exec flags */ -struct dfa *d; -chr *start; /* where the match should start */ -chr *stop; /* match must end at or before here */ -int *hitstopp; /* record whether hit v->stop, if non-NULL */ -{ - chr *cp; - chr *realstop = (stop == v->stop) ? stop : stop + 1; - color co; - struct sset *css; - struct sset *ss; - chr *post; - int i; - struct colormap *cm = d->cm; - - /* initialize */ - css = initialize(v, d, start); - cp = start; - if (hitstopp != NULL) - *hitstopp = 0; - - /* startup */ - FDEBUG(("+++ startup +++\n")); - if (cp == v->start) { - co = d->cnfa->bos[(v->eflags®_NOTBOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - } else { - co = GETCOLOR(cm, *(cp - 1)); - FDEBUG(("char %c, color %ld\n", (char)*(cp-1), (long)co)); - } - css = miss(v, d, css, co, cp, start); - if (css == NULL) - return NULL; - css->lastseen = cp; - - /* main loop */ - if (v->eflags®_FTRACE) - while (cp < realstop) { - FDEBUG(("+++ at c%d +++\n", css - d->ssets)); - co = GETCOLOR(cm, *cp); - FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co)); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - } - else - while (cp < realstop) { - co = GETCOLOR(cm, *cp); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - } - - /* shutdown */ - FDEBUG(("+++ shutdown at c%d +++\n", css - d->ssets)); - if (cp == v->stop && stop == v->stop) { - if (hitstopp != NULL) - *hitstopp = 1; - co = d->cnfa->eos[(v->eflags®_NOTEOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - ss = miss(v, d, css, co, cp, start); - /* special case: match ended at eol? */ - if (ss != NULL && (ss->flags&POSTSTATE)) - return cp; - else if (ss != NULL) - ss->lastseen = cp; /* to be tidy */ - } - - /* find last match, if any */ - post = d->lastpost; - for (ss = d->ssets, i = d->nssused; i > 0; ss++, i--) - if ((ss->flags&POSTSTATE) && post != ss->lastseen && - (post == NULL || post < ss->lastseen)) - post = ss->lastseen; - if (post != NULL) /* found one */ - return post - 1; - - return NULL; -} - -/* - - shortest - shortest-preferred matching engine - ^ static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *, - ^ chr **, int *); - */ -static chr * /* endpoint, or NULL */ -shortest(v, d, start, min, max, coldp, hitstopp) -struct vars *v; -struct dfa *d; -chr *start; /* where the match should start */ -chr *min; /* match must end at or after here */ -chr *max; /* match must end at or before here */ -chr **coldp; /* store coldstart pointer here, if nonNULL */ -int *hitstopp; /* record whether hit v->stop, if non-NULL */ -{ - chr *cp; - chr *realmin = (min == v->stop) ? min : min + 1; - chr *realmax = (max == v->stop) ? max : max + 1; - color co; - struct sset *css; - struct sset *ss; - struct colormap *cm = d->cm; - - /* initialize */ - css = initialize(v, d, start); - cp = start; - if (hitstopp != NULL) - *hitstopp = 0; - - /* startup */ - FDEBUG(("--- startup ---\n")); - if (cp == v->start) { - co = d->cnfa->bos[(v->eflags®_NOTBOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - } else { - co = GETCOLOR(cm, *(cp - 1)); - FDEBUG(("char %c, color %ld\n", (char)*(cp-1), (long)co)); - } - css = miss(v, d, css, co, cp, start); - if (css == NULL) - return NULL; - css->lastseen = cp; - ss = css; - - /* main loop */ - if (v->eflags®_FTRACE) - while (cp < realmax) { - FDEBUG(("--- at c%d ---\n", css - d->ssets)); - co = GETCOLOR(cm, *cp); - FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co)); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - if ((ss->flags&POSTSTATE) && cp >= realmin) - break; /* NOTE BREAK OUT */ - } - else - while (cp < realmax) { - co = GETCOLOR(cm, *cp); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - if ((ss->flags&POSTSTATE) && cp >= realmin) - break; /* NOTE BREAK OUT */ - } - - if (ss == NULL) - return NULL; - - if (coldp != NULL) /* report last no-progress state set, if any */ - *coldp = lastcold(v, d); - - if ((ss->flags&POSTSTATE) && cp > min) { - assert(cp >= realmin); - cp--; - } else if (cp == v->stop && max == v->stop) { - co = d->cnfa->eos[(v->eflags®_NOTEOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - ss = miss(v, d, css, co, cp, start); - /* match might have ended at eol */ - if ((ss == NULL || !(ss->flags&POSTSTATE)) && hitstopp != NULL) - *hitstopp = 1; - } - - if (ss == NULL || !(ss->flags&POSTSTATE)) - return NULL; - - return cp; -} - -/* - - lastcold - determine last point at which no progress had been made - ^ static chr *lastcold(struct vars *, struct dfa *); - */ -static chr * /* endpoint, or NULL */ -lastcold(v, d) -struct vars *v; -struct dfa *d; -{ - struct sset *ss; - chr *nopr; - int i; - - nopr = d->lastnopr; - if (nopr == NULL) - nopr = v->start; - for (ss = d->ssets, i = d->nssused; i > 0; ss++, i--) - if ((ss->flags&NOPROGRESS) && nopr < ss->lastseen) - nopr = ss->lastseen; - return nopr; -} - -/* - - newdfa - set up a fresh DFA - ^ static struct dfa *newdfa(struct vars *, struct cnfa *, - ^ struct colormap *, struct smalldfa *); - */ - -/* FIXME Required for CW 8 on Mac since it's not in limits.h */ -#ifndef __CHAR_BIT__ -#define __CHAR_BIT__ 8 -#endif - -static struct dfa * -newdfa(v, cnfa, cm, small) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -struct smalldfa *small; /* preallocated space, may be NULL */ -{ - struct dfa *d; - size_t nss = cnfa->nstates * 2; - int wordsper = (cnfa->nstates + UBITS - 1) / UBITS; - struct smalldfa *smallwas = small; - - assert(cnfa != NULL && cnfa->nstates != 0); - - if (nss <= FEWSTATES && cnfa->ncolors <= FEWCOLORS) { - assert(wordsper == 1); - if (small == NULL) { - small = (struct smalldfa *)MALLOC( - sizeof(struct smalldfa)); - if (small == NULL) { - ERR(REG_ESPACE); - return NULL; - } - } - d = &small->dfa; - d->ssets = small->ssets; - d->statesarea = small->statesarea; - d->work = &d->statesarea[nss]; - d->outsarea = small->outsarea; - d->incarea = small->incarea; - d->cptsmalloced = 0; - d->mallocarea = (smallwas == NULL) ? (char *)small : NULL; - } else { - d = (struct dfa *)MALLOC(sizeof(struct dfa)); - if (d == NULL) { - ERR(REG_ESPACE); - return NULL; - } - d->ssets = (struct sset *)MALLOC(nss * sizeof(struct sset)); - d->statesarea = (unsigned *)MALLOC((nss+WORK) * wordsper * - sizeof(unsigned)); - d->work = &d->statesarea[nss * wordsper]; - d->outsarea = (struct sset **)MALLOC(nss * cnfa->ncolors * - sizeof(struct sset *)); - d->incarea = (struct arcp *)MALLOC(nss * cnfa->ncolors * - sizeof(struct arcp)); - d->cptsmalloced = 1; - d->mallocarea = (char *)d; - if (d->ssets == NULL || d->statesarea == NULL || - d->outsarea == NULL || d->incarea == NULL) { - freedfa(d); - ERR(REG_ESPACE); - return NULL; - } - } - - d->nssets = (v->eflags®_SMALL) ? 7 : nss; - d->nssused = 0; - d->nstates = cnfa->nstates; - d->ncolors = cnfa->ncolors; - d->wordsper = wordsper; - d->cnfa = cnfa; - d->cm = cm; - d->lastpost = NULL; - d->lastnopr = NULL; - d->search = d->ssets; - - /* initialization of sset fields is done as needed */ - - return d; -} - -/* - - freedfa - free a DFA - ^ static VOID freedfa(struct dfa *); - */ -static VOID -freedfa(d) -struct dfa *d; -{ - if (d->cptsmalloced) { - if (d->ssets != NULL) - FREE(d->ssets); - if (d->statesarea != NULL) - FREE(d->statesarea); - if (d->outsarea != NULL) - FREE(d->outsarea); - if (d->incarea != NULL) - FREE(d->incarea); - } - - if (d->mallocarea != NULL) - FREE(d->mallocarea); -} - -/* - - hash - construct a hash code for a bitvector - * There are probably better ways, but they're more expensive. - ^ static unsigned hash(unsigned *, int); - */ -static unsigned -hash(uv, n) -unsigned *uv; -int n; -{ - int i; - unsigned h; - - h = 0; - for (i = 0; i < n; i++) - h ^= uv[i]; - return h; -} - -/* - - initialize - hand-craft a cache entry for startup, otherwise get ready - ^ static struct sset *initialize(struct vars *, struct dfa *, chr *); - */ -static struct sset * -initialize(v, d, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *start; -{ - struct sset *ss; - int i; - - /* is previous one still there? */ - if (d->nssused > 0 && (d->ssets[0].flags&STARTER)) - ss = &d->ssets[0]; - else { /* no, must (re)build it */ - ss = getvacant(v, d, start, start); - for (i = 0; i < d->wordsper; i++) - ss->states[i] = 0; - BSET(ss->states, d->cnfa->pre); - ss->hash = HASH(ss->states, d->wordsper); - assert(d->cnfa->pre != d->cnfa->post); - ss->flags = STARTER|LOCKED|NOPROGRESS; - /* lastseen dealt with below */ - } - - for (i = 0; i < d->nssused; i++) - d->ssets[i].lastseen = NULL; - ss->lastseen = start; /* maybe untrue, but harmless */ - d->lastpost = NULL; - d->lastnopr = NULL; - return ss; -} - -/* - - miss - handle a cache miss - ^ static struct sset *miss(struct vars *, struct dfa *, struct sset *, - ^ pcolor, chr *, chr *); - */ -static struct sset * /* NULL if goes to empty set */ -miss(v, d, css, co, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -struct sset *css; -pcolor co; -chr *cp; /* next chr */ -chr *start; /* where the attempt got started */ -{ - struct cnfa *cnfa = d->cnfa; - int i; - unsigned h; - struct carc *ca; - struct sset *p; - int ispost; - int noprogress; - int gotstate; - int dolacons; - int sawlacons; - - /* for convenience, we can be called even if it might not be a miss */ - if (css->outs[co] != NULL) { - FDEBUG(("hit\n")); - return css->outs[co]; - } - FDEBUG(("miss\n")); - - /* first, what set of states would we end up in? */ - for (i = 0; i < d->wordsper; i++) - d->work[i] = 0; - ispost = 0; - noprogress = 1; - gotstate = 0; - for (i = 0; i < d->nstates; i++) - if (ISBSET(css->states, i)) - for (ca = cnfa->states[i]+1; ca->co != COLORLESS; ca++) - if (ca->co == co) { - BSET(d->work, ca->to); - gotstate = 1; - if (ca->to == cnfa->post) - ispost = 1; - if (!cnfa->states[ca->to]->co) - noprogress = 0; - FDEBUG(("%d -> %d\n", i, ca->to)); - } - dolacons = (gotstate) ? (cnfa->flags&HASLACONS) : 0; - sawlacons = 0; - while (dolacons) { /* transitive closure */ - dolacons = 0; - for (i = 0; i < d->nstates; i++) - if (ISBSET(d->work, i)) - for (ca = cnfa->states[i]+1; ca->co != COLORLESS; - ca++) { - if (ca->co <= cnfa->ncolors) - continue; /* NOTE CONTINUE */ - sawlacons = 1; - if (ISBSET(d->work, ca->to)) - continue; /* NOTE CONTINUE */ - if (!lacon(v, cnfa, cp, ca->co)) - continue; /* NOTE CONTINUE */ - BSET(d->work, ca->to); - dolacons = 1; - if (ca->to == cnfa->post) - ispost = 1; - if (!cnfa->states[ca->to]->co) - noprogress = 0; - FDEBUG(("%d :> %d\n", i, ca->to)); - } - } - if (!gotstate) - return NULL; - h = HASH(d->work, d->wordsper); - - /* next, is that in the cache? */ - for (p = d->ssets, i = d->nssused; i > 0; p++, i--) - if (HIT(h, d->work, p, d->wordsper)) { - FDEBUG(("cached c%d\n", p - d->ssets)); - break; /* NOTE BREAK OUT */ - } - if (i == 0) { /* nope, need a new cache entry */ - p = getvacant(v, d, cp, start); - assert(p != css); - for (i = 0; i < d->wordsper; i++) - p->states[i] = d->work[i]; - p->hash = h; - p->flags = (ispost) ? POSTSTATE : 0; - if (noprogress) - p->flags |= NOPROGRESS; - /* lastseen to be dealt with by caller */ - } - - if (!sawlacons) { /* lookahead conds. always cache miss */ - FDEBUG(("c%d[%d]->c%d\n", css - d->ssets, co, p - d->ssets)); - css->outs[co] = p; - css->inchain[co] = p->ins; - p->ins.ss = css; - p->ins.co = (color)co; - } - return p; -} - -/* - - lacon - lookahead-constraint checker for miss() - ^ static int lacon(struct vars *, struct cnfa *, chr *, pcolor); - */ -static int /* predicate: constraint satisfied? */ -lacon(v, pcnfa, cp, co) -struct vars *v; -struct cnfa *pcnfa; /* parent cnfa */ -chr *cp; -pcolor co; /* "color" of the lookahead constraint */ -{ - int n; - struct subre *sub; - struct dfa *d; - struct smalldfa sd; - chr *end; - - n = co - pcnfa->ncolors; - assert(n < v->g->nlacons && v->g->lacons != NULL); - FDEBUG(("=== testing lacon %d\n", n)); - sub = &v->g->lacons[n]; - d = newdfa(v, &sub->cnfa, &v->g->cmap, &sd); - if (d == NULL) { - ERR(REG_ESPACE); - return 0; - } - end = longest(v, d, cp, v->stop, (int *)NULL); - freedfa(d); - FDEBUG(("=== lacon %d match %d\n", n, (end != NULL))); - return (sub->subno) ? (end != NULL) : (end == NULL); -} - -/* - - getvacant - get a vacant state set - * This routine clears out the inarcs and outarcs, but does not otherwise - * clear the innards of the state set -- that's up to the caller. - ^ static struct sset *getvacant(struct vars *, struct dfa *, chr *, chr *); - */ -static struct sset * -getvacant(v, d, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *cp; -chr *start; -{ - int i; - struct sset *ss; - struct sset *p; - struct arcp ap; - struct arcp lastap; - color co; - lastap.ss = NULL; lastap.co = 0; // WX: suppress dummy gcc warnings - ss = pickss(v, d, cp, start); - assert(!(ss->flags&LOCKED)); - - /* clear out its inarcs, including self-referential ones */ - ap = ss->ins; - while ((p = ap.ss) != NULL) { - co = ap.co; - FDEBUG(("zapping c%d's %ld outarc\n", p - d->ssets, (long)co)); - p->outs[co] = NULL; - ap = p->inchain[co]; - p->inchain[co].ss = NULL; /* paranoia */ - } - ss->ins.ss = NULL; - - /* take it off the inarc chains of the ssets reached by its outarcs */ - for (i = 0; i < d->ncolors; i++) { - p = ss->outs[i]; - assert(p != ss); /* not self-referential */ - if (p == NULL) - continue; /* NOTE CONTINUE */ - FDEBUG(("del outarc %d from c%d's in chn\n", i, p - d->ssets)); - if (p->ins.ss == ss && p->ins.co == i) - p->ins = ss->inchain[i]; - else { - assert(p->ins.ss != NULL); - for (ap = p->ins; ap.ss != NULL && - !(ap.ss == ss && ap.co == i); - ap = ap.ss->inchain[ap.co]) - lastap = ap; - assert(ap.ss != NULL); - lastap.ss->inchain[lastap.co] = ss->inchain[i]; - } - ss->outs[i] = NULL; - ss->inchain[i].ss = NULL; - } - - /* if ss was a success state, may need to remember location */ - if ((ss->flags&POSTSTATE) && ss->lastseen != d->lastpost && - (d->lastpost == NULL || d->lastpost < ss->lastseen)) - d->lastpost = ss->lastseen; - - /* likewise for a no-progress state */ - if ((ss->flags&NOPROGRESS) && ss->lastseen != d->lastnopr && - (d->lastnopr == NULL || d->lastnopr < ss->lastseen)) - d->lastnopr = ss->lastseen; - - return ss; -} - -/* - - pickss - pick the next stateset to be used - ^ static struct sset *pickss(struct vars *, struct dfa *, chr *, chr *); - */ -static struct sset * -pickss(v, d, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *cp; -chr *start; -{ - int i; - struct sset *ss; - struct sset *end; - chr *ancient; - - /* shortcut for cases where cache isn't full */ - if (d->nssused < d->nssets) { - i = d->nssused; - d->nssused++; - ss = &d->ssets[i]; - FDEBUG(("new c%d\n", i)); - /* set up innards */ - ss->states = &d->statesarea[i * d->wordsper]; - ss->flags = 0; - ss->ins.ss = NULL; - ss->ins.co = WHITE; /* give it some value */ - ss->outs = &d->outsarea[i * d->ncolors]; - ss->inchain = &d->incarea[i * d->ncolors]; - for (i = 0; i < d->ncolors; i++) { - ss->outs[i] = NULL; - ss->inchain[i].ss = NULL; - } - return ss; - } - - /* look for oldest, or old enough anyway */ - if (cp - start > d->nssets*2/3) /* oldest 33% are expendable */ - ancient = cp - d->nssets*2/3; - else - ancient = start; - for (ss = d->search, end = &d->ssets[d->nssets]; ss < end; ss++) - if ((ss->lastseen == NULL || ss->lastseen < ancient) && - !(ss->flags&LOCKED)) { - d->search = ss + 1; - FDEBUG(("replacing c%d\n", ss - d->ssets)); - return ss; - } - for (ss = d->ssets, end = d->search; ss < end; ss++) - if ((ss->lastseen == NULL || ss->lastseen < ancient) && - !(ss->flags&LOCKED)) { - d->search = ss + 1; - FDEBUG(("replacing c%d\n", ss - d->ssets)); - return ss; - } - - /* nobody's old enough?!? -- something's really wrong */ - FDEBUG(("can't find victim to replace!\n")); - assert(NOTREACHED); - ERR(REG_ASSERT); - return d->ssets; -} diff --git a/src/regex/regerror.c b/src/regex/regerror.c deleted file mode 100644 index 7646ba2fb6..0000000000 --- a/src/regex/regerror.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * regerror - error-code expansion - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - -/* unknown-error explanation */ -static char unk[] = "*** unknown regex error code 0x%x ***"; - -/* struct to map among codes, code names, and explanations */ -static struct rerr { - int code; - char *name; - char *explain; -} rerrs[] = { - /* the actual table is built from regex.h */ -# include "regerrs.h" - { -1, "", "oops" }, /* explanation special-cased in code */ -}; - -/* - - regerror - the interface to error numbers - */ -/* ARGSUSED */ -size_t /* actual space needed (including NUL) */ -wx_regerror(rxerrcode, preg, errbuf, errbuf_size) -int rxerrcode; /* error code, or REG_ATOI or REG_ITOA */ -CONST regex_t *preg; /* associated regex_t (unused at present) */ -char *errbuf; /* result buffer (unless errbuf_size==0) */ -size_t errbuf_size; /* available space in errbuf, can be 0 */ -{ - struct rerr *r; - char *msg; - char convbuf[sizeof(unk)+50]; /* 50 = plenty for int */ - size_t len; - int icode; - - switch (rxerrcode) { - case REG_ATOI: /* convert name to number */ - for (r = rerrs; r->code >= 0; r++) - if (strcmp(r->name, errbuf) == 0) - break; - sprintf(convbuf, "%d", r->code); /* -1 for unknown */ - msg = convbuf; - break; - case REG_ITOA: /* convert number to name */ - icode = atoi(errbuf); /* not our problem if this fails */ - for (r = rerrs; r->code >= 0; r++) - if (r->code == icode) - break; - if (r->code >= 0) - msg = r->name; - else { /* unknown; tell him the number */ - sprintf(convbuf, "REG_%u", (unsigned)icode); - msg = convbuf; - } - break; - default: /* a real, normal error code */ - for (r = rerrs; r->code >= 0; r++) - if (r->code == rxerrcode) - break; - if (r->code >= 0) - msg = r->explain; - else { /* unknown; say so */ - sprintf(convbuf, unk, rxerrcode); - msg = convbuf; - } - break; - } - - len = strlen(msg) + 1; /* space needed, including NUL */ - if (errbuf_size > 0) { - if (errbuf_size > len) - strcpy(errbuf, msg); - else { /* truncate to fit */ - strncpy(errbuf, msg, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; - } - } - - return len; -} diff --git a/src/regex/regerrs.h b/src/regex/regerrs.h deleted file mode 100644 index a3d98b6818..0000000000 --- a/src/regex/regerrs.h +++ /dev/null @@ -1,18 +0,0 @@ -{ REG_OKAY, "REG_OKAY", "no errors detected" }, -{ REG_NOMATCH, "REG_NOMATCH", "failed to match" }, -{ REG_BADPAT, "REG_BADPAT", "invalid regexp (reg version 0.8)" }, -{ REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element" }, -{ REG_ECTYPE, "REG_ECTYPE", "invalid character class" }, -{ REG_EESCAPE, "REG_EESCAPE", "invalid escape \\ sequence" }, -{ REG_ESUBREG, "REG_ESUBREG", "invalid backreference number" }, -{ REG_EBRACK, "REG_EBRACK", "brackets [] not balanced" }, -{ REG_EPAREN, "REG_EPAREN", "parentheses () not balanced" }, -{ REG_EBRACE, "REG_EBRACE", "braces {} not balanced" }, -{ REG_BADBR, "REG_BADBR", "invalid repetition count(s)" }, -{ REG_ERANGE, "REG_ERANGE", "invalid character range" }, -{ REG_ESPACE, "REG_ESPACE", "out of memory" }, -{ REG_BADRPT, "REG_BADRPT", "quantifier operand invalid" }, -{ REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug" }, -{ REG_INVARG, "REG_INVARG", "invalid argument to regex function" }, -{ REG_MIXED, "REG_MIXED", "character widths of regex and string differ" }, -{ REG_BADOPT, "REG_BADOPT", "invalid embedded option" }, diff --git a/src/regex/regex.h b/src/regex/regex.h deleted file mode 100644 index ecf61e4741..0000000000 --- a/src/regex/regex.h +++ /dev/null @@ -1,335 +0,0 @@ -#ifndef _REGEX_H_ -#define _REGEX_H_ /* never again */ -/* - * regular expressions - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * Prototypes etc. marked with "^" within comments get gathered up (and - * possibly edited) by the regfwd program and inserted near the bottom of - * this file. - * - * We offer the option of declaring one wide-character version of the - * RE functions as well as the char versions. To do that, define - * __REG_WIDE_T to the type of wide characters (unfortunately, there - * is no consensus that wchar_t is suitable) and __REG_WIDE_COMPILE and - * __REG_WIDE_EXEC to the names to be used for the compile and execute - * functions (suggestion: re_Xcomp and re_Xexec, where X is a letter - * suggestive of the wide type, e.g. re_ucomp and re_uexec for Unicode). - * For cranky old compilers, it may be necessary to do something like: - * #define __REG_WIDE_COMPILE(a,b,c,d) re_Xcomp(a,b,c,d) - * #define __REG_WIDE_EXEC(a,b,c,d,e,f,g) re_Xexec(a,b,c,d,e,f,g) - * rather than just #defining the names as parameterless macros. - * - * For some specialized purposes, it may be desirable to suppress the - * declarations of the "front end" functions, regcomp() and regexec(), - * or of the char versions of the compile and execute functions. To - * suppress the front-end functions, define __REG_NOFRONT. To suppress - * the char versions, define __REG_NOCHAR. - * - * The right place to do those defines (and some others you may want, see - * below) would be . If you don't have control of that file, - * the right place to add your own defines to this file is marked below. - * This is normally done automatically, by the makefile and regmkhdr, based - * on the contents of regcustom.h. - */ - - - -/* - * voodoo for C++ - */ -#ifdef __cplusplus -extern "C" { -#endif - - - -/* - * Add your own defines, if needed, here. - */ - - - -/* - * Location where a chunk of regcustom.h is automatically spliced into - * this file (working from its prototype, regproto.h). - */ -/* --- begin --- */ -/* ensure certain things don't sneak in from system headers */ -#ifdef __REG_WIDE_T -#undef __REG_WIDE_T -#endif -#ifdef __REG_WIDE_COMPILE -#undef __REG_WIDE_COMPILE -#endif -#ifdef __REG_WIDE_EXEC -#undef __REG_WIDE_EXEC -#endif -#ifdef __REG_REGOFF_T -#undef __REG_REGOFF_T -#endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif -#ifdef __REG_NOFRONT -#undef __REG_NOFRONT -#endif -#ifdef __REG_NOCHAR -#undef __REG_NOCHAR -#endif -#define __REG_WIDE_T wxChar -#define __REG_WIDE_COMPILE wx_re_comp -#define __REG_WIDE_EXEC wx_re_exec -#define __REG_NOCHAR /* don't want the char versions */ -#define __REG_NOFRONT /* don't want regcomp() and regexec() */ -#define _ANSI_ARGS_(x) x -/* --- end --- */ - - -/* - * interface types etc. - */ - -/* - * regoff_t has to be large enough to hold either off_t or ssize_t, - * and must be signed; it's only a guess that long is suitable, so we - * offer an override. - */ -#ifdef __REG_REGOFF_T -typedef __REG_REGOFF_T regoff_t; -#else -typedef long regoff_t; -#endif - -/* - * For benefit of old compilers, we offer the option of - * overriding the `void' type used to declare nonexistent return types. - */ -#ifdef __REG_VOID_T -typedef __REG_VOID_T re_void; -#else -typedef void re_void; -#endif - -/* - * Also for benefit of old compilers, can supply a macro - * which expands to a substitute for `const'. - */ -#ifndef __REG_CONST -#define __REG_CONST const -#endif - - - -/* - * other interface types - */ - -/* the biggie, a compiled RE (or rather, a front end to same) */ -typedef struct { - int re_magic; /* magic number */ - size_t re_nsub; /* number of subexpressions */ - long re_info; /* information about RE */ -# define REG_UBACKREF 000001 -# define REG_ULOOKAHEAD 000002 -# define REG_UBOUNDS 000004 -# define REG_UBRACES 000010 -# define REG_UBSALNUM 000020 -# define REG_UPBOTCH 000040 -# define REG_UBBS 000100 -# define REG_UNONPOSIX 000200 -# define REG_UUNSPEC 000400 -# define REG_UUNPORT 001000 -# define REG_ULOCALE 002000 -# define REG_UEMPTYMATCH 004000 -# define REG_UIMPOSSIBLE 010000 -# define REG_USHORTEST 020000 - int re_csize; /* sizeof(character) */ - char *re_endp; /* backward compatibility kludge */ - /* the rest is opaque pointers to hidden innards */ - char *re_guts; /* `char *' is more portable than `void *' */ - char *re_fns; -} regex_t; - -/* result reporting (may acquire more fields later) */ -typedef struct { - regoff_t rm_so; /* start of substring */ - regoff_t rm_eo; /* end of substring */ -} regmatch_t; - -/* supplementary control and reporting */ -typedef struct { - regmatch_t rm_extend; /* see REG_EXPECT */ -} rm_detail_t; - - - -/* - * compilation - ^ #ifndef __REG_NOCHAR - ^ int re_comp(regex_t *, __REG_CONST char *, size_t, int); - ^ #endif - ^ #ifndef __REG_NOFRONT - ^ int regcomp(regex_t *, __REG_CONST char *, int); - ^ #endif - ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); - ^ #endif - */ -#define REG_BASIC 000000 /* BREs (convenience) */ -#define REG_EXTENDED 000001 /* EREs */ -#define REG_ADVF 000002 /* advanced features in EREs */ -#define REG_ADVANCED 000003 /* AREs (which are also EREs) */ -#define REG_QUOTE 000004 /* no special characters, none */ -#define REG_NOSPEC REG_QUOTE /* historical synonym */ -#define REG_ICASE 000010 /* ignore case */ -#define REG_NOSUB 000020 /* don't care about subexpressions */ -#define REG_EXPANDED 000040 /* expanded format, white space & comments */ -#define REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */ -#define REG_NLANCH 000200 /* ^ matches after \n, $ before */ -#define REG_NEWLINE 000300 /* newlines are line terminators */ -#define REG_PEND 000400 /* ugh -- backward-compatibility hack */ -#define REG_EXPECT 001000 /* report details on partial/limited matches */ -#define REG_BOSONLY 002000 /* temporary kludge for BOS-only matches */ -#define REG_DUMP 004000 /* none of your business :-) */ -#define REG_FAKE 010000 /* none of your business :-) */ -#define REG_PROGRESS 020000 /* none of your business :-) */ - - - -/* - * execution - ^ #ifndef __REG_NOCHAR - ^ int re_exec(regex_t *, __REG_CONST char *, size_t, - ^ rm_detail_t *, size_t, regmatch_t [], int); - ^ #endif - ^ #ifndef __REG_NOFRONT - ^ int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); - ^ #endif - ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, - ^ rm_detail_t *, size_t, regmatch_t [], int); - ^ #endif - */ -#define REG_NOTBOL 0001 /* BOS is not BOL */ -#define REG_NOTEOL 0002 /* EOS is not EOL */ -#define REG_STARTEND 0004 /* backward compatibility kludge */ -#define REG_FTRACE 0010 /* none of your business */ -#define REG_MTRACE 0020 /* none of your business */ -#define REG_SMALL 0040 /* none of your business */ - - - -/* - * misc generics (may be more functions here eventually) - ^ re_void regfree(regex_t *); - */ - - - -/* - * error reporting - * Be careful if modifying the list of error codes -- the table used by - * regerror() is generated automatically from this file! - * - * Note that there is no wide-char variant of regerror at this time; what - * kind of character is used for error reports is independent of what kind - * is used in matching. - * - ^ extern size_t regerror(int, __REG_CONST regex_t *, char *, size_t); - */ -#define REG_OKAY 0 /* no errors detected */ -#define REG_NOMATCH 1 /* failed to match */ -#define REG_BADPAT 2 /* invalid regexp */ -#define REG_ECOLLATE 3 /* invalid collating element */ -#define REG_ECTYPE 4 /* invalid character class */ -#define REG_EESCAPE 5 /* invalid escape \ sequence */ -#define REG_ESUBREG 6 /* invalid backreference number */ -#define REG_EBRACK 7 /* brackets [] not balanced */ -#define REG_EPAREN 8 /* parentheses () not balanced */ -#define REG_EBRACE 9 /* braces {} not balanced */ -#define REG_BADBR 10 /* invalid repetition count(s) */ -#define REG_ERANGE 11 /* invalid character range */ -#define REG_ESPACE 12 /* out of memory */ -#define REG_BADRPT 13 /* quantifier operand invalid */ -#define REG_ASSERT 15 /* "can't happen" -- you found a bug */ -#define REG_INVARG 16 /* invalid argument to regex function */ -#define REG_MIXED 17 /* character widths of regex and string differ */ -#define REG_BADOPT 18 /* invalid embedded option */ -/* two specials for debugging and testing */ -#define REG_ATOI 101 /* convert error-code name to number */ -#define REG_ITOA 102 /* convert error-code number to name */ - - - -/* - * the prototypes, as possibly munched by regfwd - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regproto.h === */ -#ifndef __REG_NOCHAR -int wx_re_comp _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, int)); -#endif -#ifndef __REG_NOFRONT -int regcomp _ANSI_ARGS_((regex_t *, __REG_CONST char *, int)); -#endif -#ifdef __REG_WIDE_T -int __REG_WIDE_COMPILE _ANSI_ARGS_((regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int)); -#endif -#ifndef __REG_NOCHAR -int wx_re_exec _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -#endif -#ifndef __REG_NOFRONT -int regexec _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, regmatch_t [], int)); -#endif -#ifdef __REG_WIDE_T -int __REG_WIDE_EXEC _ANSI_ARGS_((regex_t *, __REG_CONST __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -#endif -re_void wx_regfree _ANSI_ARGS_((regex_t *)); -extern size_t wx_regerror _ANSI_ARGS_((int, __REG_CONST regex_t *, char *, size_t)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* - * more C++ voodoo - */ -#ifdef __cplusplus -} -#endif - - - -#endif diff --git a/src/regex/regex.vcp b/src/regex/regex.vcp deleted file mode 100644 index 3380a86ea9..0000000000 --- a/src/regex/regex.vcp +++ /dev/null @@ -1,2068 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="regex" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE x86) Static Library" 0x8304 -# TARGTYPE "Win32 (WCE MIPSIV) Static Library" 0x9604 -# TARGTYPE "Win32 (WCE ARMV4I) Static Library" 0xa504 -# TARGTYPE "Win32 (WCE MIPSIV_FP) Static Library" 0x9204 -# TARGTYPE "Win32 (WCE emulator) Static Library" 0xa604 -# TARGTYPE "Win32 (WCE MIPSII) Static Library" 0xa104 -# TARGTYPE "Win32 (WCE ARMV4T) Static Library" 0xa404 -# TARGTYPE "Win32 (WCE MIPSII_FP) Static Library" 0xa204 -# TARGTYPE "Win32 (WCE MIPS16) Static Library" 0x8904 -# TARGTYPE "Win32 (WCE SH3) Static Library" 0x8104 -# TARGTYPE "Win32 (WCE ARMV4) Static Library" 0xa304 -# TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504 -# TARGTYPE "Win32 (WCE SH4) Static Library" 0x8604 - -CFG=regex - Win32 (WCE ARM) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "regex.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.vcn" CFG="regex - Win32 (WCE ARM) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 (WCE emulator) DLL Release" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "regex - Win32 (WCE emulator) DLL Debug" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "regex - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "regex - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "regex - Win32 (WCE x86) DLL Release" (based on "Win32 (WCE x86) Static Library") -!MESSAGE "regex - Win32 (WCE x86) DLL Debug" (based on "Win32 (WCE x86) Static Library") -!MESSAGE "regex - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library") -!MESSAGE "regex - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library") -!MESSAGE "regex - Win32 (WCE SH4) DLL Release" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "regex - Win32 (WCE SH4) DLL Debug" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "regex - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "regex - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "regex - Win32 (WCE SH3) DLL Release" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "regex - Win32 (WCE SH3) DLL Debug" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "regex - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "regex - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV_FP) DLL Release" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV_FP) DLL Debug" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV_FP) Release" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV_FP) Debug" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV) DLL Release" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV) DLL Debug" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV) Release" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSIV) Debug" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII_FP) DLL Release" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII_FP) DLL Debug" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII_FP) Release" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII_FP) Debug" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII) DLL Release" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII) DLL Debug" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII) Release" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "regex - Win32 (WCE MIPSII) Debug" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "regex - Win32 (WCE MIPS16) DLL Release" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "regex - Win32 (WCE MIPS16) DLL Debug" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "regex - Win32 (WCE MIPS16) Release" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "regex - Win32 (WCE MIPS16) Debug" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4T) DLL Release" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4T) DLL Debug" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4T) Release" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4T) Debug" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4I) DLL Release" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4I) DLL Debug" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4I) Release" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4I) Debug" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4) DLL Release" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4) DLL Debug" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "regex - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "regex - Win32 (WCE ARM) DLL Release" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "regex - Win32 (WCE ARM) DLL Debug" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "regex - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "regex - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "regex - Win32 (WCE emulator) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_emulator_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_emulator\regex" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_emulator_dll" -# PROP Intermediate_Dir "evc_wincedll_emulator\regex" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_emulator_dll\regex.pdb /I "..\..\lib\evc_emulator_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_emulator_dll\regex.pdb /I "..\..\lib\evc_emulator_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_emulator_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_emulator_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE emulator) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_emulator_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_emulator\regex" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_emulator_dll" -# PROP Intermediate_Dir "evc_winceddll_emulator\regex" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_emulator_dll\regexd.pdb /I "..\..\lib\evc_emulator_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_emulator_dll\regexd.pdb /I "..\..\lib\evc_emulator_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_emulator_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_emulator_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_emulator_lib" -# PROP BASE Intermediate_Dir "evc_wince_emulator\regex" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_emulator_lib" -# PROP Intermediate_Dir "evc_wince_emulator\regex" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_emulator_lib\regex.pdb /I "..\..\lib\evc_emulator_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_emulator_lib\regex.pdb /I "..\..\lib\evc_emulator_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_emulator_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_emulator_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_emulator_lib" -# PROP BASE Intermediate_Dir "evc_winced_emulator\regex" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_emulator_lib" -# PROP Intermediate_Dir "evc_winced_emulator\regex" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_emulator_lib\regexd.pdb /I "..\..\lib\evc_emulator_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_emulator_lib\regexd.pdb /I "..\..\lib\evc_emulator_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_emulator_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_emulator_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_x86_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_x86\regex" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_x86_dll" -# PROP Intermediate_Dir "evc_wincedll_x86\regex" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_x86_dll\regex.pdb /I "..\..\lib\evc_x86_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_x86_dll\regex.pdb /I "..\..\lib\evc_x86_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_x86_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_x86_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_x86_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_x86\regex" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_x86_dll" -# PROP Intermediate_Dir "evc_winceddll_x86\regex" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_x86_dll\regexd.pdb /I "..\..\lib\evc_x86_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_x86_dll\regexd.pdb /I "..\..\lib\evc_x86_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_x86_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_x86_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_x86_lib" -# PROP BASE Intermediate_Dir "evc_wince_x86\regex" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_x86_lib" -# PROP Intermediate_Dir "evc_wince_x86\regex" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_x86_lib\regex.pdb /I "..\..\lib\evc_x86_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_x86_lib\regex.pdb /I "..\..\lib\evc_x86_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_x86_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_x86_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_x86_lib" -# PROP BASE Intermediate_Dir "evc_winced_x86\regex" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_x86_lib" -# PROP Intermediate_Dir "evc_winced_x86\regex" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_x86_lib\regexd.pdb /I "..\..\lib\evc_x86_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "_i386_" /D "i_386_" /D "_X86_" /D "x86" /Gs8192 /GF /W1 /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_x86_lib\regexd.pdb /I "..\..\lib\evc_x86_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_x86_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_x86_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_sh4_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_sh4\regex" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_sh4_dll" -# PROP Intermediate_Dir "evc_wincedll_sh4\regex" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh4_dll\regex.pdb /I "..\..\lib\evc_sh4_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh4_dll\regex.pdb /I "..\..\lib\evc_sh4_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh4_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh4_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_sh4_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_sh4\regex" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_sh4_dll" -# PROP Intermediate_Dir "evc_winceddll_sh4\regex" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh4_dll\regexd.pdb /I "..\..\lib\evc_sh4_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh4_dll\regexd.pdb /I "..\..\lib\evc_sh4_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh4_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh4_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_sh4_lib" -# PROP BASE Intermediate_Dir "evc_wince_sh4\regex" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_sh4_lib" -# PROP Intermediate_Dir "evc_wince_sh4\regex" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh4_lib\regex.pdb /I "..\..\lib\evc_sh4_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh4_lib\regex.pdb /I "..\..\lib\evc_sh4_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh4_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh4_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_sh4_lib" -# PROP BASE Intermediate_Dir "evc_winced_sh4\regex" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_sh4_lib" -# PROP Intermediate_Dir "evc_winced_sh4\regex" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh4_lib\regexd.pdb /I "..\..\lib\evc_sh4_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH4" /D "_SH4_" /Qsh4 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh4_lib\regexd.pdb /I "..\..\lib\evc_sh4_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh4_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh4_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_sh3_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_sh3\regex" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_sh3_dll" -# PROP Intermediate_Dir "evc_wincedll_sh3\regex" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh3_dll\regex.pdb /I "..\..\lib\evc_sh3_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh3_dll\regex.pdb /I "..\..\lib\evc_sh3_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh3_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh3_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_sh3_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_sh3\regex" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_sh3_dll" -# PROP Intermediate_Dir "evc_winceddll_sh3\regex" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh3_dll\regexd.pdb /I "..\..\lib\evc_sh3_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh3_dll\regexd.pdb /I "..\..\lib\evc_sh3_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh3_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh3_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_sh3_lib" -# PROP BASE Intermediate_Dir "evc_wince_sh3\regex" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_sh3_lib" -# PROP Intermediate_Dir "evc_wince_sh3\regex" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh3_lib\regex.pdb /I "..\..\lib\evc_sh3_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_sh3_lib\regex.pdb /I "..\..\lib\evc_sh3_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh3_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh3_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_sh3_lib" -# PROP BASE Intermediate_Dir "evc_winced_sh3\regex" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_sh3_lib" -# PROP Intermediate_Dir "evc_winced_sh3\regex" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh3_lib\regexd.pdb /I "..\..\lib\evc_sh3_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "SHx" /D "SH3" /D "_SH3_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_sh3_lib\regexd.pdb /I "..\..\lib\evc_sh3_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_sh3_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_sh3_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_fp_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_mipsiv_fp\regex" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsiv_fp_dll" -# PROP Intermediate_Dir "evc_wincedll_mipsiv_fp\regex" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_fp_dll\regex.pdb /I "..\..\lib\evc_mipsiv_fp_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_fp_dll\regex.pdb /I "..\..\lib\evc_mipsiv_fp_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_fp_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_mipsiv_fp\regex" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsiv_fp_dll" -# PROP Intermediate_Dir "evc_winceddll_mipsiv_fp\regex" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_fp_dll\regexd.pdb /I "..\..\lib\evc_mipsiv_fp_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_fp_dll\regexd.pdb /I "..\..\lib\evc_mipsiv_fp_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_fp_lib" -# PROP BASE Intermediate_Dir "evc_wince_mipsiv_fp\regex" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsiv_fp_lib" -# PROP Intermediate_Dir "evc_wince_mipsiv_fp\regex" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_fp_lib\regex.pdb /I "..\..\lib\evc_mipsiv_fp_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_fp_lib\regex.pdb /I "..\..\lib\evc_mipsiv_fp_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_fp_lib" -# PROP BASE Intermediate_Dir "evc_winced_mipsiv_fp\regex" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsiv_fp_lib" -# PROP Intermediate_Dir "evc_winced_mipsiv_fp\regex" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_fp_lib\regexd.pdb /I "..\..\lib\evc_mipsiv_fp_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /QMmips4 /QMn32 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_fp_lib\regexd.pdb /I "..\..\lib\evc_mipsiv_fp_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_fp_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_mipsiv\regex" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsiv_dll" -# PROP Intermediate_Dir "evc_wincedll_mipsiv\regex" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_dll\regex.pdb /I "..\..\lib\evc_mipsiv_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_dll\regex.pdb /I "..\..\lib\evc_mipsiv_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_mipsiv\regex" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsiv_dll" -# PROP Intermediate_Dir "evc_winceddll_mipsiv\regex" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_dll\regexd.pdb /I "..\..\lib\evc_mipsiv_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_dll\regexd.pdb /I "..\..\lib\evc_mipsiv_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_lib" -# PROP BASE Intermediate_Dir "evc_wince_mipsiv\regex" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsiv_lib" -# PROP Intermediate_Dir "evc_wince_mipsiv\regex" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_lib\regex.pdb /I "..\..\lib\evc_mipsiv_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsiv_lib\regex.pdb /I "..\..\lib\evc_mipsiv_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsiv_lib" -# PROP BASE Intermediate_Dir "evc_winced_mipsiv\regex" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsiv_lib" -# PROP Intermediate_Dir "evc_winced_mipsiv\regex" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_lib\regexd.pdb /I "..\..\lib\evc_mipsiv_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /QMmips4 /QMn32 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsiv_lib\regexd.pdb /I "..\..\lib\evc_mipsiv_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsiv_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsiv_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_fp_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_mipsii_fp\regex" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsii_fp_dll" -# PROP Intermediate_Dir "evc_wincedll_mipsii_fp\regex" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_fp_dll\regex.pdb /I "..\..\lib\evc_mipsii_fp_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_fp_dll\regex.pdb /I "..\..\lib\evc_mipsii_fp_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_fp_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_mipsii_fp\regex" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsii_fp_dll" -# PROP Intermediate_Dir "evc_winceddll_mipsii_fp\regex" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_fp_dll\regexd.pdb /I "..\..\lib\evc_mipsii_fp_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_fp_dll\regexd.pdb /I "..\..\lib\evc_mipsii_fp_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_fp_lib" -# PROP BASE Intermediate_Dir "evc_wince_mipsii_fp\regex" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsii_fp_lib" -# PROP Intermediate_Dir "evc_wince_mipsii_fp\regex" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_fp_lib\regex.pdb /I "..\..\lib\evc_mipsii_fp_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_fp_lib\regex.pdb /I "..\..\lib\evc_mipsii_fp_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_fp_lib" -# PROP BASE Intermediate_Dir "evc_winced_mipsii_fp\regex" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsii_fp_lib" -# PROP Intermediate_Dir "evc_winced_mipsii_fp\regex" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_fp_lib\regexd.pdb /I "..\..\lib\evc_mipsii_fp_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /QMmips2 /QMFPE- /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_fp_lib\regexd.pdb /I "..\..\lib\evc_mipsii_fp_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_fp_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_mipsii\regex" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsii_dll" -# PROP Intermediate_Dir "evc_wincedll_mipsii\regex" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_dll\regex.pdb /I "..\..\lib\evc_mipsii_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_dll\regex.pdb /I "..\..\lib\evc_mipsii_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_mipsii\regex" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsii_dll" -# PROP Intermediate_Dir "evc_winceddll_mipsii\regex" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_dll\regexd.pdb /I "..\..\lib\evc_mipsii_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_dll\regexd.pdb /I "..\..\lib\evc_mipsii_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_lib" -# PROP BASE Intermediate_Dir "evc_wince_mipsii\regex" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mipsii_lib" -# PROP Intermediate_Dir "evc_wince_mipsii\regex" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_lib\regex.pdb /I "..\..\lib\evc_mipsii_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mipsii_lib\regex.pdb /I "..\..\lib\evc_mipsii_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mipsii_lib" -# PROP BASE Intermediate_Dir "evc_winced_mipsii\regex" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mipsii_lib" -# PROP Intermediate_Dir "evc_winced_mipsii\regex" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_lib\regexd.pdb /I "..\..\lib\evc_mipsii_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /QMmips2 /QMFPE /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mipsii_lib\regexd.pdb /I "..\..\lib\evc_mipsii_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mipsii_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mipsii_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mips16_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_mips16\regex" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mips16_dll" -# PROP Intermediate_Dir "evc_wincedll_mips16\regex" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mips16_dll\regex.pdb /I "..\..\lib\evc_mips16_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mips16_dll\regex.pdb /I "..\..\lib\evc_mips16_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mips16_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mips16_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mips16_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_mips16\regex" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mips16_dll" -# PROP Intermediate_Dir "evc_winceddll_mips16\regex" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mips16_dll\regexd.pdb /I "..\..\lib\evc_mips16_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mips16_dll\regexd.pdb /I "..\..\lib\evc_mips16_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mips16_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mips16_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_mips16_lib" -# PROP BASE Intermediate_Dir "evc_wince_mips16\regex" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_mips16_lib" -# PROP Intermediate_Dir "evc_wince_mips16\regex" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mips16_lib\regex.pdb /I "..\..\lib\evc_mips16_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_mips16_lib\regex.pdb /I "..\..\lib\evc_mips16_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mips16_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mips16_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_mips16_lib" -# PROP BASE Intermediate_Dir "evc_winced_mips16\regex" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_mips16_lib" -# PROP Intermediate_Dir "evc_winced_mips16\regex" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mips16_lib\regexd.pdb /I "..\..\lib\evc_mips16_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /QMmips16 /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_mips16_lib\regexd.pdb /I "..\..\lib\evc_mips16_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_mips16_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_mips16_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_armv4t_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_armv4t\regex" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_armv4t_dll" -# PROP Intermediate_Dir "evc_wincedll_armv4t\regex" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clthumb.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4t_dll\regex.pdb /I "..\..\lib\evc_armv4t_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4t_dll\regex.pdb /I "..\..\lib\evc_armv4t_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4t_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4t_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_armv4t_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_armv4t\regex" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_armv4t_dll" -# PROP Intermediate_Dir "evc_winceddll_armv4t\regex" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clthumb.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4t_dll\regexd.pdb /I "..\..\lib\evc_armv4t_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4t_dll\regexd.pdb /I "..\..\lib\evc_armv4t_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4t_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4t_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_armv4t_lib" -# PROP BASE Intermediate_Dir "evc_wince_armv4t\regex" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_armv4t_lib" -# PROP Intermediate_Dir "evc_wince_armv4t\regex" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clthumb.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4t_lib\regex.pdb /I "..\..\lib\evc_armv4t_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4t_lib\regex.pdb /I "..\..\lib\evc_armv4t_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4t_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4t_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_armv4t_lib" -# PROP BASE Intermediate_Dir "evc_winced_armv4t\regex" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_armv4t_lib" -# PROP Intermediate_Dir "evc_winced_armv4t\regex" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clthumb.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4t_lib\regexd.pdb /I "..\..\lib\evc_armv4t_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4t_lib\regexd.pdb /I "..\..\lib\evc_armv4t_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4t_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4t_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_armv4i_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_armv4i\regex" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_armv4i_dll" -# PROP Intermediate_Dir "evc_wincedll_armv4i\regex" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4i_dll\regex.pdb /I "..\..\lib\evc_armv4i_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4i_dll\regex.pdb /I "..\..\lib\evc_armv4i_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4i_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4i_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_armv4i_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_armv4i\regex" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_armv4i_dll" -# PROP Intermediate_Dir "evc_winceddll_armv4i\regex" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4i_dll\regexd.pdb /I "..\..\lib\evc_armv4i_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4i_dll\regexd.pdb /I "..\..\lib\evc_armv4i_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4i_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4i_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_armv4i_lib" -# PROP BASE Intermediate_Dir "evc_wince_armv4i\regex" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_armv4i_lib" -# PROP Intermediate_Dir "evc_wince_armv4i\regex" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4i_lib\regex.pdb /I "..\..\lib\evc_armv4i_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4i_lib\regex.pdb /I "..\..\lib\evc_armv4i_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4i_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4i_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_armv4i_lib" -# PROP BASE Intermediate_Dir "evc_winced_armv4i\regex" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_armv4i_lib" -# PROP Intermediate_Dir "evc_winced_armv4i\regex" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4i_lib\regexd.pdb /I "..\..\lib\evc_armv4i_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4I" /QRarch4T /QRinterwork-return /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4i_lib\regexd.pdb /I "..\..\lib\evc_armv4i_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4i_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4i_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_armv4_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_armv4\regex" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_armv4_dll" -# PROP Intermediate_Dir "evc_wincedll_armv4\regex" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4_dll\regex.pdb /I "..\..\lib\evc_armv4_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4_dll\regex.pdb /I "..\..\lib\evc_armv4_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_armv4_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_armv4\regex" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_armv4_dll" -# PROP Intermediate_Dir "evc_winceddll_armv4\regex" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4_dll\regexd.pdb /I "..\..\lib\evc_armv4_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4_dll\regexd.pdb /I "..\..\lib\evc_armv4_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_armv4_lib" -# PROP BASE Intermediate_Dir "evc_wince_armv4\regex" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_armv4_lib" -# PROP Intermediate_Dir "evc_wince_armv4\regex" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4_lib\regex.pdb /I "..\..\lib\evc_armv4_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_armv4_lib\regex.pdb /I "..\..\lib\evc_armv4_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_armv4_lib" -# PROP BASE Intermediate_Dir "evc_winced_armv4\regex" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_armv4_lib" -# PROP Intermediate_Dir "evc_winced_armv4\regex" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4_lib\regexd.pdb /I "..\..\lib\evc_armv4_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /D "ARMV4" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_armv4_lib\regexd.pdb /I "..\..\lib\evc_armv4_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_armv4_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_armv4_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_arm_dll" -# PROP BASE Intermediate_Dir "evc_wincedll_arm\regex" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_arm_dll" -# PROP Intermediate_Dir "evc_wincedll_arm\regex" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_arm_dll\regex.pdb /I "..\..\lib\evc_arm_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_arm_dll\regex.pdb /I "..\..\lib\evc_arm_dll\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_arm_dll\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_arm_dll\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_arm_dll" -# PROP BASE Intermediate_Dir "evc_winceddll_arm\regex" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_arm_dll" -# PROP Intermediate_Dir "evc_winceddll_arm\regex" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_arm_dll\regexd.pdb /I "..\..\lib\evc_arm_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_arm_dll\regexd.pdb /I "..\..\lib\evc_arm_dll\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_arm_dll\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_arm_dll\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\lib\evc_arm_lib" -# PROP BASE Intermediate_Dir "evc_wince_arm\regex" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\lib\evc_arm_lib" -# PROP Intermediate_Dir "evc_wince_arm\regex" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_arm_lib\regex.pdb /I "..\..\lib\evc_arm_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMT) /O2 /I "..\..\build\wince\missing" /Fd..\..\lib\evc_arm_lib\regex.pdb /I "..\..\lib\evc_arm_lib\wince" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_arm_lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_arm_lib\regex.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\lib\evc_arm_lib" -# PROP BASE Intermediate_Dir "evc_winced_arm\regex" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\lib\evc_arm_lib" -# PROP Intermediate_Dir "evc_winced_arm\regex" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_arm_lib\regexd.pdb /I "..\..\lib\evc_arm_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -# ADD CPP /nologo /D "ARM" /D "_ARM_" /W1 /M$(CECrtMTDebug) /Od /I "..\..\build\wince\missing" /Zi /Fd..\..\lib\evc_arm_lib\regexd.pdb /I "..\..\lib\evc_arm_lib\winced" /I "..\..\include" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "__WXWINCE__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "$(CePlatform)" /D "_LIB" /D "DEBUG" /D "COMPILED_FROM_DSP" /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\evc_arm_lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\evc_arm_lib\regexd.lib" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ENDIF - -# Begin Target - -# Name "regex - Win32 (WCE emulator) DLL Release" -# Name "regex - Win32 (WCE emulator) DLL Debug" -# Name "regex - Win32 (WCE emulator) Release" -# Name "regex - Win32 (WCE emulator) Debug" -# Name "regex - Win32 (WCE x86) DLL Release" -# Name "regex - Win32 (WCE x86) DLL Debug" -# Name "regex - Win32 (WCE x86) Release" -# Name "regex - Win32 (WCE x86) Debug" -# Name "regex - Win32 (WCE SH4) DLL Release" -# Name "regex - Win32 (WCE SH4) DLL Debug" -# Name "regex - Win32 (WCE SH4) Release" -# Name "regex - Win32 (WCE SH4) Debug" -# Name "regex - Win32 (WCE SH3) DLL Release" -# Name "regex - Win32 (WCE SH3) DLL Debug" -# Name "regex - Win32 (WCE SH3) Release" -# Name "regex - Win32 (WCE SH3) Debug" -# Name "regex - Win32 (WCE MIPSIV_FP) DLL Release" -# Name "regex - Win32 (WCE MIPSIV_FP) DLL Debug" -# Name "regex - Win32 (WCE MIPSIV_FP) Release" -# Name "regex - Win32 (WCE MIPSIV_FP) Debug" -# Name "regex - Win32 (WCE MIPSIV) DLL Release" -# Name "regex - Win32 (WCE MIPSIV) DLL Debug" -# Name "regex - Win32 (WCE MIPSIV) Release" -# Name "regex - Win32 (WCE MIPSIV) Debug" -# Name "regex - Win32 (WCE MIPSII_FP) DLL Release" -# Name "regex - Win32 (WCE MIPSII_FP) DLL Debug" -# Name "regex - Win32 (WCE MIPSII_FP) Release" -# Name "regex - Win32 (WCE MIPSII_FP) Debug" -# Name "regex - Win32 (WCE MIPSII) DLL Release" -# Name "regex - Win32 (WCE MIPSII) DLL Debug" -# Name "regex - Win32 (WCE MIPSII) Release" -# Name "regex - Win32 (WCE MIPSII) Debug" -# Name "regex - Win32 (WCE MIPS16) DLL Release" -# Name "regex - Win32 (WCE MIPS16) DLL Debug" -# Name "regex - Win32 (WCE MIPS16) Release" -# Name "regex - Win32 (WCE MIPS16) Debug" -# Name "regex - Win32 (WCE ARMV4T) DLL Release" -# Name "regex - Win32 (WCE ARMV4T) DLL Debug" -# Name "regex - Win32 (WCE ARMV4T) Release" -# Name "regex - Win32 (WCE ARMV4T) Debug" -# Name "regex - Win32 (WCE ARMV4I) DLL Release" -# Name "regex - Win32 (WCE ARMV4I) DLL Debug" -# Name "regex - Win32 (WCE ARMV4I) Release" -# Name "regex - Win32 (WCE ARMV4I) Debug" -# Name "regex - Win32 (WCE ARMV4) DLL Release" -# Name "regex - Win32 (WCE ARMV4) DLL Debug" -# Name "regex - Win32 (WCE ARMV4) Release" -# Name "regex - Win32 (WCE ARMV4) Debug" -# Name "regex - Win32 (WCE ARM) DLL Release" -# Name "regex - Win32 (WCE ARM) DLL Debug" -# Name "regex - Win32 (WCE ARM) Release" -# Name "regex - Win32 (WCE ARM) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\include\wx\msw\wince\setup.h - -!IF "$(CFG)" == "regex - Win32 (WCE emulator) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_emulator_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_emulator_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_emulator_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE emulator) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_emulator_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_emulator_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_emulator_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE emulator) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_emulator_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_emulator_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_emulator_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE emulator) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_emulator_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_emulator_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_emulator_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_x86_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_x86_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_x86_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_x86_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_x86_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_x86_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_x86_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_x86_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_x86_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE x86) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_x86_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_x86_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_x86_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_sh4_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh4_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh4_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_sh4_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh4_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh4_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_sh4_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh4_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh4_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH4) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_sh4_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh4_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh4_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_sh3_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh3_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh3_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_sh3_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh3_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh3_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_sh3_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh3_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh3_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE SH3) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_sh3_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_sh3_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_sh3_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_fp_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_fp_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_fp_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_fp_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_fp_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_fp_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_fp_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_fp_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_fp_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV_FP) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_fp_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_fp_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_fp_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSIV) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsiv_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsiv_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsiv_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_fp_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_fp_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_fp_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_fp_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_fp_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_fp_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_fp_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_fp_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_fp_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII_FP) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_fp_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_fp_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_fp_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPSII) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mipsii_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mipsii_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mipsii_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mips16_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mips16_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mips16_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mips16_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mips16_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mips16_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_mips16_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mips16_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mips16_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE MIPS16) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_mips16_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_mips16_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_mips16_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4t_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4t_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4t_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4t_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4t_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4t_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4t_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4t_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4t_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4T) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4t_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4t_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4t_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4i_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4i_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4i_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4i_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4i_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4i_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4i_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4i_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4i_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4I) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4i_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4i_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4i_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARMV4) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_armv4_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_armv4_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_armv4_lib\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) DLL Release" - -# Begin Custom Build - Creating ..\..\lib\evc_arm_dll\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_arm_dll\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_arm_dll\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) DLL Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_arm_dll\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_arm_dll\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_arm_dll\winced\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) Release" - -# Begin Custom Build - Creating ..\..\lib\evc_arm_lib\wince\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_arm_lib\wince\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_arm_lib\wince\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 (WCE ARM) Debug" - -# Begin Custom Build - Creating ..\..\lib\evc_arm_lib\winced\wx\setup.h -InputPath=..\..\include\wx\msw\wince\setup.h - -"..\..\lib\evc_arm_lib\winced\wx\setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\evc_arm_lib\winced\wx\setup.h - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "MSW Headers" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\regerrs.h -# End Source File -# Begin Source File - -SOURCE=.\regex.h -# End Source File -# Begin Source File - -SOURCE=.\regguts.h -# End Source File -# End Group -# End Target -# End Project diff --git a/src/regex/regexec.c b/src/regex/regexec.c deleted file mode 100644 index 756cba131e..0000000000 --- a/src/regex/regexec.c +++ /dev/null @@ -1,1038 +0,0 @@ -/* - * re_*exec and friends - match REs - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - - - -/* lazy-DFA representation */ -struct arcp { /* "pointer" to an outarc */ - struct sset *ss; - color co; -}; - -struct sset { /* state set */ - unsigned *states; /* pointer to bitvector */ - unsigned hash; /* hash of bitvector */ -# define HASH(bv, nw) (((nw) == 1) ? *(bv) : hash(bv, nw)) -# define HIT(h,bv,ss,nw) ((ss)->hash == (h) && ((nw) == 1 || \ - memcmp(VS(bv), VS((ss)->states), (nw)*sizeof(unsigned)) == 0)) - int flags; -# define STARTER 01 /* the initial state set */ -# define POSTSTATE 02 /* includes the goal state */ -# define LOCKED 04 /* locked in cache */ -# define NOPROGRESS 010 /* zero-progress state set */ - struct arcp ins; /* chain of inarcs pointing here */ - chr *lastseen; /* last entered on arrival here */ - struct sset **outs; /* outarc vector indexed by color */ - struct arcp *inchain; /* chain-pointer vector for outarcs */ -}; - -struct dfa { - int nssets; /* size of cache */ - int nssused; /* how many entries occupied yet */ - int nstates; /* number of states */ - int ncolors; /* length of outarc and inchain vectors */ - int wordsper; /* length of state-set bitvectors */ - struct sset *ssets; /* state-set cache */ - unsigned *statesarea; /* bitvector storage */ - unsigned *work; /* pointer to work area within statesarea */ - struct sset **outsarea; /* outarc-vector storage */ - struct arcp *incarea; /* inchain storage */ - struct cnfa *cnfa; - struct colormap *cm; - chr *lastpost; /* location of last cache-flushed success */ - chr *lastnopr; /* location of last cache-flushed NOPROGRESS */ - struct sset *search; /* replacement-search-pointer memory */ - int cptsmalloced; /* were the areas individually malloced? */ - char *mallocarea; /* self, or master malloced area, or NULL */ -}; - -#define WORK 1 /* number of work bitvectors needed */ - -/* setup for non-malloc allocation for small cases */ -#define FEWSTATES 20 /* must be less than UBITS */ -#define FEWCOLORS 15 -struct smalldfa { - struct dfa dfa; - struct sset ssets[FEWSTATES*2]; - unsigned statesarea[FEWSTATES*2 + WORK]; - struct sset *outsarea[FEWSTATES*2 * FEWCOLORS]; - struct arcp incarea[FEWSTATES*2 * FEWCOLORS]; -}; -#define DOMALLOC ((struct smalldfa *)NULL) /* force malloc */ - - - -/* internal variables, bundled for easy passing around */ -struct vars { - regex_t *re; - struct guts *g; - int eflags; /* copies of arguments */ - size_t nmatch; - regmatch_t *pmatch; - rm_detail_t *details; - chr *start; /* start of string */ - chr *stop; /* just past end of string */ - int err; /* error code if any (0 none) */ - regoff_t *mem; /* memory vector for backtracking */ - struct smalldfa dfa1; - struct smalldfa dfa2; -}; -#define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ -#define ISERR() VISERR(v) -#define VERR(vv,e) (((vv)->err) ? (vv)->err : ((vv)->err = (e))) -#define ERR(e) (void)VERR(v, e) /* record an error */ -#define NOERR() {if (ISERR()) return v->err;} /* if error seen, return it */ -#define OFF(p) ((p) - v->start) -#define LOFF(p) ((long)OFF(p)) - - - -/* - * forward declarations - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regexec.c === */ -int exec _ANSI_ARGS_((regex_t *, CONST chr *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -static int find _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *)); -static int cfind _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *)); -static int cfindloop _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *, struct dfa *, struct dfa *, chr **)); -static VOID zapsubs _ANSI_ARGS_((regmatch_t *, size_t)); -static VOID zapmem _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID subset _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int dissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int condissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int altdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int cdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int ccondissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int crevdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int cbrdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int caltdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -/* === rege_dfa.c === */ -static chr *longest _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *, int *)); -static chr *shortest _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *, chr *, chr **, int *)); -static chr *lastcold _ANSI_ARGS_((struct vars *, struct dfa *)); -static struct dfa *newdfa _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *, struct smalldfa *)); -static VOID freedfa _ANSI_ARGS_((struct dfa *)); -static unsigned hash _ANSI_ARGS_((unsigned *, int)); -static struct sset *initialize _ANSI_ARGS_((struct vars *, struct dfa *, chr *)); -static struct sset *miss _ANSI_ARGS_((struct vars *, struct dfa *, struct sset *, pcolor, chr *, chr *)); -static int lacon _ANSI_ARGS_((struct vars *, struct cnfa *, chr *, pcolor)); -static struct sset *getvacant _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *)); -static struct sset *pickss _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* - - exec - match regular expression - ^ int exec(regex_t *, CONST chr *, size_t, rm_detail_t *, - ^ size_t, regmatch_t [], int); - */ -int -exec(re, string, len, details, nmatch, pmatch, flags) -regex_t *re; -CONST chr *string; -size_t len; -rm_detail_t *details; -size_t nmatch; -regmatch_t pmatch[]; -int flags; -{ - struct vars var; - register struct vars *v = &var; - int st; - size_t n; - int backref; -# define LOCALMAT 20 - regmatch_t mat[LOCALMAT]; -# define LOCALMEM 40 - regoff_t mem[LOCALMEM]; - - /* sanity checks */ - if (re == NULL || string == NULL || re->re_magic != REMAGIC) - return REG_INVARG; - if (re->re_csize != sizeof(chr)) - return REG_MIXED; - - /* setup */ - v->re = re; - v->g = (struct guts *)re->re_guts; - if ((v->g->cflags®_EXPECT) && details == NULL) - return REG_INVARG; - if (v->g->info®_UIMPOSSIBLE) - return REG_NOMATCH; - backref = (v->g->info®_UBACKREF) ? 1 : 0; - v->eflags = flags; - if (v->g->cflags®_NOSUB) - nmatch = 0; /* override client */ - v->nmatch = nmatch; - if (backref) { - /* need work area */ - if (v->g->nsub + 1 <= LOCALMAT) - v->pmatch = mat; - else - v->pmatch = (regmatch_t *)MALLOC((v->g->nsub + 1) * - sizeof(regmatch_t)); - if (v->pmatch == NULL) - return REG_ESPACE; - v->nmatch = v->g->nsub + 1; - } else - v->pmatch = pmatch; - v->details = details; - v->start = (chr *)string; - v->stop = (chr *)string + len; - v->err = 0; - if (backref) { - /* need retry memory */ - assert(v->g->ntree >= 0); - n = (size_t)v->g->ntree; - if (n <= LOCALMEM) - v->mem = mem; - else - v->mem = (regoff_t *)MALLOC(n*sizeof(regoff_t)); - if (v->mem == NULL) { - if (v->pmatch != pmatch && v->pmatch != mat) - FREE(v->pmatch); - return REG_ESPACE; - } - } else - v->mem = NULL; - - /* do it */ - assert(v->g->tree != NULL); - if (backref) - st = cfind(v, &v->g->tree->cnfa, &v->g->cmap); - else - st = find(v, &v->g->tree->cnfa, &v->g->cmap); - - /* copy (portion of) match vector over if necessary */ - if (st == REG_OKAY && v->pmatch != pmatch && nmatch > 0) { - zapsubs(pmatch, nmatch); - n = (nmatch < v->nmatch) ? nmatch : v->nmatch; - memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t)); - } - - /* clean up */ - if (v->pmatch != pmatch && v->pmatch != mat) - FREE(v->pmatch); - if (v->mem != NULL && v->mem != mem) - FREE(v->mem); - return st; -} - -/* - - find - find a match for the main NFA (no-complications case) - ^ static int find(struct vars *, struct cnfa *, struct colormap *); - */ -static int -find(v, cnfa, cm) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -{ - struct dfa *s; - struct dfa *d; - chr *begin; - chr *end = NULL; - chr *cold; - chr *open; /* open and close of range of possible starts */ - chr *close; - int hitend; - int shorter = (v->g->tree->flags&SHORTER) ? 1 : 0; - - /* first, a shot with the search RE */ - s = newdfa(v, &v->g->search, cm, &v->dfa1); - assert(!(ISERR() && s != NULL)); - NOERR(); - MDEBUG(("\nsearch at %ld\n", LOFF(v->start))); - cold = NULL; - close = shortest(v, s, v->start, v->start, v->stop, &cold, (int *)NULL); - freedfa(s); - NOERR(); - if (v->g->cflags®_EXPECT) { - assert(v->details != NULL); - if (cold != NULL) - v->details->rm_extend.rm_so = OFF(cold); - else - v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ - } - if (close == NULL) /* not found */ - return REG_NOMATCH; - if (v->nmatch == 0) /* found, don't need exact location */ - return REG_OKAY; - - /* find starting point and match */ - assert(cold != NULL); - open = cold; - cold = NULL; - MDEBUG(("between %ld and %ld\n", LOFF(open), LOFF(close))); - d = newdfa(v, cnfa, cm, &v->dfa1); - assert(!(ISERR() && d != NULL)); - NOERR(); - for (begin = open; begin <= close; begin++) { - MDEBUG(("\nfind trying at %ld\n", LOFF(begin))); - if (shorter) - end = shortest(v, d, begin, begin, v->stop, - (chr **)NULL, &hitend); - else - end = longest(v, d, begin, v->stop, &hitend); - NOERR(); - if (hitend && cold == NULL) - cold = begin; - if (end != NULL) - break; /* NOTE BREAK OUT */ - } - assert(end != NULL); /* search RE succeeded so loop should */ - freedfa(d); - - /* and pin down details */ - assert(v->nmatch > 0); - v->pmatch[0].rm_so = OFF(begin); - v->pmatch[0].rm_eo = OFF(end); - if (v->g->cflags®_EXPECT) { - if (cold != NULL) - v->details->rm_extend.rm_so = OFF(cold); - else - v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ - } - if (v->nmatch == 1) /* no need for submatches */ - return REG_OKAY; - - /* submatches */ - zapsubs(v->pmatch, v->nmatch); - return dissect(v, v->g->tree, begin, end); -} - -/* - - cfind - find a match for the main NFA (with complications) - ^ static int cfind(struct vars *, struct cnfa *, struct colormap *); - */ -static int -cfind(v, cnfa, cm) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -{ - struct dfa *s; - struct dfa *d; - chr *cold; - int ret; - - s = newdfa(v, &v->g->search, cm, &v->dfa1); - NOERR(); - d = newdfa(v, cnfa, cm, &v->dfa2); - if (ISERR()) { - assert(d == NULL); - freedfa(s); - return v->err; - } - cold = NULL;// WX: fix gcc warnings about cold being possibly uninitialized - ret = cfindloop(v, cnfa, cm, d, s, &cold); - - freedfa(d); - freedfa(s); - NOERR(); - if (v->g->cflags®_EXPECT) { - assert(v->details != NULL); - if (cold != NULL) - v->details->rm_extend.rm_so = OFF(cold); - else - v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ - } - return ret; -} - -/* - - cfindloop - the heart of cfind - ^ static int cfindloop(struct vars *, struct cnfa *, struct colormap *, - ^ struct dfa *, struct dfa *, chr **); - */ -static int -cfindloop(v, cnfa, cm, d, s, coldp) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -struct dfa *d; -struct dfa *s; -chr **coldp; /* where to put coldstart pointer */ -{ - chr *begin; - chr *end; - chr *cold; - chr *open; /* open and close of range of possible starts */ - chr *close; - chr *estart; - chr *estop; - int er; - int shorter = v->g->tree->flags&SHORTER; - int hitend; - - assert(d != NULL && s != NULL); - cold = NULL; - close = v->start; - do { - MDEBUG(("\ncsearch at %ld\n", LOFF(close))); - close = shortest(v, s, close, close, v->stop, &cold, (int *)NULL); - if (close == NULL) - break; /* NOTE BREAK */ - assert(cold != NULL); - open = cold; - cold = NULL; - MDEBUG(("cbetween %ld and %ld\n", LOFF(open), LOFF(close))); - for (begin = open; begin <= close; begin++) { - MDEBUG(("\ncfind trying at %ld\n", LOFF(begin))); - estart = begin; - estop = v->stop; - for (;;) { - if (shorter) - end = shortest(v, d, begin, estart, - estop, (chr **)NULL, &hitend); - else - end = longest(v, d, begin, estop, - &hitend); - if (hitend && cold == NULL) - cold = begin; - if (end == NULL) - break; /* NOTE BREAK OUT */ - MDEBUG(("tentative end %ld\n", LOFF(end))); - zapsubs(v->pmatch, v->nmatch); - zapmem(v, v->g->tree); - er = cdissect(v, v->g->tree, begin, end); - if (er == REG_OKAY) { - if (v->nmatch > 0) { - v->pmatch[0].rm_so = OFF(begin); - v->pmatch[0].rm_eo = OFF(end); - } - *coldp = cold; - return REG_OKAY; - } - if (er != REG_NOMATCH) { - ERR(er); - return er; - } - if ((shorter) ? end == estop : end == begin) { - /* no point in trying again */ - *coldp = cold; - return REG_NOMATCH; - } - /* go around and try again */ - if (shorter) - estart = end + 1; - else - estop = end - 1; - } - } - } while (close < v->stop); - - *coldp = cold; - return REG_NOMATCH; -} - -/* - - zapsubs - initialize the subexpression matches to "no match" - ^ static VOID zapsubs(regmatch_t *, size_t); - */ -static VOID -zapsubs(p, n) -regmatch_t *p; -size_t n; -{ - size_t i; - - for (i = n-1; i > 0; i--) { - p[i].rm_so = -1; - p[i].rm_eo = -1; - } -} - -/* - - zapmem - initialize the retry memory of a subtree to zeros - ^ static VOID zapmem(struct vars *, struct subre *); - */ -static VOID -zapmem(v, t) -struct vars *v; -struct subre *t; -{ - if (t == NULL) - return; - - assert(v->mem != NULL); - v->mem[t->retry] = 0; - if (t->op == '(') { - assert(t->subno > 0); - v->pmatch[t->subno].rm_so = -1; - v->pmatch[t->subno].rm_eo = -1; - } - - if (t->left != NULL) - zapmem(v, t->left); - if (t->right != NULL) - zapmem(v, t->right); -} - -/* - - subset - set any subexpression relevant to a successful subre - ^ static VOID subset(struct vars *, struct subre *, chr *, chr *); - */ -static VOID -subset(v, sub, begin, end) -struct vars *v; -struct subre *sub; -chr *begin; -chr *end; -{ - int n = sub->subno; - - assert(n > 0); - if ((size_t)n >= v->nmatch) - return; - - MDEBUG(("setting %d\n", n)); - v->pmatch[n].rm_so = OFF(begin); - v->pmatch[n].rm_eo = OFF(end); -} - -/* - - dissect - determine subexpression matches (uncomplicated case) - ^ static int dissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -dissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - assert(t != NULL); - MDEBUG(("dissect %ld-%ld\n", LOFF(begin), LOFF(end))); - - switch (t->op) { - case '=': /* terminal node */ - assert(t->left == NULL && t->right == NULL); - return REG_OKAY; /* no action, parent did the work */ - break; - case '|': /* alternation */ - assert(t->left != NULL); - return altdissect(v, t, begin, end); - break; - case 'b': /* back ref -- shouldn't be calling us! */ - return REG_ASSERT; - break; - case '.': /* concatenation */ - assert(t->left != NULL && t->right != NULL); - return condissect(v, t, begin, end); - break; - case '(': /* capturing */ - assert(t->left != NULL && t->right == NULL); - assert(t->subno > 0); - subset(v, t, begin, end); - return dissect(v, t->left, begin, end); - break; - default: - return REG_ASSERT; - break; - } -} - -/* - - condissect - determine concatenation subexpression matches (uncomplicated) - ^ static int condissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -condissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - struct dfa *d2; - chr *mid; - int i; - int shorter = (t->left->flags&SHORTER) ? 1 : 0; - chr *stop = (shorter) ? end : begin; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &v->dfa1); - NOERR(); - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, &v->dfa2); - if (ISERR()) { - assert(d2 == NULL); - freedfa(d); - return v->err; - } - - /* pick a tentative midpoint */ - if (shorter) - mid = shortest(v, d, begin, begin, end, (chr **)NULL, - (int *)NULL); - else - mid = longest(v, d, begin, end, (int *)NULL); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - - /* iterate until satisfaction or failure */ - while (longest(v, d2, mid, end, (int *)NULL) != end) { - /* that midpoint didn't work, find a new one */ - if (mid == stop) { - /* all possibilities exhausted! */ - MDEBUG(("no midpoint!\n")); - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - if (shorter) - mid = shortest(v, d, begin, mid+1, end, (chr **)NULL, - (int *)NULL); - else - mid = longest(v, d, begin, mid-1, (int *)NULL); - if (mid == NULL) { - /* failed to find a new one! */ - MDEBUG(("failed midpoint!\n")); - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - MDEBUG(("new midpoint %ld\n", LOFF(mid))); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - i = dissect(v, t->left, begin, mid); - if (i != REG_OKAY) - return i; - return dissect(v, t->right, mid, end); -} - -/* - - altdissect - determine alternative subexpression matches (uncomplicated) - ^ static int altdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -altdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - int i; - - assert(t != NULL); - assert(t->op == '|'); - - for (i = 0; t != NULL; t = t->right, i++) { - MDEBUG(("trying %dth\n", i)); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &v->dfa1); - if (ISERR()) - return v->err; - if (longest(v, d, begin, end, (int *)NULL) == end) { - MDEBUG(("success\n")); - freedfa(d); - return dissect(v, t->left, begin, end); - } - freedfa(d); - } - return REG_ASSERT; /* none of them matched?!? */ -} - -/* - - cdissect - determine subexpression matches (with complications) - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int cdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -cdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - int er; - - assert(t != NULL); - MDEBUG(("cdissect %ld-%ld %c\n", LOFF(begin), LOFF(end), t->op)); - - switch (t->op) { - case '=': /* terminal node */ - assert(t->left == NULL && t->right == NULL); - return REG_OKAY; /* no action, parent did the work */ - break; - case '|': /* alternation */ - assert(t->left != NULL); - return caltdissect(v, t, begin, end); - break; - case 'b': /* back ref -- shouldn't be calling us! */ - assert(t->left == NULL && t->right == NULL); - return cbrdissect(v, t, begin, end); - break; - case '.': /* concatenation */ - assert(t->left != NULL && t->right != NULL); - return ccondissect(v, t, begin, end); - break; - case '(': /* capturing */ - assert(t->left != NULL && t->right == NULL); - assert(t->subno > 0); - er = cdissect(v, t->left, begin, end); - if (er == REG_OKAY) - subset(v, t, begin, end); - return er; - break; - default: - return REG_ASSERT; - break; - } -} - -/* - - ccondissect - concatenation subexpression matches (with complications) - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int ccondissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -ccondissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - struct dfa *d2; - chr *mid; - int er; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - - if (t->left->flags&SHORTER) /* reverse scan */ - return crevdissect(v, t, begin, end); - - d = newdfa(v, &t->left->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) - return v->err; - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) { - freedfa(d); - return v->err; - } - MDEBUG(("cconcat %d\n", t->retry)); - - /* pick a tentative midpoint */ - if (v->mem[t->retry] == 0) { - mid = longest(v, d, begin, end, (int *)NULL); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - } else { - mid = begin + (v->mem[t->retry] - 1); - MDEBUG(("working midpoint %ld\n", LOFF(mid))); - } - - /* iterate until satisfaction or failure */ - for (;;) { - /* try this midpoint on for size */ - er = cdissect(v, t->left, begin, mid); - if (er == REG_OKAY && - longest(v, d2, mid, end, (int *)NULL) == end && - (er = cdissect(v, t->right, mid, end)) == - REG_OKAY) - break; /* NOTE BREAK OUT */ - if (er != REG_OKAY && er != REG_NOMATCH) { - freedfa(d); - freedfa(d2); - return er; - } - - /* that midpoint didn't work, find a new one */ - if (mid == begin) { - /* all possibilities exhausted */ - MDEBUG(("%d no midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - mid = longest(v, d, begin, mid-1, (int *)NULL); - if (mid == NULL) { - /* failed to find a new one */ - MDEBUG(("%d failed midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("%d: new midpoint %ld\n", t->retry, LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - zapmem(v, t->left); - zapmem(v, t->right); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - return REG_OKAY; -} - -/* - - crevdissect - determine backref shortest-first subexpression matches - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int crevdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -crevdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - struct dfa *d2; - chr *mid; - int er; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - assert(t->left->flags&SHORTER); - - /* concatenation -- need to split the substring between parts */ - d = newdfa(v, &t->left->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) - return v->err; - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) { - freedfa(d); - return v->err; - } - MDEBUG(("crev %d\n", t->retry)); - - /* pick a tentative midpoint */ - if (v->mem[t->retry] == 0) { - mid = shortest(v, d, begin, begin, end, (chr **)NULL, (int *)NULL); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - } else { - mid = begin + (v->mem[t->retry] - 1); - MDEBUG(("working midpoint %ld\n", LOFF(mid))); - } - - /* iterate until satisfaction or failure */ - for (;;) { - /* try this midpoint on for size */ - er = cdissect(v, t->left, begin, mid); - if (er == REG_OKAY && - longest(v, d2, mid, end, (int *)NULL) == end && - (er = cdissect(v, t->right, mid, end)) == - REG_OKAY) - break; /* NOTE BREAK OUT */ - if (er != REG_OKAY && er != REG_NOMATCH) { - freedfa(d); - freedfa(d2); - return er; - } - - /* that midpoint didn't work, find a new one */ - if (mid == end) { - /* all possibilities exhausted */ - MDEBUG(("%d no midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - mid = shortest(v, d, begin, mid+1, end, (chr **)NULL, (int *)NULL); - if (mid == NULL) { - /* failed to find a new one */ - MDEBUG(("%d failed midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("%d: new midpoint %ld\n", t->retry, LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - zapmem(v, t->left); - zapmem(v, t->right); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - return REG_OKAY; -} - -/* - - cbrdissect - determine backref subexpression matches - ^ static int cbrdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -cbrdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - int i; - int n = t->subno; - size_t len; - chr *paren; - chr *p; - chr *stop; - int min = t->min; - int max = t->max; - - assert(t != NULL); - assert(t->op == 'b'); - assert(n >= 0); - assert((size_t)n < v->nmatch); - - MDEBUG(("cbackref n%d %d{%d-%d}\n", t->retry, n, min, max)); - - if (v->pmatch[n].rm_so == -1) - return REG_NOMATCH; - paren = v->start + v->pmatch[n].rm_so; - len = v->pmatch[n].rm_eo - v->pmatch[n].rm_so; - - /* no room to maneuver -- retries are pointless */ - if (v->mem[t->retry]) - return REG_NOMATCH; - v->mem[t->retry] = 1; - - /* special-case zero-length string */ - if (len == 0) { - if (begin == end) - return REG_OKAY; - return REG_NOMATCH; - } - - /* and too-short string */ - assert(end >= begin); - if ((size_t)(end - begin) < len) - return REG_NOMATCH; - stop = end - len; - - /* count occurrences */ - i = 0; - for (p = begin; p <= stop && (i < max || max == INFINITY); p += len) { - if ((*v->g->compare)(paren, p, len) != 0) - break; - i++; - } - MDEBUG(("cbackref found %d\n", i)); - - /* and sort it out */ - if (p != end) /* didn't consume all of it */ - return REG_NOMATCH; - if (min <= i && (i <= max || max == INFINITY)) - return REG_OKAY; - return REG_NOMATCH; /* out of range */ -} - -/* - - caltdissect - determine alternative subexpression matches (w. complications) - ^ static int caltdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -caltdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - int er; -# define UNTRIED 0 /* not yet tried at all */ -# define TRYING 1 /* top matched, trying submatches */ -# define TRIED 2 /* top didn't match or submatches exhausted */ - - if (t == NULL) - return REG_NOMATCH; - assert(t->op == '|'); - if (v->mem[t->retry] == TRIED) - return caltdissect(v, t->right, begin, end); - - MDEBUG(("calt n%d\n", t->retry)); - assert(t->left != NULL); - - if (v->mem[t->retry] == UNTRIED) { - d = newdfa(v, &t->left->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) - return v->err; - if (longest(v, d, begin, end, (int *)NULL) != end) { - freedfa(d); - v->mem[t->retry] = TRIED; - return caltdissect(v, t->right, begin, end); - } - freedfa(d); - MDEBUG(("calt matched\n")); - v->mem[t->retry] = TRYING; - } - - er = cdissect(v, t->left, begin, end); - if (er != REG_NOMATCH) - return er; - - v->mem[t->retry] = TRIED; - return caltdissect(v, t->right, begin, end); -} - - - -#include "rege_dfa.c" diff --git a/src/regex/regfree.c b/src/regex/regfree.c deleted file mode 100644 index d4590075a4..0000000000 --- a/src/regex/regfree.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * regfree - free an RE - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * You might think that this could be incorporated into regcomp.c, and - * that would be a reasonable idea... except that this is a generic - * function (with a generic name), applicable to all compiled REs - * regardless of the size of their characters, whereas the stuff in - * regcomp.c gets compiled once per character size. - */ - -#include "regguts.h" - -/* - - regfree - free an RE (generic function, punts to RE-specific function) - * - * Ignoring invocation with NULL is a convenience. - */ -VOID -wx_regfree(re) -regex_t *re; -{ - if (re == NULL) - return; - (*((struct fns *)re->re_fns)->free)(re); -} diff --git a/src/regex/regfronts.c b/src/regex/regfronts.c deleted file mode 100644 index 82f48e2abc..0000000000 --- a/src/regex/regfronts.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * regcomp and regexec - front ends to re_ routines - * - * Mostly for implementation of backward-compatibility kludges. Note - * that these routines exist ONLY in char versions. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - -/* - - regcomp - compile regular expression - */ -int -regcomp(re, str, flags) -regex_t *re; -CONST char *str; -int flags; -{ - size_t len; - int f = flags; - - if (f®_PEND) { - len = re->re_endp - str; - f &= ~REG_PEND; - } else - len = strlen(str); - - return re_comp(re, str, len, f); -} - -/* - - regexec - execute regular expression - */ -int -regexec(re, str, nmatch, pmatch, flags) -regex_t *re; -CONST char *str; -size_t nmatch; -regmatch_t pmatch[]; -int flags; -{ - CONST char *start; - size_t len; - int f = flags; - - if (f®_STARTEND) { - start = str + pmatch[0].rm_so; - len = pmatch[0].rm_eo - pmatch[0].rm_so; - f &= ~REG_STARTEND; - } else { - start = str; - len = strlen(str); - } - - return re_exec(re, start, len, nmatch, pmatch, f); -} diff --git a/src/regex/regguts.h b/src/regex/regguts.h deleted file mode 100644 index ec1b8aa221..0000000000 --- a/src/regex/regguts.h +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Internal interface definitions, etc., for the reg package - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - - -/* - * Environmental customization. It should not (I hope) be necessary to - * alter the file you are now reading -- regcustom.h should handle it all, - * given care here and elsewhere. - */ -#include "regcustom.h" - -/* - * Things that regcustom.h might override. - */ - -/* standard header files (NULL is a reasonable indicator for them) */ -#ifndef NULL -#include -#include -#include -#include -#include -#endif - -/* assertions */ -#ifndef assert -# ifndef REG_DEBUG -# ifndef NDEBUG -# define NDEBUG /* no assertions */ -# endif -# endif -#include -#endif - -/* voids */ -#ifndef VOID -#define VOID void /* for function return values */ -#endif -#ifndef DISCARD -#define DISCARD VOID /* for throwing values away */ -#endif -#ifndef PVOID -#define PVOID VOID * /* generic pointer */ -#endif -#ifndef VS -#define VS(x) ((PVOID)(x)) /* cast something to generic ptr */ -#endif -#ifndef NOPARMS -#define NOPARMS VOID /* for empty parm lists */ -#endif - -/* const */ -#ifndef CONST -#define CONST const /* for old compilers, might be empty */ -#endif - -/* function-pointer declarator */ -#ifndef FUNCPTR -#if __STDC__ >= 1 -#define FUNCPTR(name, args) (*name)args -#else -#define FUNCPTR(name, args) (*name)() -#endif -#endif - -/* memory allocation */ -#ifndef MALLOC -#define MALLOC(n) malloc(n) -#endif -#ifndef REALLOC -#define REALLOC(p, n) realloc(VS(p), n) -#endif -#ifndef FREE -#define FREE(p) free(VS(p)) -#endif - -/* want size of a char in bits, and max value in bounded quantifiers */ -#ifndef CHAR_BIT -#include -#endif -#ifndef _POSIX2_RE_DUP_MAX -#define _POSIX2_RE_DUP_MAX 255 /* normally from */ -#endif - - - -/* - * misc - */ - -#define NOTREACHED 0 -#define xxx 1 - -#define DUPMAX _POSIX2_RE_DUP_MAX -#define INFINITY (DUPMAX+1) - -#define REMAGIC 0xfed7 /* magic number for main struct */ - - - -/* - * debugging facilities - */ -#ifdef REG_DEBUG -/* FDEBUG does finite-state tracing */ -#define FDEBUG(arglist) { if (v->eflags®_FTRACE) printf arglist; } -/* MDEBUG does higher-level tracing */ -#define MDEBUG(arglist) { if (v->eflags®_MTRACE) printf arglist; } -#else -#define FDEBUG(arglist) {} -#define MDEBUG(arglist) {} -#endif - - - -/* - * bitmap manipulation - */ -#define UBITS (CHAR_BIT * sizeof(unsigned)) -#define BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS)) -#define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS))) - - - -/* - * We dissect a chr into byts for colormap table indexing. Here we define - * a byt, which will be the same as a byte on most machines... The exact - * size of a byt is not critical, but about 8 bits is good, and extraction - * of 8-bit chunks is sometimes especially fast. - */ -#ifndef BYTBITS -#define BYTBITS 8 /* bits in a byt */ -#endif -#define BYTTAB (1<flags&FREECOL) - union tree *block; /* block of solid color, if any */ -}; - -/* the color map itself */ -struct colormap { - int magic; -# define CMMAGIC 0x876 - struct vars *v; /* for compile error reporting */ - size_t ncds; /* number of colordescs */ - size_t max; /* highest in use */ - color free; /* beginning of free chain (if non-0) */ - struct colordesc *cd; -# define CDEND(cm) (&(cm)->cd[(cm)->max + 1]) -# define NINLINECDS ((size_t)10) - struct colordesc cdspace[NINLINECDS]; - union tree tree[NBYTS]; /* tree top, plus fill blocks */ -}; - -/* optimization magic to do fast chr->color mapping */ -#define B0(c) ((c) & BYTMASK) -#define B1(c) (((c)>>BYTBITS) & BYTMASK) -#define B2(c) (((c)>>(2*BYTBITS)) & BYTMASK) -#define B3(c) (((c)>>(3*BYTBITS)) & BYTMASK) -#if NBYTS == 1 -#define GETCOLOR(cm, c) ((cm)->tree->tcolor[B0(c)]) -#endif -/* beware, for NBYTS>1, GETCOLOR() is unsafe -- 2nd arg used repeatedly */ -#if NBYTS == 2 -#define GETCOLOR(cm, c) ((cm)->tree->tptr[B1(c)]->tcolor[B0(c)]) -#endif -#if NBYTS == 4 -#define GETCOLOR(cm, c) ((cm)->tree->tptr[B3(c)]->tptr[B2(c)]->tptr[B1(c)]->tcolor[B0(c)]) -#endif - - - -/* - * Interface definitions for locale-interface functions in locale.c. - * Multi-character collating elements (MCCEs) cause most of the trouble. - */ -struct cvec { - int nchrs; /* number of chrs */ - int chrspace; /* number of chrs possible */ - chr *chrs; /* pointer to vector of chrs */ - int nranges; /* number of ranges (chr pairs) */ - int rangespace; /* number of chrs possible */ - chr *ranges; /* pointer to vector of chr pairs */ - int nmcces; /* number of MCCEs */ - int mccespace; /* number of MCCEs possible */ - int nmccechrs; /* number of chrs used for MCCEs */ - chr *mcces[1]; /* pointers to 0-terminated MCCEs */ - /* and both batches of chrs are on the end */ -}; - -/* caution: this value cannot be changed easily */ -#define MAXMCCE 2 /* length of longest MCCE */ - - - -/* - * definitions for NFA internal representation - * - * Having a "from" pointer within each arc may seem redundant, but it - * saves a lot of hassle. - */ -struct state; - -struct arc { - int type; -# define ARCFREE '\0' - color co; - struct state *from; /* where it's from (and contained within) */ - struct state *to; /* where it's to */ - struct arc *outchain; /* *from's outs chain or free chain */ -# define freechain outchain - struct arc *inchain; /* *to's ins chain */ - struct arc *colorchain; /* color's arc chain */ -}; - -struct arcbatch { /* for bulk allocation of arcs */ - struct arcbatch *next; -# define ABSIZE 10 - struct arc a[ABSIZE]; -}; - -struct state { - int no; -# define FREESTATE (-1) - char flag; /* marks special states */ - int nins; /* number of inarcs */ - struct arc *ins; /* chain of inarcs */ - int nouts; /* number of outarcs */ - struct arc *outs; /* chain of outarcs */ - struct arc *free; /* chain of free arcs */ - struct state *tmp; /* temporary for traversal algorithms */ - struct state *next; /* chain for traversing all */ - struct state *prev; /* back chain */ - struct arcbatch oas; /* first arcbatch, avoid malloc in easy case */ - int noas; /* number of arcs used in first arcbatch */ -}; - -struct nfa { - struct state *pre; /* pre-initial state */ - struct state *init; /* initial state */ - struct state *final; /* final state */ - struct state *post; /* post-final state */ - int nstates; /* for numbering states */ - struct state *states; /* state-chain header */ - struct state *slast; /* tail of the chain */ - struct state *free; /* free list */ - struct colormap *cm; /* the color map */ - color bos[2]; /* colors, if any, assigned to BOS and BOL */ - color eos[2]; /* colors, if any, assigned to EOS and EOL */ - struct vars *v; /* simplifies compile error reporting */ - struct nfa *parent; /* parent NFA, if any */ -}; - - - -/* - * definitions for compacted NFA - */ -struct carc { - color co; /* COLORLESS is list terminator */ - int to; /* state number */ -}; - -struct cnfa { - int nstates; /* number of states */ - int ncolors; /* number of colors */ - int flags; -# define HASLACONS 01 /* uses lookahead constraints */ - int pre; /* setup state number */ - int post; /* teardown state number */ - color bos[2]; /* colors, if any, assigned to BOS and BOL */ - color eos[2]; /* colors, if any, assigned to EOS and EOL */ - struct carc **states; /* vector of pointers to outarc lists */ - struct carc *arcs; /* the area for the lists */ -}; -#define ZAPCNFA(cnfa) ((cnfa).nstates = 0) -#define NULLCNFA(cnfa) ((cnfa).nstates == 0) - - - -/* - * subexpression tree - */ -struct subre { - char op; /* '|', '.' (concat), 'b' (backref), '(', '=' */ - char flags; -# define LONGER 01 /* prefers longer match */ -# define SHORTER 02 /* prefers shorter match */ -# define MIXED 04 /* mixed preference below */ -# define CAP 010 /* capturing parens below */ -# define BACKR 020 /* back reference below */ -# define INUSE 0100 /* in use in final tree */ -# define LOCAL 03 /* bits which may not propagate up */ -# define LMIX(f) ((f)<<2) /* LONGER -> MIXED */ -# define SMIX(f) ((f)<<1) /* SHORTER -> MIXED */ -# define UP(f) (((f)&~LOCAL) | (LMIX(f) & SMIX(f) & MIXED)) -# define MESSY(f) ((f)&(MIXED|CAP|BACKR)) -# define PREF(f) ((f)&LOCAL) -# define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2)) -# define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2)) - short retry; /* index into retry memory */ - int subno; /* subexpression number (for 'b' and '(') */ - short min; /* min repetitions, for backref only */ - short max; /* max repetitions, for backref only */ - struct subre *left; /* left child, if any (also freelist chain) */ - struct subre *right; /* right child, if any */ - struct state *begin; /* outarcs from here... */ - struct state *end; /* ...ending in inarcs here */ - struct cnfa cnfa; /* compacted NFA, if any */ - struct subre *chain; /* for bookkeeping and error cleanup */ -}; - - - -/* - * table of function pointers for generic manipulation functions - * A regex_t's re_fns points to one of these. - */ -struct fns { - VOID FUNCPTR(free, (regex_t *)); -}; - - - -/* - * the insides of a regex_t, hidden behind a void * - */ -struct guts { - int magic; -# define GUTSMAGIC 0xfed9 - int cflags; /* copy of compile flags */ - long info; /* copy of re_info */ - size_t nsub; /* copy of re_nsub */ - struct subre *tree; - struct cnfa search; /* for fast preliminary search */ - int ntree; - struct colormap cmap; - int FUNCPTR(compare, (CONST chr *, CONST chr *, size_t)); - struct subre *lacons; /* lookahead-constraint vector */ - int nlacons; /* size of lacons */ -}; diff --git a/src/regex/splice.sh b/src/regex/splice.sh deleted file mode 100755 index 88e776c850..0000000000 --- a/src/regex/splice.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -############################################################################# -# Name: splice -# Purpose: Splice a marked section of regcustom.h into regex.h -# Author: Mike Wetherell -# Copyright: (c) 2004 Mike Wetherell -# Licence: wxWindows licence -############################################################################# - -# -# Works by greping for the marks then passing their line numbers to sed. Which -# is slighly the long way round, but allows some error checking. -# - -SRC=regcustom.h -DST=regex.h -MARK1='^/\* --- begin --- \*/$' -MARK2='^/\* --- end --- \*/$' -PROG=`basename $0` -TMP=$DST.tmp - -# findline(pattern, file) -# Prints the line number of the 1st line matching the pattern in the file -# -findline() { - if ! LINE=`grep -n -- "$1" "$2"`; then - echo "$PROG: marker '$1' not found in '$2'" >&2 - return 1 - fi - echo $LINE | sed -n '1s/[^0-9].*//p' # take just the line number -} - -# findmarkers([out] line1, [out] line2, pattern1, pattern2, file) -# Returns (via the variables named in the 1st two parameters) the line -# numbers of the lines matching the patterns in file. Checks pattern1 comes -# before pattern2. -# -findmarkers() { - if ! LINE1=`findline "$3" "$5"` || ! LINE2=`findline "$4" "$5"`; then - return 1 - fi - if [ $LINE1 -ge $LINE2 ]; then - echo "$PROG: marker '$3' not before '$4' in '$5'" >&2 - return 1 - fi - eval $1=$LINE1 - eval $2=$LINE2 -} - -# find markers -# -if findmarkers SRCLINE1 SRCLINE2 "$MARK1" "$MARK2" $SRC && - findmarkers DSTLINE1 DSTLINE2 "$MARK1" "$MARK2" $DST -then - # do splice - # - if (sed $DSTLINE1,\$d $DST && - sed -n $SRCLINE1,${SRCLINE2}p $SRC && - sed 1,${DSTLINE2}d $DST) > $TMP - then - mv $TMP $DST - exit 0 - else - rm $TMP - fi -fi - -exit 1 diff --git a/src/regex/tclUniData.c b/src/regex/tclUniData.c deleted file mode 100644 index b5525dce9e..0000000000 --- a/src/regex/tclUniData.c +++ /dev/null @@ -1,903 +0,0 @@ -/* - * tclUniData.c -- - * - * Declarations of Unicode character information tables. This file is - * automatically generated by the tools/uniParse.tcl script. Do not - * modify this file by hand. - * - * Copyright (c) 1998 by Scriptics Corporation. - * All rights reserved. - * - */ - -/* - * A 16-bit Unicode character is split into two parts in order to index - * into the following tables. The lower OFFSET_BITS comprise an offset - * into a page of characters. The upper bits comprise the page number. - */ - -#define OFFSET_BITS 5 - -/* - * The pageMap is indexed by page number and returns an alternate page number - * that identifies a unique page of characters. Many Unicode characters map - * to the same alternate page number. - */ - -static unsigned char pageMap[] = { - 0, 1, 2, 3, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 7, 15, 16, 17, - 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 7, 32, - 7, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 47, - 48, 49, 50, 51, 52, 35, 47, 53, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 58, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 80, 81, - 84, 85, 80, 86, 87, 88, 89, 90, 91, 92, 35, 93, 94, 95, 35, 96, 97, - 98, 99, 100, 101, 102, 35, 47, 103, 104, 35, 35, 105, 106, 107, 47, - 47, 108, 47, 47, 109, 47, 110, 111, 47, 112, 47, 113, 114, 115, 116, - 114, 47, 117, 118, 35, 47, 47, 119, 90, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 120, 121, 47, 47, 122, - 35, 35, 35, 35, 47, 123, 124, 125, 126, 47, 127, 128, 47, 129, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 7, 7, 7, 7, 130, 7, 7, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 156, 156, 156, 156, 156, 156, - 157, 158, 159, 160, 161, 162, 35, 35, 35, 160, 163, 164, 165, 166, - 167, 168, 169, 160, 160, 160, 160, 170, 171, 172, 173, 174, 160, 160, - 175, 35, 35, 35, 35, 176, 177, 178, 179, 180, 181, 35, 35, 160, 160, - 160, 160, 160, 160, 160, 160, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 182, 160, 160, 155, 160, 160, 160, 160, 160, 160, 170, 183, 184, 185, - 90, 47, 186, 90, 47, 187, 188, 189, 47, 47, 190, 128, 35, 35, 191, - 192, 193, 194, 192, 195, 196, 197, 160, 160, 160, 198, 160, 160, 199, - 197, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 200, 35, 35, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 201, 35, 35, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 202, 203, 204, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 205, 35, 35, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 47, 47, 47, 47, 47, 47, 47, 47, 47, 208, 35, 35, 35, 35, - 35, 35, 209, 210, 211, 47, 47, 212, 213, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 214, 215, 47, 216, 47, 217, 218, 35, 219, 220, 221, 47, - 47, 47, 222, 223, 2, 224, 225, 226, 227, 228, 229, 230, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 231, 35, 232, 233, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 208, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 47, 234, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 235, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 236, 207, 207, 207, 207, 207, 207, 207, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35 -}; - -/* - * The groupMap is indexed by combining the alternate page number with - * the page offset and returns a group number that identifies a unique - * set of character attributes. - */ - -static unsigned char groupMap[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 3, 3, 3, 5, 6, 3, 7, 3, 8, - 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 7, 7, 7, 3, 3, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 5, 3, 6, 11, 12, 11, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 5, 7, 6, 7, 1, 2, 3, 4, 4, 4, 4, 14, 14, 11, 14, 15, 16, - 7, 8, 14, 11, 14, 7, 17, 17, 11, 18, 14, 3, 11, 17, 15, 19, 17, 17, - 17, 3, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 7, 10, 10, 10, 10, 10, 10, 10, 15, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 7, 13, 13, 13, 13, 13, 13, 13, 20, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 23, 24, 21, 22, 21, - 22, 21, 22, 15, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 15, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 25, - 21, 22, 21, 22, 21, 22, 26, 15, 27, 21, 22, 21, 22, 28, 21, 22, 29, - 29, 21, 22, 15, 30, 31, 32, 21, 22, 29, 33, 34, 35, 36, 21, 22, 15, - 15, 35, 37, 15, 38, 21, 22, 21, 22, 21, 22, 39, 21, 22, 39, 15, 15, - 21, 22, 39, 21, 22, 40, 40, 21, 22, 21, 22, 41, 21, 22, 15, 42, 21, - 22, 15, 43, 42, 42, 42, 42, 44, 45, 46, 44, 45, 46, 44, 45, 46, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 47, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 15, 44, 45, 46, 21, 22, 48, 49, 21, 22, 21, 22, 21, 22, 21, 22, 0, - 0, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 50, 51, 15, 52, 52, 15, 53, 15, - 54, 15, 15, 15, 15, 52, 15, 15, 55, 15, 15, 15, 15, 56, 57, 15, 15, - 15, 15, 15, 57, 15, 15, 58, 15, 15, 59, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 60, 15, 15, 60, 15, 15, 15, 15, 60, 15, 61, 61, 15, 15, - 15, 15, 15, 15, 62, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 11, 11, 63, 63, 63, 63, 63, 63, 63, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 63, 63, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 63, 63, 63, 63, - 63, 11, 11, 11, 11, 11, 11, 11, 11, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, - 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, - 0, 0, 0, 0, 63, 0, 0, 0, 3, 0, 0, 0, 0, 0, 11, 11, 66, 3, 67, 67, 67, - 0, 68, 0, 69, 69, 15, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 70, 71, - 71, 71, 15, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 72, 13, 13, 13, 13, 13, 13, 13, 13, 13, 73, 74, 74, 0, - 75, 76, 77, 77, 77, 78, 79, 15, 0, 0, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 80, 81, 47, - 15, 82, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 21, 22, 14, 64, 64, 64, 64, 0, 85, 85, 0, 0, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 77, 21, 22, 21, 22, 0, 0, 21, 22, 0, 0, 21, 22, 0, 0, 0, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 0, 0, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 0, 0, 63, 3, 3, 3, 3, 3, 3, 0, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 15, 0, 3, 8, 0, 0, - 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 64, 64, 64, 3, 64, 3, 64, - 64, 3, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 0, 0, 0, 0, 42, 42, 42, 3, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 0, 0, 0, 0, 63, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 0, 0, 64, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 3, 42, 64, - 64, 64, 64, 64, 64, 64, 85, 85, 64, 64, 64, 64, 64, 64, 63, 63, 64, - 64, 14, 64, 64, 64, 64, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 42, 42, - 42, 14, 14, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 88, 42, - 64, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, - 64, 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 0, 0, 64, 42, 89, 89, 89, 64, 64, 64, 64, 64, 64, - 64, 64, 89, 89, 89, 89, 64, 0, 0, 42, 64, 64, 64, 64, 0, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 64, 64, 3, 3, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, - 89, 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 0, 42, 0, 0, 0, 42, - 42, 42, 42, 0, 0, 64, 0, 89, 89, 89, 64, 64, 64, 64, 0, 0, 89, 89, - 0, 0, 89, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 42, 42, - 0, 42, 42, 42, 64, 64, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 42, 42, - 4, 4, 17, 17, 17, 17, 17, 17, 14, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 42, - 42, 42, 42, 42, 42, 0, 0, 0, 0, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, - 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 0, 42, 42, 0, 42, 42, 0, 0, - 64, 0, 89, 89, 89, 64, 64, 0, 0, 0, 0, 64, 64, 0, 0, 64, 64, 64, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 0, 42, 0, 0, 0, 0, 0, - 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 64, 64, 42, 42, 42, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 89, 0, 42, 42, 42, 42, 42, 42, 42, - 0, 42, 0, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, - 42, 42, 0, 42, 42, 0, 42, 42, 42, 42, 42, 0, 0, 64, 42, 89, 89, 89, - 64, 64, 64, 64, 64, 0, 64, 64, 89, 0, 89, 89, 64, 0, 0, 42, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 0, 42, - 42, 0, 0, 42, 42, 42, 42, 0, 0, 64, 42, 89, 64, 89, 64, 64, 64, 0, - 0, 0, 89, 89, 0, 0, 89, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, 0, - 0, 0, 0, 42, 42, 0, 42, 42, 42, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, - 0, 42, 42, 42, 42, 42, 42, 0, 0, 0, 42, 42, 42, 0, 42, 42, 42, 42, - 0, 0, 0, 42, 42, 0, 42, 0, 42, 42, 0, 0, 0, 42, 42, 0, 0, 0, 42, 42, - 42, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 0, 0, 0, - 0, 89, 89, 64, 89, 89, 0, 0, 0, 89, 89, 89, 0, 89, 89, 89, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 89, 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, - 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 42, 42, 42, 42, 0, 0, 0, 0, 64, 64, 64, 89, 89, - 89, 89, 0, 64, 64, 64, 0, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 64, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 0, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, - 42, 42, 0, 0, 0, 0, 89, 64, 89, 89, 89, 89, 89, 0, 64, 89, 89, 0, 89, - 89, 64, 64, 0, 0, 0, 0, 0, 0, 0, 89, 89, 0, 0, 0, 0, 0, 0, 0, 42, 0, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 89, 89, 89, 64, 64, - 64, 0, 0, 89, 89, 89, 0, 89, 89, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 89, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 0, 0, - 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 64, 0, 0, 0, 0, 89, 89, 89, 64, - 64, 64, 0, 64, 0, 89, 89, 89, 89, 89, 89, 89, 89, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 89, 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 64, 42, 42, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 4, 42, 42, - 42, 42, 42, 42, 63, 64, 64, 64, 64, 64, 64, 64, 64, 3, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 3, 3, 0, 0, 0, 0, 0, 42, 42, 0, 42, 0, 0, 42, 42, - 0, 42, 0, 0, 42, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 0, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 42, 42, 0, 42, 0, 42, 0, 0, 42, 42, 0, 42, 42, 42, - 42, 64, 42, 42, 64, 64, 64, 64, 64, 64, 0, 64, 64, 42, 0, 0, 42, 42, - 42, 42, 42, 0, 63, 0, 64, 64, 64, 64, 64, 64, 0, 0, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 0, 0, 42, 42, 0, 0, 42, 14, 14, 14, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 14, 14, 14, 14, 14, 64, 64, 14, 14, 14, - 14, 14, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 14, 64, 14, 64, 14, 64, 5, 6, 5, 6, 89, 89, 42, 42, 42, - 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 89, 64, 64, 64, 64, 64, 3, 64, 64, 42, - 42, 42, 42, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 0, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 0, 14, 14, 14, 14, 14, 14, 14, 14, 64, 14, 14, 14, 14, 14, 14, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 0, 42, - 42, 42, 42, 42, 0, 42, 42, 0, 89, 64, 64, 64, 64, 89, 64, 0, 0, 0, - 64, 64, 89, 64, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, - 3, 3, 3, 3, 3, 42, 42, 42, 42, 42, 42, 89, 89, 64, 64, 0, 0, 0, 0, - 0, 0, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 0, 0, 0, 0, 3, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, - 0, 0, 0, 0, 42, 42, 42, 42, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, - 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, 0, 42, - 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, 0, - 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, - 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 3, 3, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 5, 6, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 3, 3, 3, 90, 90, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 89, 89, 89, 64, 64, 64, 64, 64, 64, 64, 89, 89, 89, 89, 89, - 89, 89, 89, 64, 89, 89, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 3, 3, 3, 3, 3, 3, 3, 4, 3, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, - 3, 3, 3, 3, 8, 3, 3, 3, 3, 88, 88, 88, 88, 0, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 0, 0, 0, 0, 0, 0, 42, 42, 42, 63, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, - 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 15, 15, - 15, 15, 15, 91, 0, 0, 0, 0, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 0, - 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, - 93, 93, 93, 92, 92, 92, 92, 92, 92, 0, 0, 93, 93, 93, 93, 93, 93, 0, - 0, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, - 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 92, - 92, 92, 92, 92, 92, 0, 0, 93, 93, 93, 93, 93, 93, 0, 0, 15, 92, 15, - 92, 15, 92, 15, 92, 0, 93, 0, 93, 0, 93, 0, 93, 92, 92, 92, 92, 92, - 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 95, 95, 95, 95, - 96, 96, 97, 97, 98, 98, 99, 99, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, - 100, 100, 100, 100, 100, 100, 100, 100, 92, 92, 92, 92, 92, 92, 92, - 92, 100, 100, 100, 100, 100, 100, 100, 100, 92, 92, 92, 92, 92, 92, - 92, 92, 100, 100, 100, 100, 100, 100, 100, 100, 92, 92, 15, 101, 15, - 0, 15, 15, 93, 93, 102, 102, 103, 11, 104, 11, 11, 11, 15, 101, 15, - 0, 15, 15, 105, 105, 105, 105, 103, 11, 11, 11, 92, 92, 15, 15, 0, - 0, 15, 15, 93, 93, 106, 106, 0, 11, 11, 11, 92, 92, 15, 15, 15, 107, - 15, 15, 93, 93, 108, 108, 109, 11, 11, 11, 0, 0, 15, 101, 15, 0, 15, - 15, 110, 110, 111, 111, 103, 11, 11, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 88, 88, 88, 88, 8, 8, 8, 8, 8, 8, 3, 3, 16, 19, 5, 16, 16, - 19, 5, 16, 3, 3, 3, 3, 3, 3, 3, 3, 112, 113, 88, 88, 88, 88, 88, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 16, 19, 3, 3, 3, 3, 12, 12, 3, 3, 3, 7, - 5, 6, 0, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 88, 88, 88, 88, 88, 17, - 0, 0, 0, 17, 17, 17, 17, 17, 17, 7, 7, 7, 5, 6, 15, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 7, 7, 7, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 85, 85, 85, 85, 64, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 77, - 14, 14, 14, 14, 77, 14, 14, 15, 77, 77, 77, 15, 15, 77, 77, 77, 15, - 14, 77, 14, 14, 14, 77, 77, 77, 77, 77, 14, 14, 14, 14, 14, 14, 77, - 14, 114, 14, 77, 14, 115, 116, 77, 77, 14, 15, 77, 77, 14, 77, 15, - 42, 42, 42, 42, 15, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 90, 90, 90, 90, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 7, 7, 14, 14, - 14, 14, 7, 14, 14, 7, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 7, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 14, 14, 7, - 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 7, 7, 14, 14, 14, 14, 14, 14, 14, 5, 6, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 7, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 14, 14, 14, 0, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 0, 14, 0, 14, 14, 14, 14, 0, 0, 0, 14, 0, 14, 14, - 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 0, 2, 3, 3, 3, 14, 63, 42, 90, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, - 14, 14, 5, 6, 5, 6, 5, 6, 5, 6, 8, 5, 6, 6, 14, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 64, 64, 64, 64, 64, 64, 8, 63, 63, 63, 63, 63, 14, - 14, 90, 90, 90, 0, 0, 0, 14, 14, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 64, 64, - 11, 11, 63, 63, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 12, 63, - 63, 63, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 14, 14, 17, 17, 17, - 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 0, 14, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, - 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 0, - 0, 0, 0, 0, 42, 64, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 7, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, - 42, 0, 42, 0, 42, 42, 0, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 64, 64, 64, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 8, 12, 12, 5, 6, 5, 6, 5, - 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 0, 0, 0, 0, 3, 3, 3, 3, 12, 12, 12, - 3, 3, 3, 0, 3, 3, 3, 3, 8, 5, 6, 5, 6, 5, 6, 3, 3, 3, 7, 8, 7, 7, 7, - 0, 3, 4, 3, 3, 0, 0, 0, 0, 42, 42, 42, 0, 42, 0, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 0, 0, 88, 0, 3, 3, 3, 4, 3, 3, 3, 5, 6, 3, 7, 3, 8, 3, 3, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 3, 3, 7, 7, 7, 3, 11, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 5, 7, 6, 7, 0, 0, 3, 5, 6, 3, 12, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 63, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 63, - 63, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, - 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, - 42, 42, 42, 42, 0, 0, 42, 42, 42, 0, 0, 0, 4, 4, 7, 11, 14, 4, 4, 0, - 14, 7, 7, 7, 7, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 88, 88, 14, - 14, 42, 17, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, - 126, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 89, 64, 14, 14, 14, - 14, 14, 0, 0, 77, 77, 15, 15, 77, 15, 15, 77, 77, 15, 77, 77, 15, 77, - 77, 15, 15, 77, 15, 15, 77, 77, 15, 77, 77, 15, 77, 77, 15, 15, 77, - 15, 15, 77, 77, 15, 77, 77, 15, 77, 77, 15, 15, 77, 77, 15, 15, 77, - 15, 15, 77, 77, 15, 15, 77, 15, 15, 77, 77, 15, 15, 9, 9, 9, 42, 42, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 88, 0, 88, 88, 88, 88, 88, 88, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122 -}; - -/* - * Each group represents a unique set of character attributes. The attributes - * are encoded into a 32-bit value as follows: - * - * Bits 0-4 Character category: see the constants listed below. - * - * Bits 5-7 Case delta type: 000 = identity - * 010 = add delta for lower - * 011 = add delta for lower, add 1 for title - * 100 = sutract delta for title/upper - * 101 = sub delta for upper, sub 1 for title - * 110 = sub delta for upper, add delta for lower - * - * Bits 8-21 Reserved for future use. - * - * Bits 22-31 Case delta: delta for case conversions. This should be the - * highest field so we can easily sign extend. - */ - -static int groups[] = { - 0, 15, 12, 25, 27, 21, 22, 26, 20, 9, 134217793, 28, 19, 134217858, - 29, 2, 23, 11, 1178599554, 24, -507510654, 4194369, 4194434, -834666431, - 973078658, -507510719, 1258291330, 880803905, 864026689, 859832385, - 331350081, 847249473, 851443777, 868220993, -406847358, 884998209, - 876609601, 893386817, 897581121, 914358337, 910164033, 918552641, - 5, -234880894, 8388705, 4194499, 8388770, 331350146, -406847423, - -234880959, 880803970, 864026754, 859832450, 847249538, 851443842, - 868221058, 876609666, 884998274, 893386882, 897581186, 914358402, - 910164098, 918552706, 4, 6, -352321402, 159383617, 155189313, - 268435521, 264241217, 159383682, 155189378, 130023554, 268435586, - 264241282, 260046978, 239075458, 1, 197132418, 226492546, 360710274, - 335544450, -251658175, 402653314, 335544385, 7, 201326657, 201326722, - 16, 8, 10, 247464066, -33554302, -33554367, -310378366, -360710014, - -419430270, -536870782, -469761918, -528482174, -33554365, -37748606, - -310378431, -37748669, 155189378, -360710079, -419430335, -29359998, - -469761983, -29360063, -536870847, -528482239, 13, 14, -1463812031, - -801111999, -293601215, 67108938, 67109002, 109051997, 109052061, - 18, 17, 8388673, 12582977, 8388738, 12583042 -}; - -/* - * The following constants are used to determine the category of a - * Unicode character. - */ - -#define UNICODE_CATEGORY_MASK 0X1F - -enum { - UNASSIGNED, - UPPERCASE_LETTER, - LOWERCASE_LETTER, - TITLECASE_LETTER, - MODIFIER_LETTER, - OTHER_LETTER, - NON_SPACING_MARK, - ENCLOSING_MARK, - COMBINING_SPACING_MARK, - DECIMAL_DIGIT_NUMBER, - LETTER_NUMBER, - OTHER_NUMBER, - SPACE_SEPARATOR, - LINE_SEPARATOR, - PARAGRAPH_SEPARATOR, - CONTROL, - FORMAT, - PRIVATE_USE, - SURROGATE, - CONNECTOR_PUNCTUATION, - DASH_PUNCTUATION, - OPEN_PUNCTUATION, - CLOSE_PUNCTUATION, - INITIAL_QUOTE_PUNCTUATION, - FINAL_QUOTE_PUNCTUATION, - OTHER_PUNCTUATION, - MATH_SYMBOL, - CURRENCY_SYMBOL, - MODIFIER_SYMBOL, - OTHER_SYMBOL -}; - -/* - * The following macros extract the fields of the character info. The - * GetDelta() macro is complicated because we can't rely on the C compiler - * to do sign extension on right shifts. - */ - -#define GetCaseType(info) (((info) & 0xE0) >> 5) -#define GetCategory(info) ((info) & 0x1F) -#define GetDelta(info) (((info) > 0) ? ((info) >> 22) : (~(~((info)) >> 22))) - -/* - * This macro extracts the information about a character from the - * Unicode character tables. - */ - -#define GetUniCharInfo(ch) (groups[groupMap[(pageMap[(((int)(ch)) & 0xffff) >> OFFSET_BITS] << OFFSET_BITS) | ((ch) & ((1 << OFFSET_BITS)-1))]]) -