From 8c2f9268ab976015edcff16e26a13398bba8396c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 1 Apr 2024 16:03:29 +0200 Subject: Add unicode/prop.h --- lib/unicode/prop/uprop_get_gc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/unicode/prop/uprop_get_gc.c (limited to 'lib/unicode/prop/uprop_get_gc.c') 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); +} -- cgit v1.2.3