#include <stdio.h>#include <ctype.h>#include "regexp.h"Go to the source code of this file.
Defines | |
| #define | regerror(a) error("regular expression error: %s", a) |
| #define | MAGIC 0234 |
| #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)*(p)&CHARBITS) |
| #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 ushort * | reg () |
| STATIC ushort * | regbranch () |
| STATIC ushort * | regpiece () |
| STATIC ushort * | regatom () |
| STATIC ushort * | regnode () |
| STATIC ushort * | regnext () |
| STATIC void | regc () |
| STATIC void | reginsert () |
| STATIC void | regtail () |
| STATIC void | regoptail () |
| STATIC int | Strcspn () |
| regexp * | regcomp (ushort *exp) |
| IsDigid (ushort c) | |
| STATIC int | regtry () |
| STATIC int | regmatch () |
| STATIC int | regrepeat () |
| int | regexec (regexp *prog, ushort *string, int bolflag) |
| isthere (ushort *s, ushort c) | |
| ushort * | Strchr (ushort *s, ushort c) |
| Strncmp (ushort *s, ushort *t, n) | |
| Strlen (ushort *s) | |
| char * | mkpat (char *s) |
| match (regexp *p, char *s) | |
| sjtok (ushort *s, unsigned char *t) | |
| ktosj (unsigned char *s, ushort *t) | |
| regsub (ushort *dst, regexp *exp, ushort *src, ushort *pat, pos) | |
| Sub (char *u, char *exp, str, char *s, char *t, pos) | |
Variables | |
| int | r_start |
| int | r_length |
| ushort | kbuf [BUFSIZ] |
| #define regerror | ( | a | ) | error("regular expression error: %s", a) |
| STATIC ushort* reg | ( | ) |
| STATIC ushort* regatom | ( | ) |
| STATIC ushort* regbranch | ( | ) |
| STATIC void regc | ( | ) |
| int regexec | ( | regexp * | prog, | |
| ushort * | string, | |||
| int | bolflag | |||
| ) |
| STATIC void reginsert | ( | ) |
| STATIC int regmatch | ( | ) |
| STATIC ushort* regnext | ( | ) |
| STATIC ushort* regnode | ( | ) |
| STATIC void regoptail | ( | ) |
| STATIC ushort* regpiece | ( | ) |
| STATIC int regrepeat | ( | ) |
| STATIC void regtail | ( | ) |
| STATIC int regtry | ( | ) |
| STATIC int Strcspn | ( | ) |
1.5.8