PostgreSQL Source Code: src/backend/regex/regc_locale.c File Reference (original) (raw)
Go to the source code of this file.
Data Structures | |
---|---|
struct | cname |
Functions | |
---|---|
static chr | element (struct vars *v, const chr *startp, const chr *endp) |
static struct cvec * | range (struct vars *v, chr a, chr b, int cases) |
static int | before (chr x, chr y) |
static struct cvec * | eclass (struct vars *v, chr c, int cases) |
static enum char_classes | lookupcclass (struct vars *v, const chr *startp, const chr *endp) |
static struct cvec * | cclasscvec (struct vars *v, enum char_classes cclasscode, int cases) |
static int | cclass_column_index (struct colormap *cm, chr c) |
static struct cvec * | allcases (struct vars *v, chr c) |
static int | cmp (const chr *x, const chr *y, size_t len) |
static int | casecmp (const chr *x, const chr *y, size_t len) |
◆ allcases()
static struct cvec * allcases ( struct vars * v, chr c ) | static |
---|
Definition at line 717 of file regc_locale.c.
719{
720 struct cvec *cv;
722 uc;
723
726
729 if (lc != uc)
731 return cv;
732}
static void addchr(struct cvec *cv, chr c)
static struct cvec * getcvec(struct vars *v, int nchrs, int nranges)
static pg_wchar pg_wc_tolower(pg_wchar c)
static pg_wchar pg_wc_toupper(pg_wchar c)
References addchr(), getcvec(), pg_wc_tolower(), and pg_wc_toupper().
Referenced by eclass().
◆ before()
static int before ( chr x, chr y ) | static |
---|
◆ casecmp()
static int casecmp ( const chr * x, const chr * y, size_t len ) | static |
---|
◆ cclass_column_index()
static int cclass_column_index ( struct colormap * cm, chr c ) | static |
---|
Definition at line 671 of file regc_locale.c.
672{
673 int colnum = 0;
674
675
677
678
679
680
681
706
707 return colnum;
708}
static int pg_wc_islower(pg_wchar c)
static int pg_wc_isword(pg_wchar c)
static int pg_wc_isspace(pg_wchar c)
static int pg_wc_ispunct(pg_wchar c)
static int pg_wc_isgraph(pg_wchar c)
static int pg_wc_isprint(pg_wchar c)
static int pg_wc_isalnum(pg_wchar c)
static int pg_wc_isdigit(pg_wchar c)
static int pg_wc_isupper(pg_wchar c)
static int pg_wc_isalpha(pg_wchar c)
int classbits[NUM_CCLASSES]
References assert, CC_ALNUM, CC_ALPHA, CC_ASCII, CC_BLANK, CC_CNTRL, CC_DIGIT, CC_GRAPH, CC_LOWER, CC_PRINT, CC_PUNCT, CC_SPACE, CC_UPPER, CC_WORD, CC_XDIGIT, colormap::classbits, MAX_SIMPLE_CHR, pg_wc_isalnum(), pg_wc_isalpha(), pg_wc_isdigit(), pg_wc_isgraph(), pg_wc_islower(), pg_wc_isprint(), pg_wc_ispunct(), pg_wc_isspace(), pg_wc_isupper(), and pg_wc_isword().
Referenced by pg_reg_getcolor().
◆ cclasscvec()
Definition at line 569 of file regc_locale.c.
572{
573 struct cvec *cv = NULL;
574
575
576
577
578
579 if (cases &&
583
584
585
586
587
588
589
590
591
592
593
595 {
598 break;
601 break;
604 break;
607 break;
609
611 if (cv)
613 break;
615
619 break;
621
625 break;
628 break;
631 break;
633
634
635
636
637
638
640 if (cv)
641 {
645 }
646 break;
649 break;
652 break;
655 break;
658 break;
659 }
660
661
662 if (cv == NULL)
664 return cv;
665}
static void addrange(struct cvec *cv, chr from, chr to)
static struct cvec * pg_ctype_get_cache(pg_wc_probefunc probefunc, int cclasscode)
References addchr(), addrange(), CC_ALNUM, CC_ALPHA, CC_ASCII, CC_BLANK, CC_CNTRL, CC_DIGIT, CC_GRAPH, CC_LOWER, CC_PRINT, CC_PUNCT, CC_SPACE, CC_UPPER, CC_WORD, CC_XDIGIT, cvec::cclasscode, ERR, getcvec(), pg_ctype_get_cache(), pg_wc_isalnum(), pg_wc_isalpha(), pg_wc_isdigit(), pg_wc_isgraph(), pg_wc_islower(), pg_wc_isprint(), pg_wc_ispunct(), pg_wc_isspace(), pg_wc_isupper(), pg_wc_isword(), and REG_ESPACE.
◆ cmp()
static int cmp ( const chr * x, const chr * y, size_t len ) | static |
---|
Definition at line 743 of file regc_locale.c.
745{
746 return memcmp(VS(x), VS(y), len * sizeof(chr));
747}
Referenced by addToArray(), adjacent_cmp_bounds(), adjacent_inner_consistent(), append_startup_cost_compare(), append_total_cost_compare(), avlInsertNode(), binaryCompareStrings(), binaryheap_remove_node(), bit_cmp(), bitposition(), bounds_adjacent(), bpchar_larger(), bpchar_smaller(), bpcharcmp(), bpcharge(), bpchargt(), bpcharle(), bpcharlt(), bsearch_arg(), build_expanded_ranges(), bytea_larger(), bytea_smaller(), byteacmp(), byteage(), byteagt(), byteale(), bytealt(), calc_word_similarity(), collectMatchBitmap(), comp_ptrgm(), compareItems(), compareStrings(), executeComparison(), findeq(), gcd_var(), GetVariable(), gin_btree_compare_prefix(), gin_cmp_prefix(), gin_cmp_tslexeme(), ginMergeItemPointers(), IndexNextWithReorder(), invariant_g_offset(), invariant_l_nontarget_offset(), invariant_l_offset(), invariant_leq_offset(), library_name_compare(), list_sort(), ln_var(), make_row_comparison_op(), make_row_distinct_op(), matchPartialInPendingList(), MatchText(), mcelem_array_contain_overlap_selec(), mcelem_array_contained_selec(), merge_overlapping_ranges(), multirange_cmp(), multirange_elem_bsearch_comparison(), multirange_ge(), multirange_gt(), multirange_le(), multirange_lt(), oidvectoreq(), oidvectorge(), oidvectorgt(), oidvectorle(), oidvectorlt(), oidvectorne(), pairingheap_GISTSearchItem_cmp(), range_cmp(), range_compare(), range_contains_elem_internal(), range_fast_cmp(), range_ge(), range_gt(), range_le(), range_lt(), range_serialize(), rbound_bsearch(), rbt_find(), rbt_find_great(), rbt_find_less(), rbt_insert(), read_letter(), reduce_expanded_ranges(), seg_different(), seg_ge(), seg_gt(), seg_le(), seg_lt(), seg_same(), set_cheapest(), SetVariable(), SetVariableHooks(), sift_up(), sort_expanded_ranges(), spg_range_quad_inner_consistent(), transformAExprIn(), tsCompareString(), tsvector_bsearch(), tsvector_concat(), and VariableHasHook().
◆ eclass()
static struct cvec * eclass ( struct vars * v, chr c, int cases ) | static |
---|
Definition at line 500 of file regc_locale.c.
504{
505 struct cvec *cv;
506
507
509 {
513 if (cases)
514 {
517 }
518 return cv;
519 }
520
521
522 if (cases)
527 return cv;
528}
static struct cvec * allcases(struct vars *v, chr c)
References addchr(), allcases(), assert, vars::cflags, CHR, getcvec(), and REG_FAKE.
Referenced by eclass_useful_for_merging(), make_canonical_pathkey(), make_pathkey_from_sortinfo(), and print_pathkeys().
◆ element()
static chr element ( struct vars * v, const chr * startp, const chr * endp ) | static |
---|
Definition at line 376 of file regc_locale.c.
379{
380 const struct cname *cn;
381 size_t len;
382
383
384 assert(startp < endp);
385 len = endp - startp;
386 if (len == 1)
387 return *startp;
388
390
391
392 for (cn = cnames; cn->name != NULL; cn++)
393 {
394 if (strlen(cn->name) == len &&
396 {
397 break;
398 }
399 }
400 if (cn->name != NULL)
402
403
405 return 0;
406}
static const struct cname cnames[]
int pg_char_and_wchar_strncmp(const char *s1, const pg_wchar *s2, size_t n)
References assert, CHR, cnames, cname::code, ERR, len, cname::name, NOTE, pg_char_and_wchar_strncmp(), REG_ECOLLATE, and REG_ULOCALE.
Referenced by chrnamed(), ecpg_store_input(), ExecEvalHashedScalarArrayOp(), IsSquashableConst(), json_array_element(), json_array_element_text(), jsonb_array_element(), jsonb_array_element_text(), nfalsepos_for_missing_strings(), populate_array_element(), populate_with_dummy_strings(), transformArrayExpr(), transformCreateSchemaStmtElements(), and transformCreateStmt().
◆ lookupcclass()
◆ range()
static struct cvec * range ( struct vars * v, chr a, chr b, int cases ) | static |
---|
Definition at line 412 of file regc_locale.c.
416{
417 int nchrs;
418 struct cvec *cv;
420 cc;
421
423 {
425 return NULL;
426 }
427
428 if (!cases)
429 {
433 return cv;
434 }
435
436
437
438
439
440
441
442
443
444
445
447 if (nchrs <= 0 || nchrs > 100000)
449
453
455 {
457 if (cc != c &&
459 {
461 {
463 return NULL;
464 }
466 }
468 if (cc != c &&
470 {
472 {
474 return NULL;
475 }
477 }
479 }
480
481 return cv;
482}
static int before(chr x, chr y)
References a, addchr(), addrange(), b, before(), cvec::chrspace, ERR, getcvec(), INTERRUPT, cvec::nchrs, NOERRN, pg_wc_tolower(), pg_wc_toupper(), vars::re, REG_ERANGE, and REG_ETOOBIG.
Referenced by oauth_server.OAuthHandler::_response_padding(), AdjustIntervalForTypmod(), brin_range_deserialize(), brin_range_serialize(), chrnamed(), codepoint_range_cmp(), combinebackup_per_wal_range_cb(), compute_range_stats(), DecodeInterval(), DecodeTime(), DecodeTimeCommon(), DecodeTimeForInterval(), ensure_free_space_in_buffer(), executeItemOptUnwrapTarget(), find_simplified_clause(), g_box_consider_split(), get_gist_range_class(), interval_in(), make_range(), manifest_process_wal_range(), mda_get_prod(), multirange_constructor1(), multirange_get_range(), multirange_in(), multirange_out(), multirange_send(), multirange_unnest(), pg_prng_uint64_range(), pg_to_ascii(), PrepareForIncrementalBackup(), printJsonPathItem(), range_constructor2(), range_constructor3(), range_deduplicate_values(), range_deserialize(), range_get_flags(), range_gist_class_split(), range_gist_double_sorting_split(), range_gist_fallback_split(), range_gist_picksplit(), range_gist_single_sorting_split(), range_in(), range_out(), range_recv(), range_send(), range_serialize(), range_set_contain_empty(), spg_range_quad_inner_consistent(), spg_range_quad_picksplit(), transformJsonArrayQueryConstructor(), and verifybackup_per_wal_range_cb().
◆ classNames
Initial value:
= {
"alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph",
"lower", "print", "punct", "space", "upper", "xdigit", "word",
NULL
}
Definition at line 356 of file regc_locale.c.
Referenced by lookupcclass().
◆ cnames
const struct cname cnames[] | static |
---|