/*
* Use compile(3) if no regcomp present.
*/
-#if !defined(HAVE_REGCOMP) && defined(HAVE_REGEXP_H)
-#define INIT char *sp = instring;
-#define GETC() (*sp++)
-#define PEEKC() (*sp)
-#define UNGETC(c) (--sp)
-#define RETURN(c) return(c)
-#define ERROR(c)
+#if !defined(HAVE_REGCOMP) && defined(HAVE_REGEXPR_H) && defined(HAVE_COMPILE)
#define RE_BUF_SIZE 1024
-#include <regexp.h>
-#endif /* !HAVE_REGCOMP && HAVE_REGEXP_H */
+#include <regexpr.h>
+#endif /* !HAVE_REGCOMP && HAVE_REGEXP_H && HAVE_COMPILE */
#define MAX_FORMAT_BUFFER 1024
#ifndef min
kret = 0;
}
regfree(&match_exp);
-#elif HAVE_REGEXP_H
+#elif HAVE_REGEXPR_H
compile(regexp,
regexp_buffer,
- ®exp_buffer[RE_BUF_SIZE],
- '\0');
+ ®exp_buffer[RE_BUF_SIZE]);
if (step(string, regexp_buffer)) {
if ((loc1 == string) &&
(loc2 == &string[strlen(string)]))
} while (doall && matched);
regfree(&match_exp);
}
-#elif HAVE_REGEXP_H
+#elif HAVE_REGEXPR_H
int matched;
char *cp;
char *op;
compile(regexp,
regexp_buffer,
- ®exp_buffer[RE_BUF_SIZE],
- '\0');
+ ®exp_buffer[RE_BUF_SIZE]);
cp = in;
op = out;
matched = 0;