annotate src/arabic.c @ 15245:74bc96b99f4f v8.1.0631

patch 8.1.0631: test for :stop fails on Arch commit https://github.com/vim/vim/commit/d6024e2dd4e0c1556d9b69e61c4059fa78e5609d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 24 19:15:20 2018 +0100 patch 8.1.0631: test for :stop fails on Arch Problem: Test for :stop fails on Arch. Solution: Check five lines for the expected output. (closes https://github.com/vim/vim/issues/3714)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 Dec 2018 19:30:07 +0100
parents 27b9a84395b5
children 78faa25f9698
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10042
4aead6a9b7a9 commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents: 9403
diff changeset
1 /* vi:set ts=8 sts=4 sw=4 noet:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * See README.txt for an overview of the Vim source code.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 * arabic.c: functions for Arabic language
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 * Author: Nadim Shaikli & Isam Bayazidi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
9403
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 7817
diff changeset
16 #include "vim.h"
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 7817
diff changeset
17
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 7817
diff changeset
18 #if defined(FEAT_ARABIC) || defined(PROTO)
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 7817
diff changeset
19
7799
af3c41a3c53f commit https://github.com/vim/vim/commit/f28dbcea371b3a35727d91afc90fb90e0527d78a
Christian Brabandt <cb@256bit.org>
parents: 3549
diff changeset
20 static int A_firstc_laa(int c1, int c);
af3c41a3c53f commit https://github.com/vim/vim/commit/f28dbcea371b3a35727d91afc90fb90e0527d78a
Christian Brabandt <cb@256bit.org>
parents: 3549
diff changeset
21 static int A_is_harakat(int c);
af3c41a3c53f commit https://github.com/vim/vim/commit/f28dbcea371b3a35727d91afc90fb90e0527d78a
Christian Brabandt <cb@256bit.org>
parents: 3549
diff changeset
22 static int A_is_iso(int c);
af3c41a3c53f commit https://github.com/vim/vim/commit/f28dbcea371b3a35727d91afc90fb90e0527d78a
Christian Brabandt <cb@256bit.org>
parents: 3549
diff changeset
23 static int A_is_formb(int c);
af3c41a3c53f commit https://github.com/vim/vim/commit/f28dbcea371b3a35727d91afc90fb90e0527d78a
Christian Brabandt <cb@256bit.org>
parents: 3549
diff changeset
24 static int A_is_ok(int c);
af3c41a3c53f commit https://github.com/vim/vim/commit/f28dbcea371b3a35727d91afc90fb90e0527d78a
Christian Brabandt <cb@256bit.org>
parents: 3549
diff changeset
25 static int A_is_valid(int c);
af3c41a3c53f commit https://github.com/vim/vim/commit/f28dbcea371b3a35727d91afc90fb90e0527d78a
Christian Brabandt <cb@256bit.org>
parents: 3549
diff changeset
26 static int A_is_special(int c);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 * Returns True if c is an ISO-8859-6 shaped ARABIC letter (user entered)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
33 A_is_a(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 case a_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 case a_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 case a_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 case a_WAW_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 case a_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 case a_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 case a_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 case a_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 case a_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 case a_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 case a_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 case a_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 case a_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 case a_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 case a_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 case a_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 case a_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 case a_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 case a_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 case a_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 case a_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 case a_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 case a_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 case a_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 case a_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 case a_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 case a_TATWEEL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 case a_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 case a_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 case a_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 case a_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 case a_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 case a_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 case a_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 case a_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 case a_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 case a_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 * Returns True if c is an Isolated Form-B ARABIC letter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
85 A_is_s(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 case a_s_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 case a_s_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 case a_s_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 case a_s_WAW_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 case a_s_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 case a_s_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 case a_s_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 case a_s_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 case a_s_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 case a_s_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 case a_s_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 case a_s_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 case a_s_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 case a_s_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 case a_s_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 case a_s_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 case a_s_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 case a_s_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 case a_s_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 case a_s_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 case a_s_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 case a_s_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 case a_s_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 case a_s_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 case a_s_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 case a_s_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 case a_s_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 case a_s_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 case a_s_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 case a_s_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 case a_s_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 case a_s_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 case a_s_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 case a_s_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 case a_s_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 case a_s_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 * Returns True if c is a Final shape of an ARABIC letter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
136 A_is_f(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 case a_f_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 case a_f_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 case a_f_WAW_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 case a_f_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 case a_f_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 case a_f_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 case a_f_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 case a_f_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 case a_f_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 case a_f_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 case a_f_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 case a_f_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 case a_f_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 case a_f_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 case a_f_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 case a_f_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 case a_f_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 case a_f_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 case a_f_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 case a_f_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 case a_f_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 case a_f_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 case a_f_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 case a_f_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 case a_f_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 case a_f_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 case a_f_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 case a_f_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 case a_f_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 case a_f_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 case a_f_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 case a_f_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 case a_f_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 case a_f_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 case a_f_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 case a_f_LAM_ALEF_MADDA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 case a_f_LAM_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 case a_f_LAM_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 case a_f_LAM_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 * Change shape - from ISO-8859-6/Isolated to Form-B Isolated
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
189 chg_c_a2s(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 {
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
193 case a_HAMZA: return a_s_HAMZA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
194 case a_ALEF_MADDA: return a_s_ALEF_MADDA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
195 case a_ALEF_HAMZA_ABOVE: return a_s_ALEF_HAMZA_ABOVE;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
196 case a_WAW_HAMZA: return a_s_WAW_HAMZA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
197 case a_ALEF_HAMZA_BELOW: return a_s_ALEF_HAMZA_BELOW;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
198 case a_YEH_HAMZA: return a_s_YEH_HAMZA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
199 case a_ALEF: return a_s_ALEF;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
200 case a_TEH_MARBUTA: return a_s_TEH_MARBUTA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
201 case a_DAL: return a_s_DAL;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
202 case a_THAL: return a_s_THAL;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
203 case a_REH: return a_s_REH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
204 case a_ZAIN: return a_s_ZAIN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
205 case a_TATWEEL: return cur_c; /* exceptions */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
206 case a_WAW: return a_s_WAW;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
207 case a_ALEF_MAKSURA: return a_s_ALEF_MAKSURA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
208 case a_BEH: return a_s_BEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
209 case a_TEH: return a_s_TEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
210 case a_THEH: return a_s_THEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
211 case a_JEEM: return a_s_JEEM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
212 case a_HAH: return a_s_HAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
213 case a_KHAH: return a_s_KHAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
214 case a_SEEN: return a_s_SEEN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
215 case a_SHEEN: return a_s_SHEEN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
216 case a_SAD: return a_s_SAD;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
217 case a_DAD: return a_s_DAD;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
218 case a_TAH: return a_s_TAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
219 case a_ZAH: return a_s_ZAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
220 case a_AIN: return a_s_AIN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
221 case a_GHAIN: return a_s_GHAIN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
222 case a_FEH: return a_s_FEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
223 case a_QAF: return a_s_QAF;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
224 case a_KAF: return a_s_KAF;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
225 case a_LAM: return a_s_LAM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
226 case a_MEEM: return a_s_MEEM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
227 case a_NOON: return a_s_NOON;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
228 case a_HEH: return a_s_HEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
229 case a_YEH: return a_s_YEH;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 }
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
231 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 * Change shape - from ISO-8859-6/Isolated to Initial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
239 chg_c_a2i(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 {
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
243 case a_YEH_HAMZA: return a_i_YEH_HAMZA;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 case a_HAMZA: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
245 return a_s_HAMZA;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 case a_ALEF_MADDA: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
247 return a_s_ALEF_MADDA;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 case a_ALEF_HAMZA_ABOVE: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
249 return a_s_ALEF_HAMZA_ABOVE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 case a_WAW_HAMZA: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
251 return a_s_WAW_HAMZA;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 case a_ALEF_HAMZA_BELOW: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
253 return a_s_ALEF_HAMZA_BELOW;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 case a_ALEF: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
255 return a_s_ALEF;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 case a_TEH_MARBUTA: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
257 return a_s_TEH_MARBUTA;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 case a_DAL: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
259 return a_s_DAL;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 case a_THAL: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
261 return a_s_THAL;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 case a_REH: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
263 return a_s_REH;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 case a_ZAIN: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
265 return a_s_ZAIN;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 case a_TATWEEL: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
267 return cur_c;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 case a_WAW: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
269 return a_s_WAW;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 case a_ALEF_MAKSURA: /* exceptions */
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
271 return a_s_ALEF_MAKSURA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
272 case a_BEH: return a_i_BEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
273 case a_TEH: return a_i_TEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
274 case a_THEH: return a_i_THEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
275 case a_JEEM: return a_i_JEEM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
276 case a_HAH: return a_i_HAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
277 case a_KHAH: return a_i_KHAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
278 case a_SEEN: return a_i_SEEN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
279 case a_SHEEN: return a_i_SHEEN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
280 case a_SAD: return a_i_SAD;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
281 case a_DAD: return a_i_DAD;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
282 case a_TAH: return a_i_TAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
283 case a_ZAH: return a_i_ZAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
284 case a_AIN: return a_i_AIN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
285 case a_GHAIN: return a_i_GHAIN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
286 case a_FEH: return a_i_FEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
287 case a_QAF: return a_i_QAF;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
288 case a_KAF: return a_i_KAF;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
289 case a_LAM: return a_i_LAM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
290 case a_MEEM: return a_i_MEEM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
291 case a_NOON: return a_i_NOON;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
292 case a_HEH: return a_i_HEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
293 case a_YEH: return a_i_YEH;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 }
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
295 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 * Change shape - from ISO-8859-6/Isolated to Medial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
303 chg_c_a2m(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 {
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
307 case a_HAMZA: return a_s_HAMZA; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
308 case a_ALEF_MADDA: return a_f_ALEF_MADDA; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
309 case a_ALEF_HAMZA_ABOVE: return a_f_ALEF_HAMZA_ABOVE; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
310 case a_WAW_HAMZA: return a_f_WAW_HAMZA; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
311 case a_ALEF_HAMZA_BELOW: return a_f_ALEF_HAMZA_BELOW; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
312 case a_YEH_HAMZA: return a_m_YEH_HAMZA;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
313 case a_ALEF: return a_f_ALEF; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
314 case a_BEH: return a_m_BEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
315 case a_TEH_MARBUTA: return a_f_TEH_MARBUTA; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
316 case a_TEH: return a_m_TEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
317 case a_THEH: return a_m_THEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
318 case a_JEEM: return a_m_JEEM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
319 case a_HAH: return a_m_HAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
320 case a_KHAH: return a_m_KHAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
321 case a_DAL: return a_f_DAL; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
322 case a_THAL: return a_f_THAL; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
323 case a_REH: return a_f_REH; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
324 case a_ZAIN: return a_f_ZAIN; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
325 case a_SEEN: return a_m_SEEN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
326 case a_SHEEN: return a_m_SHEEN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
327 case a_SAD: return a_m_SAD;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
328 case a_DAD: return a_m_DAD;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
329 case a_TAH: return a_m_TAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
330 case a_ZAH: return a_m_ZAH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
331 case a_AIN: return a_m_AIN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
332 case a_GHAIN: return a_m_GHAIN;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
333 case a_TATWEEL: return cur_c; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
334 case a_FEH: return a_m_FEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
335 case a_QAF: return a_m_QAF;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
336 case a_KAF: return a_m_KAF;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
337 case a_LAM: return a_m_LAM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
338 case a_MEEM: return a_m_MEEM;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
339 case a_NOON: return a_m_NOON;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
340 case a_HEH: return a_m_HEH;
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
341 case a_WAW: return a_f_WAW; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
342 case a_ALEF_MAKSURA: return a_f_ALEF_MAKSURA; /* exception */
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
343 case a_YEH: return a_m_YEH;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 }
11004
f91d4c95b696 patch 8.0.0391: arabic support is verbose and not well tested
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
345 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 * Change shape - from ISO-8859-6/Isolated to final
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
353 chg_c_a2f(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 /* NOTE: these encodings need to be accounted for
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
356 * a_f_ALEF_MADDA;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
357 * a_f_ALEF_HAMZA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
358 * a_f_ALEF_HAMZA_BELOW;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
359 * a_f_LAM_ALEF_MADDA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
360 * a_f_LAM_ALEF_HAMZA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
361 * a_f_LAM_ALEF_HAMZA_BELOW;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
362 */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 {
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
365 case a_HAMZA: return a_s_HAMZA; /* exception */
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
366 case a_ALEF_MADDA: return a_f_ALEF_MADDA;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
367 case a_ALEF_HAMZA_ABOVE: return a_f_ALEF_HAMZA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
368 case a_WAW_HAMZA: return a_f_WAW_HAMZA;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
369 case a_ALEF_HAMZA_BELOW: return a_f_ALEF_HAMZA_BELOW;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
370 case a_YEH_HAMZA: return a_f_YEH_HAMZA;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
371 case a_ALEF: return a_f_ALEF;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
372 case a_BEH: return a_f_BEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
373 case a_TEH_MARBUTA: return a_f_TEH_MARBUTA;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
374 case a_TEH: return a_f_TEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
375 case a_THEH: return a_f_THEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
376 case a_JEEM: return a_f_JEEM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
377 case a_HAH: return a_f_HAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
378 case a_KHAH: return a_f_KHAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
379 case a_DAL: return a_f_DAL;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
380 case a_THAL: return a_f_THAL;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
381 case a_REH: return a_f_REH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
382 case a_ZAIN: return a_f_ZAIN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
383 case a_SEEN: return a_f_SEEN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
384 case a_SHEEN: return a_f_SHEEN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
385 case a_SAD: return a_f_SAD;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
386 case a_DAD: return a_f_DAD;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
387 case a_TAH: return a_f_TAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
388 case a_ZAH: return a_f_ZAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
389 case a_AIN: return a_f_AIN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
390 case a_GHAIN: return a_f_GHAIN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
391 case a_TATWEEL: return cur_c; /* exception */
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
392 case a_FEH: return a_f_FEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
393 case a_QAF: return a_f_QAF;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
394 case a_KAF: return a_f_KAF;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
395 case a_LAM: return a_f_LAM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
396 case a_MEEM: return a_f_MEEM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
397 case a_NOON: return a_f_NOON;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
398 case a_HEH: return a_f_HEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
399 case a_WAW: return a_f_WAW;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
400 case a_ALEF_MAKSURA: return a_f_ALEF_MAKSURA;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
401 case a_YEH: return a_f_YEH;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 }
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
403 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 * Change shape - from Initial to Medial
11221
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
409 * This code is unreachable, because for the relevant characters ARABIC_CHAR()
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
410 * is FALSE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 */
11221
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
412 #if 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
414 chg_c_i2m(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 {
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
418 case a_i_YEH_HAMZA: return a_m_YEH_HAMZA;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
419 case a_i_BEH: return a_m_BEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
420 case a_i_TEH: return a_m_TEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
421 case a_i_THEH: return a_m_THEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
422 case a_i_JEEM: return a_m_JEEM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
423 case a_i_HAH: return a_m_HAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
424 case a_i_KHAH: return a_m_KHAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
425 case a_i_SEEN: return a_m_SEEN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
426 case a_i_SHEEN: return a_m_SHEEN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
427 case a_i_SAD: return a_m_SAD;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
428 case a_i_DAD: return a_m_DAD;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
429 case a_i_TAH: return a_m_TAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
430 case a_i_ZAH: return a_m_ZAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
431 case a_i_AIN: return a_m_AIN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
432 case a_i_GHAIN: return a_m_GHAIN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
433 case a_i_FEH: return a_m_FEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
434 case a_i_QAF: return a_m_QAF;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
435 case a_i_KAF: return a_m_KAF;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
436 case a_i_LAM: return a_m_LAM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
437 case a_i_MEEM: return a_m_MEEM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
438 case a_i_NOON: return a_m_NOON;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
439 case a_i_HEH: return a_m_HEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
440 case a_i_YEH: return a_m_YEH;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 }
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
442 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 }
11221
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
444 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 * Change shape - from Final to Medial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
451 chg_c_f2m(int cur_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 /* NOTE: these encodings are multi-positional, no ?
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
456 * case a_f_ALEF_MADDA:
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
457 * case a_f_ALEF_HAMZA_ABOVE:
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
458 * case a_f_ALEF_HAMZA_BELOW:
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
459 */
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
460 case a_f_YEH_HAMZA: return a_m_YEH_HAMZA;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 case a_f_WAW_HAMZA: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 case a_f_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 case a_f_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 case a_f_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 case a_f_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 case a_f_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 case a_f_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 case a_f_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 case a_f_ALEF_MAKSURA:
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
470 return cur_c;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
471 case a_f_BEH: return a_m_BEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
472 case a_f_TEH: return a_m_TEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
473 case a_f_THEH: return a_m_THEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
474 case a_f_JEEM: return a_m_JEEM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
475 case a_f_HAH: return a_m_HAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
476 case a_f_KHAH: return a_m_KHAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
477 case a_f_SEEN: return a_m_SEEN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
478 case a_f_SHEEN: return a_m_SHEEN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
479 case a_f_SAD: return a_m_SAD;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
480 case a_f_DAD: return a_m_DAD;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
481 case a_f_TAH: return a_m_TAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
482 case a_f_ZAH: return a_m_ZAH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
483 case a_f_AIN: return a_m_AIN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
484 case a_f_GHAIN: return a_m_GHAIN;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
485 case a_f_FEH: return a_m_FEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
486 case a_f_QAF: return a_m_QAF;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
487 case a_f_KAF: return a_m_KAF;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
488 case a_f_LAM: return a_m_LAM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
489 case a_f_MEEM: return a_m_MEEM;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
490 case a_f_NOON: return a_m_NOON;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
491 case a_f_HEH: return a_m_HEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
492 case a_f_YEH: return a_m_YEH;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
493
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
494 /* NOTE: these encodings are multi-positional, no ?
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
495 * case a_f_LAM_ALEF_MADDA_ABOVE:
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
496 * case a_f_LAM_ALEF_HAMZA_ABOVE:
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
497 * case a_f_LAM_ALEF_HAMZA_BELOW:
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
498 * case a_f_LAM_ALEF:
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
499 */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 }
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
501 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 * Change shape - from Combination (2 char) to an Isolated
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
509 chg_c_laa2i(int hid_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 switch (hid_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 {
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
513 case a_ALEF_MADDA: return a_s_LAM_ALEF_MADDA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
514 case a_ALEF_HAMZA_ABOVE: return a_s_LAM_ALEF_HAMZA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
515 case a_ALEF_HAMZA_BELOW: return a_s_LAM_ALEF_HAMZA_BELOW;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
516 case a_ALEF: return a_s_LAM_ALEF;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 }
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
518 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 * Change shape - from Combination-Isolated to Final
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
526 chg_c_laa2f(int hid_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 switch (hid_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 {
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
530 case a_ALEF_MADDA: return a_f_LAM_ALEF_MADDA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
531 case a_ALEF_HAMZA_ABOVE: return a_f_LAM_ALEF_HAMZA_ABOVE;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
532 case a_ALEF_HAMZA_BELOW: return a_f_LAM_ALEF_HAMZA_BELOW;
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
533 case a_ALEF: return a_f_LAM_ALEF;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 }
11034
8ae6d6052b14 patch 8.0.0406: arabic shaping code is verbose
Christian Brabandt <cb@256bit.org>
parents: 11004
diff changeset
535 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 * Do "half-shaping" on character "c". Return zero if no shaping.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
542 half_shape(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 if (A_is_a(c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 return chg_c_a2i(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 if (A_is_valid(c) && A_is_f(c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 return chg_c_f2m(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 return 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 * Do Arabic shaping on character "c". Returns the shaped character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 * out: "ccp" points to the first byte of the character to be shaped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 * in/out: "c1p" points to the first composing char for "c".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 * in: "prev_c" is the previous character (not shaped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 * in: "prev_c1" is the first composing char for the previous char
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 * (not shaped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 * in: "next_c" is the next character (not shaped).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
561 arabic_shape(
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
562 int c,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
563 int *ccp,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
564 int *c1p,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
565 int prev_c,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
566 int prev_c1,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
567 int next_c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 int curr_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 int shape_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 int curr_laa;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 int prev_laa;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 /* Deal only with Arabic character, pass back all others */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 if (!A_is_ok(c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 /* half-shape current and previous character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 shape_c = half_shape(prev_c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 /* Save away current character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 curr_c = c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 curr_laa = A_firstc_laa(c, *c1p);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 prev_laa = A_firstc_laa(prev_c, prev_c1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 if (curr_laa)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 if (A_is_valid(prev_c) && !A_is_f(shape_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 && !A_is_s(shape_c) && !prev_laa)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 curr_c = chg_c_laa2f(curr_laa);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 curr_c = chg_c_laa2i(curr_laa);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 /* Remove the composing character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 *c1p = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 else if (!A_is_valid(prev_c) && A_is_valid(next_c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599 curr_c = chg_c_a2i(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 else if (!shape_c || A_is_f(shape_c) || A_is_s(shape_c) || prev_laa)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 curr_c = A_is_valid(next_c) ? chg_c_a2i(c) : chg_c_a2s(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 else if (A_is_valid(next_c))
11221
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
603 #if 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 curr_c = A_is_iso(c) ? chg_c_a2m(c) : chg_c_i2m(c);
11221
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
605 #else
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
606 curr_c = A_is_iso(c) ? chg_c_a2m(c) : 0;
3fa27b97d263 patch 8.0.0497: arabic support is not fully tested
Christian Brabandt <cb@256bit.org>
parents: 11034
diff changeset
607 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 else if (A_is_valid(prev_c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 curr_c = chg_c_a2f(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611 curr_c = chg_c_a2s(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 /* Sanity check -- curr_c should, in the future, never be 0.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614 * We should, in the future, insert a fatal error here. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 if (curr_c == NUL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 curr_c = c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 if (curr_c != c && ccp != NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 {
3549
f52d2ea0f81c updated for version 7.3.535
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
620 char_u buf[MB_MAXBYTES + 1];
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 /* Update the first byte of the character. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 (*mb_char2bytes)(curr_c, buf);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 *ccp = buf[0];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 /* Return the shaped character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 return curr_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633 * A_firstc_laa returns first character of LAA combination if it exists
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
636 A_firstc_laa(
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
637 int c, /* base character */
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
638 int c1) /* first composing character */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 if (c1 != NUL && c == a_LAM && !A_is_harakat(c1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 return c1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 return 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 * A_is_harakat returns TRUE if 'c' is an Arabic Harakat character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 * (harakat/tanween)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
651 A_is_harakat(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 return (c >= a_FATHATAN && c <= a_SUKUN);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658 * A_is_iso returns TRUE if 'c' is an Arabic ISO-8859-6 character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 * (alphabet/number/punctuation)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
662 A_is_iso(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 return ((c >= a_HAMZA && c <= a_GHAIN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 || (c >= a_TATWEEL && c <= a_HAMZA_BELOW)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 || c == a_MINI_ALEF);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 * A_is_formb returns TRUE if 'c' is an Arabic 10646-1 FormB character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 * (alphabet/number/punctuation)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
675 A_is_formb(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 return ((c >= a_s_FATHATAN && c <= a_s_DAMMATAN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 || c == a_s_KASRATAN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679 || (c >= a_s_FATHA && c <= a_f_LAM_ALEF)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 || c == a_BYTE_ORDER_MARK);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 * A_is_ok returns TRUE if 'c' is an Arabic 10646 (8859-6 or Form-B)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
688 A_is_ok(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 return (A_is_iso(c) || A_is_formb(c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 * A_is_valid returns TRUE if 'c' is an Arabic 10646 (8859-6 or Form-B)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 * with some exceptions/exclusions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
699 A_is_valid(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 return (A_is_ok(c) && !A_is_special(c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 * A_is_special returns TRUE if 'c' is not a special Arabic character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 * Specials don't adhere to most of the rules.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709 static int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
710 A_is_special(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 return (c == a_HAMZA || c == a_s_HAMZA);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 }
9403
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 7817
diff changeset
714
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 7817
diff changeset
715 #endif /* FEAT_ARABIC */