From 21ba565ff4f164b9dfd24a7b0a2cc5d114713e55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Tue, 11 Feb 1997 21:03:46 -0800
Subject: [PATCH] some regexp functions renamed

Rev: src/modules/Regexp/glue.c:1.3
Rev: src/modules/Regexp/pike_regexp.c:1.3
Rev: src/modules/Regexp/pike_regexp.h:1.2
---
 src/modules/Regexp/glue.c        |  8 +++----
 src/modules/Regexp/pike_regexp.c | 38 +++-----------------------------
 src/modules/Regexp/pike_regexp.h | 10 +++++----
 3 files changed, 13 insertions(+), 43 deletions(-)

diff --git a/src/modules/Regexp/glue.c b/src/modules/Regexp/glue.c
index d12810c6df..1775386234 100644
--- a/src/modules/Regexp/glue.c
+++ b/src/modules/Regexp/glue.c
@@ -79,7 +79,7 @@ static void regexp_create(INT32 args)
       THIS->num_paren = i;
     }
 #else
-    THIS->regexp=regcomp(sp[-args].u.string->str, 0);
+    THIS->regexp=pike_regcomp(sp[-args].u.string->str, 0);
 #endif
   }
 }
@@ -87,7 +87,7 @@ static void regexp_create(INT32 args)
 static void regexp_match(INT32 args)
 {
   int i;
-  const char *str;
+  char *str;
 #ifdef USE_SYSTEM_REGEXP
   regex_t *regexp = &(THIS->regexp);
 #else
@@ -101,7 +101,7 @@ static void regexp_match(INT32 args)
   i = !regexec(regexp, str, 0, NULL, 0);
   DISALLOW_THREADS();
 #else
-  i=regexec(regexp, str);
+  i=pike_regexec(regexp, str);
 #endif /* USE_SYSTEM_REGEXP */
   pop_n_elems(args);
   push_int(i);
@@ -151,7 +151,7 @@ static void regexp_split(INT32 args)
     push_int(0);
   }
 #else
-  if(regexec(r=THIS->regexp, s->str))
+  if(pike_regexec(r=THIS->regexp, s->str))
   {
     int i,j;
     s->refs++;
diff --git a/src/modules/Regexp/pike_regexp.c b/src/modules/Regexp/pike_regexp.c
index 7617935682..a0ff79a859 100644
--- a/src/modules/Regexp/pike_regexp.c
+++ b/src/modules/Regexp/pike_regexp.c
@@ -242,9 +242,7 @@ STATIC void     regoptail();
  * Beware that the optimization-preparation code in here knows about some
  * of the structure of the compiled regexp.
  */
-regexp *regcomp(exp,excompat)
-char   *exp;
-int		excompat;	/* \( \) operators like in unix ex */
+regexp *pike_regcomp(char *exp,int excompat)
 {
     register regexp *r;
     register char  *scan;
@@ -784,9 +782,7 @@ STATIC char    *regprop();
 /*
  - regexec - match a regexp against a string
  */
-int regexec(prog, string)
-register regexp *prog;
-register char  *string;
+int pike_regexec(regexp *prog, char *string)
 {
     register char  *s;
 
@@ -1316,19 +1312,8 @@ char           *op;
 /*
  - regsub - perform substitutions after a regexp match
  */
-#ifdef __STDC__
-
-char *regsub(regexp *prog, char *source, char *dest, int n)
 
-#else
-
-char *regsub(prog, source, dest, n)
-regexp         *prog;
-char           *source;
-char           *dest;
-int		n;
-
-#endif
+char *pike_regsub(regexp *prog, char *source, char *dest, int n)
 {
     register char  *src;
     register char  *dst;
@@ -1389,20 +1374,3 @@ int		n;
     return dst;
 }
 
-
-#if 0	/* Use the local regerror() in ed.c */
-#ifdef __STDC__
-
-void regerror(char *s)
-
-#else
-
-void regerror(s)
-char           *s;
-
-#endif
-{
-    fprintf(stderr, "regexp(3): %s", s);
-    exit(1);
-}
-#endif /* 0 */
diff --git a/src/modules/Regexp/pike_regexp.h b/src/modules/Regexp/pike_regexp.h
index 5fa51439e9..621691cfe0 100644
--- a/src/modules/Regexp/pike_regexp.h
+++ b/src/modules/Regexp/pike_regexp.h
@@ -26,8 +26,10 @@ typedef struct regexp
 
 
 
-extern regexp *regcomp();
-extern int regexec();
-extern char *regsub();
-extern void regerror();
+/* Prototypes begin here */
+regexp *pike_regcomp(char *exp,int excompat);
+int pike_regexec(regexp *prog, char *string);
+char *pike_regsub(regexp *prog, char *source, char *dest, int n);
+/* Prototypes end here */
+
 #endif
-- 
GitLab