summaryrefslogtreecommitdiff
path: root/zwgc
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1997-09-29 04:49:03 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1997-09-29 04:49:03 +0000
commit17416619185d3a9aeb006a931be0e50a25f809cf (patch)
tree0c3ab6c6115b4784d76275ea39ea4dd5adf86b09 /zwgc
parentbb56e5757cd0639afee1ddafccc12cb94116de0f (diff)
The new world order is to assume POSIX regexps.
Diffstat (limited to 'zwgc')
-rw-r--r--zwgc/Makefile.in2
-rw-r--r--zwgc/regexp.c62
2 files changed, 2 insertions, 62 deletions
diff --git a/zwgc/Makefile.in b/zwgc/Makefile.in
index ca76220..ce75d68 100644
--- a/zwgc/Makefile.in
+++ b/zwgc/Makefile.in
@@ -27,7 +27,7 @@ CFLAGS=${DEBUG} -DDATADIR=\"${datadir}\" -I${top_srcdir}/h \
YFLAGS=-d
LDFLAGS=${DEBUG} -L${BUILDTOP}/lib @X_LIBS@ @LDFLAGS@
LIBS=-lzephyr @LIBS@ -lcom_err @X_PRE_LIBS@ @ZWGC_LIBX11@ @X_EXTRA_LIBS@ \
- @TLIB@ @RLIB@
+ @TLIB@ @RX_LIBS@
OBJS= port_dictionary.o pointer_dictionary.o unsigned_long_dictionary.o \
string_dictionary.o int_dictionary.o string_dictionary_aux.o \
diff --git a/zwgc/regexp.c b/zwgc/regexp.c
index f874e45..07fad58 100644
--- a/zwgc/regexp.c
+++ b/zwgc/regexp.c
@@ -13,20 +13,14 @@
*/
#include <sysdep.h>
+#include <regex.h>
#if (!defined(lint) && !defined(SABER))
static const char rcsid_regexp_c[] = "$Id$";
#endif
-#ifdef SOLARIS
-#include <libgen.h>
-#endif
-
#include "regexp.h"
-#ifdef HAVE_REGCOMP
-#include <regex.h>
-
int ed_regexp_match_p(test_string, pattern)
string test_string;
string pattern;
@@ -51,57 +45,3 @@ int ed_regexp_match_p(test_string, pattern)
regfree(&RE);
return(retval == 0 ? 1 : 0);
}
-
-#else
-char *re_comp();
-int re_exec();
-
-int ed_regexp_match_p(test_string, pattern)
- string test_string;
- string pattern;
-{
- char *comp_retval;
- int exec_retval;
-
- if (comp_retval = re_comp(pattern)) {
- fprintf(stderr,"%s in regex %s\n",comp_retval,pattern);
- return(0);
- }
- if ((exec_retval=re_exec(test_string)) == -1) {
- fprintf(stderr,"Internal error in re_exec()");
- return(0);
- }
-
- return(exec_retval);
-}
-#endif
-
-#if !defined(HAVE_RE_COMP) && !defined(HAVE_REGCOMP)
-
-#ifdef HAVE_LIBGEN_H
-#include <libgen.h>
-#endif
-
-static char *re;
-
-char *re_comp(s)
- char *s;
-{
- if(!s)
- return 0;
- if(re)
- free(re);
-
- if(!(re = regcmp(s, (char *)0)))
- return "Bad argument to re_comp";
-
- return 0;
-}
-
-int re_exec(s)
- char *s;
-{
- return regex(re, s) != 0;
-}
-
-#endif