PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | pg_locale_struct |
Macros | |
#define | LOCALE_NAME_BUFLEN 128 |
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_newlocale_from_collation (Oid collid) |
char * | get_collation_actual_version (char collprovider, const char *collcollate) |
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) |
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) |
size_t | wchar2char (char *to, const wchar_t *from, size_t tolen, pg_locale_t locale) |
size_t | char2wchar (wchar_t *to, size_t tolen, const char *from, size_t fromlen, pg_locale_t locale) |
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 [] |
PGDLLIMPORT bool | database_ctype_is_c |
#define LOCALE_NAME_BUFLEN 128 |
Definition at line 33 of file pg_locale.h.
typedef struct pg_locale_struct* pg_locale_t |
Definition at line 103 of file pg_locale.h.
int builtin_locale_encoding | ( | const char * | locale | ) |
Definition at line 1803 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 1824 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(), createdb(), DefineCollation(), and init_database_collation().
void cache_locale_time | ( | void | ) |
Definition at line 817 of file pg_locale.c.
References buf, cache_single_string(), CurrentLCTimeValid, DEBUG3, elog, encoding, ERROR, FATAL, i, locale_time, localized_abbrev_days, localized_abbrev_months, localized_full_days, localized_full_months, MAX_L10N_DATA, pfree(), pg_get_encoding_from_locale(), PG_SQL_ASCII, PG_UTF8, pstrdup(), setlocale, and tm.
Referenced by DCH_from_char(), and DCH_to_char().
size_t char2wchar | ( | wchar_t * | to, |
size_t | tolen, | ||
const char * | from, | ||
size_t | fromlen, | ||
pg_locale_t | locale | ||
) |
Definition at line 433 of file pg_locale_libc.c.
References Assert, ereport, errcode(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), locale, mbstowcs_l(), pfree(), PG_UTF8, pg_verifymbstr(), pnstrdup(), and str.
Referenced by lowerstr_with_len(), str_initcap(), str_tolower(), str_toupper(), t_isalnum(), t_isalpha(), t_isdigit(), t_isprint(), t_isspace(), and TParserInit().
bool check_locale | ( | int | category, |
const char * | locale, | ||
char ** | canonname | ||
) |
Definition at line 304 of file pg_locale.c.
References elog, ereport, errcode(), errmsg(), locale, pfree(), pg_is_ascii(), pstrdup(), res, 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 1483 of file pg_locale.c.
References buf, ereport, errcode(), errmsg(), ERROR, locale_t, pg_strcasecmp(), pg_strncasecmp(), psprintf(), and pstrdup().
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 1862 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 1920 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 1335 of file pg_locale.c.
References pg_locale_struct::builtin, builtin_validate_locale(), pg_locale_struct::collate_is_c, pg_locale_struct::ctype_is_c, datlocale, default_locale, pg_locale_struct::deterministic, elog, ereport, errcode(), errmsg(), ERROR, GETSTRUCT, HeapTupleIsValid, pg_locale_struct::info, pg_locale_struct::is_default, pg_locale_struct::locale, pg_locale_struct::lt, make_libc_collator(), MemoryContextStrdup(), MyDatabaseId, ObjectIdGetDatum(), PGLOCALE_SUPPORT_ERROR, pg_locale_struct::provider, ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, and TopMemoryContext.
Referenced by CheckMyDatabase().
pg_locale_t pg_newlocale_from_collation | ( | Oid | collid | ) |
Definition at line 1434 of file pg_locale.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, 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_set_regex_collation(), spg_text_inner_consistent(), str_initcap(), str_tolower(), str_toupper(), 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 201 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 1591 of file pg_locale.c.
References locale, PGLOCALE_SUPPORT_ERROR, and strncoll_libc().
Referenced by varstrfastcmp_locale().
int pg_strncoll | ( | const char * | arg1, |
ssize_t | len1, | ||
const char * | arg2, | ||
ssize_t | len2, | ||
pg_locale_t | locale | ||
) |
Definition at line 1623 of file pg_locale.c.
References locale, PGLOCALE_SUPPORT_ERROR, and strncoll_libc().
Referenced by MatchText(), 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 1716 of file pg_locale.c.
References generate_unaccent_rules::dest, locale, PGLOCALE_SUPPORT_ERROR, and strnxfrm_libc().
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 1783 of file pg_locale.c.
References generate_unaccent_rules::dest, locale, and PGLOCALE_SUPPORT_ERROR.
Referenced by pg_strxfrm_prefix().
size_t pg_strxfrm | ( | char * | dest, |
const char * | src, | ||
size_t | destsize, | ||
pg_locale_t | locale | ||
) |
Definition at line 1679 of file pg_locale.c.
References generate_unaccent_rules::dest, locale, PGLOCALE_SUPPORT_ERROR, and strnxfrm_libc().
Referenced by convert_string_datum(), and varstr_abbrev_convert().
bool pg_strxfrm_enabled | ( | pg_locale_t | locale | ) |
Definition at line 1656 of file pg_locale.c.
References locale, and PGLOCALE_SUPPORT_ERROR.
Referenced by varstr_sortsupport().
size_t pg_strxfrm_prefix | ( | char * | dest, |
const char * | src, | ||
size_t | destsize, | ||
pg_locale_t | locale | ||
) |
Definition at line 1758 of file pg_locale.c.
References generate_unaccent_rules::dest, locale, and pg_strnxfrm_prefix().
Referenced by varstr_abbrev_convert().
bool pg_strxfrm_prefix_enabled | ( | pg_locale_t | locale | ) |
Definition at line 1739 of file pg_locale.c.
References locale, and PGLOCALE_SUPPORT_ERROR.
Referenced by varstr_abbrev_convert().
struct lconv* PGLC_localeconv | ( | void | ) |
Definition at line 535 of file pg_locale.c.
References CurrentLocaleConvValid, db_encoding_convert(), elog, encoding, ereport, errcode(), errmsg(), ERROR, FATAL, free_struct_lconv(), locale_monetary, locale_numeric, pfree(), PG_CATCH, PG_END_TRY, pg_get_encoding_from_locale(), PG_RE_THROW, PG_SQL_ASCII, PG_TRY, pstrdup(), setlocale, and struct_lconv_is_valid().
Referenced by cash_in(), cash_numeric(), cash_out(), int4_cash(), int8_cash(), NUM_prepare_locale(), and numeric_cash().
size_t wchar2char | ( | char * | to, |
const wchar_t * | from, | ||
size_t | tolen, | ||
pg_locale_t | locale | ||
) |
Definition at line 379 of file pg_locale_libc.c.
References Assert, GetDatabaseEncoding(), locale, PG_UTF8, and wcstombs_l().
Referenced by lowerstr_with_len(), str_initcap(), str_tolower(), and str_toupper().
|
extern |
Definition at line 139 of file pg_locale.c.
Referenced by CheckMyDatabase(), lowerstr_with_len(), t_isalnum(), t_isalpha(), t_isdigit(), t_isprint(), t_isspace(), and TParserInit().
|
extern |
Definition at line 124 of file pg_locale.c.
Referenced by createdb(), DefineCollation(), and icu_validate_locale().
|
extern |
Definition at line 119 of file pg_locale.c.
|
extern |
Definition at line 120 of file pg_locale.c.
Referenced by PGLC_localeconv().
|
extern |
Definition at line 121 of file pg_locale.c.
Referenced by PGLC_localeconv().
|
extern |
Definition at line 122 of file pg_locale.c.
Referenced by cache_locale_time().
|
extern |
Definition at line 133 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
|
extern |
Definition at line 135 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
|
extern |
Definition at line 134 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
|
extern |
Definition at line 136 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().