annotate src/arabic.c @ 12945:ffe901f0ba65

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