#include <stdio.h>#include <string.h>#include "regexp.h"#include "regmagic.h"Go to the source code of this file.
Defines | |
| #define | END 0 |
| #define | BOL 1 |
| #define | EOL 2 |
| #define | ANY 3 |
| #define | ANYOF 4 |
| #define | ANYBUT 5 |
| #define | BRANCH 6 |
| #define | BACK 7 |
| #define | EXACTLY 8 |
| #define | NOTHING 9 |
| #define | STAR 10 |
| #define | PLUS 11 |
| #define | OPEN 20 |
| #define | CLOSE 30 |
| #define | OP(p) (*(p)) |
| #define | NEXT(p) (((*((p)+1)&0377)<<8) + (*((p)+2)&0377)) |
| #define | OPERAND(p) ((p) + 3) |
| #define | UCHARAT(p) ((int)*(unsigned char *)(p)) |
| #define | FAIL(m) { regerror(m); return(NULL); } |
| #define | ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?') |
| #define | META "^$.[()|?+*\\" |
| #define | HASWIDTH 01 |
| #define | SIMPLE 02 |
| #define | SPSTART 04 |
| #define | WORST 0 |
| #define | STATIC static |
Functions | |
| 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 () |
| regexp * | regcomp (char *exp) |
| 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 (char op) |
| static void | regc (char b) |
| static void | reginsert (char op, char *opnd) |
| static void | regtail (char *p, char *val) |
| static void | regoptail (char *p, char *val) |
| STATIC int | regtry () |
| STATIC int | regmatch () |
| STATIC int | regrepeat () |
| int | regexec (regexp *prog, char *string) |
| static int | regtry (regexp *prog, char *string) |
| static int | regmatch (char *prog) |
| static int | regrepeat (char *p) |
| static char * | regnext (char *p) |
| long | last_regsize () |
Variables | |
| static char * | regparse |
| static int | regnpar |
| static char | regdummy |
| static char * | regcode |
| static long | regsize |
| static char * | reginput |
| static char * | regbol |
| static char ** | regstartp |
| static char ** | regendp |
| #define ANY 3 |
| #define ANYBUT 5 |
| #define ANYOF 4 |
| #define BACK 7 |
Definition at line 75 of file regexp.c.
Referenced by regmatch(), regnext(), regpiece(), and regtail().
| #define BOL 1 |
| #define BRANCH 6 |
Definition at line 74 of file regexp.c.
Referenced by regbranch(), regmatch(), regoptail(), and regpiece().
| #define CLOSE 30 |
| #define END 0 |
| #define EOL 2 |
| #define EXACTLY 8 |
Definition at line 76 of file regexp.c.
Referenced by regatom(), regcomp(), regmatch(), and regrepeat().
| #define FAIL | ( | m | ) | { regerror(m); return(NULL); } |
| #define HASWIDTH 01 |
Definition at line 140 of file regexp.c.
Referenced by reg(), regatom(), regbranch(), and regpiece().
| #define ISMULT | ( | c | ) | ((c) == '*' || (c) == '+' || (c) == '?') |
| #define NEXT | ( | p | ) | (((*((p)+1)&0377)<<8) + (*((p)+2)&0377)) |
| #define NOTHING 9 |
| #define OP | ( | p | ) | (*(p)) |
Definition at line 116 of file regexp.c.
Referenced by regcomp(), regmatch(), regnext(), regoptail(), regrepeat(), and regtail().
| #define OPEN 20 |
| #define OPERAND | ( | p | ) | ((p) + 3) |
Definition at line 118 of file regexp.c.
Referenced by regcomp(), regmatch(), regoptail(), and regrepeat().
| #define PLUS 11 |
| #define SIMPLE 02 |
| #define SPSTART 04 |
Definition at line 142 of file regexp.c.
Referenced by reg(), regatom(), regbranch(), regcomp(), and regpiece().
| #define STAR 10 |
| #define UCHARAT | ( | p | ) | ((int)*(unsigned char *)(p)) |
| #define WORST 0 |
| long last_regsize | ( | ) |
Definition at line 1217 of file regexp.c.
References regsize.
Referenced by regexp_compile_internal().
| static char* reg | ( | int | paren, | |
| int * | flagp | |||
| ) | [static] |
| static char* regatom | ( | int * | flagp | ) | [static] |
| STATIC char* regatom | ( | ) |
Referenced by regpiece().
| static char* regbranch | ( | int * | flagp | ) | [static] |
| STATIC char* regbranch | ( | ) |
Referenced by reg().
| static void regc | ( | char | b | ) | [static] |
| regexp* regcomp | ( | char * | exp | ) |
Definition at line 190 of file regexp.c.
References BOL, END, EXACTLY, FAIL, MAGIC, NULL, OP, OPERAND, regexp::program, reg(), regexp::reganch, regc(), regcode, regdummy, regexp::regmlen, regexp::regmust, regnext(), regnpar, regparse, regsize, regexp::regstart, and SPSTART.
Referenced by main(), multiple(), regexp_compile_internal(), and try().
| int regexec | ( | regexp * | prog, | |
| char * | string | |||
| ) |
Definition at line 702 of file regexp.c.
References MAGIC, NULL, regbol, regerror(), regtry(), and UCHARAT.
Referenced by main(), multiple(), regexp_execute_internal(), and try().
| static void reginsert | ( | char | op, | |
| char * | opnd | |||
| ) | [static] |
| STATIC void reginsert | ( | ) |
Referenced by regpiece().
| static int regmatch | ( | char * | prog | ) | [static] |
| STATIC int regmatch | ( | ) |
Referenced by regmatch(), and regtry().
| static char* regnext | ( | char * | p | ) | [static] |
| STATIC char* regnext | ( | ) |
Referenced by reg(), regcomp(), regmatch(), and regtail().
| static char* regnode | ( | char | op | ) | [static] |
| STATIC char* regnode | ( | ) |
Referenced by reg(), regatom(), regbranch(), and regpiece().
| static void regoptail | ( | char * | p, | |
| char * | val | |||
| ) | [static] |
| STATIC void regoptail | ( | ) |
Referenced by reg(), and regpiece().
| static char* regpiece | ( | int * | flagp | ) | [static] |
| STATIC char* regpiece | ( | ) |
Referenced by regbranch().
| static int regrepeat | ( | char * | p | ) | [static] |
| STATIC int regrepeat | ( | ) |
Referenced by regmatch().
| static void regtail | ( | char * | p, | |
| char * | val | |||
| ) | [static] |
| STATIC void regtail | ( | ) |
Referenced by reg(), regbranch(), regoptail(), and regpiece().
| static int regtry | ( | regexp * | prog, | |
| char * | string | |||
| ) | [static] |
| STATIC int regtry | ( | ) |
Referenced by regexec().
char* regbol [static] |
char* regcode [static] |
char regdummy [static] |
Definition at line 150 of file regexp.c.
Referenced by regc(), regcomp(), reginsert(), regnext(), regnode(), regoptail(), and regtail().
char** regendp [static] |
char* reginput [static] |
char* regparse [static] |
Definition at line 148 of file regexp.c.
Referenced by reg(), regatom(), regbranch(), regcomp(), and regpiece().
long regsize [static] |
Definition at line 152 of file regexp.c.
Referenced by last_regsize(), regc(), regcomp(), reginsert(), and regnode().
char** regstartp [static] |
1.5.4