31 #define ALLOC(size) palloc(size)
32 #define FREE(size) pfree(size)
34 #define ALLOC(size) malloc(size)
35 #define FREE(size) free(size)
46 #define NCOUNT VCOUNT * TCOUNT
47 #define SCOUNT LCOUNT * NCOUNT
52 conv_compare(
const void *p1,
const void *
p2)
59 return (v1 > v2) ? 1 : ((v1 == v2) ? 0 : -1);
84 h = decompinfo.
hash(&hashkey);
100 return bsearch(&(code),
178 sindex = code -
SBASE;
201 for (
i = 0;
i < dec_size;
i++)
243 *result =
start + tindex;
270 h = recompinfo.
hash(&hashkey);
342 sindex = code -
SBASE;
374 res[*current] = code;
383 for (
i = 0;
i < dec_size;
i++)
425 for (p =
input; *p; p++)
429 if (decomp_chars == NULL)
437 for (p =
input; *p; p++)
439 decomp_chars[decomp_size] =
'\0';
443 if (decomp_size == 0)
449 for (count = 1; count < decomp_size; count++)
451 pg_wchar prev = decomp_chars[count - 1];
465 if (prevClass == 0 || nextClass == 0)
468 if (prevClass <= nextClass)
472 tmp = decomp_chars[count - 1];
473 decomp_chars[count - 1] = decomp_chars[count];
474 decomp_chars[count] = tmp;
500 starter_ch = recomp_chars[0] = decomp_chars[0];
502 for (count = 1; count < decomp_size; count++)
508 if (last_class < ch_class &&
511 recomp_chars[starter_pos] = composite;
512 starter_ch = composite;
514 else if (ch_class == 0)
516 starter_pos = target_pos;
519 recomp_chars[target_pos++] = ch;
523 last_class = ch_class;
524 recomp_chars[target_pos++] = ch;
527 recomp_chars[target_pos] = (
pg_wchar)
'\0';
553 h = norminfo->
hash(&hashkey);
600 uint8 lastCanonicalClass = 0;
616 uint8 canonicalClass;
620 if (lastCanonicalClass > canonicalClass && canonicalClass != 0)
629 lastCanonicalClass = canonicalClass;
#define Assert(condition)
static void PGresult const char * p2
static void PGresult * res
static int64 current_size
static pg_noinline void Size size
const pg_unicode_decomposition * decomps
const pg_unicode_normprops * normprops
const uint16 * inverse_lookup
static void decompose_code(pg_wchar code, bool compat, pg_wchar **result, int *current)
UnicodeNormalizationQC unicode_is_normalized_quickcheck(UnicodeNormalizationForm form, const pg_wchar *input)
static uint8 get_canonical_class(pg_wchar code)
static const pg_wchar * get_code_decomposition(const pg_unicode_decomposition *entry, int *dec_size)
static UnicodeNormalizationQC qc_is_allowed(UnicodeNormalizationForm form, pg_wchar ch)
static const pg_unicode_normprops * qc_hash_lookup(pg_wchar ch, const pg_unicode_norminfo *norminfo)
pg_wchar * unicode_normalize(UnicodeNormalizationForm form, const pg_wchar *input)
static bool recompose_code(uint32 start, uint32 code, uint32 *result)
static const pg_unicode_decomposition * get_code_entry(pg_wchar code)
static int get_decomposed_size(pg_wchar code, bool compat)
static const pg_unicode_decompinfo UnicodeDecompInfo
static const pg_unicode_recompinfo UnicodeRecompInfo
#define DECOMPOSITION_NO_COMPOSE(x)
#define DECOMPOSITION_IS_INLINE(x)
static const uint32 UnicodeDecomp_codepoints[5098]
#define DECOMPOSITION_IS_COMPAT(x)
static const pg_unicode_decomposition UnicodeDecompMain[6775]
#define DECOMPOSITION_SIZE(x)
static const pg_unicode_norminfo UnicodeNormInfo_NFKC_QC
static const pg_unicode_norminfo UnicodeNormInfo_NFC_QC