annotate src/arabic.c @ 271:8d34af900bae v7.0072

updated for version 7.0072
author vimboss
date Wed, 18 May 2005 22:24:46 +0000
parents 3fc0f57ecb91
children f52d2ea0f81c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 /* vi:set ts=8 sts=4 sw=4:
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 * Included by main.c, when FEAT_ARABIC & FEAT_GUI is defined.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 * --
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 * Author: Nadim Shaikli & Isam Bayazidi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 static int A_is_a __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 static int A_is_s __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 static int A_is_f __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 static int chg_c_a2s __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 static int chg_c_a2i __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 static int chg_c_a2m __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 static int chg_c_a2f __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 static int chg_c_i2m __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 static int chg_c_f2m __ARGS((int cur_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 static int chg_c_laa2i __ARGS((int hid_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 static int chg_c_laa2f __ARGS((int hid_c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 static int half_shape __ARGS((int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 static int A_firstc_laa __ARGS((int c1, int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 static int A_is_harakat __ARGS((int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 static int A_is_iso __ARGS((int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 static int A_is_formb __ARGS((int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 static int A_is_ok __ARGS((int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 static int A_is_valid __ARGS((int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 static int A_is_special __ARGS((int c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
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 * Returns True if c is an ISO-8859-6 shaped ARABIC letter (user entered)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 A_is_a(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 int cur_c;
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 A_is_s(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 case a_s_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 case a_s_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 case a_s_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 case a_s_WAW_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 case a_s_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 case a_s_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 case a_s_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 case a_s_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 case a_s_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 case a_s_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 case a_s_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 case a_s_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 case a_s_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 case a_s_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 case a_s_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 case a_s_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 case a_s_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 case a_s_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 case a_s_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 case a_s_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 case a_s_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 case a_s_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 case a_s_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 case a_s_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 case a_s_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 case a_s_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 case a_s_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 case a_s_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 case a_s_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 case a_s_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 case a_s_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 case a_s_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 case a_s_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 case a_s_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 case a_s_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 case a_s_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 return FALSE;
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 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 * Returns True if c is a Final shape of an ARABIC letter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 A_is_f(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 case a_f_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 case a_f_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 case a_f_WAW_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 case a_f_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 case a_f_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 case a_f_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 case a_f_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 case a_f_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 case a_f_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 case a_f_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 case a_f_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 case a_f_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 case a_f_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 case a_f_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 case a_f_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 case a_f_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 case a_f_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 case a_f_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 case a_f_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 case a_f_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 case a_f_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 case a_f_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 case a_f_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 case a_f_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 case a_f_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 case a_f_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 case a_f_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 case a_f_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 case a_f_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 case a_f_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 case a_f_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 case a_f_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 case a_f_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 case a_f_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 case a_f_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 case a_f_LAM_ALEF_MADDA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 case a_f_LAM_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 case a_f_LAM_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 case a_f_LAM_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 return FALSE;
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 * Change shape - from ISO-8859-6/Isolated to Form-B Isolated
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 chg_c_a2s(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 case a_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 tempc = a_s_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 case a_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 tempc = a_s_ALEF_MADDA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 case a_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 tempc = a_s_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 case a_WAW_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 tempc = a_s_WAW_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 case a_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 tempc = a_s_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 case a_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 tempc = a_s_YEH_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 case a_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 tempc = a_s_ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 case a_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 tempc = a_s_TEH_MARBUTA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 case a_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 tempc = a_s_DAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 case a_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 tempc = a_s_THAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 case a_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 tempc = a_s_REH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 case a_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 tempc = a_s_ZAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 case a_TATWEEL: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 tempc = cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 case a_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 tempc = a_s_WAW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 case a_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 tempc = a_s_ALEF_MAKSURA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 case a_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 tempc = a_s_BEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 case a_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 tempc = a_s_TEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 case a_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 tempc = a_s_THEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 case a_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 tempc = a_s_JEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 case a_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 tempc = a_s_HAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 case a_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 tempc = a_s_KHAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 case a_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 tempc = a_s_SEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 case a_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 tempc = a_s_SHEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 case a_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 tempc = a_s_SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 case a_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 tempc = a_s_DAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 case a_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 tempc = a_s_TAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 case a_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 tempc = a_s_ZAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 case a_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 tempc = a_s_AIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 case a_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 tempc = a_s_GHAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 case a_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 tempc = a_s_FEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 case a_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 tempc = a_s_QAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 case a_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 tempc = a_s_KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 case a_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 tempc = a_s_LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 case a_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 tempc = a_s_MEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 case a_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 tempc = a_s_NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 case a_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 tempc = a_s_HEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 case a_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 tempc = a_s_YEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 * Change shape - from ISO-8859-6/Isolated to Initial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 chg_c_a2i(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 case a_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 tempc = a_i_YEH_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 case a_HAMZA: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 tempc = a_s_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 case a_ALEF_MADDA: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 tempc = a_s_ALEF_MADDA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 case a_ALEF_HAMZA_ABOVE: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 tempc = a_s_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 case a_WAW_HAMZA: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 tempc = a_s_WAW_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 case a_ALEF_HAMZA_BELOW: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 tempc = a_s_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 case a_ALEF: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 tempc = a_s_ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 case a_TEH_MARBUTA: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 tempc = a_s_TEH_MARBUTA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 case a_DAL: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 tempc = a_s_DAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 case a_THAL: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 tempc = a_s_THAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 case a_REH: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 tempc = a_s_REH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 case a_ZAIN: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 tempc = a_s_ZAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 case a_TATWEEL: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 tempc = cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 case a_WAW: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 tempc = a_s_WAW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 case a_ALEF_MAKSURA: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 tempc = a_s_ALEF_MAKSURA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 case a_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 tempc = a_i_BEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 case a_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 tempc = a_i_TEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 case a_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 tempc = a_i_THEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 case a_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 tempc = a_i_JEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 case a_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 tempc = a_i_HAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 case a_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 tempc = a_i_KHAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 case a_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 tempc = a_i_SEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 case a_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 tempc = a_i_SHEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 case a_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 tempc = a_i_SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 case a_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 tempc = a_i_DAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 case a_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 tempc = a_i_TAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 case a_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 tempc = a_i_ZAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 case a_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 tempc = a_i_AIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 case a_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 tempc = a_i_GHAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 case a_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 tempc = a_i_FEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 case a_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 tempc = a_i_QAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 case a_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 tempc = a_i_KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 case a_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 tempc = a_i_LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 case a_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 tempc = a_i_MEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 case a_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 tempc = a_i_NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 case a_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 tempc = a_i_HEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 case a_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 tempc = a_i_YEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 }
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 ISO-8859-6/Isolated 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 chg_c_a2m(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 case a_HAMZA: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 tempc = a_s_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 case a_ALEF_MADDA: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 tempc = a_f_ALEF_MADDA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 case a_ALEF_HAMZA_ABOVE: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 tempc = a_f_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 case a_WAW_HAMZA: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 tempc = a_f_WAW_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 case a_ALEF_HAMZA_BELOW: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 tempc = a_f_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 case a_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488 tempc = a_m_YEH_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 case a_ALEF: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 tempc = a_f_ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 case a_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 tempc = a_m_BEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 case a_TEH_MARBUTA: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 tempc = a_f_TEH_MARBUTA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 case a_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 tempc = a_m_TEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 case a_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 tempc = a_m_THEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 case a_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 tempc = a_m_JEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 case a_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 tempc = a_m_HAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 case a_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 tempc = a_m_KHAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 case a_DAL: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 tempc = a_f_DAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 case a_THAL: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 tempc = a_f_THAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520 case a_REH: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 tempc = a_f_REH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 case a_ZAIN: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 tempc = a_f_ZAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 case a_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 tempc = a_m_SEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 case a_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 tempc = a_m_SHEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 case a_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 tempc = a_m_SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 case a_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 tempc = a_m_DAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 case a_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 tempc = a_m_TAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 case a_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 tempc = a_m_ZAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 case a_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 tempc = a_m_AIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 case a_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 tempc = a_m_GHAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 case a_TATWEEL: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 tempc = cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 case a_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 tempc = a_m_FEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 case a_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 tempc = a_m_QAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 case a_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 tempc = a_m_KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 case a_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 tempc = a_m_LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 case a_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 tempc = a_m_MEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 case a_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 tempc = a_m_NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 case a_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 tempc = a_m_HEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 case a_WAW: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 tempc = a_f_WAW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 case a_ALEF_MAKSURA: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 tempc = a_f_ALEF_MAKSURA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 case a_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 tempc = a_m_YEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 * Change shape - from ISO-8859-6/Isolated to final
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 chg_c_a2f(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 /* NOTE: these encodings need to be accounted for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 a_f_ALEF_MADDA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 a_f_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 a_f_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 a_f_LAM_ALEF_MADDA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606 a_f_LAM_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607 a_f_LAM_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 case a_HAMZA: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 tempc = a_s_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 case a_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 tempc = a_f_ALEF_MADDA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 case a_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 tempc = a_f_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621 case a_WAW_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 tempc = a_f_WAW_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 case a_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 tempc = a_f_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 case a_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 tempc = a_f_YEH_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 case a_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 tempc = a_f_ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633 case a_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 tempc = a_f_BEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 case a_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 tempc = a_f_TEH_MARBUTA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639 case a_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 tempc = a_f_TEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 case a_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 tempc = a_f_THEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 case a_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 tempc = a_f_JEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 case a_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 tempc = a_f_HAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 case a_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 tempc = a_f_KHAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 case a_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655 tempc = a_f_DAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 case a_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658 tempc = a_f_THAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 case a_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 tempc = a_f_REH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 case a_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 tempc = a_f_ZAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 case a_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 tempc = a_f_SEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669 case a_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 tempc = a_f_SHEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 case a_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 tempc = a_f_SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 case a_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676 tempc = a_f_DAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 case a_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679 tempc = a_f_TAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 case a_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682 tempc = a_f_ZAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 case a_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 tempc = a_f_AIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 case a_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688 tempc = a_f_GHAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 case a_TATWEEL: /* exception */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691 tempc = cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693 case a_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 tempc = a_f_FEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 case a_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697 tempc = a_f_QAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 case a_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 tempc = a_f_KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 case a_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 tempc = a_f_LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 case a_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 tempc = a_f_MEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 case a_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709 tempc = a_f_NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 case a_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 tempc = a_f_HEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714 case a_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715 tempc = a_f_WAW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717 case a_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 tempc = a_f_ALEF_MAKSURA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 case a_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 tempc = a_f_YEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 * Change shape - from Initial to Medial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 chg_c_i2m(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 case a_i_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 tempc = a_m_YEH_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 case a_i_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746 tempc = a_m_BEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 case a_i_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 tempc = a_m_TEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 case a_i_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 tempc = a_m_THEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 case a_i_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 tempc = a_m_JEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 case a_i_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 tempc = a_m_HAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760 case a_i_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 tempc = a_m_KHAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 case a_i_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764 tempc = a_m_SEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766 case a_i_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 tempc = a_m_SHEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 case a_i_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 tempc = a_m_SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772 case a_i_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773 tempc = a_m_DAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 case a_i_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 tempc = a_m_TAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 case a_i_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 tempc = a_m_ZAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781 case a_i_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782 tempc = a_m_AIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 case a_i_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 tempc = a_m_GHAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787 case a_i_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 tempc = a_m_FEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790 case a_i_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791 tempc = a_m_QAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 case a_i_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794 tempc = a_m_KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796 case a_i_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 tempc = a_m_LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 case a_i_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800 tempc = a_m_MEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 case a_i_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803 tempc = a_m_NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 case a_i_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806 tempc = a_m_HEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 case a_i_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809 tempc = a_m_YEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
814
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 * Change shape - from Final to Medial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823 chg_c_f2m(cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824 int cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828 switch (cur_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 /* NOTE: these encodings are multi-positional, no ?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 case a_f_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832 case a_f_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833 case a_f_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835 case a_f_YEH_HAMZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836 tempc = a_m_YEH_HAMZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838 case a_f_WAW_HAMZA: /* exceptions */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839 case a_f_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840 case a_f_TEH_MARBUTA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841 case a_f_DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842 case a_f_THAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843 case a_f_REH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844 case a_f_ZAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845 case a_f_WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
846 case a_f_ALEF_MAKSURA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
847 tempc = cur_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
848 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
849 case a_f_BEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
850 tempc = a_m_BEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
851 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
852 case a_f_TEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
853 tempc = a_m_TEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
854 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
855 case a_f_THEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
856 tempc = a_m_THEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
857 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
858 case a_f_JEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
859 tempc = a_m_JEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
860 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
861 case a_f_HAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
862 tempc = a_m_HAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
863 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
864 case a_f_KHAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
865 tempc = a_m_KHAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
866 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
867 case a_f_SEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
868 tempc = a_m_SEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
869 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
870 case a_f_SHEEN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
871 tempc = a_m_SHEEN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
872 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
873 case a_f_SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
874 tempc = a_m_SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
875 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
876 case a_f_DAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
877 tempc = a_m_DAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
878 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
879 case a_f_TAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
880 tempc = a_m_TAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
881 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
882 case a_f_ZAH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
883 tempc = a_m_ZAH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
884 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
885 case a_f_AIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
886 tempc = a_m_AIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
887 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
888 case a_f_GHAIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
889 tempc = a_m_GHAIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
890 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
891 case a_f_FEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
892 tempc = a_m_FEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
893 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
894 case a_f_QAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
895 tempc = a_m_QAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
896 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
897 case a_f_KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
898 tempc = a_m_KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
899 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
900 case a_f_LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
901 tempc = a_m_LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
902 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
903 case a_f_MEEM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
904 tempc = a_m_MEEM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
905 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
906 case a_f_NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
907 tempc = a_m_NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
908 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
909 case a_f_HEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
910 tempc = a_m_HEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
911 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
912 case a_f_YEH:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
913 tempc = a_m_YEH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
914 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
915 /* NOTE: these encodings are multi-positional, no ?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
916 case a_f_LAM_ALEF_MADDA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
917 case a_f_LAM_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
918 case a_f_LAM_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
919 case a_f_LAM_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
920 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
921 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
922 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
923 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
924
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
925 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
926 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
927
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
928
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
929 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
930 * Change shape - from Combination (2 char) to an Isolated
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
931 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
932 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
933 chg_c_laa2i(hid_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
934 int hid_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
935 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
936 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
937
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
938 switch (hid_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
939 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
940 case a_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
941 tempc = a_s_LAM_ALEF_MADDA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
942 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
943 case a_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
944 tempc = a_s_LAM_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
945 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
946 case a_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
947 tempc = a_s_LAM_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
948 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
949 case a_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
950 tempc = a_s_LAM_ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
951 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
952 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
953 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
954 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
955
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
956 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
957 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
958
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
959
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
960 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
961 * Change shape - from Combination-Isolated to Final
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
962 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
963 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
964 chg_c_laa2f(hid_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
965 int hid_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
966 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
967 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
968
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
969 switch (hid_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
970 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
971 case a_ALEF_MADDA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
972 tempc = a_f_LAM_ALEF_MADDA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
973 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
974 case a_ALEF_HAMZA_ABOVE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
975 tempc = a_f_LAM_ALEF_HAMZA_ABOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
976 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
977 case a_ALEF_HAMZA_BELOW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
978 tempc = a_f_LAM_ALEF_HAMZA_BELOW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
979 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
980 case a_ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
981 tempc = a_f_LAM_ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
982 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
983 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
984 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
985 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
986
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
987 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
988 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
989
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
990 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
991 * Do "half-shaping" on character "c". Return zero if no shaping.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
992 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
993 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
994 half_shape(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
995 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
996 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
997 if (A_is_a(c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
998 return chg_c_a2i(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
999 if (A_is_valid(c) && A_is_f(c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1000 return chg_c_f2m(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1001 return 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1002 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1003
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1004 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1005 * Do Arabic shaping on character "c". Returns the shaped character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1006 * out: "ccp" points to the first byte of the character to be shaped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1007 * in/out: "c1p" points to the first composing char for "c".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1008 * in: "prev_c" is the previous character (not shaped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1009 * in: "prev_c1" is the first composing char for the previous char
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1010 * (not shaped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1011 * in: "next_c" is the next character (not shaped).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1012 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1013 int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1014 arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1015 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1016 int *ccp;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1017 int *c1p;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1018 int prev_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1019 int prev_c1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1020 int next_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1021 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1022 int curr_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1023 int shape_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1024 int curr_laa;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1025 int prev_laa;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1026
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1027 /* Deal only with Arabic character, pass back all others */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1028 if (!A_is_ok(c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1029 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1030
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1031 /* half-shape current and previous character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1032 shape_c = half_shape(prev_c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1033
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1034 /* Save away current character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1035 curr_c = c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1036
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1037 curr_laa = A_firstc_laa(c, *c1p);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1038 prev_laa = A_firstc_laa(prev_c, prev_c1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1039
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1040 if (curr_laa)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1041 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1042 if (A_is_valid(prev_c) && !A_is_f(shape_c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1043 && !A_is_s(shape_c) && !prev_laa)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1044 curr_c = chg_c_laa2f(curr_laa);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1045 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1046 curr_c = chg_c_laa2i(curr_laa);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1047
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1048 /* Remove the composing character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1049 *c1p = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1050 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1051 else if (!A_is_valid(prev_c) && A_is_valid(next_c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1052 curr_c = chg_c_a2i(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1053 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
1054 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
1055 else if (A_is_valid(next_c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1056 curr_c = A_is_iso(c) ? chg_c_a2m(c) : chg_c_i2m(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1057 else if (A_is_valid(prev_c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1058 curr_c = chg_c_a2f(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1059 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1060 curr_c = chg_c_a2s(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1061
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1062 /* Sanity check -- curr_c should, in the future, never be 0.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1063 * We should, in the future, insert a fatal error here. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1064 if (curr_c == NUL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1065 curr_c = c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1066
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1067 if (curr_c != c && ccp != NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1068 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1069 char_u buf[MB_MAXBYTES];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1070
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1071 /* Update the first byte of the character. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1072 (*mb_char2bytes)(curr_c, buf);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1073 *ccp = buf[0];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1074 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1075
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1076 /* Return the shaped character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1077 return curr_c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1078 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1079
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1080
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1081 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1082 * A_firstc_laa returns first character of LAA combination if it exists
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1083 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1084 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1085 A_firstc_laa(c, c1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1086 int c; /* base character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1087 int c1; /* first composing character */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1088 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1089 if (c1 != NUL && c == a_LAM && !A_is_harakat(c1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1090 return c1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1091 return 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1092 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1093
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1094
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1095 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1096 * A_is_harakat returns TRUE if 'c' is an Arabic Harakat character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1097 * (harakat/tanween)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1098 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1099 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1100 A_is_harakat(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1101 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1102 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1103 return (c >= a_FATHATAN && c <= a_SUKUN);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1104 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1107 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1108 * A_is_iso returns TRUE if 'c' is an Arabic ISO-8859-6 character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1109 * (alphabet/number/punctuation)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1110 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1111 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1112 A_is_iso(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1113 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1114 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1115 return ((c >= a_HAMZA && c <= a_GHAIN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1116 || (c >= a_TATWEEL && c <= a_HAMZA_BELOW)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1117 || c == a_MINI_ALEF);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1118 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1121 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1122 * A_is_formb returns TRUE if 'c' is an Arabic 10646-1 FormB character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1123 * (alphabet/number/punctuation)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1124 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1125 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1126 A_is_formb(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1127 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1128 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1129 return ((c >= a_s_FATHATAN && c <= a_s_DAMMATAN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1130 || c == a_s_KASRATAN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1131 || (c >= a_s_FATHA && c <= a_f_LAM_ALEF)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1132 || c == a_BYTE_ORDER_MARK);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1133 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1136 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1137 * 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
1138 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1139 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1140 A_is_ok(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1141 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1142 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1143 return (A_is_iso(c) || A_is_formb(c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1144 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1147 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1148 * 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
1149 * with some exceptions/exclusions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1150 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1151 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1152 A_is_valid(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1153 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1154 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1155 return (A_is_ok(c) && !A_is_special(c));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1156 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1157
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1159 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1160 * A_is_special returns TRUE if 'c' is not a special Arabic character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1161 * Specials don't adhere to most of the rules.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1162 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1163 static int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1164 A_is_special(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1165 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1166 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1167 return (c == a_HAMZA || c == a_s_HAMZA);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1168 }