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

version» Context lines:

pike.git/src/modules/Regexp/pike_regexp.c:235:    * place to put the code. So we cheat: we compile it twice, once with code    * generation turned off and size counting turned on, and once "for real".    * This also means that we don't allocate space until we are sure that the    * thing really will compile successfully, and we never have to move the    * code and thus invalidate pointers into it. (Note that it has to be in    * one piece because free() must be able to free it all.)    *    * 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;    register char *longest;    register int len;    int flags;    short *exp2,*dest,c;       if (exp == (char *)NULL)    FAIL("NULL argument");
pike.git/src/modules/Regexp/pike_regexp.c:777: Inside #if defined(DEBUG)
     #ifdef DEBUG   int regnarrate = 0;   void regdump();   STATIC char *regprop();   #endif      /*    - 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;       /* Be paranoid... */    if (prog == (regexp *)NULL || string == (char *)NULL) {    regerror("NULL parameter");    return (0);    }    /* Check validity of program. */    if (UCHARAT(prog->program) != MAGIC) {
pike.git/src/modules/Regexp/pike_regexp.c:1309:    }    if (p != (char *)NULL)    strcat(buf, p);    return (buf);   }   #endif      /*    - 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;    register char c;    register int no;    register int len;   #ifndef strncpy    extern char *strncpy();   #endif   
pike.git/src/modules/Regexp/pike_regexp.c:1382:    }    }    if (--n < 0) { /* amylaar */    regerror("line too long");    return NULL;    }    *dst = '\0';    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 */ +