forked from swdunlop/WaspVM
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Henry Spencer's Regex Library for Win32
- Loading branch information
Scott Dunlop
authored and
Scott Dunlop
committed
Sep 18, 2008
1 parent
2d3d1b1
commit 502d135
Showing
37 changed files
with
6,001 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,6 @@ stubs/* | |
mod/site/config.mo | ||
mod/site/config.ms | ||
FUTURE | ||
rx/engine.ih | ||
rx/regcomp.ih | ||
rx/regerror.ih |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright 1992, 1993, 1994, 1997 Henry Spencer. All rights reserved. | ||
This software is not subject to any license of the American Telephone | ||
and Telegraph Company or of the Regents of the University of California. | ||
|
||
Permission is granted to anyone to use this software for any purpose on | ||
any computer system, and to alter it and redistribute it, subject | ||
to the following restrictions: | ||
|
||
1. The author is not responsible for the consequences of use of this | ||
software, no matter how awful, even if they arise from flaws in it. | ||
|
||
2. The origin of this software must not be misrepresented, either by | ||
explicit claim or by omission. Since few users ever read sources, | ||
credits must appear in the documentation. | ||
|
||
3. Altered versions must be plainly marked as such, and must not be | ||
misrepresented as being the original software. Since few users | ||
ever read sources, credits must appear in the documentation. | ||
|
||
4. This notice may not be removed or altered. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# You probably want to take -DREDEBUG out of CFLAGS, and put something like | ||
# -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of | ||
# internal assertion checking and some debugging facilities). | ||
# Put -Dconst= in for a pre-ANSI compiler. | ||
# Do not take -DPOSIX_MISTAKE out. | ||
# REGCFLAGS isn't important to you (it's for my use in some special contexts). | ||
CFLAGS=-O -I. -DPOSIX_MISTAKE -DNDEBUG $(REGCFLAGS) | ||
|
||
# If you have a pre-ANSI compiler, put -o into MKHFLAGS. If you want | ||
# the Berkeley __P macro, put -b in. | ||
MKHFLAGS= | ||
|
||
# Flags for linking but not compiling, if any. | ||
LDFLAGS= | ||
|
||
# Extra libraries for linking, if any. | ||
LIBS= | ||
|
||
# Internal stuff, should not need changing. | ||
OBJPRODN=regcomp.o regexec.o regerror.o regfree.o | ||
OBJS=$(OBJPRODN) split.o debug.o main.o | ||
H=cclass.h cname.h regex2.h utils.h | ||
REGSRC=regcomp.c regerror.c regexec.c regfree.c | ||
ALLSRC=$(REGSRC) engine.c debug.c main.c split.c | ||
|
||
# Stuff that matters only if you're trying to lint the package. | ||
LINTFLAGS=-I. -Dstatic= -Dconst= -DREDEBUG | ||
LINTC=regcomp.c regexec.c regerror.c regfree.c debug.c main.c | ||
JUNKLINT=possible pointer alignment|null effect | ||
|
||
# arrangements to build forward-reference header files | ||
.SUFFIXES: .ih .h | ||
.c.ih: | ||
sh ./mkh $(MKHFLAGS) -p $< >$@ | ||
|
||
default: r | ||
|
||
lib: purge $(OBJPRODN) | ||
rm -f libregex.a | ||
ar crv libregex.a $(OBJPRODN) | ||
|
||
purge: | ||
rm -f *.o | ||
|
||
# stuff to build regex.h | ||
REGEXH=regex.h | ||
REGEXHSRC=regex2.h $(REGSRC) | ||
$(REGEXH): $(REGEXHSRC) mkh | ||
sh ./mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp | ||
cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h | ||
rm -f regex.tmp | ||
|
||
# dependencies | ||
$(OBJPRODN) debug.o: utils.h regex.h regex2.h | ||
regcomp.o: cclass.h cname.h regcomp.ih | ||
regexec.o: engine.c engine.ih | ||
regerror.o: regerror.ih | ||
debug.o: debug.ih | ||
main.o: main.ih | ||
|
||
# tester | ||
re: $(OBJS) | ||
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ | ||
|
||
# regression test | ||
r: re tests | ||
./re <tests | ||
./re -el <tests | ||
./re -er <tests | ||
|
||
# 57 variants, and other stuff, for development use -- not useful to you | ||
ra: ./re tests | ||
-./re <tests | ||
-./re -el <tests | ||
-./re -er <tests | ||
|
||
rx: ./re tests | ||
./re -x <tests | ||
./re -x -el <tests | ||
./re -x -er <tests | ||
|
||
t: ./re tests | ||
-time ./re <tests | ||
-time ./re -cs <tests | ||
-time ./re -el <tests | ||
-time ./re -cs -el <tests | ||
|
||
l: $(LINTC) | ||
lint $(LINTFLAGS) -h $(LINTC) 2>&1 | egrep -v '$(JUNKLINT)' | tee lint | ||
|
||
fullprint: | ||
ti README WHATSNEW notes todo | list | ||
ti *.h | list | ||
list *.c | ||
list regex.3 regex.7 | ||
|
||
print: | ||
ti README WHATSNEW notes todo | list | ||
ti *.h | list | ||
list reg*.c engine.c | ||
|
||
|
||
mf.tmp: Makefile | ||
sed '/^REGEXH=/s/=.*/=regex.h/' Makefile | sed '/#DEL$$/d' >$@ | ||
|
||
DTRH=cclass.h cname.h regex2.h utils.h | ||
PRE=COPYRIGHT README WHATSNEW | ||
POST=mkh regex.3 regex.7 tests $(DTRH) $(ALLSRC) fake/*.[ch] | ||
FILES=$(PRE) Makefile $(POST) | ||
DTR=$(PRE) Makefile=mf.tmp $(POST) | ||
dtr: $(FILES) mf.tmp | ||
makedtr $(DTR) >$@ | ||
rm mf.tmp | ||
|
||
cio: $(FILES) | ||
cio $(FILES) | ||
|
||
rdf: $(FILES) | ||
rcsdiff -c $(FILES) 2>&1 | p | ||
|
||
# various forms of cleanup | ||
tidy: | ||
rm -f junk* core core.* *.core dtr *.tmp lint | ||
|
||
clean: tidy | ||
rm -f *.o *.s *.ih re libregex.a | ||
|
||
# don't do this one unless you know what you're doing | ||
spotless: clean | ||
rm -f mkh regex.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
alpha3.8 release. | ||
Tue Aug 10 15:51:48 EDT 1999 | ||
henry@spsystems.net (formerly henry@zoo.toronto.edu) | ||
|
||
See WHATSNEW for change listing. | ||
|
||
installation notes: | ||
-------- | ||
Read the comments at the beginning of Makefile before running. | ||
|
||
Utils.h contains some things that just might have to be modified on | ||
some systems, as well as a nested include (ugh) of <assert.h>. | ||
|
||
The "fake" directory contains quick-and-dirty fakes for some header | ||
files and routines that old systems may not have. Note also that | ||
-DUSEBCOPY will make utils.h substitute bcopy() for memmove(). | ||
|
||
After that, "make r" will build regcomp.o, regexec.o, regfree.o, | ||
and regerror.o (the actual routines), bundle them together into a test | ||
program, and run regression tests on them. No output is good output. | ||
|
||
"make lib" builds just the .o files for the actual routines (when | ||
you're happy with testing and have adjusted CFLAGS for production), | ||
and puts them together into libregex.a. You can pick up either the | ||
library or *.o ("make lib" makes sure there are no other .o files left | ||
around to confuse things). | ||
|
||
Main.c, debug.c, split.c are used for regression testing but are not part | ||
of the RE routines themselves. | ||
|
||
Regex.h goes in /usr/include. All other .h files are internal only. | ||
-------- |
Oops, something went wrong.