|
PostgreSQL Source Code git master
|
#include "mb/pg_wchar.h"

Go to the source code of this file.
Data Structures | |
| struct | collate_methods |
| struct | ctype_methods |
| struct | pg_locale_struct |
Macros | |
| #define | LOCALE_NAME_BUFLEN 128 |
| #define | UNICODE_CASEMAP_LEN 3 |
| #define | UNICODE_CASEMAP_BUFSZ (UNICODE_CASEMAP_LEN * sizeof(char32_t)) |
Typedefs | |
| typedef struct pg_locale_struct * | pg_locale_t |
Functions | |
| bool | check_locale (int category, const char *locale, char **canonname) |
| char * | pg_perm_setlocale (int category, const char *locale) |
| struct lconv * | PGLC_localeconv (void) |
| void | cache_locale_time (void) |
| void | init_database_collation (void) |
| pg_locale_t | pg_database_locale (void) |
| pg_locale_t | pg_newlocale_from_collation (Oid collid) |
| char * | get_collation_actual_version (char collprovider, const char *collcollate) |
| bool | char_is_cased (char ch, pg_locale_t locale) |
| bool | char_tolower_enabled (pg_locale_t locale) |
| char | char_tolower (unsigned char ch, pg_locale_t locale) |
| size_t | pg_strlower (char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| size_t | pg_strtitle (char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| size_t | pg_strupper (char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| size_t | pg_strfold (char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| int | pg_strcoll (const char *arg1, const char *arg2, pg_locale_t locale) |
| int | pg_strncoll (const char *arg1, ssize_t len1, const char *arg2, ssize_t len2, pg_locale_t locale) |
| bool | pg_strxfrm_enabled (pg_locale_t locale) |
| size_t | pg_strxfrm (char *dest, const char *src, size_t destsize, pg_locale_t locale) |
| size_t | pg_strnxfrm (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| bool | pg_strxfrm_prefix_enabled (pg_locale_t locale) |
| size_t | pg_strxfrm_prefix (char *dest, const char *src, size_t destsize, pg_locale_t locale) |
| size_t | pg_strnxfrm_prefix (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| bool | pg_iswdigit (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswalpha (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswalnum (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswupper (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswlower (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswgraph (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswprint (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswpunct (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswspace (pg_wchar wc, pg_locale_t locale) |
| bool | pg_iswxdigit (pg_wchar wc, pg_locale_t locale) |
| pg_wchar | pg_towupper (pg_wchar wc, pg_locale_t locale) |
| pg_wchar | pg_towlower (pg_wchar wc, pg_locale_t locale) |
| int | builtin_locale_encoding (const char *locale) |
| const char * | builtin_validate_locale (int encoding, const char *locale) |
| void | icu_validate_locale (const char *loc_str) |
| char * | icu_language_tag (const char *loc_str, int elevel) |
| void | report_newlocale_failure (const char *localename) |
| size_t | wchar2char (char *to, const wchar_t *from, size_t tolen, locale_t loc) |
Variables | |
| PGDLLIMPORT char * | locale_messages |
| PGDLLIMPORT char * | locale_monetary |
| PGDLLIMPORT char * | locale_numeric |
| PGDLLIMPORT char * | locale_time |
| PGDLLIMPORT int | icu_validation_level |
| PGDLLIMPORT char * | localized_abbrev_days [] |
| PGDLLIMPORT char * | localized_full_days [] |
| PGDLLIMPORT char * | localized_abbrev_months [] |
| PGDLLIMPORT char * | localized_full_months [] |
| #define LOCALE_NAME_BUFLEN 128 |
Definition at line 27 of file pg_locale.h.
| #define UNICODE_CASEMAP_BUFSZ (UNICODE_CASEMAP_LEN * sizeof(char32_t)) |
Definition at line 41 of file pg_locale.h.
| #define UNICODE_CASEMAP_LEN 3 |
Definition at line 40 of file pg_locale.h.
| typedef struct pg_locale_struct* pg_locale_t |
Definition at line 69 of file pg_locale.h.
| int builtin_locale_encoding | ( | const char * | locale | ) |
Definition at line 1663 of file pg_locale.c.
References ereport, errcode(), errmsg(), ERROR, locale, and PG_UTF8.
Referenced by builtin_validate_locale(), and DefineCollation().
| const char * builtin_validate_locale | ( | int | encoding, |
| const char * | locale | ||
| ) |
Definition at line 1687 of file pg_locale.c.
References builtin_locale_encoding(), encoding, ereport, errcode(), errmsg(), ERROR, locale, and pg_encoding_to_char.
Referenced by create_pg_locale_builtin(), createdb(), and DefineCollation().
| void cache_locale_time | ( | void | ) |
Definition at line 699 of file pg_locale.c.
References _dosmaperr(), buf, cache_single_string(), CurrentLCTimeValid, DEBUG3, elog, encoding, ERROR, i, locale, locale_t, locale_time, localized_abbrev_days, localized_abbrev_months, localized_full_days, localized_full_months, MAX_L10N_DATA, pg_get_encoding_from_locale(), PG_SQL_ASCII, PG_UTF8, report_newlocale_failure(), and tm.
Referenced by DCH_from_char(), and DCH_to_char().
| bool char_is_cased | ( | char | ch, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1625 of file pg_locale.c.
References locale.
Referenced by pattern_char_isalpha().
| char char_tolower | ( | unsigned char | ch, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1651 of file pg_locale.c.
References locale, and pg_ascii_tolower().
Referenced by SB_lower_char().
| bool char_tolower_enabled | ( | pg_locale_t | locale | ) |
Definition at line 1638 of file pg_locale.c.
References locale.
Referenced by Generic_Text_IC_like().
| bool check_locale | ( | int | category, |
| const char * | locale, | ||
| char ** | canonname | ||
| ) |
Definition at line 272 of file pg_locale.c.
References elog, ereport, errcode(), errmsg(), locale, pfree(), pg_is_ascii(), pstrdup(), setlocale, and WARNING.
Referenced by check_locale_messages(), check_locale_monetary(), check_locale_numeric(), check_locale_time(), and createdb().
| char * get_collation_actual_version | ( | char | collprovider, |
| const char * | collcollate | ||
| ) |
Definition at line 1244 of file pg_locale.c.
References get_collation_actual_version_builtin(), and get_collation_actual_version_libc().
Referenced by AlterCollation(), AlterDatabaseRefreshColl(), CheckMyDatabase(), create_pg_locale(), createdb(), DefineCollation(), pg_collation_actual_version(), pg_database_collation_actual_version(), and pg_import_system_collations().
| char * icu_language_tag | ( | const char * | loc_str, |
| int | elevel | ||
| ) |
Definition at line 1727 of file pg_locale.c.
References ereport, errcode(), errmsg(), ERROR, MaxAllocSize, Min, palloc(), pfree(), and repalloc().
Referenced by createdb(), DefineCollation(), and pg_import_system_collations().
| void icu_validate_locale | ( | const char * | loc_str | ) |
Definition at line 1785 of file pg_locale.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, i, icu_validation_level, IsBinaryUpgrade, and WARNING.
Referenced by createdb(), and DefineCollation().
| void init_database_collation | ( | void | ) |
Definition at line 1128 of file pg_locale.c.
References Assert(), pg_locale_struct::collate, pg_locale_struct::collate_is_c, create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), pg_locale_struct::ctype, pg_locale_struct::ctype_is_c, default_locale, elog, ERROR, GETSTRUCT(), HeapTupleIsValid, pg_locale_struct::is_default, MyDatabaseId, ObjectIdGetDatum(), PGLOCALE_SUPPORT_ERROR, ReleaseSysCache(), SearchSysCache1(), and TopMemoryContext.
Referenced by CheckMyDatabase().
| pg_locale_t pg_database_locale | ( | void | ) |
Definition at line 1172 of file pg_locale.c.
References pg_newlocale_from_collation().
Referenced by t_isalnum(), and t_isalpha().
| bool pg_iswalnum | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1510 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISALNUM.
Referenced by t_isalnum().
| bool pg_iswalpha | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1500 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISALPHA.
Referenced by t_isalpha().
| bool pg_iswdigit | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1490 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISDIGIT.
| bool pg_iswgraph | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1540 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISGRAPH.
| bool pg_iswlower | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1530 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISLOWER.
| bool pg_iswprint | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1550 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISPRINT.
| bool pg_iswpunct | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1560 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISPUNCT.
| bool pg_iswspace | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1570 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISSPACE.
| bool pg_iswupper | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1520 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISUPPER.
| bool pg_iswxdigit | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1580 of file pg_locale.c.
References locale, pg_char_properties, and PG_ISDIGIT.
| pg_locale_t pg_newlocale_from_collation | ( | Oid | collid | ) |
Definition at line 1186 of file pg_locale.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AssertCouldGetRelation(), c_locale, CollationCache, CollationCacheContext, collid, create_pg_locale(), default_locale, elog, ERROR, last_collation_cache_locale, last_collation_cache_oid, collation_cache_entry::locale, OidIsValid, and TopMemoryContext.
Referenced by bpchareq(), bpcharne(), btvarstrequalimage(), convert_string_datum(), DefineCollation(), Generic_Text_IC_like(), GenericMatchText(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), like_fixed_prefix(), make_greater_string(), match_pattern_prefix(), pg_database_locale(), pg_set_regex_collation(), spg_text_inner_consistent(), str_casefold(), str_initcap(), str_tolower(), str_toupper(), text_position(), text_position_setup(), text_starts_with(), texteq(), textne(), varstr_cmp(), and varstr_sortsupport().
| char * pg_perm_setlocale | ( | int | category, |
| const char * | locale | ||
| ) |
Definition at line 169 of file pg_locale.c.
References DEBUG3, elog, FATAL, GetDatabaseEncoding(), locale, LOCALE_NAME_BUFLEN, setenv, setlocale, SetMessageEncoding(), and strlcpy().
Referenced by assign_locale_messages(), CheckMyDatabase(), and init_locale().
| int pg_strcoll | ( | const char * | arg1, |
| const char * | arg2, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1361 of file pg_locale.c.
References locale.
Referenced by varstrfastcmp_locale().
| size_t pg_strfold | ( | char * | dst, |
| size_t | dstsize, | ||
| const char * | src, | ||
| ssize_t | srclen, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1345 of file pg_locale.c.
References locale, and strlower_c().
Referenced by str_casefold().
| size_t pg_strlower | ( | char * | dst, |
| size_t | dstsize, | ||
| const char * | src, | ||
| ssize_t | srclen, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1315 of file pg_locale.c.
References locale, and strlower_c().
Referenced by str_tolower().
| int pg_strncoll | ( | const char * | arg1, |
| ssize_t | len1, | ||
| const char * | arg2, | ||
| ssize_t | len2, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1381 of file pg_locale.c.
References locale.
Referenced by MatchText(), text_position_next_internal(), and varstr_cmp().
| size_t pg_strnxfrm | ( | char * | dest, |
| size_t | destsize, | ||
| const char * | src, | ||
| ssize_t | srclen, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1436 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
Referenced by hashbpchar(), hashbpcharextended(), hashtext(), and hashtextextended().
| size_t pg_strnxfrm_prefix | ( | char * | dest, |
| size_t | destsize, | ||
| const char * | src, | ||
| ssize_t | srclen, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1483 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
| size_t pg_strtitle | ( | char * | dst, |
| size_t | dstsize, | ||
| const char * | src, | ||
| ssize_t | srclen, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1325 of file pg_locale.c.
References locale, and strtitle_c().
Referenced by str_initcap().
| size_t pg_strupper | ( | char * | dst, |
| size_t | dstsize, | ||
| const char * | src, | ||
| ssize_t | srclen, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1335 of file pg_locale.c.
References locale, and strupper_c().
Referenced by str_toupper().
| size_t pg_strxfrm | ( | char * | dest, |
| const char * | src, | ||
| size_t | destsize, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1411 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
Referenced by convert_string_datum(), and varstr_abbrev_convert().
| bool pg_strxfrm_enabled | ( | pg_locale_t | locale | ) |
Definition at line 1395 of file pg_locale.c.
References locale.
Referenced by varstr_sortsupport().
| size_t pg_strxfrm_prefix | ( | char * | dest, |
| const char * | src, | ||
| size_t | destsize, | ||
| pg_locale_t | locale | ||
| ) |
Definition at line 1458 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
Referenced by varstr_abbrev_convert().
| bool pg_strxfrm_prefix_enabled | ( | pg_locale_t | locale | ) |
Definition at line 1447 of file pg_locale.c.
References locale.
Referenced by varstr_abbrev_convert().
| pg_wchar pg_towlower | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1605 of file pg_locale.c.
References locale, and pg_ascii_tolower().
| pg_wchar pg_towupper | ( | pg_wchar | wc, |
| pg_locale_t | locale | ||
| ) |
Definition at line 1592 of file pg_locale.c.
References locale, and pg_ascii_toupper().
| struct lconv * PGLC_localeconv | ( | void | ) |
Definition at line 503 of file pg_locale.c.
References CurrentLocaleConvValid, db_encoding_convert(), elog, encoding, ereport, errcode(), errmsg(), ERROR, free_struct_lconv(), locale_monetary, locale_numeric, PG_CATCH, PG_END_TRY, pg_get_encoding_from_locale(), pg_localeconv_free(), pg_localeconv_r(), PG_RE_THROW, PG_SQL_ASCII, PG_TRY, and struct_lconv_is_valid().
Referenced by cash_in(), cash_numeric(), cash_out(), int4_cash(), int8_cash(), NUM_prepare_locale(), and numeric_cash().
| void report_newlocale_failure | ( | const char * | localename | ) |
Definition at line 1101 of file pg_locale_libc.c.
References ereport, errcode(), errdetail(), errmsg(), and ERROR.
Referenced by cache_locale_time(), and make_libc_collator().
| size_t wchar2char | ( | char * | to, |
| const wchar_t * | from, | ||
| size_t | tolen, | ||
| locale_t | loc | ||
| ) |
Definition at line 1179 of file pg_locale_libc.c.
References Assert(), GetDatabaseEncoding(), locale_t, PG_UTF8, and wcstombs_l().
Referenced by strlower_libc_mb(), strtitle_libc_mb(), and strupper_libc_mb().
|
extern |
Definition at line 89 of file pg_locale.c.
Referenced by createdb(), DefineCollation(), and icu_validate_locale().
|
extern |
Definition at line 84 of file pg_locale.c.
|
extern |
Definition at line 85 of file pg_locale.c.
Referenced by PGLC_localeconv().
|
extern |
Definition at line 86 of file pg_locale.c.
Referenced by PGLC_localeconv().
|
extern |
Definition at line 87 of file pg_locale.c.
Referenced by cache_locale_time().
|
extern |
Definition at line 98 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
|
extern |
Definition at line 100 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
|
extern |
Definition at line 99 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
|
extern |
Definition at line 101 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().