PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/unicode_norm.h"
#include "common/unicode_norm_hashfunc.h"
#include "common/unicode_normprops_table.h"
#include "port/pg_bswap.h"
Go to the source code of this file.
Macros | |
#define | ALLOC(size) palloc(size) |
#define | FREE(size) pfree(size) |
#define | SBASE 0xAC00 /* U+AC00 */ |
#define | LBASE 0x1100 /* U+1100 */ |
#define | VBASE 0x1161 /* U+1161 */ |
#define | TBASE 0x11A7 /* U+11A7 */ |
#define | LCOUNT 19 |
#define | VCOUNT 21 |
#define | TCOUNT 28 |
#define | NCOUNT VCOUNT * TCOUNT |
#define | SCOUNT LCOUNT * NCOUNT |
Functions | |
static const pg_unicode_decomposition * | get_code_entry (pg_wchar code) |
static uint8 | get_canonical_class (pg_wchar code) |
static const pg_wchar * | get_code_decomposition (const pg_unicode_decomposition *entry, int *dec_size) |
static int | get_decomposed_size (pg_wchar code, bool compat) |
static bool | recompose_code (uint32 start, uint32 code, uint32 *result) |
static void | decompose_code (pg_wchar code, bool compat, pg_wchar **result, int *current) |
pg_wchar * | unicode_normalize (UnicodeNormalizationForm form, const pg_wchar *input) |
static const pg_unicode_normprops * | qc_hash_lookup (pg_wchar ch, const pg_unicode_norminfo *norminfo) |
static UnicodeNormalizationQC | qc_is_allowed (UnicodeNormalizationForm form, pg_wchar ch) |
UnicodeNormalizationQC | unicode_is_normalized_quickcheck (UnicodeNormalizationForm form, const pg_wchar *input) |
Definition at line 31 of file unicode_norm.c.
Definition at line 32 of file unicode_norm.c.
#define LBASE 0x1100 /* U+1100 */ |
Definition at line 40 of file unicode_norm.c.
#define LCOUNT 19 |
Definition at line 43 of file unicode_norm.c.
Definition at line 46 of file unicode_norm.c.
#define SBASE 0xAC00 /* U+AC00 */ |
Definition at line 39 of file unicode_norm.c.
Definition at line 47 of file unicode_norm.c.
#define TBASE 0x11A7 /* U+11A7 */ |
Definition at line 42 of file unicode_norm.c.
#define TCOUNT 28 |
Definition at line 45 of file unicode_norm.c.
#define VBASE 0x1161 /* U+1161 */ |
Definition at line 41 of file unicode_norm.c.
#define VCOUNT 21 |
Definition at line 44 of file unicode_norm.c.
Definition at line 321 of file unicode_norm.c.
References compat, DECOMPOSITION_IS_COMPAT, DECOMPOSITION_SIZE, get_code_decomposition(), get_code_entry(), i, LBASE, res, SBASE, SCOUNT, TBASE, TCOUNT, VBASE, and VCOUNT.
Referenced by unicode_normalize().
Definition at line 112 of file unicode_norm.c.
References pg_unicode_decomposition::comb_class, and get_code_entry().
Referenced by unicode_is_normalized_quickcheck(), and unicode_normalize().
|
static |
Definition at line 134 of file unicode_norm.c.
References Assert, pg_unicode_decomposition::dec_index, DECOMPOSITION_IS_INLINE, DECOMPOSITION_SIZE, UnicodeDecomp_codepoints, and x.
Referenced by decompose_code(), and get_decomposed_size().
|
static |
Definition at line 72 of file unicode_norm.c.
References pg_unicode_decomposition::codepoint, pg_unicode_decompinfo::decomps, pg_unicode_decompinfo::hash, lengthof, pg_unicode_decompinfo::num_decomps, pg_hton32, UnicodeDecompInfo, and UnicodeDecompMain.
Referenced by decompose_code(), get_canonical_class(), and get_decomposed_size().
|
static |
Definition at line 159 of file unicode_norm.c.
References compat, DECOMPOSITION_IS_COMPAT, DECOMPOSITION_SIZE, get_code_decomposition(), get_code_entry(), i, SBASE, SCOUNT, size, and TCOUNT.
Referenced by unicode_normalize().
|
static |
Definition at line 543 of file unicode_norm.c.
References pg_unicode_normprops::codepoint, pg_unicode_norminfo::hash, pg_unicode_norminfo::normprops, pg_unicode_norminfo::num_normprops, and pg_hton32.
Referenced by qc_is_allowed().
|
static |
Definition at line 574 of file unicode_norm.c.
References Assert, qc_hash_lookup(), pg_unicode_normprops::quickcheck, UNICODE_NFC, UNICODE_NFKC, UNICODE_NORM_QC_YES, UnicodeNormInfo_NFC_QC, and UnicodeNormInfo_NFKC_QC.
Referenced by unicode_is_normalized_quickcheck().
Definition at line 218 of file unicode_norm.c.
References pg_unicode_decomposition::codepoint, pg_unicode_decomposition::dec_index, DECOMPOSITION_NO_COMPOSE, DECOMPOSITION_SIZE, pg_unicode_recompinfo::hash, i, pg_unicode_recompinfo::inverse_lookup, LBASE, LCOUNT, lengthof, pg_unicode_recompinfo::num_recomps, pg_hton64, SBASE, SCOUNT, start, TBASE, TCOUNT, UnicodeDecomp_codepoints, UnicodeDecompMain, UnicodeRecompInfo, VBASE, and VCOUNT.
Referenced by unicode_normalize().
UnicodeNormalizationQC unicode_is_normalized_quickcheck | ( | UnicodeNormalizationForm | form, |
const pg_wchar * | input | ||
) |
Definition at line 598 of file unicode_norm.c.
References get_canonical_class(), input, qc_is_allowed(), UNICODE_NFD, UNICODE_NFKD, UNICODE_NORM_QC_MAYBE, UNICODE_NORM_QC_NO, and UNICODE_NORM_QC_YES.
Referenced by unicode_is_normalized().
pg_wchar* unicode_normalize | ( | UnicodeNormalizationForm | form, |
const pg_wchar * | input | ||
) |
Definition at line 402 of file unicode_norm.c.
References ALLOC, Assert, compat, current_size, decompose_code(), FREE, get_canonical_class(), get_decomposed_size(), input, next, recompose_code(), UNICODE_NFC, UNICODE_NFKC, and UNICODE_NFKD.
Referenced by main(), pg_saslprep(), unicode_is_normalized(), and unicode_normalize_func().