1 ?RCS: $Id: d_strchr.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: d_strchr.U,v $
12 ?RCS: Revision 3.0.1.2 1993/10/16 13:49:20 ram
13 ?RCS: patch12: added support for HAS_INDEX
14 ?RCS: patch12: added magic for index() and rindex()
16 ?RCS: Revision 3.0.1.1 1993/09/13 16:05:26 ram
17 ?RCS: patch10: now only defines HAS_STRCHR, no macro remap of index (WAD)
19 ?RCS: Revision 3.0 1993/08/18 12:07:32 ram
20 ?RCS: Baseline for dist 3.0 netwide release.
22 ?MAKE:d_strchr d_index: contains strings Setvar Myread Oldconfig Csym
23 ?MAKE: -pick add $@ %<
25 ?S: This variable conditionally defines HAS_STRCHR if strchr() and
26 ?S: strrchr() are available for string searching.
29 ?S: This variable conditionally defines HAS_INDEX if index() and
30 ?S: rindex() are available for string searching.
33 ?C: This symbol is defined to indicate that the strchr()/strrchr()
34 ?C: functions are available for string searching. If not, try the
35 ?C: index()/rindex() pair.
38 ?C: This symbol is defined to indicate that the index()/rindex()
39 ?C: functions are available for string searching.
41 ?H:#$d_strchr HAS_STRCHR /**/
42 ?H:#$d_index HAS_INDEX /**/
47 ?M:#define index strchr
54 ?M:#define rindex strrchr
59 ?LINT:set d_strchr d_index
62 if set index val -f; eval $csym; $val; then
63 if set strchr val -f d_strchr; eval $csym; $val; then
64 if $contains strchr "$strings" >/dev/null 2>&1 ; then
65 ?X: has index, strchr, and strchr in string header
68 echo "strchr() found." >&4
70 ?X: has index, strchr, and no strchr in string header
73 echo "index() found." >&4
76 ?X: has only index, no strchr, string header is a moot point
79 echo "index() found." >&4
82 if set strchr val -f d_strchr; eval $csym; $val; then
85 echo "strchr() found." >&4
87 echo "No index() or strchr() found!" >&4
92 set d_strchr; eval $setvar
94 set d_index; eval $setvar