summaryrefslogtreecommitdiff
path: root/mcon/U/d_regcmp.U
blob: e5e7a1f0e75e2c18743c66361e7e7ef1ec0f0e04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS: 
?RCS: You may redistribute only under the terms of the Artistic Licence,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic Licence; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: d_regcmp.U,v $
?RCS: Revision 3.0.1.1  1995/01/30  14:34:45  ram
?RCS: patch49: now looks for POSIX regcomp() routine
?RCS:
?RCS: Revision 3.0  1993/08/18  12:06:53  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?MAKE:d_regcmp d_re_comp: Csym cat
?MAKE:	-pick add $@ %<
?X:
?X: Modern code should use POSIX's regcomp().
?X:
?S:d_regcmp:
?S:	This variable conditionally defines the HAS_REGCMP symbol, which
?S:	indicates to the C program that the regcmp() routine is available
?S:	for regular pattern matching (usually on System V).
?S:.
?S:d_re_comp:
?S:	This variable conditionally defines the HAS_RECOMP symbol, which
?S:	indicates to the C program that the re_comp() routine is available
?S:	for regular pattern matching (usually on BSD). If so, it is likely that
?S:	re_exec() exists.
?S:.
?C:HAS_REGCMP (REGCMP):
?C:	This symbol, if defined, indicates that the regcmp() routine is
?C:	available to do some regular pattern matching (usually on System V).
?C:.
?C:HAS_RECOMP (RECOMP):
?C:	This symbol, if defined, indicates that the re_comp() routine is
?C:	available to do some regular pattern matching (usually on BSD). If so,
?C:	it is likely that re_exec() be available.
?C:.
?H:#$d_regcmp HAS_REGCMP		/* sysV */
?H:#$d_re_comp HAS_RECOMP		/* BSD */
?H:.
?T:val
: see if regcmp or re_comp exist, for regular pattern matching
echo " "
if set regcmp val -f d_regcmp; eval $csym; $val; then
	echo 'regcmp() found.' >&4
	d_regcmp="$define"
	d_re_comp="$undef"
elif set re_comp val -f d_re_comp; eval $csym; $val; then
	echo 're_comp() found, assuming re_exec() also exists.' >&4
	d_re_comp="$define"
	d_regcmp="$undef"
else
	$cat >&4 <<EOM
No regcmp() nor re_comp() found.
EOM
	d_regcmp="$undef"
	d_re_comp="$undef"
fi