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) |
size_t | strlower_libc (char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale) |
size_t | strtitle_libc (char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale) |
size_t | strupper_libc (char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale) |
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 void | report_newlocale_failure (const char *localename) |
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 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, pg_locale_t locale) |
size_t | char2wchar (wchar_t *to, size_t tolen, const char *from, size_t fromlen, pg_locale_t locale) |
Variables | |
static const struct collate_methods | collate_methods_libc |
#define TEXTBUFLEN 1024 |
Definition at line 42 of file pg_locale_libc.c.
size_t char2wchar | ( | wchar_t * | to, |
size_t | tolen, | ||
const char * | from, | ||
size_t | fromlen, | ||
pg_locale_t | locale | ||
) |
Definition at line 937 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 strlower_libc_mb(), strtitle_libc_mb(), strupper_libc_mb(), t_isalnum(), t_isalpha(), and TParserInit().
pg_locale_t create_pg_locale_libc | ( | Oid | collid, |
MemoryContext | context | ||
) |
Definition at line 422 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_is_c, pg_locale_struct::deterministic, elog, ERROR, GetDatabaseEncoding(), HeapTupleIsValid, pg_locale_struct::info, locale_t, pg_locale_struct::lt, make_libc_collator(), MemoryContextAllocZero(), MyDatabaseId, ObjectIdGetDatum(), PG_UTF8, pg_locale_struct::provider, 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 660 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 498 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 839 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, and locale_t.
Referenced by char2wchar().
|
static |
Definition at line 805 of file pg_locale_libc.c.
References ereport, errcode(), errdetail(), errmsg(), and ERROR.
Referenced by make_libc_collator().
size_t strlower_libc | ( | char * | dst, |
size_t | dstsize, | ||
const char * | src, | ||
ssize_t | srclen, | ||
pg_locale_t | locale | ||
) |
Definition at line 124 of file pg_locale_libc.c.
References locale, pg_database_encoding_max_length(), strlower_libc_mb(), and strlower_libc_sb().
Referenced by pg_strfold(), and pg_strlower().
|
static |
Definition at line 191 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().
Referenced by strlower_libc().
|
static |
Definition at line 154 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, locale, locale_t, pg_tolower(), and tolower_l.
Referenced by strlower_libc().
|
static |
Definition at line 569 of file pg_locale_libc.c.
References Assert(), buf, locale, palloc(), pfree(), strcoll_l, and TEXTBUFLEN.
|
static |
Definition at line 628 of file pg_locale_libc.c.
References Assert(), buf, bufsize, generate_unaccent_rules::dest, locale, palloc(), pfree(), strxfrm_l, and TEXTBUFLEN.
size_t strtitle_libc | ( | char * | dst, |
size_t | dstsize, | ||
const char * | src, | ||
ssize_t | srclen, | ||
pg_locale_t | locale | ||
) |
Definition at line 134 of file pg_locale_libc.c.
References locale, pg_database_encoding_max_length(), strtitle_libc_mb(), and strtitle_libc_sb().
Referenced by pg_strtitle().
|
static |
Definition at line 285 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().
Referenced by strtitle_libc().
|
static |
Definition at line 239 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, isalnum_l, locale, locale_t, pg_tolower(), pg_toupper(), tolower_l, and toupper_l.
Referenced by strtitle_libc().
size_t strupper_libc | ( | char * | dst, |
size_t | dstsize, | ||
const char * | src, | ||
ssize_t | srclen, | ||
pg_locale_t | locale | ||
) |
Definition at line 144 of file pg_locale_libc.c.
References locale, pg_database_encoding_max_length(), strupper_libc_mb(), and strupper_libc_sb().
Referenced by pg_strupper().
|
static |
Definition at line 374 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().
Referenced by strupper_libc().
|
static |
Definition at line 340 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, locale, locale_t, pg_toupper(), and toupper_l.
Referenced by strupper_libc().
size_t wchar2char | ( | char * | to, |
const wchar_t * | from, | ||
size_t | tolen, | ||
pg_locale_t | locale | ||
) |
Definition at line 883 of file pg_locale_libc.c.
References Assert(), GetDatabaseEncoding(), locale, PG_UTF8, and wcstombs_l().
Referenced by strlower_libc_mb(), strtitle_libc_mb(), and strupper_libc_mb().
|
static |
Definition at line 855 of file pg_locale_libc.c.
References generate_unaccent_rules::dest, and locale_t.
Referenced by wchar2char().
|
static |
Definition at line 89 of file pg_locale_libc.c.
Referenced by create_pg_locale_libc().