Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
fd5e2b03
Commit
fd5e2b03
authored
Dec 18, 1992
by
Per Cederqvist
Browse files
Initial revision
parent
91b1b117
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/libraries/regex/doc/regex.aux
0 → 100644
View file @
fd5e2b03
'xrdef
{
Overview-pg
}{
1
}
'xrdef
{
Overview-snt
}{
Chapter'tie1
}
'xrdef
{
Regular Expression Syntax-pg
}{
2
}
'xrdef
{
Regular Expression Syntax-snt
}{
Chapter'tie2
}
'xrdef
{
Syntax Bits-pg
}{
2
}
'xrdef
{
Syntax Bits-snt
}{
Section'tie2.1
}
'xrdef
{
Predefined Syntaxes-pg
}{
5
}
'xrdef
{
Predefined Syntaxes-snt
}{
Section'tie2.2
}
'xrdef
{
Collating Elements vs. Characters-pg
}{
6
}
'xrdef
{
Collating Elements vs. Characters-snt
}{
Section'tie2.3
}
'xrdef
{
The Backslash Character-pg
}{
7
}
'xrdef
{
The Backslash Character-snt
}{
Section'tie2.4
}
'xrdef
{
Common Operators-pg
}{
9
}
'xrdef
{
Common Operators-snt
}{
Chapter'tie3
}
'xrdef
{
Match-self Operator-pg
}{
9
}
'xrdef
{
Match-self Operator-snt
}{
Section'tie3.1
}
'xrdef
{
Match-any-character Operator-pg
}{
9
}
'xrdef
{
Match-any-character Operator-snt
}{
Section'tie3.2
}
'xrdef
{
Concatenation Operator-pg
}{
10
}
'xrdef
{
Concatenation Operator-snt
}{
Section'tie3.3
}
'xrdef
{
Repetition Operators-pg
}{
10
}
'xrdef
{
Repetition Operators-snt
}{
Section'tie3.4
}
'xrdef
{
Match-zero-or-more Operator-pg
}{
10
}
'xrdef
{
Match-zero-or-more Operator-snt
}{
Section'tie3.4.1
}
'xrdef
{
Match-one-or-more Operator-pg
}{
11
}
'xrdef
{
Match-one-or-more Operator-snt
}{
Section'tie3.4.2
}
'xrdef
{
Match-zero-or-one Operator-pg
}{
11
}
'xrdef
{
Match-zero-or-one Operator-snt
}{
Section'tie3.4.3
}
'xrdef
{
Interval Operators-pg
}{
12
}
'xrdef
{
Interval Operators-snt
}{
Section'tie3.4.4
}
'xrdef
{
Alternation Operator-pg
}{
13
}
'xrdef
{
Alternation Operator-snt
}{
Section'tie3.5
}
'xrdef
{
List Operators-pg
}{
13
}
'xrdef
{
List Operators-snt
}{
Section'tie3.6
}
'xrdef
{
Character Class Operators-pg
}{
14
}
'xrdef
{
Character Class Operators-snt
}{
Section'tie3.6.1
}
'xrdef
{
Range Operator-pg
}{
15
}
'xrdef
{
Range Operator-snt
}{
Section'tie3.6.2
}
'xrdef
{
Grouping Operators-pg
}{
16
}
'xrdef
{
Grouping Operators-snt
}{
Section'tie3.7
}
'xrdef
{
Back-reference Operator-pg
}{
17
}
'xrdef
{
Back-reference Operator-snt
}{
Section'tie3.8
}
'xrdef
{
Anchoring Operators-pg
}{
18
}
'xrdef
{
Anchoring Operators-snt
}{
Section'tie3.9
}
'xrdef
{
Match-beginning-of-line Operator-pg
}{
18
}
'xrdef
{
Match-beginning-of-line Operator-snt
}{
Section'tie3.9.1
}
'xrdef
{
Match-end-of-line Operator-pg
}{
19
}
'xrdef
{
Match-end-of-line Operator-snt
}{
Section'tie3.9.2
}
'xrdef
{
GNU Operators-pg
}{
20
}
'xrdef
{
GNU Operators-snt
}{
Chapter'tie4
}
'xrdef
{
Word Operators-pg
}{
20
}
'xrdef
{
Word Operators-snt
}{
Section'tie4.1
}
'xrdef
{
Non-Emacs Syntax Tables-pg
}{
20
}
'xrdef
{
Non-Emacs Syntax Tables-snt
}{
Section'tie4.1.1
}
'xrdef
{
Match-word-boundary Operator-pg
}{
20
}
'xrdef
{
Match-word-boundary Operator-snt
}{
Section'tie4.1.2
}
'xrdef
{
Match-within-word Operator-pg
}{
20
}
'xrdef
{
Match-within-word Operator-snt
}{
Section'tie4.1.3
}
'xrdef
{
Match-beginning-of-word Operator-pg
}{
21
}
'xrdef
{
Match-beginning-of-word Operator-snt
}{
Section'tie4.1.4
}
'xrdef
{
Match-end-of-word Operator-pg
}{
21
}
'xrdef
{
Match-end-of-word Operator-snt
}{
Section'tie4.1.5
}
'xrdef
{
Match-word-constituent Operator-pg
}{
21
}
'xrdef
{
Match-word-constituent Operator-snt
}{
Section'tie4.1.6
}
'xrdef
{
Match-non-word-constituent Operator-pg
}{
21
}
'xrdef
{
Match-non-word-constituent Operator-snt
}{
Section'tie4.1.7
}
'xrdef
{
Buffer Operators-pg
}{
21
}
'xrdef
{
Buffer Operators-snt
}{
Section'tie4.2
}
'xrdef
{
Match-beginning-of-buffer Operator-pg
}{
21
}
'xrdef
{
Match-beginning-of-buffer Operator-snt
}{
Section'tie4.2.1
}
'xrdef
{
Match-end-of-buffer Operator-pg
}{
21
}
'xrdef
{
Match-end-of-buffer Operator-snt
}{
Section'tie4.2.2
}
'xrdef
{
GNU Emacs Operators-pg
}{
22
}
'xrdef
{
GNU Emacs Operators-snt
}{
Chapter'tie5
}
'xrdef
{
Syntactic Class Operators-pg
}{
22
}
'xrdef
{
Syntactic Class Operators-snt
}{
Section'tie5.1
}
'xrdef
{
Emacs Syntax Tables-pg
}{
22
}
'xrdef
{
Emacs Syntax Tables-snt
}{
Section'tie5.1.1
}
'xrdef
{
Match-syntactic-class Operator-pg
}{
22
}
'xrdef
{
Match-syntactic-class Operator-snt
}{
Section'tie5.1.2
}
'xrdef
{
Match-not-syntactic-class Operator-pg
}{
22
}
'xrdef
{
Match-not-syntactic-class Operator-snt
}{
Section'tie5.1.3
}
'xrdef
{
What Gets Matched?-pg
}{
23
}
'xrdef
{
What Gets Matched?-snt
}{
Chapter'tie6
}
'xrdef
{
Programming with Regex-pg
}{
24
}
'xrdef
{
Programming with Regex-snt
}{
Chapter'tie7
}
'xrdef
{
GNU Regex Functions-pg
}{
24
}
'xrdef
{
GNU Regex Functions-snt
}{
Section'tie7.1
}
'xrdef
{
GNU Pattern Buffers-pg
}{
24
}
'xrdef
{
GNU Pattern Buffers-snt
}{
Section'tie7.1.1
}
'xrdef
{
GNU Regular Expression Compiling-pg
}{
26
}
'xrdef
{
GNU Regular Expression Compiling-snt
}{
Section'tie7.1.2
}
'xrdef
{
GNU Matching-pg
}{
27
}
'xrdef
{
GNU Matching-snt
}{
Section'tie7.1.3
}
'xrdef
{
GNU Searching-pg
}{
28
}
'xrdef
{
GNU Searching-snt
}{
Section'tie7.1.4
}
'xrdef
{
Matching/Searching with Split Data-pg
}{
29
}
'xrdef
{
Matching/Searching with Split Data-snt
}{
Section'tie7.1.5
}
'xrdef
{
Searching with Fastmaps-pg
}{
30
}
'xrdef
{
Searching with Fastmaps-snt
}{
Section'tie7.1.6
}
'xrdef
{
GNU Translate Tables-pg
}{
31
}
'xrdef
{
GNU Translate Tables-snt
}{
Section'tie7.1.7
}
'xrdef
{
Using Registers-pg
}{
32
}
'xrdef
{
Using Registers-snt
}{
Section'tie7.1.8
}
'xrdef
{
Freeing GNU Pattern Buffers-pg
}{
34
}
'xrdef
{
Freeing GNU Pattern Buffers-snt
}{
Section'tie7.1.9
}
'xrdef
{
POSIX Regex Functions-pg
}{
35
}
'xrdef
{
POSIX Regex Functions-snt
}{
Section'tie7.2
}
'xrdef
{
POSIX Pattern Buffers-pg
}{
35
}
'xrdef
{
POSIX Pattern Buffers-snt
}{
Section'tie7.2.1
}
'xrdef
{
POSIX Regular Expression Compiling-pg
}{
35
}
'xrdef
{
POSIX Regular Expression Compiling-snt
}{
Section'tie7.2.2
}
'xrdef
{
POSIX Matching-pg
}{
37
}
'xrdef
{
POSIX Matching-snt
}{
Section'tie7.2.3
}
'xrdef
{
Reporting Errors-pg
}{
38
}
'xrdef
{
Reporting Errors-snt
}{
Section'tie7.2.4
}
'xrdef
{
Using Byte Offsets-pg
}{
39
}
'xrdef
{
Using Byte Offsets-snt
}{
Section'tie7.2.5
}
'xrdef
{
Freeing POSIX Pattern Buffers-pg
}{
39
}
'xrdef
{
Freeing POSIX Pattern Buffers-snt
}{
Section'tie7.2.6
}
'xrdef
{
BSD Regex Functions-pg
}{
40
}
'xrdef
{
BSD Regex Functions-snt
}{
Section'tie7.3
}
'xrdef
{
BSD Regular Expression Compiling-pg
}{
40
}
'xrdef
{
BSD Regular Expression Compiling-snt
}{
Section'tie7.3.1
}
'xrdef
{
BSD Searching-pg
}{
40
}
'xrdef
{
BSD Searching-snt
}{
Section'tie7.3.2
}
'xrdef
{
Copying-pg
}{
42
}
'xrdef
{
Copying-snt
}{
Appendix'tie'char65
{}}
'xrdef
{
Copying-pg
}{
42
}
'xrdef
{
Copying-snt
}{}
'xrdef
{
Copying-pg
}{
43
}
'xrdef
{
Copying-snt
}{}
'xrdef
{
Copying-pg
}{
48
}
'xrdef
{
Copying-snt
}{}
'xrdef
{
Index-pg
}{
50
}
'xrdef
{
Index-snt
}{}
src/libraries/regex/doc/regex.cps
0 → 100644
View file @
fd5e2b03
\initial {$}
\entry {\code {$}}{19}
\initial {(}
\entry {\code {(}}{16}
\initial {)}
\entry {\code {)}}{16}
\initial {*}
\entry {\samp {*}}{10}
\initial {-}
\entry {\samp {-}}{13}
\initial {.}
\entry {\samp {.}}{9}
\initial {:}
\entry {\samp {:]} in regex}{14}
\initial {?}
\entry {\samp {?}}{11}
\initial {[}
\entry {\samp {[}}{13}
\entry {\samp {[:} in regex}{14}
\entry {\samp {[{\tt\hat}}}{13}
\initial {]}
\entry {\samp {]}}{13}
\initial {{\tt\char'173}}
\entry {\samp {{\tt\char'173}}}{12}
\initial {{\tt\char'174}}
\entry {\code {{\tt\char'174}}}{13}
\initial {{\tt\char'175}}
\entry {\samp {{\tt\char'175}}}{12}
\initial {{\tt\char43}}
\entry {\samp {{\tt\char43}}}{11}
\initial {{\tt\hat}}
\entry {\samp {{\tt\hat}}}{13}
\entry {\code {{\tt\hat}}}{18}
\initial {{\tt\indexbackslash }}
\entry {{\tt\indexbackslash }}{7}
\entry {\samp {{\tt\indexbackslash }}}{13}
\entry {\samp {{\tt\indexbackslash }'}}{21}
\entry {\code {{\tt\indexbackslash }(}}{16}
\entry {\code {{\tt\indexbackslash })}}{16}
\entry {\samp {{\tt\indexbackslash }`}}{21}
\entry {\samp {{\tt\indexbackslash }{\tt\char'173}}}{12}
\entry {\code {{\tt\indexbackslash }{\tt\char'174}}}{13}
\entry {\samp {{\tt\indexbackslash }{\tt\char'175}}}{12}
\entry {\samp {{\tt\indexbackslash }{\tt\gtr}}}{21}
\entry {\samp {{\tt\indexbackslash }{\tt\less}}}{21}
\entry {\samp {{\tt\indexbackslash }b}}{20}
\entry {\samp {{\tt\indexbackslash }B}}{20}
\entry {\samp {{\tt\indexbackslash }s}}{22}
\entry {\samp {{\tt\indexbackslash }S}}{22}
\entry {\samp {{\tt\indexbackslash }w}}{21}
\entry {\samp {{\tt\indexbackslash }W}}{21}
\initial {A}
\entry {alternation operator}{13}
\entry {alternation operator and \samp {{\tt\hat}}}{18}
\entry {anchoring}{18}
\entry {anchors}{18, 19}
\entry {Awk}{5}
\initial {B}
\entry {back references}{17}
\entry {backtracking}{10, 13}
\entry {beginning-of-line operator}{18}
\entry {bracket expression}{13}
\initial {C}
\entry {character classes}{14}
\initial {E}
\entry {Egrep}{5}
\entry {Emacs}{5}
\entry {end-of-line operator}{19}
\entry {\code {end\ \r {in\ \code {struct\ re_registers}}}}{32}
\initial {G}
\entry {Grep}{5}
\entry {grouping}{16}
\initial {I}
\entry {interval expression}{12}
\initial {M}
\entry {matching list}{13}
\entry {matching newline}{13}
\initial {N}
\entry {\code {newline{\_}anchor \r {field in pattern buffer}}}{18}
\entry {nonmatching list}{13}
\entry {\code {not{\_}bol \r {field in pattern buffer}}}{18}
\entry {\code {num_regs\ \r {in\ \code {struct\ re_registers}}}}{32}
\initial {O}
\entry {open-group operator and \samp {{\tt\hat}}}{18}
\entry {or operator}{13}
\initial {P}
\entry {parenthesizing}{16}
\entry {POSIX Awk}{5}
\initial {R}
\entry {\code {re_registers}}{32}
\entry {\code {RE{\_}BACKSLASH{\_}ESCAPE{\_}IN{\_}LIST}}{3}
\entry {\code {RE{\_}BK{\_}PLUS{\_}QM}}{3}
\entry {\code {RE{\_}CHAR{\_}CLASSES}}{3}
\entry {\code {RE{\_}CONTEXT{\_}INDEP{\_}ANCHORS}}{3}
\entry {\code {RE{\_}CONTEXT{\_}INDEP{\_}ANCHORS \r {(and \samp {{\tt\hat}})}}}{18}
\entry {\code {RE{\_}CONTEXT{\_}INDEP{\_}OPS}}{3}
\entry {\code {RE{\_}CONTEXT{\_}INVALID{\_}OPS}}{3}
\entry {\code {RE{\_}DOT{\_}NEWLINE}}{4}
\entry {\code {RE{\_}DOT{\_}NOT{\_}NULL}}{4}
\entry {\code {RE{\_}INTERVALS}}{4}
\entry {\code {RE{\_}LIMITED{\_}OPS}}{4}
\entry {\code {RE{\_}NEWLINE{\_}ALT}}{4}
\entry {\code {RE{\_}NO{\_}BK{\_}BRACES}}{4}
\entry {\code {RE{\_}NO{\_}BK{\_}PARENS}}{4}
\entry {\code {RE{\_}NO{\_}BK{\_}REFS}}{4}
\entry {\code {RE{\_}NO{\_}BK{\_}VBAR}}{4}
\entry {\code {RE{\_}NO{\_}EMPTY{\_}RANGES}}{4}
\entry {\code {re{\_}pattern{\_}buffer}}{24}
\entry {\code {RE{\_}UNMATCHED{\_}RIGHT{\_}PAREN{\_}ORD}}{4}
\entry {\code {REG{\_}ICASE}}{36}
\entry {\code {regex.c}}{1}
\entry {\code {regex.h}}{1}
\entry {regexp anchoring}{18}
\entry {\code {regs{\_}allocated}}{32}
\entry {\code {REGS{\_}FIXED}}{33}
\entry {\code {REGS{\_}REALLOCATE}}{32}
\entry {\code {REGS{\_}UNALLOCATED}}{32}
\entry {regular expressions, syntax of}{2}
\initial {S}
\entry {\code {start\ \r {in\ \code {struct\ re_registers}}}}{32}
\entry {subexpressions}{16}
\entry {syntax bits}{2}
\entry {syntax of regular expressions}{2}
\initial {W}
\entry {word boundaries, matching}{20}
src/libraries/regex/test/ChangeLog
0 → 100644
View file @
fd5e2b03
Wed Sep 16 09:29:27 1992 Karl Berry (karl@hayley)
* xmalloc.c (xmalloc): use char *, not void *, as some compilers
bomb out on the latter.
* Makefile.in (LOADLIBES): use LIBS instead, as that what's
Autoconf wants to define.
* other.c: remove tests for ^/$ around newlines.
Tue Sep 15 11:01:15 1992 Karl Berry (karl@hayley)
* fileregex.c (main): call re_search_2 instead of re_search.
* Makefile.in (regex.o): make target dregex.o, so VPATH doesn't
find ../regex.o.
Sun Sep 13 06:50:03 1992 Karl Berry (karl@hayley)
* Created.
src/libraries/regex/test/Makefile.in
0 → 100644
View file @
fd5e2b03
# Makefile for regex testing.
#
# Copyright (C) 1992 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
CPPFLAGS
=
CFLAGS
=
-g
LDFLAGS
=
srcdir
=
@srcdir@
VPATH
=
@srcdir@:../@srcdir@
CC
=
@CC@
DEFS
=
@DEFS@
LIBS
=
@LIBS@
$(LOADLIBES)
ETAGS
=
etags
SHELL
=
/bin/sh
debug
=
-DDEBUG
ALL_CPPFLAGS
=
-I
.
-I
$(srcdir)
-I
../
$(srcdir)
$(DEFS)
$(CPPFLAGS)
$(debug)
.c.o
:
$(CC)
$(ALL_CPPFLAGS)
$(CFLAGS)
-c
$<
# Define this as `../regex.o' to get the optimized version.
regex_o
=
dregex.o
test_h
=
test.h
test_o
=
test.o bsd-interf.o other.o tregress.o psx-basic.o psx-extend.o
\
psx-generic.o psx-group.o psx-interf.o psx-interv.o
common_o
=
printchar.o upcase.o xmalloc.o
$(malloc)
# We have a lot of mallocs we can try when we run afoul of strange bugs.
malloc
=
@ALLOCA@
#malloc = # the libc malloc
#malloc = g++malloc.o
#malloc = debugmalloc.o
#malloc = emacsmalloc.o
emacsmallocflags
=
-Drcheck
-Dbotch
=
abort
-DUSG
# default is to do nothing.
default
:
all
:
regex syntax
regex
:
$(regex_o) $(common_o) $(test_o) main.o
$(CC)
-o
$@
$(LDFLAGS)
$^
$(LIBS)
# As long as we're doing tests, we enable debugging.
dregex.o
:
regex.c regex.h
rm
-f
$@
$(CC)
$(ALL_CPPFLAGS)
$(CFLAGS)
-c
$<
mv
regex.o
$@
# iregex is the interactive regex.
iregex
:
$(common_o) $(regex_o) iregex.o
$(CC)
-o
$@
$(LDFLAGS)
$^
$(LIBS)
# fileregex searches for an r.e. in every line of a given file.
fileregex_o
=
fileregex.o printchar.o
$(regex_o)
fileregex
:
$(fileregex_o)
$(CC)
-o
$@
$(LDFLAGS)
$(fileregex_o)
$(LIBS)
# cppregex is regex with a preprocessed regex.c. Useful when the
# problem is inside some macro.
cppregex
:
regexcpp.o $(common_o) $(test_o) main.o
$(CC)
-o
$@
$(LDFLAGS)
$^
$(LIBS)
regexcpp.o
:
regexcpp.c
regexcpp.c
:
regex.c regexcpp.sed
rm
-f
regexcpp.c
$(CC)
-E
$(ALL_CPPFLAGS)
$<
\
| egrep
-v
'^#|^ *$$'
\
|
sed
-f
regexcpp.sed
\
>
regexcpp.c
chmod
a-w regexcpp.c
# Have to give this malloc special flags.
emacsmalloc.o
:
emacsmalloc.c
$(CC)
-c
$(CFLAGS)
$(ALL_CPPFLAGS)
$(emacsmallocflags)
$<
syntax
:
syntax.o
$(CC)
$(CFLAGS)
$<
-o
$@
syntax.c
:
syntax.skel bits
sed
'/\[\[\[replace.*\]\]\]/r bits'
syntax.skel
>
$@
bits
:
regex.h
sed
-n
1,/RE_SYNTAX_EMACS/p
$<
\
|
grep
"#define RE_.*1"
\
|
sed
's/^#define \(RE_[A-Z_]*\) .*/ TEST_BIT (\1);/'
>
$@
check
:
regex
./regex
TAGS
:
regex.h regex.c *.h *.c
$(ETAGS)
-t
$^
depend
:
gcc
-MM
$(ALL_CPPFLAGS)
*
.c
>
/tmp/depend
.PHONY
:
depend
install
:
.PHONY
:
install
clean mostlyclean
:
rm
-f
*
.o regex cppregex iregex fileregex regexcpp.c syntax
distclean
:
clean
rm
-f
bits syntax.c Makefile
extraclean
:
distclean
rm
-f
*
~
*
*
\#
*
patch
*
*
.orig
*
.rej
*
.bak core a.out
realclean
:
distclean
rm
-f
TAGS
Makefile
:
Makefile.in ../config.status
(
cd
..
;
sh config.status
)
# Prevent GNU make 3 from overflowing arg limit on system V.
.NOEXPORT
:
# Assumes $(distdir) is the place to put our files.
distfiles
=
ChangeLog TAGS
*
.in
*
.c
*
.h regexcpp.sed syntax.skel
dist
:
Makefile TAGS
mkdir
$(distdir)
ln
$(distfiles)
$(distdir)
# Automatically-generated dependencies below here.
alloca.o
:
alloca.c
bsd-interf.o
:
bsd-interf.c
debugmalloc.o
:
debugmalloc.c
emacsmalloc.o
:
emacsmalloc.c getpagesize.h
fileregex.o
:
fileregex.c .././regex.h
g++malloc.o
:
g++malloc.c //usr/include/stdio.h getpagesize.h
iregex.o
:
iregex.c .././regex.h
main.o
:
main.c test.h .././regex.h
malloc-test.o
:
malloc-test.c
other.o
:
other.c test.h .././regex.h
printchar.o
:
printchar.c
psx-basic.o
:
psx-basic.c test.h .././regex.h
psx-extend.o
:
psx-extend.c test.h .././regex.h
psx-generic.o
:
psx-generic.c test.h .././regex.h
psx-group.o
:
psx-group.c test.h .././regex.h
psx-interf.o
:
psx-interf.c test.h .././regex.h
psx-interv.o
:
psx-interv.c test.h .././regex.h
syntax.o
:
syntax.c .././regex.h
test.o
:
test.c test.h .././regex.h
tregress.o
:
tregress.c test.h .././regex.h
upcase.o
:
upcase.c
xmalloc.o
:
xmalloc.c
src/libraries/regex/test/Makefile.src
0 → 100644
View file @
fd5e2b03
# Makefile for regex testing.
#
# Copyright (C) 1992 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
CPPFLAGS
=
CFLAGS
=
-g
LDFLAGS
=
srcdir
=
@srcdir@
VPATH
=
@srcdir@:../@srcdir@
CC
=
@CC@
DEFS
=
@DEFS@
LIBS
=
@LIBS@
$(LOADLIBES)
ETAGS
=
etags
SHELL
=
/bin/sh
debug
=
-DDEBUG
ALL_CPPFLAGS
=
-I
.
-I
$(srcdir)
-I
../
$(srcdir)
$(DEFS)
$(CPPFLAGS)
$(debug)
.c.o
:
$(CC)
$(ALL_CPPFLAGS)
$(CFLAGS)
-c
$<
# Define this as `../regex.o' to get the optimized version.
regex_o
=
dregex.o
test_h
=
test.h
test_o
=
test.o bsd-interf.o other.o tregress.o psx-basic.o psx-extend.o
\
psx-generic.o psx-group.o psx-interf.o psx-interv.o
common_o
=
printchar.o upcase.o xmalloc.o
$(malloc)
# We have a lot of mallocs we can try when we run afoul of strange bugs.
malloc
=
@ALLOCA@
#malloc = # the libc malloc
#malloc = g++malloc.o
#malloc = debugmalloc.o
#malloc = emacsmalloc.o
emacsmallocflags
=
-Drcheck
-Dbotch
=
abort
-DUSG
# default is to do nothing.
default
:
all
:
regex syntax
regex
:
$(regex_o) $(common_o) $(test_o) main.o
$(CC)
-o
$@
$(LDFLAGS)
$^
$(LIBS)
# As long as we're doing tests, we enable debugging.
dregex.o
:
regex.c regex.h
rm
-f
$@
$(CC)
$(ALL_CPPFLAGS)
$(CFLAGS)
-c
$<
mv
regex.o
$@
# iregex is the interactive regex.
iregex
:
$(common_o) $(regex_o) iregex.o
$(CC)
-o
$@
$(LDFLAGS)
$^
$(LIBS)
# fileregex searches for an r.e. in every line of a given file.
fileregex_o
=
fileregex.o printchar.o
$(regex_o)
fileregex
:
$(fileregex_o)
$(CC)
-o
$@
$(LDFLAGS)
$(fileregex_o)
$(LIBS)
# cppregex is regex with a preprocessed regex.c. Useful when the
# problem is inside some macro.
cppregex
:
regexcpp.o $(common_o) $(test_o) main.o
$(CC)
-o
$@
$(LDFLAGS)
$^
$(LIBS)
regexcpp.o
:
regexcpp.c
regexcpp.c
:
regex.c regexcpp.sed
rm
-f
regexcpp.c
$(CC)
-E
$(ALL_CPPFLAGS)
$<
\
| egrep
-v
'^#|^ *$$'
\
|
sed
-f
regexcpp.sed
\
>
regexcpp.c
chmod
a-w regexcpp.c
# Have to give this malloc special flags.
emacsmalloc.o
:
emacsmalloc.c
$(CC)
-c
$(CFLAGS)
$(ALL_CPPFLAGS)
$(emacsmallocflags)
$<
syntax
:
syntax.o
$(CC)
$(CFLAGS)
$<
-o
$@
syntax.c
:
syntax.skel bits
sed
'/\[\[\[replace.*\]\]\]/r bits'
syntax.skel
>
$@
bits
:
regex.h
sed
-n
1,/RE_SYNTAX_EMACS/p
$<
\
|
grep
"#define RE_.*1"
\
|
sed
's/^#define \(RE_[A-Z_]*\) .*/ TEST_BIT (\1);/'
>
$@
check
:
regex
./regex
TAGS
:
regex.h regex.c *.h *.c
$(ETAGS)
-t
$^
depend
:
gcc
-MM
$(ALL_CPPFLAGS)
*
.c
>
/tmp/depend
.PHONY
:
depend
install
:
.PHONY
:
install
clean mostlyclean
:
rm
-f
*
.o regex cppregex iregex fileregex regexcpp.c syntax
distclean
:
clean
rm
-f
bits syntax.c Makefile
extraclean
:
distclean
rm
-f
*
~
*
*
\#
*
patch
*
*
.orig
*
.rej
*
.bak core a.out
realclean
:
distclean
rm
-f
TAGS
Makefile
:
Makefile.in ../config.status
(
cd
..
;
sh config.status
)
# Prevent GNU make 3 from overflowing arg limit on system V.
.NOEXPORT
:
# Assumes $(distdir) is the place to put our files.
distfiles
=
ChangeLog TAGS
*
.in
*
.c
*
.h regexcpp.sed syntax.skel
dist
:
Makefile TAGS
mkdir
$(distdir)
ln
$(distfiles)
$(distdir)
# Automatically-generated dependencies below here.
alloca.o
:
alloca.c
bsd-interf.o
:
bsd-interf.c
debugmalloc.o
:
debugmalloc.c
emacsmalloc.o
:
emacsmalloc.c getpagesize.h
fileregex.o
:
fileregex.c .././regex.h
g++malloc.o
:
g++malloc.c //usr/include/stdio.h getpagesize.h
iregex.o
:
iregex.c .././regex.h
main.o
:
main.c test.h .././regex.h
malloc-test.o
:
malloc-test.c
other.o
:
other.c test.h .././regex.h
printchar.o
:
printchar.c
psx-basic.o
:
psx-basic.c test.h .././regex.h
psx-extend.o
:
psx-extend.c test.h .././regex.h
psx-generic.o
:
psx-generic.c test.h .././regex.h
psx-group.o
:
psx-group.c test.h .././regex.h
psx-interf.o
:
psx-interf.c test.h .././regex.h
psx-interv.o
:
psx-interv.c test.h .././regex.h
syntax.o
:
syntax.c .././regex.h
test.o
:
test.c test.h .././regex.h
tregress.o
:
tregress.c test.h .././regex.h
upcase.o
:
upcase.c
xmalloc.o
:
xmalloc.c
src/libraries/regex/test/alloca.c
0 → 100644
View file @
fd5e2b03
/*
alloca -- (mostly) portable public-domain implementation -- D A Gwyn
last edit: 86/05/30 rms
include config.h, since on VMS it renames some symbols.
Use xmalloc instead of malloc.