3 #define CASEMAP(u1, u2, l) \ 5 (u1), (l) - (u1), (u2) - (u1) + 1 \ 7 #define CASELACE(u1, u2) CASEMAP((u1), (u2), (u1) + 1) 38 CASEMAP(0x1f48, 0x1f4d, 0x1f40),
46 CASEMAP(0x1ffa, 0x1ffb, 0x1f7c),
65 CASEMAP(0xff21, 0xff3a, 0xff41), {0, 0, 0}};
67 static const unsigned short pairs[][2] = {{
'I', 0x0131},
221 int lmul = 2 * lower - 1;
222 int lmask = lower - 1;
224 if(!
iswalpha((
wint_t)wc) || (
unsigned)wc - 0x0600 <= 0x0fff - 0x0600 ||
225 (
unsigned)wc - 0x2e00 <= 0xa63f - 0x2e00 || (
unsigned)wc - 0xa800 <= 0xab52 - 0xa800 ||
226 (
unsigned)wc - 0xabc0 <= 0xfeff - 0xabc0)
232 if(lower && (
unsigned)wc - 0x10a0 < 0x2e)
234 if(wc > 0x10c5 && wc != 0x10c7 && wc != 0x10cd)
239 return wc + 0x2d00 - 0x10a0;
242 if(!lower && (
unsigned)wc - 0x2d00 < 0x26)
244 if(wc > 0x2d25 && wc != 0x2d27 && wc != 0x2d2d)
249 return wc + 0x10a0 - 0x2d00;
252 if(lower && (
unsigned)wc - 0x13a0 < 0x50)
254 return wc + 0xab70 - 0x13a0;
257 if(!lower && (
unsigned)wc - 0xab70 < 0x50)
259 return wc + 0x13a0 - 0xab70;
269 return wc + lower - ((wc -
casemaps[i].upper) & 1);
271 return wc + lmul *
casemaps[i].lower;
275 for(i = 0;
pairs[i][1 - lower]; i++)
277 if(
pairs[i][1 - lower] == wc)
279 return pairs[i][lower];
283 if(wc - (0x10428 - 0x28 * lower) < 0x28)
285 return wc - 0x28 + 0x50 * lower;
288 if(wc - (0x104d8 - 0x28 * lower) < 0x24)
290 return wc - 0x28 + 0x50 * lower;
293 if(wc - (0x10cc0 - 0x40 * lower) < 0x33)
295 return wc - 0x40 + 0x80 * lower;
298 if(wc - (0x118c0 - 0x20 * lower) < 0x20)
300 return wc - 0x20 + 0x40 * lower;
303 if(wc - (0x1e922 - 0x22 * lower) < 0x22)
305 return wc - 0x22 + 0x44 * lower;
static const unsigned short pairs[][2]
#define CASEMAP(u1, u2, l)
wchar_t __towcase(wchar_t wc, int lower)
static const struct @2 casemaps[]