PostgreSQL Source Code
git master
|
#include "regcustom.h"
Go to the source code of this file.
Data Structures | |
struct | colordesc |
struct | colormaprange |
struct | colormap |
struct | cvec |
struct | arc |
struct | arcbatch |
struct | state |
struct | statebatch |
struct | nfa |
struct | carc |
struct | cnfa |
struct | subre |
struct | fns |
struct | guts |
Macros | |
#define | DISCARD void /* for throwing values away */ |
#define | VS(x) ((void *)(x)) /* cast something to generic ptr */ |
#define | _POSIX2_RE_DUP_MAX 255 /* normally from <limits.h> */ |
#define | NOTREACHED 0 |
#define | DUPMAX _POSIX2_RE_DUP_MAX |
#define | DUPINF (DUPMAX+1) |
#define | REMAGIC 0xfed7 /* magic number for main struct */ |
#define | LATYPE_AHEAD_POS 03 /* positive lookahead */ |
#define | LATYPE_AHEAD_NEG 02 /* negative lookahead */ |
#define | LATYPE_BEHIND_POS 01 /* positive lookbehind */ |
#define | LATYPE_BEHIND_NEG 00 /* negative lookbehind */ |
#define | LATYPE_IS_POS(la) ((la) & 01) |
#define | LATYPE_IS_AHEAD(la) ((la) & 02) |
#define | FDEBUG(arglist) {} |
#define | MDEBUG(arglist) {} |
#define | UBITS (CHAR_BIT * sizeof(unsigned)) |
#define | BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS)) |
#define | ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS))) |
#define | NUM_CCLASSES 14 |
#define | MAX_COLOR 32767 /* max color (must fit in 'color' datatype) */ |
#define | COLORLESS (-1) /* impossible color */ |
#define | RAINBOW (-2) /* represents all colors except pseudocolors */ |
#define | WHITE 0 /* default color, parent of all others */ |
#define | NOSUB COLORLESS /* value of "sub" when no open subcolor */ |
#define | FREECOL 01 /* currently free */ |
#define | PSEUDO 02 /* pseudocolor, no real chars */ |
#define | COLMARK 04 /* temporary marker used in some functions */ |
#define | UNUSEDCOLOR(cd) ((cd)->flags & FREECOL) |
#define | CMMAGIC 0x876 |
#define | CDEND(cm) (&(cm)->cd[(cm)->max + 1]) |
#define | NINLINECDS ((size_t) 10) |
#define | GETCOLOR(cm, c) ((c) <= MAX_SIMPLE_CHR ? (cm)->locolormap[(c) - CHR_MIN] : pg_reg_getcolor(cm, c)) |
#define | freechain outchain /* we do not maintain "freechainRev" */ |
#define | ARCBATCHSIZE(n) ((n) * sizeof(struct arc) + offsetof(struct arcbatch, a)) |
#define | FIRSTABSIZE 64 |
#define | MAXABSIZE 1024 |
#define | FREESTATE (-1) |
#define | STATEBATCHSIZE(n) ((n) * sizeof(struct state) + offsetof(struct statebatch, s)) |
#define | FIRSTSBSIZE 32 |
#define | MAXSBSIZE 1024 |
#define | HASLACONS 01 /* uses lookaround constraints */ |
#define | MATCHALL 02 /* matches all strings of a range of lengths */ |
#define | CNFA_NOPROGRESS 01 /* flag bit for a no-progress state */ |
#define | ZAPCNFA(cnfa) ((cnfa).nstates = 0) |
#define | NULLCNFA(cnfa) ((cnfa).nstates == 0) |
#define | REG_MAX_COMPILE_SPACE (500000 * (sizeof(struct state) + 4 * sizeof(struct arc))) |
#define | LONGER 01 /* prefers longer match */ |
#define | SHORTER 02 /* prefers shorter match */ |
#define | MIXED 04 /* mixed preference below */ |
#define | CAP 010 /* capturing parens here or below */ |
#define | BACKR 020 /* back reference here or below */ |
#define | INUSE 0100 /* in use in final tree */ |
#define | NOPROP 03 /* bits which may not propagate up */ |
#define | LMIX(f) ((f)<<2) /* LONGER -> MIXED */ |
#define | SMIX(f) ((f)<<1) /* SHORTER -> MIXED */ |
#define | UP(f) (((f)&~NOPROP) | (LMIX(f) & SMIX(f) & MIXED)) |
#define | MESSY(f) ((f)&(MIXED|CAP|BACKR)) |
#define | PREF(f) ((f)&NOPROP) |
#define | PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2)) |
#define | COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2)) |
#define | CANCEL_REQUESTED(re) ((*((struct fns *) (re)->re_fns)->cancel_requested) ()) |
#define | STACK_TOO_DEEP(re) ((*((struct fns *) (re)->re_fns)->stack_too_deep) ()) |
#define | GUTSMAGIC 0xfed9 |
Typedefs | |
typedef short | color |
typedef struct colormaprange | colormaprange |
Enumerations | |
enum | char_classes { CC_ALNUM, CC_ALPHA, CC_ASCII, CC_BLANK, CC_CNTRL, CC_DIGIT, CC_GRAPH, CC_LOWER, CC_PRINT, CC_PUNCT, CC_SPACE, CC_UPPER, CC_XDIGIT, CC_WORD } |
Functions | |
void | pg_set_regex_collation (Oid collation) |
color | pg_reg_getcolor (struct colormap *cm, chr c) |
#define _POSIX2_RE_DUP_MAX 255 /* normally from <limits.h> */ |
Definition at line 312 of file regguts.h.
Referenced by allocarc(), and freenfa().
#define BACKR 020 /* back reference here or below */ |
Definition at line 479 of file regguts.h.
Referenced by cdissect(), parseqatom(), and rstacktoodeep().
Definition at line 126 of file regguts.h.
Referenced by initialize(), and miss().
#define CANCEL_REQUESTED | ( | re | ) | ((*((struct fns *) (re)->re_fns)->cancel_requested) ()) |
Definition at line 516 of file regguts.h.
Referenced by cdissect(), copyins(), copyouts(), mergeins(), miss(), moveins(), moveouts(), newarc(), newstate(), and range().
#define CAP 010 /* capturing parens here or below */ |
Definition at line 478 of file regguts.h.
Referenced by parseqatom(), and rstacktoodeep().
#define CDEND | ( | cm | ) | (&(cm)->cd[(cm)->max + 1]) |
Definition at line 232 of file regguts.h.
Referenced by colorcomplement(), okcolors(), optimizebracket(), and rainbow().
#define COLMARK 04 /* temporary marker used in some functions */ |
Definition at line 182 of file regguts.h.
Referenced by colorcomplement(), and optimizebracket().
#define COLORLESS (-1) /* impossible color */ |
Definition at line 153 of file regguts.h.
Referenced by compact(), dumpnfa(), findprefix(), makesearch(), maxcolor(), miss(), newcolor(), newnfa(), newsub(), onechr(), parseqatom(), pg_regcomp(), pseudocolor(), rainbow(), specialcolors(), subcolor(), subcolorcvec(), subcolorhi(), and traverse_lacons().
Definition at line 488 of file regguts.h.
Referenced by parseqatom().
#define DISCARD void /* for throwing values away */ |
Definition at line 58 of file regguts.h.
Referenced by nfatree(), and pg_regcomp().
#define DUPINF (DUPMAX+1) |
Definition at line 94 of file regguts.h.
Referenced by cbrdissect(), checkmatchall(), checkmatchall_recurse(), citerdissect(), creviterdissect(), dfa_backref(), longest(), parseqatom(), rstacktoodeep(), and shortest().
#define DUPMAX _POSIX2_RE_DUP_MAX |
#define FDEBUG | ( | arglist | ) | {} |
Definition at line 116 of file regguts.h.
Referenced by getvacant(), lacon(), longest(), matchuntil(), miss(), pickss(), and shortest().
#define FIRSTABSIZE 64 |
Definition at line 314 of file regguts.h.
Referenced by allocarc().
#define FIRSTSBSIZE 32 |
Definition at line 340 of file regguts.h.
Referenced by newstate().
#define freechain outchain /* we do not maintain "freechainRev" */ |
#define FREECOL 01 /* currently free */ |
Definition at line 180 of file regguts.h.
Referenced by freecolor().
#define FREESTATE (-1) |
Definition at line 320 of file regguts.h.
Referenced by delsub(), deltraverse(), and freestate().
#define GETCOLOR | ( | cm, | |
c | |||
) | ((c) <= MAX_SIMPLE_CHR ? (cm)->locolormap[(c) - CHR_MIN] : pg_reg_getcolor(cm, c)) |
Definition at line 252 of file regguts.h.
Referenced by colorcomplement(), findprefix(), longest(), matchuntil(), and shortest().
#define GUTSMAGIC 0xfed9 |
Definition at line 529 of file regguts.h.
Referenced by pg_regcomp(), and rstacktoodeep().
#define HASLACONS 01 /* uses lookaround constraints */ |
#define INUSE 0100 /* in use in final tree */ |
Definition at line 480 of file regguts.h.
Referenced by cleanst(), markst(), and rstacktoodeep().
#define LATYPE_AHEAD_NEG 02 /* negative lookahead */ |
Definition at line 100 of file regguts.h.
Referenced by next(), processlacon(), and rstacktoodeep().
#define LATYPE_AHEAD_POS 03 /* positive lookahead */ |
Definition at line 99 of file regguts.h.
Referenced by next(), processlacon(), and rstacktoodeep().
#define LATYPE_BEHIND_NEG 00 /* negative lookbehind */ |
Definition at line 102 of file regguts.h.
Referenced by next(), processlacon(), and rstacktoodeep().
#define LATYPE_BEHIND_POS 01 /* positive lookbehind */ |
Definition at line 101 of file regguts.h.
Referenced by next(), processlacon(), and rstacktoodeep().
#define LATYPE_IS_AHEAD | ( | la | ) | ((la) & 02) |
Definition at line 104 of file regguts.h.
Referenced by lacon(), and pg_regcomp().
#define LATYPE_IS_POS | ( | la | ) | ((la) & 01) |
#define LONGER 01 /* prefers longer match */ |
Definition at line 475 of file regguts.h.
Referenced by parse(), parseqatom(), and rstacktoodeep().
#define MATCHALL 02 /* matches all strings of a range of lengths */ |
Definition at line 407 of file regguts.h.
Referenced by checkmatchall(), dumpnfa(), longest(), matchuntil(), pg_regprefix(), and shortest().
Definition at line 152 of file regguts.h.
Referenced by newcolor().
#define MAXABSIZE 1024 |
Definition at line 315 of file regguts.h.
Referenced by allocarc().
#define MAXSBSIZE 1024 |
Definition at line 341 of file regguts.h.
Referenced by newstate().
#define MDEBUG | ( | arglist | ) | {} |
Definition at line 117 of file regguts.h.
Referenced by caltdissect(), cbrdissect(), ccondissect(), cdissect(), cfindloop(), citerdissect(), crevcondissect(), creviterdissect(), find(), and subset().
Definition at line 485 of file regguts.h.
Referenced by parse(), and parseqatom().
#define MIXED 04 /* mixed preference below */ |
Definition at line 477 of file regguts.h.
Referenced by parseqatom(), and rstacktoodeep().
Definition at line 176 of file regguts.h.
Referenced by freecolor(), initcm(), newcolor(), newsub(), okcolors(), and pseudocolor().
#define NOTREACHED 0 |
Definition at line 91 of file regguts.h.
Referenced by brenext(), combine(), copyins(), copyouts(), lexescape(), mergeins(), moveins(), moveouts(), next(), processlacon(), pull(), and push().
Definition at line 431 of file regguts.h.
Referenced by freecnfa(), freelacons(), freesrnode(), rfree(), and rstacktoodeep().
#define PREF | ( | f | ) | ((f)&NOPROP) |
Definition at line 486 of file regguts.h.
Referenced by parseqatom().
#define PSEUDO 02 /* pseudocolor, no real chars */ |
Definition at line 181 of file regguts.h.
Referenced by checkmatchall_recurse(), colorcomplement(), combine(), miss(), optimizebracket(), pg_reg_getcharacters(), pg_reg_getnumcharacters(), pseudocolor(), and rainbow().
#define RAINBOW (-2) /* represents all colors except pseudocolors */ |
Definition at line 154 of file regguts.h.
Referenced by checkmatchall(), checkmatchall_recurse(), colorcomplement(), combine(), dumpnfa(), findprefix(), miss(), optimizebracket(), and rainbow().
Definition at line 444 of file regguts.h.
Referenced by allocarc(), and newstate().
#define REMAGIC 0xfed7 /* magic number for main struct */ |
Definition at line 96 of file regguts.h.
Referenced by pg_reg_colorisbegin(), pg_reg_colorisend(), pg_reg_getcharacters(), pg_reg_getfinalstate(), pg_reg_getinitialstate(), pg_reg_getnumcharacters(), pg_reg_getnumcolors(), pg_reg_getnumoutarcs(), pg_reg_getnumstates(), pg_reg_getoutarcs(), pg_regcomp(), pg_regexec(), pg_regprefix(), rfree(), and rstacktoodeep().
#define SHORTER 02 /* prefers shorter match */ |
Definition at line 476 of file regguts.h.
Referenced by ccondissect(), cdissect(), cfindloop(), citerdissect(), crevcondissect(), creviterdissect(), find(), parseqatom(), pg_regcomp(), and rstacktoodeep().
#define STACK_TOO_DEEP | ( | re | ) | ((*((struct fns *) (re)->re_fns)->stack_too_deep) ()) |
Definition at line 519 of file regguts.h.
Referenced by cdissect(), checkmatchall_recurse(), cleartraverse(), clonesuccessorstates(), deltraverse(), duptraverse(), emptyreachable(), findconstraintloop(), lacon(), markcanreach(), markreachable(), removetraverse(), and subre().
#define STATEBATCHSIZE | ( | n | ) | ((n) * sizeof(struct state) + offsetof(struct statebatch, s)) |
Definition at line 338 of file regguts.h.
Referenced by freenfa(), and newstate().
#define UBITS (CHAR_BIT * sizeof(unsigned)) |
#define UNUSEDCOLOR | ( | cd | ) | ((cd)->flags & FREECOL) |
Definition at line 185 of file regguts.h.
Referenced by colorcomplement(), freecolor(), newcolor(), okcolors(), optimizebracket(), and rainbow().
Definition at line 484 of file regguts.h.
Referenced by parse(), and parseqatom().
#define VS | ( | x | ) | ((void *)(x)) /* cast something to generic ptr */ |
Definition at line 61 of file regguts.h.
Referenced by cmp(), moresubs(), newcolor(), pg_regcomp(), and pg_regexec().
#define WHITE 0 /* default color, parent of all others */ |
Definition at line 155 of file regguts.h.
Referenced by freecolor(), initcm(), and pickss().
Definition at line 429 of file regguts.h.
Referenced by freecnfa(), newlacon(), pg_regcomp(), and subre().
typedef struct colormaprange colormaprange |
enum char_classes |
Enumerator | |
---|---|
CC_ALNUM | |
CC_ALPHA | |
CC_ASCII | |
CC_BLANK | |
CC_CNTRL | |
CC_DIGIT | |
CC_GRAPH | |
CC_LOWER | |
CC_PRINT | |
CC_PUNCT | |
CC_SPACE | |
CC_UPPER | |
CC_XDIGIT | |
CC_WORD |
Definition at line 133 of file regguts.h.
Definition at line 120 of file regc_color.c.
References assert, cclass_column_index(), colormap::cmranges, colormap::hiarraycols, colormap::hicolormap, MAX_SIMPLE_CHR, colormap::numcmranges, and colormaprange::rownum.
void pg_set_regex_collation | ( | Oid | collation | ) |
Definition at line 232 of file regc_pg_locale.c.
References pg_locale_struct::deterministic, ereport, errcode(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), lc_ctype_is_c(), OidIsValid, pg_newlocale_from_collation(), pg_regex_collation, PG_REGEX_LOCALE_1BYTE, PG_REGEX_LOCALE_1BYTE_L, PG_REGEX_LOCALE_C, PG_REGEX_LOCALE_ICU, PG_REGEX_LOCALE_WIDE, PG_REGEX_LOCALE_WIDE_L, pg_regex_strategy, PG_UTF8, and pg_locale_struct::provider.
Referenced by pg_regcomp(), pg_regexec(), and pg_regprefix().