Debian Codegraph @

test/keysym-case-mapping.h

raw
1 // WARNING: This file is automatically generated by: scripts/update-keysyms-case-mappings.py
2 #pragma once
3
4 #include "config.h"
5
6 #include <stdint.h>
7 #include <unicode/uchar.h>
8
9 /* Unicode code points used in case mapping exceptions */
10 #define LATIN_SMALL_LETTER_SHARP_S 0x00df // ß
11 #define LATIN_CAPITAL_LETTER_SHARP_S 0x1e9e // ẞ
12
13 static inline uint32_t
14 to_simple_lower(uint32_t cp)
15 {
16 return (uint32_t)u_tolower((UChar32) cp);
17 }
18
19 static inline uint32_t
20 to_simple_upper(uint32_t cp)
21 {
22 switch (cp) {
23 /* Some exceptions */
24 case LATIN_SMALL_LETTER_SHARP_S:
25 return LATIN_CAPITAL_LETTER_SHARP_S;
26 /* Default to the Unicode simple mapping */
27 default:
28 return (uint32_t)u_toupper((UChar32) cp);
29 }
30 }