diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/regex/regex.h | 4 | ||||
-rw-r--r-- | src/include/regex/regguts.h | 10 | ||||
-rw-r--r-- | src/include/utils/builtins.h | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h index cec4b837cd1..616c2c6450d 100644 --- a/src/include/regex/regex.h +++ b/src/include/regex/regex.h @@ -156,6 +156,9 @@ typedef struct /* two specials for debugging and testing */ #define REG_ATOI 101 /* convert error-code name to number */ #define REG_ITOA 102 /* convert error-code number to name */ +/* non-error result codes for pg_regprefix */ +#define REG_PREFIX (-1) /* identified a common prefix */ +#define REG_EXACT (-2) /* identified an exact match */ @@ -164,6 +167,7 @@ typedef struct */ extern int pg_regcomp(regex_t *, const pg_wchar *, size_t, int, Oid); extern int pg_regexec(regex_t *, const pg_wchar *, size_t, size_t, rm_detail_t *, size_t, regmatch_t[], int); +extern int pg_regprefix(regex_t *, pg_wchar **, size_t *); extern void pg_regfree(regex_t *); extern size_t pg_regerror(int, const regex_t *, char *, size_t); extern void pg_set_regex_collation(Oid collation); diff --git a/src/include/regex/regguts.h b/src/include/regex/regguts.h index b8788506d41..e1e406f4eaa 100644 --- a/src/include/regex/regguts.h +++ b/src/include/regex/regguts.h @@ -199,19 +199,21 @@ struct colordesc color sub; /* open subcolor, if any; or free-chain ptr */ #define NOSUB COLORLESS /* value of "sub" when no open subcolor */ struct arc *arcs; /* chain of all arcs of this color */ + chr firstchr; /* char first assigned to this color */ int flags; /* bit values defined next */ #define FREECOL 01 /* currently free */ #define PSEUDO 02 /* pseudocolor, no real chars */ -#define UNUSEDCOLOR(cd) ((cd)->flags&FREECOL) +#define UNUSEDCOLOR(cd) ((cd)->flags & FREECOL) union tree *block; /* block of solid color, if any */ }; /* * The color map itself * - * Only the "tree" part is used at execution time, and that only via the - * GETCOLOR() macro. Possibly that should be separated from the compile-time - * data. + * Much of the data in the colormap struct is only used at compile time. + * However, the bulk of the space usage is in the "tree" structure, so it's + * not clear that there's much point in converting the rest to a more compact + * form when compilation is finished. */ struct colormap { diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 10634039a44..b43a4f1f6f3 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -568,6 +568,8 @@ extern Datum regexp_split_to_table(PG_FUNCTION_ARGS); extern Datum regexp_split_to_table_no_flags(PG_FUNCTION_ARGS); extern Datum regexp_split_to_array(PG_FUNCTION_ARGS); extern Datum regexp_split_to_array_no_flags(PG_FUNCTION_ARGS); +extern char *regexp_fixed_prefix(text *text_re, bool case_insensitive, + Oid collation, bool *exact); /* regproc.c */ extern Datum regprocin(PG_FUNCTION_ARGS); |