mirror of
https://github.com/postgres/postgres.git
synced 2026-04-20 22:00:13 -04:00
Remove unused single-byte char_is_cased() API.
https://postgr.es/m/450ceb6260cad30d7afdf155d991a9caafee7c0d.camel@j-davis.com
This commit is contained in:
parent
9c8de15969
commit
54c41a6deb
5 changed files with 0 additions and 49 deletions
|
|
@ -1625,21 +1625,6 @@ pg_towlower(pg_wchar wc, pg_locale_t locale)
|
|||
return locale->ctype->wc_tolower(wc, locale);
|
||||
}
|
||||
|
||||
/*
|
||||
* char_is_cased()
|
||||
*
|
||||
* Fuzzy test of whether the given char is case-varying or not. The argument
|
||||
* is a single byte, so in a multibyte encoding, just assume any non-ASCII
|
||||
* char is case-varying.
|
||||
*/
|
||||
bool
|
||||
char_is_cased(char ch, pg_locale_t locale)
|
||||
{
|
||||
if (locale->ctype == NULL)
|
||||
return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
|
||||
return locale->ctype->char_is_cased(ch, locale);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return required encoding ID for the given locale, or -1 if any encoding is
|
||||
* valid for the locale.
|
||||
|
|
|
|||
|
|
@ -191,13 +191,6 @@ wc_iscased_builtin(pg_wchar wc, pg_locale_t locale)
|
|||
return pg_u_prop_cased(to_char32(wc));
|
||||
}
|
||||
|
||||
static bool
|
||||
char_is_cased_builtin(char ch, pg_locale_t locale)
|
||||
{
|
||||
return IS_HIGHBIT_SET(ch) ||
|
||||
(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
|
||||
}
|
||||
|
||||
static pg_wchar
|
||||
wc_toupper_builtin(pg_wchar wc, pg_locale_t locale)
|
||||
{
|
||||
|
|
@ -225,7 +218,6 @@ static const struct ctype_methods ctype_methods_builtin = {
|
|||
.wc_ispunct = wc_ispunct_builtin,
|
||||
.wc_isspace = wc_isspace_builtin,
|
||||
.wc_isxdigit = wc_isxdigit_builtin,
|
||||
.char_is_cased = char_is_cased_builtin,
|
||||
.wc_iscased = wc_iscased_builtin,
|
||||
.wc_tolower = wc_tolower_builtin,
|
||||
.wc_toupper = wc_toupper_builtin,
|
||||
|
|
|
|||
|
|
@ -121,13 +121,6 @@ static int32_t u_strFoldCase_default(UChar *dest, int32_t destCapacity,
|
|||
const char *locale,
|
||||
UErrorCode *pErrorCode);
|
||||
|
||||
static bool
|
||||
char_is_cased_icu(char ch, pg_locale_t locale)
|
||||
{
|
||||
return IS_HIGHBIT_SET(ch) ||
|
||||
(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX: many of the functions below rely on casts directly from pg_wchar to
|
||||
* UChar32, which is correct for the UTF-8 encoding, but not in general.
|
||||
|
|
@ -244,7 +237,6 @@ static const struct ctype_methods ctype_methods_icu = {
|
|||
.wc_ispunct = wc_ispunct_icu,
|
||||
.wc_isspace = wc_isspace_icu,
|
||||
.wc_isxdigit = wc_isxdigit_icu,
|
||||
.char_is_cased = char_is_cased_icu,
|
||||
.wc_iscased = wc_iscased_icu,
|
||||
.wc_toupper = toupper_icu,
|
||||
.wc_tolower = tolower_icu,
|
||||
|
|
|
|||
|
|
@ -262,17 +262,6 @@ wc_iscased_libc_mb(pg_wchar wc, pg_locale_t locale)
|
|||
iswlower_l((wint_t) wc, locale->lt);
|
||||
}
|
||||
|
||||
static bool
|
||||
char_is_cased_libc(char ch, pg_locale_t locale)
|
||||
{
|
||||
bool is_multibyte = pg_database_encoding_max_length() > 1;
|
||||
|
||||
if (is_multibyte && IS_HIGHBIT_SET(ch))
|
||||
return true;
|
||||
else
|
||||
return isalpha_l((unsigned char) ch, locale->lt);
|
||||
}
|
||||
|
||||
static pg_wchar
|
||||
toupper_libc_sb(pg_wchar wc, pg_locale_t locale)
|
||||
{
|
||||
|
|
@ -345,7 +334,6 @@ static const struct ctype_methods ctype_methods_libc_sb = {
|
|||
.wc_ispunct = wc_ispunct_libc_sb,
|
||||
.wc_isspace = wc_isspace_libc_sb,
|
||||
.wc_isxdigit = wc_isxdigit_libc_sb,
|
||||
.char_is_cased = char_is_cased_libc,
|
||||
.wc_iscased = wc_iscased_libc_sb,
|
||||
.wc_toupper = toupper_libc_sb,
|
||||
.wc_tolower = tolower_libc_sb,
|
||||
|
|
@ -371,7 +359,6 @@ static const struct ctype_methods ctype_methods_libc_other_mb = {
|
|||
.wc_ispunct = wc_ispunct_libc_sb,
|
||||
.wc_isspace = wc_isspace_libc_sb,
|
||||
.wc_isxdigit = wc_isxdigit_libc_sb,
|
||||
.char_is_cased = char_is_cased_libc,
|
||||
.wc_iscased = wc_iscased_libc_sb,
|
||||
.wc_toupper = toupper_libc_sb,
|
||||
.wc_tolower = tolower_libc_sb,
|
||||
|
|
@ -393,7 +380,6 @@ static const struct ctype_methods ctype_methods_libc_utf8 = {
|
|||
.wc_ispunct = wc_ispunct_libc_mb,
|
||||
.wc_isspace = wc_isspace_libc_mb,
|
||||
.wc_isxdigit = wc_isxdigit_libc_mb,
|
||||
.char_is_cased = char_is_cased_libc,
|
||||
.wc_iscased = wc_iscased_libc_mb,
|
||||
.wc_toupper = toupper_libc_mb,
|
||||
.wc_tolower = tolower_libc_mb,
|
||||
|
|
|
|||
|
|
@ -125,9 +125,6 @@ struct ctype_methods
|
|||
bool (*wc_iscased) (pg_wchar wc, pg_locale_t locale);
|
||||
pg_wchar (*wc_toupper) (pg_wchar wc, pg_locale_t locale);
|
||||
pg_wchar (*wc_tolower) (pg_wchar wc, pg_locale_t locale);
|
||||
|
||||
/* required */
|
||||
bool (*char_is_cased) (char ch, pg_locale_t locale);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -178,7 +175,6 @@ extern pg_locale_t pg_newlocale_from_collation(Oid collid);
|
|||
|
||||
extern char *get_collation_actual_version(char collprovider, const char *collcollate);
|
||||
|
||||
extern bool char_is_cased(char ch, pg_locale_t locale);
|
||||
extern size_t pg_strlower(char *dst, size_t dstsize,
|
||||
const char *src, ssize_t srclen,
|
||||
pg_locale_t locale);
|
||||
|
|
|
|||
Loading…
Reference in a new issue