pike.git / src / modules / Regexp / pike_regexp.c

version» Context lines:

pike.git/src/modules/Regexp/pike_regexp.c:367:      /*    - reg - regular expression, i.e. main body or parenthesized thing    *    * Caller must absorb opening parenthesis.    *    * Combining parenthesis handling with the base level of regular expression    * is a trifle forced, but the need to tie the tails of the branches to what    * follows makes it hard to avoid.    */ - static char *reg(paren, flagp) - int paren; /* Parenthesized? */ - int *flagp; + static char *reg(int paren,int *flagp)   {    register char *ret;    register char *br;    register char *ender;    register int parno=0; /* make gcc happy */    int flags;       *flagp = HASWIDTH; /* Tentatively. */       /* Make an OPEN node, if parenthesized. */
pike.git/src/modules/Regexp/pike_regexp.c:437:    /* NOTREACHED */    }    return (ret);   }      /*    - regbranch - one alternative of an | operator    *    * Implements the concatenation operator.    */ - static char *regbranch(flagp) - int *flagp; + static char *regbranch(int *flagp)   {    register char *ret;    register char *chain;    register char *latest;    int flags;       *flagp = WORST; /* Tentatively. */       ret = regnode(BRANCH);    chain = (char *)NULL;
pike.git/src/modules/Regexp/pike_regexp.c:474:   }      /*    - regpiece - something followed by possible [*]    *    * Note that the branching code sequence used for * is somewhat optimized:    * they use the same NOTHING node as both the endmarker for their branch    * list and the body of the last branch. It might seem that this node could    * be dispensed with entirely, but the endmarker role is not redundant.    */ - static char *regpiece(flagp) - int *flagp; + static char *regpiece(int *flagp)   {    register char *ret;    register short op;    /* register char *nxt; */    int flags;       ret = regatom(&flags);    if (ret == (char *)NULL)    return ((char *)NULL);   
pike.git/src/modules/Regexp/pike_regexp.c:538:   }         /*    - regatom - the lowest level    *    * Optimization: gobbles an entire sequence of ordinary characters so that    * it can turn them into a single node, which is smaller to store and    * faster to run.    */ - static char *regatom(flagp) - int *flagp; + static char *regatom(int *flagp)   {    register char *ret;    int flags;       *flagp = WORST; /* Tentatively. */       switch (*regparse++) {    case CARET:    ret = regnode(BOL);    break;
pike.git/src/modules/Regexp/pike_regexp.c:705:       place = opnd; /* Op node, where operand used to be. */    *place++ = op;    *place++ = '\0';    *place++ = '\0';   }      /*    - 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;    register int offset;       if (p == &regdummy)    return;       /* Find last node. */    scan = p;
pike.git/src/modules/Regexp/pike_regexp.c:736:    offset = scan - val;    else    offset = val - scan;    *(scan + 1) = (offset >> 8) & 0377;    *(scan + 2) = offset & 0377;   }      /*    - 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 == (char *)NULL || p == &regdummy || OP(p) != BRANCH)    return;    regtail(OPERAND(p), val);   }      /*    * regexec and friends    */