Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/regex/regex2.h
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
#define OLPAREN (13L<<OPSHIFT) /* ( fwd to ) */ | #define OLPAREN (13L<<OPSHIFT) /* ( fwd to ) */ | ||||
#define ORPAREN (14L<<OPSHIFT) /* ) back to ( */ | #define ORPAREN (14L<<OPSHIFT) /* ) back to ( */ | ||||
#define OCH_ (15L<<OPSHIFT) /* begin choice fwd to OOR2 */ | #define OCH_ (15L<<OPSHIFT) /* begin choice fwd to OOR2 */ | ||||
#define OOR1 (16L<<OPSHIFT) /* | pt. 1 back to OOR1 or OCH_ */ | #define OOR1 (16L<<OPSHIFT) /* | pt. 1 back to OOR1 or OCH_ */ | ||||
#define OOR2 (17L<<OPSHIFT) /* | pt. 2 fwd to OOR2 or O_CH */ | #define OOR2 (17L<<OPSHIFT) /* | pt. 2 fwd to OOR2 or O_CH */ | ||||
#define O_CH (18L<<OPSHIFT) /* end choice back to OOR1 */ | #define O_CH (18L<<OPSHIFT) /* end choice back to OOR1 */ | ||||
#define OBOW (19L<<OPSHIFT) /* begin word - */ | #define OBOW (19L<<OPSHIFT) /* begin word - */ | ||||
#define OEOW (20L<<OPSHIFT) /* end word - */ | #define OEOW (20L<<OPSHIFT) /* end word - */ | ||||
#define OWBND (21L<<OPSHIFT) /* word bound - */ | |||||
#define ONWBND (22L<<OPSHIFT) /* not - */ | |||||
#define OBOS (23L<<OPSHIFT) /* begin subj. - */ | |||||
#define OEOS (24L<<OPSHIFT) /* end sub. - */ | |||||
/* | /* | ||||
* Structures for [] character-set representation. | * Structures for [] character-set representation. | ||||
*/ | */ | ||||
typedef struct { | typedef struct { | ||||
wint_t min; | wint_t min; | ||||
wint_t max; | wint_t max; | ||||
} crange; | } crange; | ||||
typedef struct { | typedef struct { | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | # define MAGIC2 ((('R'^0200)<<8)|'E') | ||||
int cflags; /* copy of regcomp() cflags argument */ | int cflags; /* copy of regcomp() cflags argument */ | ||||
sopno nstates; /* = number of sops */ | sopno nstates; /* = number of sops */ | ||||
sopno firststate; /* the initial OEND (normally 0) */ | sopno firststate; /* the initial OEND (normally 0) */ | ||||
sopno laststate; /* the final OEND */ | sopno laststate; /* the final OEND */ | ||||
int iflags; /* internal flags */ | int iflags; /* internal flags */ | ||||
# define USEBOL 01 /* used ^ */ | # define USEBOL 01 /* used ^ */ | ||||
# define USEEOL 02 /* used $ */ | # define USEEOL 02 /* used $ */ | ||||
# define BAD 04 /* something wrong */ | # define BAD 04 /* something wrong */ | ||||
# define EMPTBR 010 /* empty branch present */ | |||||
int nbol; /* number of ^ used */ | int nbol; /* number of ^ used */ | ||||
int neol; /* number of $ used */ | int neol; /* number of $ used */ | ||||
char *must; /* match must contain this string */ | char *must; /* match must contain this string */ | ||||
int moffset; /* latest point at which must may be located */ | int moffset; /* latest point at which must may be located */ | ||||
int *charjump; /* Boyer-Moore char jump table */ | int *charjump; /* Boyer-Moore char jump table */ | ||||
int *matchjump; /* Boyer-Moore match jump table */ | int *matchjump; /* Boyer-Moore match jump table */ | ||||
int mlen; /* length of must */ | int mlen; /* length of must */ | ||||
size_t nsub; /* copy of re_nsub */ | size_t nsub; /* copy of re_nsub */ | ||||
int backrefs; /* does it use back references? */ | int backrefs; /* does it use back references? */ | ||||
sopno nplus; /* how deep does it nest +s? */ | sopno nplus; /* how deep does it nest +s? */ | ||||
}; | }; | ||||
/* misc utilities */ | /* misc utilities */ | ||||
#define OUT (CHAR_MIN - 1) /* a non-character value */ | #define OUT (CHAR_MIN - 1) /* a non-character value */ | ||||
#define IGN (CHAR_MIN - 2) | #define IGN (CHAR_MIN - 2) | ||||
#define ISWORD(c) (iswalnum((uch)(c)) || (c) == '_') | #define ISWORD(c) (iswalnum((uch)(c)) || (c) == '_') |