|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <limits.h>#include <wctype.h>#include "access/htup_details.h"#include "catalog/pg_database.h"#include "catalog/pg_collation.h"#include "mb/pg_wchar.h"#include "miscadmin.h"#include "utils/builtins.h"#include "utils/formatting.h"#include "utils/memutils.h"#include "utils/pg_locale.h"#include "utils/syscache.h"
Go to the source code of this file.
Macros | |
| #define | TEXTBUFLEN 1024 |
Functions | |
| pg_locale_t | create_pg_locale_libc (Oid collid, MemoryContext context) |
| static int | strncoll_libc (const char *arg1, ssize_t len1, const char *arg2, ssize_t len2, pg_locale_t locale) |
| static size_t | strnxfrm_libc (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| char * | get_collation_actual_version_libc (const char *collcollate) |
| static locale_t | make_libc_collator (const char *collate, const char *ctype) |
| static size_t | char2wchar (wchar_t *to, size_t tolen, const char *from, size_t fromlen, locale_t loc) |
| static size_t | strlower_libc_sb (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| static size_t | strlower_libc_mb (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| static size_t | strtitle_libc_sb (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| static size_t | strtitle_libc_mb (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| static size_t | strupper_libc_sb (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| static size_t | strupper_libc_mb (char *dest, size_t destsize, const char *src, ssize_t srclen, pg_locale_t locale) |
| static bool | wc_isdigit_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isalpha_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isalnum_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isupper_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_islower_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isgraph_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isprint_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_ispunct_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isspace_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isxdigit_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isdigit_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isalpha_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isalnum_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isupper_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_islower_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isgraph_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isprint_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_ispunct_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isspace_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static bool | wc_isxdigit_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static char | char_tolower_libc (unsigned char ch, pg_locale_t locale) |
| static bool | char_is_cased_libc (char ch, pg_locale_t locale) |
| static pg_wchar | toupper_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static pg_wchar | toupper_libc_mb (pg_wchar wc, pg_locale_t locale) |
| static pg_wchar | tolower_libc_sb (pg_wchar wc, pg_locale_t locale) |
| static pg_wchar | tolower_libc_mb (pg_wchar wc, pg_locale_t locale) |
| void | report_newlocale_failure (const char *localename) |
| static size_t | mbstowcs_l (wchar_t *dest, const char *src, size_t n, locale_t loc) |
| static size_t | wcstombs_l (char *dest, const wchar_t *src, size_t n, locale_t loc) |
| size_t | wchar2char (char *to, const wchar_t *from, size_t tolen, locale_t loc) |
Variables | |
| static const struct ctype_methods | ctype_methods_libc_sb |
| static const struct ctype_methods | ctype_methods_libc_other_mb |
| static const struct ctype_methods | ctype_methods_libc_utf8 |
| static const struct collate_methods | collate_methods_libc |
| #define TEXTBUFLEN 1024 |
Definition at line 81 of file pg_locale_libc.c.
|
static |
Definition at line 1233 of file pg_locale_libc.c.
References Assert(), ereport, errcode(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), locale_t, mbstowcs_l(), pfree(), PG_UTF8, pg_verifymbstr(), pnstrdup(), and str.
Referenced by strlower_libc_mb(), strtitle_libc_mb(), and strupper_libc_mb().
|
static |
Definition at line 259 of file pg_locale_libc.c.
References IS_HIGHBIT_SET, isalpha_l, locale, and pg_database_encoding_max_length().
|
static |
Definition at line 252 of file pg_locale_libc.c.
References Assert(), locale, pg_database_encoding_max_length(), and tolower_l.
| pg_locale_t create_pg_locale_libc | ( | Oid | collid, |
| MemoryContext | context | ||
| ) |
Definition at line 715 of file pg_locale_libc.c.
References pg_locale_struct::collate, pg_locale_struct::collate_is_c, collate_methods_libc, collid, pg_locale_struct::ctype, pg_locale_struct::ctype_is_c, ctype_methods_libc_other_mb, ctype_methods_libc_sb, ctype_methods_libc_utf8, pg_locale_struct::deterministic, elog, ERROR, GetDatabaseEncoding(), HeapTupleIsValid, if(), locale_t, pg_locale_struct::lt, make_libc_collator(), MemoryContextAllocZero(), MyDatabaseId, ObjectIdGetDatum(), pg_database_encoding_max_length(), PG_UTF8, ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Referenced by create_pg_locale(), and init_database_collation().
| char * get_collation_actual_version_libc | ( | const char * | collcollate | ) |
Definition at line 957 of file pg_locale_libc.c.
References ereport, errmsg(), ERROR, locale_t, pg_strcasecmp(), pg_strncasecmp(), psprintf(), and pstrdup().
Referenced by get_collation_actual_version().
|
static |
Definition at line 799 of file pg_locale_libc.c.
References ereport, errcode(), errmsg(), ERROR, locale_t, and report_newlocale_failure().
Referenced by create_pg_locale_libc().
|
static |
Definition at line 1135 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, and locale_t.
Referenced by char2wchar().
| 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().
|
static |
Definition at line 469 of file pg_locale_libc.c.
References char2wchar(), generate_unaccent_rules::dest, ereport, errcode(), errmsg(), ERROR, locale, locale_t, palloc(), pfree(), pg_database_encoding_max_length(), towlower_l, and wchar2char().
|
static |
Definition at line 430 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, IS_HIGHBIT_SET, isupper_l, locale, locale_t, and tolower_l.
|
static |
Definition at line 870 of file pg_locale_libc.c.
References buf, locale, palloc(), pfree(), strcoll_l, and TEXTBUFLEN.
|
static |
Definition at line 927 of file pg_locale_libc.c.
References Assert(), buf, bufsize, generate_unaccent_rules::dest, locale, palloc(), pfree(), strxfrm_l, and TEXTBUFLEN.
|
static |
Definition at line 573 of file pg_locale_libc.c.
References char2wchar(), generate_unaccent_rules::dest, ereport, errcode(), errmsg(), ERROR, iswalnum_l, locale, locale_t, palloc(), pfree(), pg_database_encoding_max_length(), towlower_l, towupper_l, and wchar2char().
|
static |
Definition at line 517 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, IS_HIGHBIT_SET, isalnum_l, islower_l, isupper_l, locale, locale_t, tolower_l, and toupper_l.
|
static |
Definition at line 667 of file pg_locale_libc.c.
References char2wchar(), generate_unaccent_rules::dest, ereport, errcode(), errmsg(), ERROR, locale, locale_t, palloc(), pfree(), pg_database_encoding_max_length(), towupper_l, and wchar2char().
|
static |
Definition at line 628 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, IS_HIGHBIT_SET, islower_l, locale, locale_t, and toupper_l.
|
static |
Definition at line 312 of file pg_locale_libc.c.
References Assert(), GetDatabaseEncoding(), locale, pg_ascii_tolower(), PG_UTF8, and towlower_l.
|
static |
Definition at line 298 of file pg_locale_libc.c.
References Assert(), GetDatabaseEncoding(), locale, pg_ascii_tolower(), PG_UTF8, and tolower_l.
|
static |
Definition at line 284 of file pg_locale_libc.c.
References Assert(), GetDatabaseEncoding(), locale, pg_ascii_toupper(), PG_UTF8, and towupper_l.
|
static |
Definition at line 270 of file pg_locale_libc.c.
References Assert(), GetDatabaseEncoding(), locale, pg_ascii_toupper(), PG_UTF8, and toupper_l.
|
static |
Definition at line 200 of file pg_locale_libc.c.
References iswalnum_l, and locale.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 124 of file pg_locale_libc.c.
|
static |
|
static |
Definition at line 154 of file pg_locale_libc.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 160 of file pg_locale_libc.c.
|
static |
|
static |
Definition at line 166 of file pg_locale_libc.c.
|
static |
|
static |
Definition at line 172 of file pg_locale_libc.c.
|
static |
|
static |
|
static |
Definition at line 242 of file pg_locale_libc.c.
References locale.
|
static |
Definition at line 178 of file pg_locale_libc.c.
References locale.
| 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().
|
static |
Definition at line 1151 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, and locale_t.
Referenced by wchar2char().
|
static |
Definition at line 395 of file pg_locale_libc.c.
Referenced by create_pg_locale_libc().
|
static |
Definition at line 351 of file pg_locale_libc.c.
Referenced by create_pg_locale_libc().
|
static |
Definition at line 325 of file pg_locale_libc.c.
Referenced by create_pg_locale_libc().
|
static |
Definition at line 373 of file pg_locale_libc.c.
Referenced by create_pg_locale_libc().