61 #define VS(x) ((void *)(x))
66 #define FUNCPTR(name, args) (*(name)) args
71 #define MALLOC(n) malloc(n)
74 #define REALLOC(p, n) realloc(VS(p), n)
77 #define FREE(p) free(VS(p))
81 #ifndef _POSIX2_RE_DUP_MAX
82 #define _POSIX2_RE_DUP_MAX 255
93 #define DUPMAX _POSIX2_RE_DUP_MAX
94 #define DUPINF (DUPMAX+1)
96 #define REMAGIC 0xfed7
99 #define LATYPE_AHEAD_POS 03
100 #define LATYPE_AHEAD_NEG 02
101 #define LATYPE_BEHIND_POS 01
102 #define LATYPE_BEHIND_NEG 00
103 #define LATYPE_IS_POS(la) ((la) & 01)
104 #define LATYPE_IS_AHEAD(la) ((la) & 02)
112 #define FDEBUG(arglist) { if (v->eflags®_FTRACE) printf arglist; }
114 #define MDEBUG(arglist) { if (v->eflags®_MTRACE) printf arglist; }
116 #define FDEBUG(arglist) {}
117 #define MDEBUG(arglist) {}
125 #define UBITS (CHAR_BIT * sizeof(unsigned))
126 #define BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS))
127 #define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS)))
139 #define NUM_CCLASSES 14
152 #define MAX_COLOR 32767
153 #define COLORLESS (-1)
176 #define NOSUB COLORLESS
185 #define UNUSEDCOLOR(cd) ((cd)->flags & FREECOL)
226 #define CMMAGIC 0x876
232 #define CDEND(cm) (&(cm)->cd[(cm)->max + 1])
247 #define NINLINECDS ((size_t) 10)
252 #define GETCOLOR(cm, c) \
253 ((c) <= MAX_SIMPLE_CHR ? (cm)->locolormap[(c) - CHR_MIN] : pg_reg_getcolor(cm, c))
298 #define freechain outchain
312 #define ARCBATCHSIZE(n) ((n) * sizeof(struct arc) + offsetof(struct arcbatch, a))
314 #define FIRSTABSIZE 64
315 #define MAXABSIZE 1024
320 #define FREESTATE (-1)
338 #define STATEBATCHSIZE(n) ((n) * sizeof(struct state) + offsetof(struct statebatch, s))
340 #define FIRSTSBSIZE 32
341 #define MAXSBSIZE 1024
413 #define CNFA_NOPROGRESS 01
427 #define ZAPCNFA(cnfa) memset(&(cnfa), 0, sizeof(cnfa))
429 #define ZAPCNFA(cnfa) ((cnfa).nstates = 0)
431 #define NULLCNFA(cnfa) ((cnfa).nstates == 0)
443 #ifndef REG_MAX_COMPILE_SPACE
444 #define REG_MAX_COMPILE_SPACE \
445 (500000 * (sizeof(struct state) + 4 * sizeof(struct arc)))
482 #define UPPROP (MIXED|CAP|BACKR)
483 #define LMIX(f) ((f)<<2)
484 #define SMIX(f) ((f)<<1)
485 #define UP(f) (((f)&UPPROP) | (LMIX(f) & SMIX(f) & MIXED))
486 #define MESSY(f) ((f)&(MIXED|CAP|BACKR))
487 #define PREF(f) ((f)&(LONGER|SHORTER))
488 #define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2))
489 #define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2))
517 #define CANCEL_REQUESTED(re) \
518 ((*((struct fns *) (re)->re_fns)->cancel_requested) ())
520 #define STACK_TOO_DEEP(re) \
521 ((*((struct fns *) (re)->re_fns)->stack_too_deep) ())
530 #define GUTSMAGIC 0xfed9
#define FLEXIBLE_ARRAY_MEMBER
static int compare(const void *arg1, const void *arg2)
void pg_set_regex_collation(Oid collation)
struct colormaprange colormaprange
color pg_reg_getcolor(struct colormap *cm, chr c)
struct arc * colorchainRev
struct arc a[FLEXIBLE_ARRAY_MEMBER]
int classbits[NUM_CCLASSES]
struct colordesc cdspace[NINLINECDS]
int FUNCPTR(stack_too_deep,(void))
void FUNCPTR(free,(regex_t *))
int FUNCPTR(cancel_requested,(void))
int FUNCPTR(compare,(const chr *, const chr *, size_t))
struct statebatch * lastsb
struct state * freestates
struct state s[FLEXIBLE_ARRAY_MEMBER]