spacerocks: Fix indentation and remove trailing spaces. Fix some minor bugs.
[kugel-rb.git] / firmware / arabjoin.c
blob0aab5fab5c8a4a38bc920aeaf578724b56376964
1 #include "arabjoin.h"
3 const arab_t zwj = {0x20,0x20,0x20,0x20}; //zero-width joiner
5 const arab_t lamaleph[] = {
6 {0xfefb,0xfefc,0,0},
7 {0xfef9,0xfefa,0,0},
8 {0xfef7,0xfef8,0,0},
9 {0xfef5,0xfef6,0,0}
12 const arab_t jointable[] = {
13 {0xfe80,0x0000,0x0000,0x0000}, // 0x0621
14 {0xfe81,0xfe82,0x0000,0x0000}, // 0x0622
15 {0xfe83,0xfe84,0x0000,0x0000}, // 0x0623
16 {0xfe85,0xfe86,0x0000,0x0000}, // 0x0624
17 {0xfe87,0xfe88,0x0000,0x0000}, // 0x0625
18 {0xfe89,0xfe8a,0xfe8c,0xfe8b}, // 0x0626
19 {0xfe8d,0xfe8e,0x0000,0x0000}, // 0x0627
20 {0xfe8f,0xfe90,0xfe92,0xfe91}, // 0x0628
21 {0xfe93,0xfe94,0x0000,0x0000}, // 0x0629
22 {0xfe95,0xfe96,0xfe98,0xfe97}, // 0x062a
23 {0xfe99,0xfe9a,0xfe9c,0xfe9b}, // 0x062b
24 {0xfe9d,0xfe9e,0xfea0,0xfe9f}, // 0x062c
25 {0xfea1,0xfea2,0xfea4,0xfea3}, // 0x062d
26 {0xfea5,0xfea6,0xfea8,0xfea7}, // 0x062e
27 {0xfea9,0xfeaa,0x0000,0x0000}, // 0x062f
28 {0xfeab,0xfeac,0x0000,0x0000}, // 0x0630
29 {0xfead,0xfeae,0x0000,0x0000}, // 0x0631
30 {0xfeaf,0xfeb0,0x0000,0x0000}, // 0x0632
31 {0xfeb1,0xfeb2,0xfeb4,0xfeb3}, // 0x0633
32 {0xfeb5,0xfeb6,0xfeb8,0xfeb7}, // 0x0634
33 {0xfeb9,0xfeba,0xfebc,0xfebb}, // 0x0635
34 {0xfebd,0xfebe,0xfec0,0xfebf}, // 0x0636
35 {0xfec1,0xfec2,0xfec4,0xfec3}, // 0x0637
36 {0xfec5,0xfec6,0xfec8,0xfec7}, // 0x0638
37 {0xfec9,0xfeca,0xfecc,0xfecb}, // 0x0639
38 {0xfecd,0xfece,0xfed0,0xfecf}, // 0x063a
39 #if 0
40 {0x0000,0x0000,0x0000,0x0000}, // 0x063b
41 {0x0000,0x0000,0x0000,0x0000}, // 0x063c
42 {0x0000,0x0000,0x0000,0x0000}, // 0x063d
43 {0x0000,0x0000,0x0000,0x0000}, // 0x063e
44 {0x0000,0x0000,0x0000,0x0000}, // 0x063f
45 #endif
46 {0x0640,0x0640,0x0640,0x0640}, // 0x0640
47 {0xfed1,0xfed2,0xfed4,0xfed3}, // 0x0641
48 {0xfed5,0xfed6,0xfed8,0xfed7}, // 0x0642
49 {0xfed9,0xfeda,0xfedc,0xfedb}, // 0x0643
50 {0xfedd,0xfede,0xfee0,0xfedf}, // 0x0644
51 {0xfee1,0xfee2,0xfee4,0xfee3}, // 0x0645
52 {0xfee5,0xfee6,0xfee8,0xfee7}, // 0x0646
53 {0xfee9,0xfeea,0xfeec,0xfeeb}, // 0x0647
54 {0xfeed,0xfeee,0x0000,0x0000}, // 0x0648
55 {0xfeef,0xfef0,0x0000,0x0000}, // 0x0649
56 {0xfef1,0xfef2,0xfef4,0xfef3}, // 0x064a
57 # if 0
58 {0x0000,0x0000,0x0000,0x0000}, // 0x064b
59 {0x0000,0x0000,0x0000,0x0000}, // 0x064c
60 {0x0000,0x0000,0x0000,0x0000}, // 0x064d
61 {0x0000,0x0000,0x0000,0x0000}, // 0x064e
62 {0x0000,0x0000,0x0000,0x0000}, // 0x064f
63 {0x0000,0x0000,0x0000,0x0000}, // 0x0650
64 {0x0000,0x0000,0x0000,0x0000}, // 0x0651
65 {0x0000,0x0000,0x0000,0x0000}, // 0x0652
66 {0x0000,0x0000,0x0000,0x0000}, // 0x0653
67 {0x0000,0x0000,0x0000,0x0000}, // 0x0654
68 {0x0000,0x0000,0x0000,0x0000}, // 0x0655
69 {0x0000,0x0000,0x0000,0x0000}, // 0x0656
70 {0x0000,0x0000,0x0000,0x0000}, // 0x0657
71 {0x0000,0x0000,0x0000,0x0000}, // 0x0658
72 {0x0000,0x0000,0x0000,0x0000}, // 0x0659
73 {0x0000,0x0000,0x0000,0x0000}, // 0x065a
74 {0x0000,0x0000,0x0000,0x0000}, // 0x065b
75 {0x0000,0x0000,0x0000,0x0000}, // 0x065c
76 {0x0000,0x0000,0x0000,0x0000}, // 0x065d
77 {0x0000,0x0000,0x0000,0x0000}, // 0x065e
78 {0x0000,0x0000,0x0000,0x0000}, // 0x065f
79 {0x0000,0x0000,0x0000,0x0000}, // 0x0660
80 {0x0000,0x0000,0x0000,0x0000}, // 0x0661
81 {0x0000,0x0000,0x0000,0x0000}, // 0x0662
82 {0x0000,0x0000,0x0000,0x0000}, // 0x0663
83 {0x0000,0x0000,0x0000,0x0000}, // 0x0664
84 {0x0000,0x0000,0x0000,0x0000}, // 0x0665
85 {0x0000,0x0000,0x0000,0x0000}, // 0x0666
86 {0x0000,0x0000,0x0000,0x0000}, // 0x0667
87 {0x0000,0x0000,0x0000,0x0000}, // 0x0668
88 {0x0000,0x0000,0x0000,0x0000}, // 0x0669
89 {0x0000,0x0000,0x0000,0x0000}, // 0x066a
90 {0x0000,0x0000,0x0000,0x0000}, // 0x066b
91 {0x0000,0x0000,0x0000,0x0000}, // 0x066c
92 {0x0000,0x0000,0x0000,0x0000}, // 0x066d
93 {0x0000,0x0000,0x0000,0x0000}, // 0x066e
94 {0x0000,0x0000,0x0000,0x0000}, // 0x066f
95 {0x0000,0x0000,0x0000,0x0000}, // 0x0670
96 #endif
97 {0xfb50,0x0000,0x0000,0x0000}, // 0x0671
98 {0x0672,0x0672,0x0000,0x0000}, // 0x0672
99 {0x0673,0x0673,0x0000,0x0000}, // 0x0673
100 {0x0674,0x0000,0x0000,0x0000}, // 0x0674
101 {0x0675,0x0675,0x0000,0x0000}, // 0x0675
102 {0x0676,0x0676,0x0000,0x0000}, // 0x0676
103 {0xfbdd,0x0677,0x0000,0x0000}, // 0x0677
104 {0x0678,0x0678,0x0678,0x0678}, // 0x0678
105 {0xfb66,0xfb67,0xfb69,0xfb68}, // 0x0679
106 {0xfb5e,0xfb5f,0xfb61,0xfb60}, // 0x067a
107 {0xfb52,0xfb53,0xfb55,0xfb54}, // 0x067b
108 {0x067c,0x067c,0x067c,0x067c}, // 0x067c
109 {0x067d,0x067d,0x067d,0x067d}, // 0x067d
110 {0xfb56,0xfb57,0xfb59,0xfb58}, // 0x067e
111 {0xfb62,0xfb63,0xfb65,0xfb64}, // 0x067f
112 {0xfb5a,0xfb5b,0xfb5d,0xfb5c}, // 0x0680
113 {0x0681,0x0681,0x0681,0x0681}, // 0x0681
114 {0x0682,0x0682,0x0682,0x0682}, // 0x0682
115 {0xfb76,0xfb77,0xfb79,0xfb78}, // 0x0683
116 {0xfb72,0xfb73,0xfb75,0xfb74}, // 0x0684
117 {0x0685,0x0685,0x0685,0x0685}, // 0x0685
118 {0xfb7a,0xfb7b,0xfb7d,0xfb7c}, // 0x0686
119 {0xfb7e,0xfb7f,0xfb81,0xfb80}, // 0x0687
120 {0xfb88,0xfb89,0x0000,0x0000}, // 0x0688
121 {0x0689,0x0689,0x0000,0x0000}, // 0x0689
122 {0x068a,0x068a,0x0000,0x0000}, // 0x068a
123 {0x068b,0x068b,0x0000,0x0000}, // 0x068b
124 {0xfb84,0xfb85,0x0000,0x0000}, // 0x068c
125 {0xfb82,0xfb83,0x0000,0x0000}, // 0x068d
126 {0xfb86,0xfb87,0x0000,0x0000}, // 0x068e
127 {0x068f,0x068f,0x0000,0x0000}, // 0x068f
128 {0x0690,0x0690,0x0000,0x0000}, // 0x0690
129 {0xfb8c,0xfb8d,0x0000,0x0000}, // 0x0691
130 {0x0692,0x0692,0x0000,0x0000}, // 0x0692
131 {0x0693,0x0693,0x0000,0x0000}, // 0x0693
132 {0x0694,0x0694,0x0000,0x0000}, // 0x0694
133 {0x0695,0x0695,0x0000,0x0000}, // 0x0695
134 {0x0695,0x0696,0x0000,0x0000}, // 0x0696
135 {0x0697,0x0697,0x0000,0x0000}, // 0x0697
136 {0xfb8a,0xfb8b,0x0000,0x0000}, // 0x0698
137 {0x0699,0x0699,0x0000,0x0000}, // 0x0699
138 {0x069a,0x069a,0x069a,0x069a}, // 0x069a
139 {0x069b,0x069b,0x069b,0x069b}, // 0x069b
140 {0x069c,0x069c,0x069c,0x069c}, // 0x069c
141 {0x069d,0x069d,0x069d,0x069d}, // 0x069d
142 {0x069e,0x069e,0x069e,0x069e}, // 0x069e
143 {0x069f,0x069f,0x069f,0x069f}, // 0x069f
144 {0x06a0,0x06a0,0x06a0,0x06a0}, // 0x06a0
145 {0x06a1,0x06a1,0x06a1,0x06a1}, // 0x06a1
146 {0x06a2,0x06a2,0x06a2,0x06a2}, // 0x06a2
147 {0x06a3,0x06a3,0x06a3,0x06a3}, // 0x06a3
148 {0xfb6a,0xfb6b,0xfb6d,0xfb6c}, // 0x06a4
149 {0x06a5,0x06a5,0x06a5,0x06a5}, // 0x06a5
150 {0xfb6e,0xfb6f,0xfb71,0xfb70}, // 0x06a6
151 {0x06a7,0x06a7,0x06a7,0x06a7}, // 0x06a7
152 {0x06a8,0x06a8,0x06a8,0x06a8}, // 0x06a8
153 {0xfb8e,0xfb8f,0xfb91,0xfb90}, // 0x06a9
154 {0x06aa,0x06aa,0x06aa,0x06aa}, // 0x06aa
155 {0x06ab,0x06ab,0x06ab,0x06ab}, // 0x06ab
156 {0x06ac,0x06ac,0x06ac,0x06ac}, // 0x06ac
157 {0xfbd3,0xfbd4,0xfbd6,0xfbd5}, // 0x06ad
158 {0x06ae,0x06ae,0x06ae,0x06ae}, // 0x06ae
159 {0xfb92,0xfb93,0xfb95,0xfb94}, // 0x06af
160 {0x06b0,0x06b0,0x06b0,0x06b0}, // 0x06b0
161 {0xfb9a,0xfb9b,0xfb9d,0xfb9c}, // 0x06b1
162 {0x06b2,0x06b2,0x06b2,0x06b2}, // 0x06b2
163 {0xfb96,0xfb97,0xfb99,0xfb98}, // 0x06b3
164 {0x06b4,0x06b4,0x06b4,0x06b4}, // 0x06b4
165 {0x06b5,0x06b5,0x06b5,0x06b5}, // 0x06b5
166 {0x06b6,0x06b6,0x06b6,0x06b6}, // 0x06b6
167 {0x06b7,0x06b7,0x06b7,0x06b7}, // 0x06b7
168 {0x0000,0x0000,0x0000,0x0000}, // 0x06b8
169 {0x0000,0x0000,0x0000,0x0000}, // 0x06b9
170 {0xfb9e,0xfb9f,0x06ba,0x06ba}, // 0x06ba
171 {0xfba0,0xfba1,0xfba3,0xfba2}, // 0x06bb
172 {0x06bc,0x06bc,0x06bc,0x06bc}, // 0x06bc
173 {0x06bd,0x06bd,0x06bd,0x06bd}, // 0x06bd
174 {0xfbaa,0xfbab,0xfbad,0xfbac}, // 0x06be
175 {0x0000,0x0000,0x0000,0x0000}, // 0x06bf
176 {0xfba4,0xfba5,0x0000,0x0000}, // 0x06c0
177 {0x06c1,0x06c1,0x06c1,0x06c1}, // 0x06c1
178 {0x06c2,0x06c2,0x0000,0x0000}, // 0x06c2
179 {0x06c3,0x06c3,0x0000,0x0000}, // 0x06c3
180 {0x06c4,0x06c4,0x0000,0x0000}, // 0x06c4
181 {0x06c5,0x06c5,0x0000,0x0000}, // 0x06c5
182 {0x06c6,0x06c6,0x0000,0x0000}, // 0x06c6
183 {0x06c7,0x06c7,0x0000,0x0000}, // 0x06c7
184 {0x06c8,0x06c8,0x0000,0x0000}, // 0x06c8
185 {0x06c9,0x06c9,0x0000,0x0000}, // 0x06c9
186 {0x06ca,0x06ca,0x0000,0x0000}, // 0x06ca
187 {0x06cb,0x06cb,0x0000,0x0000}, // 0x06cb
188 {0x06cc,0x06cc,0x06cc,0x06cc}, // 0x06cc
189 {0x06cd,0x06cd,0x0000,0x0000}, // 0x06cd
190 {0x06ce,0x06ce,0x06ce,0x06ce}, // 0x06ce
191 {0x0000,0x0000,0x0000,0x0000}, // 0x06cf
192 {0x06d0,0x06d0,0x06d0,0x06d0}, // 0x06d0
193 {0x06d1,0x06d1,0x06d1,0x06d1}, // 0x06d1
194 {0xfbae,0xfbaf,0x0000,0x0000}, // 0x06d2
195 {0xfbb0,0xfbb1,0x0000,0x0000}, // 0x06d3
196 {0x0000,0x0000,0x0000,0x0000}, // 0x06d4
197 {0x06d5,0x0000,0x0000,0x0000} // 0x06d5