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))
86 #ifndef _POSIX2_RE_DUP_MAX
87 #define _POSIX2_RE_DUP_MAX 255
98 #define DUPMAX _POSIX2_RE_DUP_MAX
99 #define DUPINF (DUPMAX+1)
101 #define REMAGIC 0xfed7
104 #define LATYPE_AHEAD_POS 03
105 #define LATYPE_AHEAD_NEG 02
106 #define LATYPE_BEHIND_POS 01
107 #define LATYPE_BEHIND_NEG 00
108 #define LATYPE_IS_POS(la) ((la) & 01)
109 #define LATYPE_IS_AHEAD(la) ((la) & 02)
117 #define FDEBUG(arglist) { if (v->eflags®_FTRACE) printf arglist; }
119 #define MDEBUG(arglist) { if (v->eflags®_MTRACE) printf arglist; }
121 #define FDEBUG(arglist) {}
122 #define MDEBUG(arglist) {}
130 #define UBITS (CHAR_BIT * sizeof(unsigned))
131 #define BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS))
132 #define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS)))
144 #define NUM_CCLASSES 14
157 #define MAX_COLOR 32767
158 #define COLORLESS (-1)
181 #define NOSUB COLORLESS
190 #define UNUSEDCOLOR(cd) ((cd)->flags & FREECOL)
231 #define CMMAGIC 0x876
237 #define CDEND(cm) (&(cm)->cd[(cm)->max + 1])
252 #define NINLINECDS ((size_t) 10)
257 #define GETCOLOR(cm, c) \
258 ((c) <= MAX_SIMPLE_CHR ? (cm)->locolormap[(c) - CHR_MIN] : pg_reg_getcolor(cm, c))
303 #define freechain outchain
317 #define ARCBATCHSIZE(n) ((n) * sizeof(struct arc) + offsetof(struct arcbatch, a))
319 #define FIRSTABSIZE 64
320 #define MAXABSIZE 1024
325 #define FREESTATE (-1)
343 #define STATEBATCHSIZE(n) ((n) * sizeof(struct state) + offsetof(struct statebatch, s))
345 #define FIRSTSBSIZE 32
346 #define MAXSBSIZE 1024
418 #define CNFA_NOPROGRESS 01
432 #define ZAPCNFA(cnfa) memset(&(cnfa), 0, sizeof(cnfa))
434 #define ZAPCNFA(cnfa) ((cnfa).nstates = 0)
436 #define NULLCNFA(cnfa) ((cnfa).nstates == 0)
448 #ifndef REG_MAX_COMPILE_SPACE
449 #define REG_MAX_COMPILE_SPACE \
450 (500000 * (sizeof(struct state) + 4 * sizeof(struct arc)))
487 #define UPPROP (MIXED|CAP|BACKR)
488 #define LMIX(f) ((f)<<2)
489 #define SMIX(f) ((f)<<1)
490 #define UP(f) (((f)&UPPROP) | (LMIX(f) & SMIX(f) & MIXED))
491 #define MESSY(f) ((f)&(MIXED|CAP|BACKR))
492 #define PREF(f) ((f)&(LONGER|SHORTER))
493 #define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2))
494 #define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2))
521 #define STACK_TOO_DEEP(re) \
522 ((*((struct fns *) (re)->re_fns)->stack_too_deep) ())
531 #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(compare,(const chr *, const chr *, size_t))
struct statebatch * lastsb
struct state * freestates
struct state s[FLEXIBLE_ARRAY_MEMBER]