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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
?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_strchr.U,v $
?RCS: Revision 3.0.1.2 1993/10/16 13:49:20 ram
?RCS: patch12: added support for HAS_INDEX
?RCS: patch12: added magic for index() and rindex()
?RCS:
?RCS: Revision 3.0.1.1 1993/09/13 16:05:26 ram
?RCS: patch10: now only defines HAS_STRCHR, no macro remap of index (WAD)
?RCS:
?RCS: Revision 3.0 1993/08/18 12:07:32 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?MAKE:d_strchr d_index: contains strings Setvar Myread Oldconfig Csym
?MAKE: -pick add $@ %<
?S:d_strchr:
?S: This variable conditionally defines HAS_STRCHR if strchr() and
?S: strrchr() are available for string searching.
?S:.
?S:d_index:
?S: This variable conditionally defines HAS_INDEX if index() and
?S: rindex() are available for string searching.
?S:.
?C:HAS_STRCHR:
?C: This symbol is defined to indicate that the strchr()/strrchr()
?C: functions are available for string searching. If not, try the
?C: index()/rindex() pair.
?C:.
?C:HAS_INDEX:
?C: This symbol is defined to indicate that the index()/rindex()
?C: functions are available for string searching.
?C:.
?H:#$d_strchr HAS_STRCHR /**/
?H:#$d_index HAS_INDEX /**/
?H:.
?M:index: HAS_INDEX
?M:#ifndef HAS_INDEX
?M:#ifndef index
?M:#define index strchr
?M:#endif
?M:#endif
?M:.
?M:rindex: HAS_INDEX
?M:#ifndef HAS_INDEX
?M:#ifndef rindex
?M:#define rindex strrchr
?M:#endif
?M:#endif
?M:.
?T:vali
?LINT:set d_strchr d_index
: index or strchr
echo " "
if set index val -f; eval $csym; $val; then
if set strchr val -f d_strchr; eval $csym; $val; then
if $contains strchr "$strings" >/dev/null 2>&1 ; then
?X: has index, strchr, and strchr in string header
val="$define"
vali="$undef"
echo "strchr() found." >&4
else
?X: has index, strchr, and no strchr in string header
val="$undef"
vali="$define"
echo "index() found." >&4
fi
else
?X: has only index, no strchr, string header is a moot point
val="$undef"
vali="$define"
echo "index() found." >&4
fi
else
if set strchr val -f d_strchr; eval $csym; $val; then
val="$define"
vali="$undef"
echo "strchr() found." >&4
else
echo "No index() or strchr() found!" >&4
val="$undef"
vali="$undef"
fi
fi
set d_strchr; eval $setvar
val="$vali"
set d_index; eval $setvar
|