#ifndef STATIC
#define STATIC static
#endif
-STATIC char *reg();
-STATIC char *regbranch();
-STATIC char *regpiece();
-STATIC char *regatom();
-STATIC char *regnode();
-STATIC char *regnext();
-STATIC void regc();
-STATIC void reginsert();
-STATIC void regtail();
-STATIC void regoptail();
+STATIC char *reg(int paren, int *flagp);
+STATIC char *regbranch(int *flagp);
+STATIC char *regpiece(int *flagp);
+STATIC char *regatom(int *flagp);
+STATIC char *regnode(int op);
+STATIC char *regnext(register char *p);
+STATIC void regc(int b);
+STATIC void reginsert(int op, char *opnd);
+STATIC void regtail(char *p, char *val);
+STATIC void regoptail(char *p, char *val);
#ifdef STRCSPN
STATIC int strcspn();
#endif
* of the structure of the compiled regexp.
*/
regexp *
-regcomp(exp)
-char *exp;
+regcomp (char *exp)
{
register regexp *r;
register char *scan;
* follows makes it hard to avoid.
*/
static char *
-reg(paren, flagp)
-int paren; /* Parenthesized? */
-int *flagp;
+reg (
+ int paren, /* Parenthesized? */
+ int *flagp
+)
{
register char *ret;
register char *br;
* Implements the concatenation operator.
*/
static char *
-regbranch(flagp)
-int *flagp;
+regbranch (int *flagp)
{
register char *ret;
register char *chain;
* endmarker role is not redundant.
*/
static char *
-regpiece(flagp)
-int *flagp;
+regpiece (int *flagp)
{
register char *ret;
register char op;
* separate node; the code is simpler that way and it's not worth fixing.
*/
static char *
-regatom(flagp)
-int *flagp;
+regatom (int *flagp)
{
register char *ret;
int flags;
/*
- regnode - emit a node
*/
-static char * /* Location. */
-regnode(op)
-char op;
+static char *
+regnode (int op)
{
register char *ret;
register char *ptr;
/*
- regc - emit (if appropriate) a byte of code
*/
-static void
-regc(b)
-char b;
+static void
+regc (int b)
{
if (regcode != ®dummy)
*regcode++ = b;
*
* Means relocating the operand.
*/
-static void
-reginsert(op, opnd)
-char op;
-char *opnd;
+static void
+reginsert (int op, char *opnd)
{
register char *src;
register char *dst;
/*
- regtail - set the next-pointer at the end of a node chain
*/
-static void
-regtail(p, val)
-char *p;
-char *val;
+static void
+regtail (char *p, char *val)
{
register char *scan;
register char *temp;
/*
- regoptail - regtail on operand of first argument; nop if operandless
*/
-static void
-regoptail(p, val)
-char *p;
-char *val;
+static void
+regoptail (char *p, char *val)
{
/* "Operandless" and "op != BRANCH" are synonymous in practice. */
if (p == NULL || p == ®dummy || OP(p) != BRANCH)
/*
* Forwards.
*/
-STATIC int regtry();
-STATIC int regmatch();
-STATIC int regrepeat();
+STATIC int regtry(regexp *prog, char *string);
+STATIC int regmatch(char *prog);
+STATIC int regrepeat(char *p);
#ifdef DEBUG
int regnarrate = 0;
/*
- regexec - match a regexp against a string
*/
-int
-regexec(prog, string)
-register regexp *prog;
-register char *string;
+int
+regexec (register regexp *prog, register char *string)
{
register char *s;
#ifndef IS_LINUX
- regtry - try match at specific point
*/
static int /* 0 failure, 1 success */
-regtry(prog, string)
-regexp *prog;
-char *string;
+regtry(regexp *prog, char *string)
{
register int i;
register char **sp;
* by recursion.
*/
static int /* 0 failure, 1 success */
-regmatch(prog)
-char *prog;
+regmatch(char *prog)
{
register char *scan; /* Current node. */
char *next; /* Next node. */
- regrepeat - repeatedly match something simple, report how many
*/
static int
-regrepeat(p)
-char *p;
+regrepeat(char *p)
{
register int count = 0;
register char *scan;
- regnext - dig the "next" pointer out of a node
*/
static char *
-regnext(p)
-register char *p;
+regnext (register char *p)
{
register int offset;
/*
- regdump - dump a regexp onto stdout in vaguely comprehensible form
*/
-void
-regdump(r)
-regexp *r;
+void
+regdump (regexp *r)
{
register char *s;
register char op = EXACTLY; /* Arbitrary non-END op. */
- regprop - printable representation of opcode
*/
static char *
-regprop(op)
-char *op;
+regprop (char *op)
{
register char *p;
static char buf[50];
* of characters not from s2
*/
-static int
-strcspn(s1, s2)
-char *s1;
-char *s2;
+static int
+strcspn (char *s1, char *s2)
{
register char *scan1;
register char *scan2;