aboutsummaryrefslogtreecommitdiff
path: root/src/include/regex/regex.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-04-10 18:02:17 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-04-10 18:03:09 -0400
commit1e16a8107db9a50435b39e09c6f9c52c45e63e1a (patch)
treebf2231fc078b46004c7814ba871e3c38c1d8d52d /src/include/regex/regex.h
parent210f95f1cd59c6fdfe0f84b922c19d8498ac377d (diff)
downloadpostgresql-1e16a8107db9a50435b39e09c6f9c52c45e63e1a.tar.gz
postgresql-1e16a8107db9a50435b39e09c6f9c52c45e63e1a.zip
Teach regular expression operators to honor collations.
This involves getting the character classification and case-folding functions in the regex library to use the collations infrastructure. Most of this work had been done already in connection with the upper/lower and LIKE logic, so it was a simple matter of transposition. While at it, split out these functions into a separate source file regc_pg_locale.c, so that they can be correctly labeled with the Postgres project's license rather than the Scriptics license. These functions are 100% Postgres-written code whereas what remains in regc_locale.c is still mostly not ours, so lumping them both under the same copyright notice was getting more and more misleading.
Diffstat (limited to 'src/include/regex/regex.h')
-rw-r--r--src/include/regex/regex.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h
index cab439df78e..cec4b837cd1 100644
--- a/src/include/regex/regex.h
+++ b/src/include/regex/regex.h
@@ -73,6 +73,7 @@ typedef struct
#define REG_USHORTEST 020000
int re_csize; /* sizeof(character) */
char *re_endp; /* backward compatibility kludge */
+ Oid re_collation; /* Collation that defines LC_CTYPE behavior */
/* the rest is opaque pointers to hidden innards */
char *re_guts; /* `char *' is more portable than `void *' */
char *re_fns;
@@ -161,9 +162,10 @@ typedef struct
/*
* the prototypes for exported functions
*/
-extern int pg_regcomp(regex_t *, const pg_wchar *, size_t, int);
+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 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);
#endif /* _REGEX_H_ */