This source file includes following definitions.
- FUNC1
- FUNC2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 casing_suffix_context_t
27 FUNC1 (const UNIT *s, size_t n)
28 {
29 return FUNC2 (s, n, unicase_empty_suffix_context);
30 }
31
32 casing_suffix_context_t
33 FUNC2 (const UNIT *s, size_t n, casing_suffix_context_t a_context)
34 {
35 casing_suffix_context_t context;
36
37
38
39 ucs4_t first_char_except_ignorable = (ucs4_t)(-1);
40 int scc_MORE_ABOVE = -1;
41 int scc_BEFORE_DOT = -1;
42 const UNIT *s_end = s + n;
43
44 while (s < s_end)
45 {
46 ucs4_t uc;
47 int count = U_MBTOUC_UNSAFE (&uc, s, s_end - s);
48
49 if (first_char_except_ignorable == (ucs4_t)(-1))
50 {
51 if (!uc_is_case_ignorable (uc))
52 first_char_except_ignorable = uc;
53 }
54
55 if (scc_MORE_ABOVE < 0)
56 {
57 int ccc = uc_combining_class (uc);
58 if (ccc == UC_CCC_A)
59 scc_MORE_ABOVE = SCC_MORE_ABOVE_MASK;
60 else if (ccc == UC_CCC_NR)
61 scc_MORE_ABOVE = 0;
62 }
63
64 if (scc_BEFORE_DOT < 0)
65 {
66 if (uc == 0x0307)
67 scc_BEFORE_DOT = SCC_BEFORE_DOT_MASK;
68 else
69 {
70 int ccc = uc_combining_class (uc);
71 if (ccc == UC_CCC_A || ccc == UC_CCC_NR)
72 scc_BEFORE_DOT = 0;
73 }
74 }
75
76 if (first_char_except_ignorable != (ucs4_t)(-1)
77 && (scc_MORE_ABOVE | scc_BEFORE_DOT) >= 0)
78
79 break;
80
81 s += count;
82 }
83
84
85
86 context.first_char_except_ignorable =
87 (first_char_except_ignorable != (ucs4_t)(-1)
88 ? first_char_except_ignorable
89 : a_context.first_char_except_ignorable);
90 context.bits =
91 (scc_MORE_ABOVE >= 0
92 ? scc_MORE_ABOVE
93 : a_context.bits & SCC_MORE_ABOVE_MASK)
94 | (scc_BEFORE_DOT >= 0
95 ? scc_BEFORE_DOT
96 : a_context.bits & SCC_BEFORE_DOT_MASK);
97 return context;
98 }