summaryrefslogtreecommitdiff
path: root/src/include/common
diff options
context:
space:
mode:
authorJeff Davis2024-03-30 00:35:07 +0000
committerJeff Davis2024-03-30 00:35:07 +0000
commit46e5441fa536b89c1123f270fdfeeb72c320b901 (patch)
treedddff7b376feddb7200d6bf4c334b74de7f61980 /src/include/common
parenta96a8b15fa4e00b78ac7dd7f37ff7f871aa248f6 (diff)
Add unicode_strtitle() for Unicode Default Case Conversion.
This brings the titlecasing implementation for the builtin provider out of formatting.c and into unicode_case.c, along with unicode_strlower() and unicode_strupper(). Accepts an arbitrary word boundary callback. Simple for now, but can be extended to support the Unicode Default Case Conversion algorithm with full case mapping. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Peter Eisentraut
Diffstat (limited to 'src/include/common')
-rw-r--r--src/include/common/unicode_case.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/common/unicode_case.h b/src/include/common/unicode_case.h
index df36d8db213..c0c3382e79e 100644
--- a/src/include/common/unicode_case.h
+++ b/src/include/common/unicode_case.h
@@ -16,11 +16,16 @@
#include "mb/pg_wchar.h"
+typedef size_t (*WordBoundaryNext) (void *wbstate);
+
pg_wchar unicode_lowercase_simple(pg_wchar ucs);
pg_wchar unicode_titlecase_simple(pg_wchar ucs);
pg_wchar unicode_uppercase_simple(pg_wchar ucs);
size_t unicode_strlower(char *dst, size_t dstsize, const char *src,
ssize_t srclen);
+size_t unicode_strtitle(char *dst, size_t dstsize, const char *src,
+ ssize_t srclen, WordBoundaryNext wbnext,
+ void *wbstate);
size_t unicode_strupper(char *dst, size_t dstsize, const char *src,
ssize_t srclen);