diff options
author | rmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d> | 2011-11-14 23:31:52 +0000 |
---|---|---|
committer | rmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d> | 2011-11-14 23:31:52 +0000 |
commit | 6a9d0870219d8590bac17037f72b8f4287a71c8a (patch) | |
tree | 3cef596cf7f1038364e8766f35ea6a225c054305 | |
parent | 92423e3a5cdaade1dc3c6a3434af613d2795a116 (diff) |
Moved regcomp() test to a separate unit since modern code should now
only use this POSIX routine and no longer rely on obsolete regcmp() or
re_comp() routines.
Cleaned up previously added units to remove unused RCS logs.
git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@104 2592e710-e01b-42a5-8df0-11608a6cc53d
-rw-r--r-- | MANIFEST | 3 | ||||
-rw-r--r-- | mcon/U/d_end_symbol.U | 4 | ||||
-rw-r--r-- | mcon/U/d_etext_symbol.U | 4 | ||||
-rw-r--r-- | mcon/U/d_regcmp.U | 30 | ||||
-rw-r--r-- | mcon/U/d_regcomp.U | 44 | ||||
-rw-r--r-- | mcon/U/i_alloca.U | 1 |
6 files changed, 53 insertions, 33 deletions
@@ -324,7 +324,8 @@ mcon/U/d_rdchk.U Is rdchk() there to check for input? mcon/U/d_readdir.U Do we have readdir()? mcon/U/d_readlink.U Do we have readlink()? mcon/U/d_recvmsg.U Do we have recvmsg()? -mcon/U/d_regcmp.U Do we have regcmp()? +mcon/U/d_regcmp.U Do we have regcmp() or re_comp()? +mcon/U/d_regcomp.U Do we have POSIX regcomp()? mcon/U/d_regparm.U Can we use __attribute__((__regparm__(n)))? mcon/U/d_rename.U Do we have rename()? mcon/U/d_rmdir.U Do we have rmdir()? diff --git a/mcon/U/d_end_symbol.U b/mcon/U/d_end_symbol.U index 5dfe8b6..591ba0c 100644 --- a/mcon/U/d_end_symbol.U +++ b/mcon/U/d_end_symbol.U @@ -8,10 +8,6 @@ ?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_select.U,v $ -?RCS: Revision 3.0 1993/08/18 12:07:02 ram -?RCS: Baseline for dist 3.0 netwide release. -?RCS: ?MAKE:d_end_symbol: Trylink cat ?MAKE: -pick add $@ %< ?S:d_end_symbol: diff --git a/mcon/U/d_etext_symbol.U b/mcon/U/d_etext_symbol.U index 47c01e5..1e50671 100644 --- a/mcon/U/d_etext_symbol.U +++ b/mcon/U/d_etext_symbol.U @@ -8,10 +8,6 @@ ?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_select.U,v $ -?RCS: Revision 3.0 1993/08/18 12:07:02 ram -?RCS: Baseline for dist 3.0 netwide release. -?RCS: ?MAKE:d_etext_symbol: Trylink cat ?MAKE: -pick add $@ %< ?S:d_etext_symbol: diff --git a/mcon/U/d_regcmp.U b/mcon/U/d_regcmp.U index 50fe24c..cff5054 100644 --- a/mcon/U/d_regcmp.U +++ b/mcon/U/d_regcmp.U @@ -15,13 +15,11 @@ ?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 d_regcomp: Csym cat +?MAKE:d_regcmp d_re_comp: Csym cat ?MAKE: -pick add $@ %< -?S:d_regcomp: -?S: This variable conditionally defines the HAS_REGCOMP symbol, which -?S: indicates to the C program that the regcomp() routine is available -?S: for regular patern matching (usally on POSIX.2 conforming systems). -?S:. +?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 @@ -33,11 +31,6 @@ ?S: for regular patern matching (usally on BSD). If so, it is likely that ?S: re_exec() exists. ?S:. -?C:HAS_REGCOMP (REGCOMP): -?C: This symbol, if defined, indicates that the regcomp() routine is -?C: available to do some regular patern matching (usually on POSIX.2 -?C: conforming systems). -?C:. ?C:HAS_REGCMP (REGCMP): ?C: This symbol, if defined, indicates that the regcmp() routine is ?C: available to do some regular patern matching (usually on System V). @@ -47,34 +40,25 @@ ?C: available to do some regular patern matching (usually on BSD). If so, ?C: it is likely that re_exec() be available. ?C:. -?H:#$d_regcomp HAS_REGCOMP /* POSIX.2 */ ?H:#$d_regcmp HAS_REGCMP /* sysV */ ?H:#$d_re_comp HAS_RECOMP /* BSD */ ?H:. ?T:val -: see if regcomp, regcmp, or re_comp exist, for regular pattern matching +: see if regcmp or re_comp exist, for regular pattern matching echo " " -if set regcomp val -f d_regcomp; eval $csym; $val; then - echo 'regcomp() found.' >&4 - d_regcomp="$define" - d_regcmp="$undef" - d_re_comp="$undef" -elif set regcmp val -f d_regcmp; eval $csym; $val; then +if set regcmp val -f d_regcmp; eval $csym; $val; then echo 'regcmp() found.' >&4 d_regcmp="$define" - d_regcomp="$undef" 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_regcomp="$undef" d_regcmp="$undef" else $cat >&4 <<EOM -No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching. +No regcmp() nor re_comp() found. EOM d_regcmp="$undef" d_re_comp="$undef" - d_regcomp="$undef" fi diff --git a/mcon/U/d_regcomp.U b/mcon/U/d_regcomp.U new file mode 100644 index 0000000..88d0b4b --- /dev/null +++ b/mcon/U/d_regcomp.U @@ -0,0 +1,44 @@ +?RCS: $Id$ +?RCS: +?RCS: Copyright (c) 2011, 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$ +?MAKE:d_regcomp: Trylink cat +?MAKE: -pick add $@ %< +?S:d_regcomp: +?S: This variable conditionally defines the HAS_REGCOMP symbol, which +?S: indicates to the C program that the regcomp() routine is available +?S: for regular patern matching (usally on POSIX.2 conforming systems). +?S:. +?C:HAS_REGCOMP (REGCOMP): +?C: This symbol, if defined, indicates that the regcomp() routine is +?C: available to do some regular patern matching (usually on POSIX.2 +?C: conforming systems). +?C: When regcomp() exists, it is safe to assume regexec() and regfree() +?C: are also available. +?C:. +?H:#$d_regcomp HAS_REGCOMP /**/ +?H:. +?LINT:set d_regcomp +: see if regcomp exists +$cat >try.c <<EOC +#include <regex.h> +int main(void) +{ + int ret = 0; + regex_t re; + ret |= regcomp(&re, ".", + REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE); + return ret ? 0 : 1; +} +EOC +cyn=regcomp +set d_regcomp +eval $trylink + diff --git a/mcon/U/i_alloca.U b/mcon/U/i_alloca.U index 4f33614..5105031 100644 --- a/mcon/U/i_alloca.U +++ b/mcon/U/i_alloca.U @@ -8,7 +8,6 @@ ?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: i_gdbm.U,v $ ?MAKE:i_alloca: Trylink cat ?MAKE: -pick add $@ %< ?S:i_alloca: |