| 1 |
/************************************************************************** |
| 2 |
* This program is Copyright (C) 1986-2002 by Jonathan Payne. JOVE is * |
| 3 |
* provided by Jonathan and Jovehacks without charge and without * |
| 4 |
* warranty. You may copy, modify, and/or distribute JOVE, provided that * |
| 5 |
* this notice is included in all the source files and documentation. * |
| 6 |
**************************************************************************/ |
| 7 |
|
| 8 |
#define NALTS 16 /* number of alternate search strings */ |
| 9 |
#define COMPSIZE 512 |
| 10 |
|
| 11 |
/* kinds of regular expression compiles */ |
| 12 |
#define NORM 0 /* nothing special */ |
| 13 |
#define OKAY_RE 1 /* allow regular expressions */ |
| 14 |
#define IN_CB 2 /* in curly brace; implies OKAY_RE */ |
| 15 |
|
| 16 |
struct RE_block { |
| 17 |
char |
| 18 |
r_compbuf[COMPSIZE], |
| 19 |
*r_alternates[NALTS], |
| 20 |
r_lbuf[LBSIZE]; |
| 21 |
int |
| 22 |
r_nparens; |
| 23 |
ZXchar |
| 24 |
r_firstc; |
| 25 |
jbool |
| 26 |
r_anchored; |
| 27 |
}; |
| 28 |
|
| 29 |
extern char |
| 30 |
rep_search[128], /* replace search string */ |
| 31 |
rep_str[128]; /* contains replacement string */ |
| 32 |
|
| 33 |
extern int |
| 34 |
REbom, /* beginning and end columns of match */ |
| 35 |
REeom, |
| 36 |
REdelta; /* increase in line length due to last re_dosub */ |
| 37 |
|
| 38 |
extern jbool |
| 39 |
okay_wrap; /* Do a wrap search ... not when we're |
| 40 |
parsing errors ... */ |
| 41 |
|
| 42 |
extern jbool |
| 43 |
re_lindex(LinePtr line, int offset, int dir, |
| 44 |
struct RE_block *re_blk, jbool lbuf_okay, int crater), |
| 45 |
LookingAt(const char *pattern,char *buf,int offset), |
| 46 |
look_at(char *expr); |
| 47 |
|
| 48 |
extern Bufpos |
| 49 |
*docompiled(int dir, struct RE_block *re_blk), |
| 50 |
*dosearch(const char *pattern, int dir, jbool re); |
| 51 |
|
| 52 |
extern void |
| 53 |
REcompile(const char *pattern, jbool re, struct RE_block *re_blk), |
| 54 |
putmatch(int which, char *buf,size_t size), |
| 55 |
re_dosub(struct RE_block *re_blk, char *tobuf, jbool delp), |
| 56 |
RErecur(void); |
| 57 |
|
| 58 |
/* Variables: */ |
| 59 |
|
| 60 |
extern jbool |
| 61 |
CaseIgnore, /* VAR: ignore case in search */ |
| 62 |
WrapScan; /* VAR: make searches wrap */ |