aboutsummaryrefslogtreecommitdiff
path: root/lib/unicode/prop
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicode/prop')
-rw-r--r--lib/unicode/prop/uprop_get_gc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/unicode/prop/uprop_get_gc.c b/lib/unicode/prop/uprop_get_gc.c
new file mode 100644
index 0000000..da75b98
--- /dev/null
+++ b/lib/unicode/prop/uprop_get_gc.c
@@ -0,0 +1,12 @@
+#include "__bsearch.h"
+#include "rune.h"
+#include "unicode/__gc.h"
+#include "unicode/prop.h"
+
+__MLIB_DEFINE_BSEARCH(enum uprop_gc, __mlib_gc_lt, GC_CN)
+
+enum uprop_gc
+uprop_get_gc(rune ch)
+{
+ return ch <= LATIN1_MAX ? __mlib_gc_lat1_lt[ch] : mlib_lookup(ch);
+}