summaryrefslogtreecommitdiff
path: root/zwgc/regexp.c
diff options
context:
space:
mode:
authorGravatar John F. Carr <jfc@mit.edu>1991-06-20 05:20:45 +0000
committerGravatar John F. Carr <jfc@mit.edu>1991-06-20 05:20:45 +0000
commitea967b1b2d1b41bb96c2017dff7efea79ad753be (patch)
treed333899448a846acf7963d669acc191ad5c1c687 /zwgc/regexp.c
parentff4cfeb23f963fa951223f03751ab52792e662c8 (diff)
AUX support.
Diffstat (limited to 'zwgc/regexp.c')
-rw-r--r--zwgc/regexp.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/zwgc/regexp.c b/zwgc/regexp.c
index 3b3cdf0..26ce0e9 100644
--- a/zwgc/regexp.c
+++ b/zwgc/regexp.c
@@ -16,8 +16,6 @@
static char rcsid_regexp_c[] = "$Id$";
#endif
-#include <zephyr/mit-copyright.h>
-
#include <stdio.h>
#include "regexp.h"
@@ -42,3 +40,35 @@ int ed_regexp_match_p(test_string, pattern)
return(exec_retval);
}
+
+
+/*
+ * This is for AUX.
+ * It is a wrapper around the C library regexp functions.
+ */
+
+#ifdef _AUX_SOURCE
+
+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