src/commands/awk/regexp.c File Reference

#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 ()
regexpregcomp (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 Documentation

#define ANY   3

Definition at line 85 of file regexp.c.

#define ANYBUT   5

Definition at line 87 of file regexp.c.

#define ANYOF   4

Definition at line 86 of file regexp.c.

#define BACK   7

Definition at line 89 of file regexp.c.

#define BOL   1

Definition at line 83 of file regexp.c.

#define BRANCH   6

Definition at line 88 of file regexp.c.

#define CLOSE   30

Definition at line 96 of file regexp.c.

#define END   0

Definition at line 82 of file regexp.c.

#define EOL   2

Definition at line 84 of file regexp.c.

#define EXACTLY   8

Definition at line 90 of file regexp.c.

#define FAIL ( m   )     { regerror(m); return(NULL); }

Definition at line 145 of file regexp.c.

#define HASWIDTH   01

Definition at line 152 of file regexp.c.

#define ISMULT ( c   )     ((c) == '*' || (c) == '+' || (c) == '?')

Definition at line 146 of file regexp.c.

#define MAGIC   0234

Definition at line 43 of file regexp.c.

#define META   "^$.[()|?+*\\"

Definition at line 147 of file regexp.c.

#define NEXT ( p   )     (((*((p)+1)&0377)<<8) + *((p)+2)&0377)

Definition at line 131 of file regexp.c.

#define NOTHING   9

Definition at line 91 of file regexp.c.

#define OP ( p   )     (*(p))

Definition at line 130 of file regexp.c.

#define OPEN   20

Definition at line 94 of file regexp.c.

#define OPERAND ( p   )     ((p) + 3)

Definition at line 132 of file regexp.c.

#define PLUS   11

Definition at line 93 of file regexp.c.

#define regerror ( a   )     error("regular expression error: %s", a)

Definition at line 35 of file regexp.c.

#define SIMPLE   02

Definition at line 153 of file regexp.c.

#define SPSTART   04

Definition at line 154 of file regexp.c.

#define STAR   10

Definition at line 92 of file regexp.c.

#define STATIC   static

Definition at line 170 of file regexp.c.

#define UCHARAT ( p   )     ((int)*(p)&CHARBITS)

Definition at line 142 of file regexp.c.

#define WORST   0

Definition at line 155 of file regexp.c.


Function Documentation

IsDigid ( ushort  c  ) 

Definition at line 599 of file regexp.c.

isthere ( ushort *  s,
ushort  c 
)

Definition at line 1281 of file regexp.c.

ktosj ( unsigned char *  s,
ushort *  t 
)

Definition at line 1357 of file regexp.c.

match ( regexp p,
char *  s 
)

Definition at line 1331 of file regexp.c.

char* mkpat ( char *  s  ) 

Definition at line 1325 of file regexp.c.

STATIC ushort* reg (  ) 

STATIC ushort* regatom (  ) 

STATIC ushort* regbranch (  ) 

STATIC void regc (  ) 

regexp* regcomp ( ushort *  exp  ) 

Definition at line 200 of file regexp.c.

int regexec ( regexp prog,
ushort *  string,
int  bolflag 
)

Definition at line 748 of file regexp.c.

STATIC void reginsert (  ) 

STATIC int regmatch (  ) 

STATIC ushort* regnext (  ) 

STATIC ushort* regnode (  ) 

STATIC void regoptail (  ) 

STATIC ushort* regpiece (  ) 

STATIC int regrepeat (  ) 

regsub ( ushort *  dst,
regexp exp,
ushort *  src,
ushort *  pat,
pos   
)

Definition at line 1369 of file regexp.c.

STATIC void regtail (  ) 

STATIC int regtry (  ) 

sjtok ( ushort *  s,
unsigned char *  t 
)

Definition at line 1345 of file regexp.c.

ushort* Strchr ( ushort *  s,
ushort  c 
)

Definition at line 1298 of file regexp.c.

STATIC int Strcspn (  ) 

Strlen ( ushort *  s  ) 

Definition at line 1313 of file regexp.c.

Strncmp ( ushort *  s,
ushort *  t,
n   
)

Definition at line 1306 of file regexp.c.

Sub ( char *  u,
char *  exp,
str  ,
char *  s,
char *  t,
pos   
)

Definition at line 1421 of file regexp.c.


Variable Documentation

ushort kbuf[BUFSIZ]

Definition at line 1322 of file regexp.c.

int r_length

Definition at line 37 of file regexp.c.

int r_start

Definition at line 37 of file regexp.c.


Generated on Tue Mar 9 04:36:22 2010 for Minix by  doxygen 1.5.8