PostgreSQL Source Code git master
Loading...
Searching...
No Matches
regguts.h
Go to the documentation of this file.
1/*
2 * Internal interface definitions, etc., for the reg package
3 *
4 * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
5 *
6 * Development of this software was funded, in part, by Cray Research Inc.,
7 * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
8 * Corporation, none of whom are responsible for the results. The author
9 * thanks all of them.
10 *
11 * Redistribution and use in source and binary forms -- with or without
12 * modification -- are permitted for any purpose, provided that
13 * redistributions in source form retain this entire copyright notice and
14 * indicate the origin and nature of any modifications.
15 *
16 * I'd appreciate being given credit for this package in the documentation
17 * of software which uses it, but that is not a requirement.
18 *
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * src/include/regex/regguts.h
31 */
32
33
34
35/*
36 * Environmental customization. It should not (I hope) be necessary to
37 * alter the file you are now reading -- regcustom.h should handle it all,
38 * given care here and elsewhere.
39 */
40#include "regcustom.h"
41
42
43
44/*
45 * Things that regcustom.h might override.
46 */
47
48/* assertions */
49#ifndef assert
50#ifndef REG_DEBUG
51#define NDEBUG /* no assertions */
52#endif
53#include <assert.h>
54#endif
55
56/* voids */
57#ifndef DISCARD
58#define DISCARD void /* for throwing values away */
59#endif
60#ifndef VS
61#define VS(x) ((void *)(x)) /* cast something to generic ptr */
62#endif
63
64/* function-pointer declarator */
65#ifndef FUNCPTR
66#define FUNCPTR(name, args) (*(name)) args
67#endif
68
69/* memory allocation */
70#ifndef MALLOC
71#define MALLOC(n) malloc(n)
72#endif
73#ifndef REALLOC
74#define REALLOC(p, n) realloc(VS(p), n)
75#endif
76#ifndef FREE
77#define FREE(p) free(VS(p))
78#endif
79#ifndef MALLOC_ARRAY
80/* we don't depend on calloc's zeroing behavior, we do need overflow check */
81#define MALLOC_ARRAY(type, n) ((type *) calloc(sizeof(type), n))
82#endif
83#ifndef REALLOC_ARRAY
84/* XXX this definition does not provide the desired overflow check */
85#define REALLOC_ARRAY(p, type, n) ((type *) REALLOC(p, sizeof(type) * (n)))
86#endif
87
88/* interruption */
89#ifndef INTERRUPT
90#define INTERRUPT(re)
91#endif
92
93/* want size of a char in bits, and max value in bounded quantifiers */
94#ifndef _POSIX2_RE_DUP_MAX
95#define _POSIX2_RE_DUP_MAX 255 /* normally from <limits.h> */
96#endif
97
98
99
100/*
101 * misc
102 */
103
104#define NOTREACHED 0
105
106#define DUPMAX _POSIX2_RE_DUP_MAX
107#define DUPINF (DUPMAX+1)
108
109#define REMAGIC 0xfed7 /* magic number for main struct */
110
111/* Type codes for lookaround constraints */
112#define LATYPE_AHEAD_POS 03 /* positive lookahead */
113#define LATYPE_AHEAD_NEG 02 /* negative lookahead */
114#define LATYPE_BEHIND_POS 01 /* positive lookbehind */
115#define LATYPE_BEHIND_NEG 00 /* negative lookbehind */
116#define LATYPE_IS_POS(la) ((la) & 01)
117#define LATYPE_IS_AHEAD(la) ((la) & 02)
118
119
120/*
121 * debugging facilities
122 */
123#ifdef REG_DEBUG
124/* FDEBUG does finite-state tracing */
125#define FDEBUG(arglist) { if (v->eflags&REG_FTRACE) printf arglist; }
126/* MDEBUG does higher-level tracing */
127#define MDEBUG(arglist) { if (v->eflags&REG_MTRACE) printf arglist; }
128#else
129#define FDEBUG(arglist) {}
130#define MDEBUG(arglist) {}
131#endif
132
133
134
135/*
136 * bitmap manipulation
137 */
138#define UBITS (CHAR_BIT * sizeof(unsigned))
139#define BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS))
140#define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS)))
141
142
143/*
144 * known character classes
145 */
151
152#define NUM_CCLASSES 14
153
154
155/*
156 * As soon as possible, we map chrs into equivalence classes -- "colors" --
157 * which are of much more manageable number.
158 *
159 * To further reduce the number of arcs in NFAs and DFAs, we also have a
160 * special RAINBOW "color" that can be assigned to an arc. This is not a
161 * real color, in that it has no entry in color maps.
162 */
163typedef short color; /* colors of characters */
164
165#define MAX_COLOR 32767 /* max color (must fit in 'color' datatype) */
166#define COLORLESS (-1) /* impossible color */
167#define RAINBOW (-2) /* represents all colors except pseudocolors */
168#define WHITE 0 /* default color, parent of all others */
169/* Note: various places in the code know that WHITE is zero */
170
171
172/*
173 * Per-color data structure for the compile-time color machinery
174 *
175 * If "sub" is not NOSUB then it is the number of the color's current
176 * subcolor, i.e. we are in process of dividing this color (character
177 * equivalence class) into two colors. See src/backend/regex/README for
178 * discussion of subcolors.
179 *
180 * Currently-unused colors have the FREECOL bit set and are linked into a
181 * freelist using their "sub" fields, but only if their color numbers are
182 * less than colormap.max. Any array entries beyond "max" are just garbage.
183 */
185{
186 int nschrs; /* number of simple chars of this color */
187 int nuchrs; /* number of upper map entries of this color */
188 color sub; /* open subcolor, if any; or free-chain ptr */
189#define NOSUB COLORLESS /* value of "sub" when no open subcolor */
190 struct arc *arcs; /* chain of all arcs of this color */
191 chr firstchr; /* simple char first assigned to this color */
192 int flags; /* bitmask of the following flags: */
193#define FREECOL 01 /* currently free */
194#define PSEUDO 02 /* pseudocolor, no real chars */
195#define COLMARK 04 /* temporary marker used in some functions */
196};
197
198#define UNUSEDCOLOR(cd) ((cd)->flags & FREECOL)
199
200/*
201 * The color map itself
202 *
203 * This struct holds both data used only at compile time, and the chr to
204 * color mapping information, used at both compile and run time. The latter
205 * is the bulk of the space, so it's not really worth separating out the
206 * compile-only portion.
207 *
208 * Ideally, the mapping data would just be an array of colors indexed by
209 * chr codes; but for large character sets that's impractical. Fortunately,
210 * common characters have smaller codes, so we can use a simple array for chr
211 * codes up to MAX_SIMPLE_CHR, and do something more complex for codes above
212 * that, without much loss of performance. The "something more complex" is a
213 * 2-D array of color entries, where row indexes correspond to individual chrs
214 * or chr ranges that have been mentioned in the regex (with row zero
215 * representing all other chrs), and column indexes correspond to different
216 * sets of locale-dependent character classes such as "isalpha". The
217 * classbits[k] entry is zero if we do not care about the k'th character class
218 * in this regex, and otherwise it is the bit to be OR'd into the column index
219 * if the character in question is a member of that class. We find the color
220 * of a high-valued chr by identifying which colormaprange it is in to get
221 * the row index (use row zero if it's in none of them), identifying which of
222 * the interesting cclasses it's in to get the column index, and then indexing
223 * into the 2-D hicolormap array.
224 *
225 * The colormapranges are required to be nonempty, nonoverlapping, and to
226 * appear in increasing chr-value order.
227 */
228
229typedef struct colormaprange
230{
231 chr cmin; /* range represents cmin..cmax inclusive */
233 int rownum; /* row index in hicolormap array (>= 1) */
235
237{
238 int magic;
239#define CMMAGIC 0x876
240 struct vars *v; /* for compile error reporting */
241 size_t ncds; /* allocated length of colordescs array */
242 size_t max; /* highest color number currently in use */
243 color free; /* beginning of free chain (if non-0) */
244 struct colordesc *cd; /* pointer to array of colordescs */
245#define CDEND(cm) (&(cm)->cd[(cm)->max + 1])
246
247 /* mapping data for chrs <= MAX_SIMPLE_CHR: */
248 color *locolormap; /* simple array indexed by chr code */
249
250 /* mapping data for chrs > MAX_SIMPLE_CHR: */
251 int classbits[NUM_CCLASSES]; /* see comment above */
252 int numcmranges; /* number of colormapranges */
253 colormaprange *cmranges; /* ranges of high chrs */
254 color *hicolormap; /* 2-D array of color entries */
255 int maxarrayrows; /* number of array rows allocated */
256 int hiarrayrows; /* number of array rows in use */
257 int hiarraycols; /* number of array columns (2^N) */
258
259 /* If we need up to NINLINECDS, we store them here to save a malloc */
260#define NINLINECDS ((size_t) 10)
262};
263
264/* fetch color for chr; beware of multiple evaluation of c argument */
265#define GETCOLOR(cm, c) \
266 ((c) <= MAX_SIMPLE_CHR ? (cm)->locolormap[(c) - CHR_MIN] : pg_reg_getcolor(cm, c))
267
268
269/*
270 * Interface definitions for locale-interface functions in regc_locale.c.
271 */
272
273/*
274 * Representation of a set of characters. chrs[] represents individual
275 * code points, ranges[] represents ranges in the form min..max inclusive.
276 *
277 * If the cvec represents a locale-specific character class, eg [[:alpha:]],
278 * then the chrs[] and ranges[] arrays contain only members of that class
279 * up to MAX_SIMPLE_CHR (inclusive). cclasscode is set to regc_locale.c's
280 * code for the class, rather than being -1 as it is in an ordinary cvec.
281 *
282 * Note that in cvecs gotten from newcvec() and intended to be freed by
283 * freecvec(), both arrays of chrs are after the end of the struct, not
284 * separately malloc'd; so chrspace and rangespace are effectively immutable.
285 */
286struct cvec
287{
288 int nchrs; /* number of chrs */
289 int chrspace; /* number of chrs allocated in chrs[] */
290 chr *chrs; /* pointer to vector of chrs */
291 int nranges; /* number of ranges (chr pairs) */
292 int rangespace; /* number of ranges allocated in ranges[] */
293 chr *ranges; /* pointer to vector of chr pairs */
294 int cclasscode; /* value of "enum classes", or -1 */
295};
296
297
298/*
299 * definitions for NFA internal representation
300 */
301struct state;
302
303struct arc
304{
305 int type; /* 0 if free, else an NFA arc type code */
306 color co; /* color the arc matches (possibly RAINBOW) */
307 struct state *from; /* where it's from */
308 struct state *to; /* where it's to */
309 struct arc *outchain; /* link in *from's outs chain or free chain */
310 struct arc *outchainRev; /* back-link in *from's outs chain */
311#define freechain outchain /* we do not maintain "freechainRev" */
312 struct arc *inchain; /* link in *to's ins chain */
313 struct arc *inchainRev; /* back-link in *to's ins chain */
314 /* these fields are not used when co == RAINBOW: */
315 struct arc *colorchain; /* link in color's arc chain */
316 struct arc *colorchainRev; /* back-link in color's arc chain */
317};
318
320{ /* for bulk allocation of arcs */
321 struct arcbatch *next; /* chain link */
322 size_t narcs; /* number of arcs allocated in this arcbatch */
324};
325#define ARCBATCHSIZE(n) ((n) * sizeof(struct arc) + offsetof(struct arcbatch, a))
326/* first batch will have FIRSTABSIZE arcs; then double it until MAXABSIZE */
327#define FIRSTABSIZE 64
328#define MAXABSIZE 1024
329
330struct state
331{
332 int no; /* state number, zero and up; or FREESTATE */
333#define FREESTATE (-1)
334 char flag; /* marks special states */
335 int nins; /* number of inarcs */
336 int nouts; /* number of outarcs */
337 struct arc *ins; /* chain of inarcs */
338 struct arc *outs; /* chain of outarcs */
339 struct state *tmp; /* temporary for traversal algorithms */
340 struct state *next; /* chain for traversing all live states */
341 /* the "next" field is also used to chain free states together */
342 struct state *prev; /* back-link in chain of all live states */
343};
344
346{ /* for bulk allocation of states */
347 struct statebatch *next; /* chain link */
348 size_t nstates; /* number of states allocated in this batch */
350};
351#define STATEBATCHSIZE(n) ((n) * sizeof(struct state) + offsetof(struct statebatch, s))
352/* first batch will have FIRSTSBSIZE states; then double it until MAXSBSIZE */
353#define FIRSTSBSIZE 32
354#define MAXSBSIZE 1024
355
356struct nfa
357{
358 struct state *pre; /* pre-initial state */
359 struct state *init; /* initial state */
360 struct state *final; /* final state */
361 struct state *post; /* post-final state */
362 int nstates; /* for numbering states */
363 struct state *states; /* chain of live states */
364 struct state *slast; /* tail of the chain */
365 struct state *freestates; /* chain of free states */
366 struct arc *freearcs; /* chain of free arcs */
367 struct statebatch *lastsb; /* chain of statebatches */
368 struct arcbatch *lastab; /* chain of arcbatches */
369 size_t lastsbused; /* number of states consumed from *lastsb */
370 size_t lastabused; /* number of arcs consumed from *lastab */
371 struct colormap *cm; /* the color map */
372 color bos[2]; /* colors, if any, assigned to BOS and BOL */
373 color eos[2]; /* colors, if any, assigned to EOS and EOL */
374 int flags; /* flags to pass forward to cNFA */
375 int minmatchall; /* min number of chrs to match, if matchall */
376 int maxmatchall; /* max number of chrs to match, or DUPINF */
377 struct vars *v; /* simplifies compile error reporting */
378 struct nfa *parent; /* parent NFA, if any */
379};
380
381
382
383/*
384 * definitions for compacted NFA
385 *
386 * The main space savings in a compacted NFA is from making the arcs as small
387 * as possible. We store only the transition color and next-state number for
388 * each arc. The list of out arcs for each state is an array beginning at
389 * cnfa.states[statenumber], and terminated by a dummy carc struct with
390 * co == COLORLESS.
391 *
392 * The non-dummy carc structs are of two types: plain arcs and LACON arcs.
393 * Plain arcs just store the transition color number as "co". LACON arcs
394 * store the lookaround constraint number plus cnfa.ncolors as "co". LACON
395 * arcs can be distinguished from plain by testing for co >= cnfa.ncolors.
396 *
397 * Note that in a plain arc, "co" can be RAINBOW; since that's negative,
398 * it doesn't break the rule about how to recognize LACON arcs.
399 *
400 * We have special markings for "trivial" NFAs that can match any string
401 * (possibly with limits on the number of characters therein). In such a
402 * case, flags & MATCHALL is set (and HASLACONS can't be set). Then the
403 * fields minmatchall and maxmatchall give the minimum and maximum numbers
404 * of characters to match. For example, ".*" produces minmatchall = 0
405 * and maxmatchall = DUPINF, while ".+" produces minmatchall = 1 and
406 * maxmatchall = DUPINF.
407 */
408struct carc
409{
410 color co; /* COLORLESS is list terminator */
411 int to; /* next-state number */
412};
413
414struct cnfa
415{
416 int nstates; /* number of states */
417 int ncolors; /* number of colors (max color in use + 1) */
418 int flags; /* bitmask of the following flags: */
419#define HASLACONS 01 /* uses lookaround constraints */
420#define MATCHALL 02 /* matches all strings of a range of lengths */
421#define HASCANTMATCH 04 /* contains CANTMATCH arcs */
422 /* Note: HASCANTMATCH appears in nfa structs' flags, but never in cnfas */
423 int pre; /* setup state number */
424 int post; /* teardown state number */
425 color bos[2]; /* colors, if any, assigned to BOS and BOL */
426 color eos[2]; /* colors, if any, assigned to EOS and EOL */
427 char *stflags; /* vector of per-state flags bytes */
428#define CNFA_NOPROGRESS 01 /* flag bit for a no-progress state */
429 struct carc **states; /* vector of pointers to outarc lists */
430 /* states[n] are pointers into a single malloc'd array of arcs */
431 struct carc *arcs; /* the area for the lists */
432 /* these fields are used only in a MATCHALL NFA (else they're -1): */
433 int minmatchall; /* min number of chrs to match */
434 int maxmatchall; /* max number of chrs to match, or DUPINF */
435};
436
437/*
438 * When debugging, it's helpful if an un-filled CNFA is all-zeroes.
439 * In production, though, we only require nstates to be zero.
440 */
441#ifdef REG_DEBUG
442#define ZAPCNFA(cnfa) memset(&(cnfa), 0, sizeof(cnfa))
443#else
444#define ZAPCNFA(cnfa) ((cnfa).nstates = 0)
445#endif
446#define NULLCNFA(cnfa) ((cnfa).nstates == 0)
447
448/*
449 * This symbol limits the transient heap space used by the regex compiler,
450 * and thereby also the maximum complexity of NFAs that we'll deal with.
451 * Currently we only count NFA states and arcs against this; the other
452 * transient data is generally not large enough to notice compared to those.
453 * Note that we do not charge anything for the final output data structures
454 * (the compacted NFA and the colormap).
455 * The scaling here is based on an empirical measurement that very large
456 * NFAs tend to have about 4 arcs/state.
457 *
458 * Do not raise this so high as to allow more than INT_MAX/8 states or arcs,
459 * or you risk integer overflows in various space allocation requests.
460 * (We could be more defensive in those places, but that's so far beyond the
461 * practical range of NFA sizes that it doesn't seem worth additional code.)
462 */
463#ifndef REG_MAX_COMPILE_SPACE
464#define REG_MAX_COMPILE_SPACE \
465 (500000 * (sizeof(struct state) + 4 * sizeof(struct arc)))
466#endif
467
468/*
469 * subexpression tree
470 *
471 * "op" is one of:
472 * '=' plain regex without interesting substructure (implemented as DFA)
473 * 'b' back-reference (has no substructure either)
474 * '(' no-op capture node: captures the match of its single child
475 * '.' concatenation: matches a match for first child, then second child
476 * '|' alternation: matches a match for any of its children
477 * '*' iteration: matches some number of matches of its single child
478 *
479 * An alternation node can have any number of children (but at least two),
480 * linked through their sibling fields.
481 *
482 * A concatenation node must have exactly two children. It might be useful
483 * to support more, but that would complicate the executor. Note that it is
484 * the first child's greediness that determines the node's preference for
485 * where to split a match.
486 *
487 * Note: when a backref is directly quantified, we stick the min/max counts
488 * into the backref rather than plastering an iteration node on top. This is
489 * for efficiency: there is no need to search for possible division points.
490 */
491struct subre
492{
493 char op; /* see type codes above */
494 char flags;
495#define LONGER 01 /* prefers longer match */
496#define SHORTER 02 /* prefers shorter match */
497#define MIXED 04 /* mixed preference below */
498#define CAP 010 /* capturing parens here or below */
499#define BACKR 020 /* back reference here or below */
500#define BRUSE 040 /* is referenced by a back reference */
501#define INUSE 0100 /* in use in final tree */
502#define UPPROP (MIXED|CAP|BACKR) /* flags which should propagate up */
503#define LMIX(f) ((f)<<2) /* LONGER -> MIXED */
504#define SMIX(f) ((f)<<1) /* SHORTER -> MIXED */
505#define UP(f) (((f)&UPPROP) | (LMIX(f) & SMIX(f) & MIXED))
506#define MESSY(f) ((f)&(MIXED|CAP|BACKR))
507#define PREF(f) ((f)&(LONGER|SHORTER))
508#define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2))
509#define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2))
510 char latype; /* LATYPE code, if lookaround constraint */
511 int id; /* ID of subre (1..ntree-1) */
512 int capno; /* if capture node, subno to capture into */
513 int backno; /* if backref node, subno it refers to */
514 short min; /* min repetitions for iteration or backref */
515 short max; /* max repetitions for iteration or backref */
516 struct subre *child; /* first child, if any (also freelist chain) */
517 struct subre *sibling; /* next child of same parent, if any */
518 struct state *begin; /* outarcs from here... */
519 struct state *end; /* ...ending in inarcs here */
520 struct cnfa cnfa; /* compacted NFA, if any */
521 struct subre *chain; /* for bookkeeping and error cleanup */
522};
523
524
525
526/*
527 * table of function pointers for generic manipulation functions
528 * A regex_t's re_fns points to one of these.
529 */
530struct fns
531{
532 void FUNCPTR(free, (regex_t *));
534};
535
536#define STACK_TOO_DEEP(re) \
537 ((*((struct fns *) (re)->re_fns)->stack_too_deep) ())
538
539
540/*
541 * the insides of a regex_t, hidden behind a void *
542 */
543struct guts
544{
545 int magic;
546#define GUTSMAGIC 0xfed9
547 int cflags; /* copy of compile flags */
548 long info; /* copy of re_info */
549 size_t nsub; /* copy of re_nsub */
550 struct subre *tree;
551 struct cnfa search; /* for fast preliminary search */
552 int ntree; /* number of subre's, plus one */
554 int FUNCPTR(compare, (const chr *, const chr *, size_t));
555 struct subre *lacons; /* lookaround-constraint vector */
556 int nlacons; /* size of lacons[]; note that only slots
557 * numbered 1 .. nlacons-1 are used */
558};
559
560
561/* prototypes for functions that are exported from regcomp.c to regexec.c */
562extern void pg_set_regex_collation(Oid collation);
563extern color pg_reg_getcolor(struct colormap *cm, chr c);
#define FLEXIBLE_ARRAY_MEMBER
Definition c.h:558
static int compare(const void *arg1, const void *arg2)
Definition geqo_pool.c:145
unsigned int Oid
char * c
static int fb(int x)
pg_wchar chr
Definition regcustom.h:62
#define regex_t
Definition regex.h:245
#define NUM_CCLASSES
Definition regguts.h:152
#define NINLINECDS
Definition regguts.h:260
short color
Definition regguts.h:163
char_classes
Definition regguts.h:147
@ CC_UPPER
Definition regguts.h:149
@ CC_WORD
Definition regguts.h:149
@ CC_LOWER
Definition regguts.h:149
@ CC_ASCII
Definition regguts.h:148
@ CC_ALNUM
Definition regguts.h:148
@ CC_XDIGIT
Definition regguts.h:149
@ CC_PRINT
Definition regguts.h:149
@ CC_BLANK
Definition regguts.h:148
@ CC_GRAPH
Definition regguts.h:148
@ CC_CNTRL
Definition regguts.h:148
@ CC_SPACE
Definition regguts.h:149
@ CC_DIGIT
Definition regguts.h:148
@ CC_ALPHA
Definition regguts.h:148
@ CC_PUNCT
Definition regguts.h:149
void pg_set_regex_collation(Oid collation)
color pg_reg_getcolor(struct colormap *cm, chr c)
Definition regc_color.c:120
#define free(a)
Definition regguts.h:304
struct arc * outchain
Definition regguts.h:309
struct arc * colorchain
Definition regguts.h:315
struct arc * outchainRev
Definition regguts.h:310
struct state * from
Definition regguts.h:307
int type
Definition regguts.h:305
color co
Definition regguts.h:306
struct state * to
Definition regguts.h:308
struct arc * inchainRev
Definition regguts.h:313
struct arc * inchain
Definition regguts.h:312
struct arc * colorchainRev
Definition regguts.h:316
struct arcbatch * next
Definition regguts.h:321
size_t narcs
Definition regguts.h:322
struct arc a[FLEXIBLE_ARRAY_MEMBER]
Definition regguts.h:323
int to
Definition regguts.h:411
color co
Definition regguts.h:410
int pre
Definition regguts.h:423
color eos[2]
Definition regguts.h:426
struct carc ** states
Definition regguts.h:429
int ncolors
Definition regguts.h:417
int maxmatchall
Definition regguts.h:434
int flags
Definition regguts.h:418
int post
Definition regguts.h:424
int minmatchall
Definition regguts.h:433
struct carc * arcs
Definition regguts.h:431
color bos[2]
Definition regguts.h:425
int nstates
Definition regguts.h:416
char * stflags
Definition regguts.h:427
struct arc * arcs
Definition regguts.h:190
chr firstchr
Definition regguts.h:191
int nuchrs
Definition regguts.h:187
int nschrs
Definition regguts.h:186
color sub
Definition regguts.h:188
int flags
Definition regguts.h:192
int classbits[NUM_CCLASSES]
Definition regguts.h:251
struct vars * v
Definition regguts.h:240
color * locolormap
Definition regguts.h:248
int hiarraycols
Definition regguts.h:257
struct colordesc cdspace[NINLINECDS]
Definition regguts.h:261
size_t max
Definition regguts.h:242
int maxarrayrows
Definition regguts.h:255
color free
Definition regguts.h:243
struct colordesc * cd
Definition regguts.h:244
int numcmranges
Definition regguts.h:252
int magic
Definition regguts.h:238
size_t ncds
Definition regguts.h:241
int hiarrayrows
Definition regguts.h:256
color * hicolormap
Definition regguts.h:254
colormaprange * cmranges
Definition regguts.h:253
int chrspace
Definition regguts.h:289
int nchrs
Definition regguts.h:288
int rangespace
Definition regguts.h:292
chr * chrs
Definition regguts.h:290
chr * ranges
Definition regguts.h:293
int cclasscode
Definition regguts.h:294
int nranges
Definition regguts.h:291
Definition regguts.h:531
int FUNCPTR(stack_too_deep,(void))
void FUNCPTR(free,(regex_t *))
struct subre * tree
Definition regguts.h:550
struct subre * lacons
Definition regguts.h:555
int magic
Definition regguts.h:545
long info
Definition regguts.h:548
int FUNCPTR(compare,(const chr *, const chr *, size_t))
struct cnfa search
Definition regguts.h:551
int ntree
Definition regguts.h:552
int cflags
Definition regguts.h:547
size_t nsub
Definition regguts.h:549
int nlacons
Definition regguts.h:556
struct colormap cmap
Definition regguts.h:553
Definition regguts.h:357
struct vars * v
Definition regguts.h:377
struct statebatch * lastsb
Definition regguts.h:367
size_t lastabused
Definition regguts.h:370
int minmatchall
Definition regguts.h:375
struct arc * freearcs
Definition regguts.h:366
int maxmatchall
Definition regguts.h:376
struct state * slast
Definition regguts.h:364
color bos[2]
Definition regguts.h:372
size_t lastsbused
Definition regguts.h:369
int nstates
Definition regguts.h:362
color eos[2]
Definition regguts.h:373
struct arcbatch * lastab
Definition regguts.h:368
struct state * states
Definition regguts.h:363
int flags
Definition regguts.h:374
struct state * post
Definition regguts.h:361
struct state * pre
Definition regguts.h:358
struct colormap * cm
Definition regguts.h:371
struct nfa * parent
Definition regguts.h:378
struct state * freestates
Definition regguts.h:365
struct state * init
Definition regguts.h:359
int nins
Definition regguts.h:335
int nouts
Definition regguts.h:336
char flag
Definition regguts.h:334
struct state * prev
Definition regguts.h:342
struct state * tmp
Definition regguts.h:339
struct arc * outs
Definition regguts.h:338
struct state * next
Definition regguts.h:340
struct arc * ins
Definition regguts.h:337
int no
Definition regguts.h:332
struct state s[FLEXIBLE_ARRAY_MEMBER]
Definition regguts.h:349
struct statebatch * next
Definition regguts.h:347
size_t nstates
Definition regguts.h:348
int backno
Definition regguts.h:513
char op
Definition regguts.h:493
struct subre * chain
Definition regguts.h:521
struct state * end
Definition regguts.h:519
short min
Definition regguts.h:514
short max
Definition regguts.h:515
struct subre * sibling
Definition regguts.h:517
char flags
Definition regguts.h:494
int id
Definition regguts.h:511
char latype
Definition regguts.h:510
struct subre * child
Definition regguts.h:516
int capno
Definition regguts.h:512
struct state * begin
Definition regguts.h:518