diff options
Diffstat (limited to 'mcon/U/d_strchr.U')
-rw-r--r-- | mcon/U/d_strchr.U | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/mcon/U/d_strchr.U b/mcon/U/d_strchr.U new file mode 100644 index 0000000..ddc44b1 --- /dev/null +++ b/mcon/U/d_strchr.U @@ -0,0 +1,87 @@ +?RCS: $Id$ +?RCS: +?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi +?RCS: +?RCS: You may redistribute only under the terms of the Artistic License, +?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 License; 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: Trylink cat +?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:. +?LINT:set d_strchr d_index +: index or strchr +$cat >try.c <<EOC +#include <string.h> +int main(void) +{ + static char ret; + static int c; + ret |= *strchr("string", c); + return ret ? 0 : 1; +} +EOC +cyn=strchr +set d_strchr +eval $trylink + +$cat >try.c <<EOC +#include <strings.h> +int main(void) +{ + static char ret; + static int c; + ret |= *index("string", c); + return ret ? 0 : 1; +} +EOC +cyn=index +set d_index +eval $trylink + |