[w3m-dev 02811] new regexp implementation

From: aito@fw.ipsj.or.jp
This commit is contained in:
Fumitoshi UKAI
2002-01-10 04:55:06 +00:00
parent 3d272a74fc
commit 31d84e0083
4 changed files with 535 additions and 161 deletions

35
regex.h
View File

@@ -1,44 +1,25 @@
/* $Id: regex.h,v 1.3 2001/11/24 02:01:26 ukai Exp $ */
/* $Id: regex.h,v 1.4 2002/01/10 04:55:07 ukai Exp $ */
#define REGEX_MAX 64
#define STORAGE_MAX 256
#ifndef NULL
#define NULL 0
#endif /* not NULL */
#define RE_NORMAL 0
#define RE_MATCHMODE 0x07
#define RE_ANY 0x01
#define RE_WHICH 0x02
#define RE_EXCEPT 0x04
#define RE_ANYTIME 0x08
#define RE_BEGIN 0x10
#define RE_END 0x20
#define RE_IGNCASE 0x40
#define RE_ENDMARK 0x80
typedef unsigned short longchar;
typedef struct {
longchar *pattern;
typedef struct regexchar {
union {
longchar *pattern;
struct regex *sub;
} p;
unsigned char mode;
} regexchar;
typedef struct {
typedef struct regex {
regexchar re[REGEX_MAX];
longchar storage[STORAGE_MAX];
char *position;
char *lposition;
struct regex *alt_regex;
} Regex;