aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-04-09 20:37:09 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-04-09 20:37:09 +0200
commita83a4de7820cf0a7c470c3a8acbfebf1a93b215f (patch)
treeda661591e39133eb546d9d483852193f5a0c8719
parentc02c6641704245b35be78f45e2291a3cb93a6511 (diff)
Add uprop_get_bpb() and uprop_get_bpt()
-rwxr-xr-xgen/data-files1
-rwxr-xr-xgen/prop/bpb52
-rwxr-xr-xgen/prop/bpt53
-rw-r--r--include/unicode/prop.h26
-rw-r--r--lib/unicode/prop/uprop_get_bpb.c176
-rw-r--r--lib/unicode/prop/uprop_get_bpt.c177
6 files changed, 476 insertions, 9 deletions
diff --git a/gen/data-files b/gen/data-files
index a2c64d6..0946f7e 100755
--- a/gen/data-files
+++ b/gen/data-files
@@ -8,6 +8,7 @@ readonly BASE=https://www.unicode.org/Public/UCD/latest/ucd
readonly URLS='
auxiliary/GraphemeBreakProperty.txt
+BidiBrackets.txt
DerivedCoreProperties.txt
DerivedNormalizationProps.txt
emoji/emoji-data.txt
diff --git a/gen/prop/bpb b/gen/prop/bpb
new file mode 100755
index 0000000..52e3a9d
--- /dev/null
+++ b/gen/prop/bpb
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+cd "${0%/*}/../.."
+exec >lib/unicode/prop/uprop_get_bpb.c
+
+gawk '
+BEGIN {
+ FS = " *(; *|#.*)"
+
+ print "/* This file is autogenerated by gen/prop/bpb; DO NOT EDIT. */"
+ print ""
+ print "#include \"__bsearch.h\""
+ print "#include \"macros.h\""
+ print "#include \"rune.h\""
+ print "#include \"unicode/prop.h\""
+ print ""
+}
+
+/^[^#]/ {
+ props[strtonum("0X" $1)] = strtonum("0X" $2)
+}
+
+END {
+ print "static constexpr rune lookup_lat1[] = {"
+ for (i = 0; i < 0x100; i++) {
+ if (i % 8 == 0)
+ printf "\t"
+ printf "0x%02X,%s", props[i] ? props[i] : 0, i % 8 == 7 ? "\n" : " "
+ }
+ print "};"
+ print ""
+ print "static const struct {"
+ print "\trune k, v;"
+ print "} lookup[] = {"
+
+ for (i = 0x100; i <= 0x10FFFF; i++) {
+ if (props[i])
+ printf "\t{RUNE_C(0x%06X), RUNE_C(0x%06X)},\n", i, props[i]
+ }
+
+ print "};"
+ print ""
+ print "__MLIB_DEFINE_BSEARCH_KV(rune, lookup, 0)"
+ print ""
+ print "rune"
+ print "uprop_get_bpb(rune ch)"
+ print "{"
+ print "\treturn ch < lengthof(lookup_lat1) ? lookup_lat1[ch] : mlib_lookup_kv(ch);"
+ print "}"
+}
+' data/BidiBrackets.txt
diff --git a/gen/prop/bpt b/gen/prop/bpt
new file mode 100755
index 0000000..b73b804
--- /dev/null
+++ b/gen/prop/bpt
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+set -e
+cd "${0%/*}/../.."
+exec >lib/unicode/prop/uprop_get_bpt.c
+
+gawk '
+BEGIN {
+ FS = " *(; *|#.*)"
+
+ print "/* This file is autogenerated by gen/prop/bpt; DO NOT EDIT. */"
+ print ""
+ print "#include \"__bsearch.h\""
+ print "#include \"macros.h\""
+ print "#include \"rune.h\""
+ print "#include \"unicode/prop.h\""
+ print ""
+}
+
+/^[^#]/ {
+ props[strtonum("0X" $1)] = "BPT_" toupper($3)
+}
+
+END {
+ print "static constexpr enum uprop_bpt lookup_lat1[] = {"
+ for (i = 0; i < 0x100; i++) {
+ if (i % 8 == 0)
+ printf "\t"
+ printf "%5s,%s", props[i] ? props[i] : "BPT_N", i % 8 == 7 ? "\n" : " "
+ }
+ print "};"
+ print ""
+ print "static const struct {"
+ print "\trune k;"
+ print "\tenum uprop_bpt v;"
+ print "} lookup[] = {"
+
+ for (i = 0x100; i <= 0x10FFFF; i++) {
+ if (props[i])
+ printf "\t{RUNE_C(0x%06X), %s},\n", i, props[i]
+ }
+
+ print "};"
+ print ""
+ print "__MLIB_DEFINE_BSEARCH_KV(enum uprop_bpt, lookup, BPT_N)"
+ print ""
+ print "enum uprop_bpt"
+ print "uprop_get_bpt(rune ch)"
+ print "{"
+ print "\treturn ch < lengthof(lookup_lat1) ? lookup_lat1[ch] : mlib_lookup_kv(ch);"
+ print "}"
+}
+' data/BidiBrackets.txt
diff --git a/include/unicode/prop.h b/include/unicode/prop.h
index 0efd0c1..1af318b 100644
--- a/include/unicode/prop.h
+++ b/include/unicode/prop.h
@@ -5,6 +5,21 @@
#include "__rune.h"
+enum uprop_bpt {
+ BPT_N, /* None */
+ BPT_C, /* Close */
+ BPT_O, /* Open */
+};
+
+enum uprop_ea {
+ EA_A, /* Ambiguous */
+ EA_F, /* Fullwidth */
+ EA_H, /* Halfwidth */
+ EA_NA, /* Wide */
+ EA_N, /* Neutral */
+ EA_W, /* Narrow */
+};
+
enum [[clang::__flag_enum__]] uprop_gc : uint_fast32_t {
GC_CN = UINT32_C(1) << 0, /* Not Assigned */
GC_CC = UINT32_C(1) << 1, /* Control */
@@ -55,19 +70,12 @@ enum uprop_nt {
NT_NU, /* Numeric */
};
-enum uprop_ea {
- EA_A, /* Ambiguous */
- EA_F, /* Fullwidth */
- EA_H, /* Halfwidth */
- EA_NA, /* Wide */
- EA_N, /* Neutral */
- EA_W, /* Narrow */
-};
-
[[__nodiscard__, __unsequenced__]] double uprop_get_nv(rune);
+[[__nodiscard__, __unsequenced__]] enum uprop_bpt uprop_get_bpt(rune);
[[__nodiscard__, __unsequenced__]] enum uprop_ea uprop_get_ea(rune);
[[__nodiscard__, __unsequenced__]] enum uprop_gc uprop_get_gc(rune);
[[__nodiscard__, __unsequenced__]] enum uprop_nt uprop_get_nt(rune);
+[[__nodiscard__, __unsequenced__]] rune uprop_get_bpb(rune);
/* PROP PREDICATES START */
[[__nodiscard__, __unsequenced__]] bool uprop_is_ahex(rune);
diff --git a/lib/unicode/prop/uprop_get_bpb.c b/lib/unicode/prop/uprop_get_bpb.c
new file mode 100644
index 0000000..343f71b
--- /dev/null
+++ b/lib/unicode/prop/uprop_get_bpb.c
@@ -0,0 +1,176 @@
+/* This file is autogenerated by gen/prop/bpb; DO NOT EDIT. */
+
+#include "__bsearch.h"
+#include "macros.h"
+#include "rune.h"
+#include "unicode/prop.h"
+
+static constexpr rune lookup_lat1[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x29, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x5D, 0x00, 0x5B, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7D, 0x00, 0x7B, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+static const struct {
+ rune k, v;
+} lookup[] = {
+ {RUNE_C(0x000F3A), RUNE_C(0x000F3B)},
+ {RUNE_C(0x000F3B), RUNE_C(0x000F3A)},
+ {RUNE_C(0x000F3C), RUNE_C(0x000F3D)},
+ {RUNE_C(0x000F3D), RUNE_C(0x000F3C)},
+ {RUNE_C(0x00169B), RUNE_C(0x00169C)},
+ {RUNE_C(0x00169C), RUNE_C(0x00169B)},
+ {RUNE_C(0x002045), RUNE_C(0x002046)},
+ {RUNE_C(0x002046), RUNE_C(0x002045)},
+ {RUNE_C(0x00207D), RUNE_C(0x00207E)},
+ {RUNE_C(0x00207E), RUNE_C(0x00207D)},
+ {RUNE_C(0x00208D), RUNE_C(0x00208E)},
+ {RUNE_C(0x00208E), RUNE_C(0x00208D)},
+ {RUNE_C(0x002308), RUNE_C(0x002309)},
+ {RUNE_C(0x002309), RUNE_C(0x002308)},
+ {RUNE_C(0x00230A), RUNE_C(0x00230B)},
+ {RUNE_C(0x00230B), RUNE_C(0x00230A)},
+ {RUNE_C(0x002329), RUNE_C(0x00232A)},
+ {RUNE_C(0x00232A), RUNE_C(0x002329)},
+ {RUNE_C(0x002768), RUNE_C(0x002769)},
+ {RUNE_C(0x002769), RUNE_C(0x002768)},
+ {RUNE_C(0x00276A), RUNE_C(0x00276B)},
+ {RUNE_C(0x00276B), RUNE_C(0x00276A)},
+ {RUNE_C(0x00276C), RUNE_C(0x00276D)},
+ {RUNE_C(0x00276D), RUNE_C(0x00276C)},
+ {RUNE_C(0x00276E), RUNE_C(0x00276F)},
+ {RUNE_C(0x00276F), RUNE_C(0x00276E)},
+ {RUNE_C(0x002770), RUNE_C(0x002771)},
+ {RUNE_C(0x002771), RUNE_C(0x002770)},
+ {RUNE_C(0x002772), RUNE_C(0x002773)},
+ {RUNE_C(0x002773), RUNE_C(0x002772)},
+ {RUNE_C(0x002774), RUNE_C(0x002775)},
+ {RUNE_C(0x002775), RUNE_C(0x002774)},
+ {RUNE_C(0x0027C5), RUNE_C(0x0027C6)},
+ {RUNE_C(0x0027C6), RUNE_C(0x0027C5)},
+ {RUNE_C(0x0027E6), RUNE_C(0x0027E7)},
+ {RUNE_C(0x0027E7), RUNE_C(0x0027E6)},
+ {RUNE_C(0x0027E8), RUNE_C(0x0027E9)},
+ {RUNE_C(0x0027E9), RUNE_C(0x0027E8)},
+ {RUNE_C(0x0027EA), RUNE_C(0x0027EB)},
+ {RUNE_C(0x0027EB), RUNE_C(0x0027EA)},
+ {RUNE_C(0x0027EC), RUNE_C(0x0027ED)},
+ {RUNE_C(0x0027ED), RUNE_C(0x0027EC)},
+ {RUNE_C(0x0027EE), RUNE_C(0x0027EF)},
+ {RUNE_C(0x0027EF), RUNE_C(0x0027EE)},
+ {RUNE_C(0x002983), RUNE_C(0x002984)},
+ {RUNE_C(0x002984), RUNE_C(0x002983)},
+ {RUNE_C(0x002985), RUNE_C(0x002986)},
+ {RUNE_C(0x002986), RUNE_C(0x002985)},
+ {RUNE_C(0x002987), RUNE_C(0x002988)},
+ {RUNE_C(0x002988), RUNE_C(0x002987)},
+ {RUNE_C(0x002989), RUNE_C(0x00298A)},
+ {RUNE_C(0x00298A), RUNE_C(0x002989)},
+ {RUNE_C(0x00298B), RUNE_C(0x00298C)},
+ {RUNE_C(0x00298C), RUNE_C(0x00298B)},
+ {RUNE_C(0x00298D), RUNE_C(0x002990)},
+ {RUNE_C(0x00298E), RUNE_C(0x00298F)},
+ {RUNE_C(0x00298F), RUNE_C(0x00298E)},
+ {RUNE_C(0x002990), RUNE_C(0x00298D)},
+ {RUNE_C(0x002991), RUNE_C(0x002992)},
+ {RUNE_C(0x002992), RUNE_C(0x002991)},
+ {RUNE_C(0x002993), RUNE_C(0x002994)},
+ {RUNE_C(0x002994), RUNE_C(0x002993)},
+ {RUNE_C(0x002995), RUNE_C(0x002996)},
+ {RUNE_C(0x002996), RUNE_C(0x002995)},
+ {RUNE_C(0x002997), RUNE_C(0x002998)},
+ {RUNE_C(0x002998), RUNE_C(0x002997)},
+ {RUNE_C(0x0029D8), RUNE_C(0x0029D9)},
+ {RUNE_C(0x0029D9), RUNE_C(0x0029D8)},
+ {RUNE_C(0x0029DA), RUNE_C(0x0029DB)},
+ {RUNE_C(0x0029DB), RUNE_C(0x0029DA)},
+ {RUNE_C(0x0029FC), RUNE_C(0x0029FD)},
+ {RUNE_C(0x0029FD), RUNE_C(0x0029FC)},
+ {RUNE_C(0x002E22), RUNE_C(0x002E23)},
+ {RUNE_C(0x002E23), RUNE_C(0x002E22)},
+ {RUNE_C(0x002E24), RUNE_C(0x002E25)},
+ {RUNE_C(0x002E25), RUNE_C(0x002E24)},
+ {RUNE_C(0x002E26), RUNE_C(0x002E27)},
+ {RUNE_C(0x002E27), RUNE_C(0x002E26)},
+ {RUNE_C(0x002E28), RUNE_C(0x002E29)},
+ {RUNE_C(0x002E29), RUNE_C(0x002E28)},
+ {RUNE_C(0x002E55), RUNE_C(0x002E56)},
+ {RUNE_C(0x002E56), RUNE_C(0x002E55)},
+ {RUNE_C(0x002E57), RUNE_C(0x002E58)},
+ {RUNE_C(0x002E58), RUNE_C(0x002E57)},
+ {RUNE_C(0x002E59), RUNE_C(0x002E5A)},
+ {RUNE_C(0x002E5A), RUNE_C(0x002E59)},
+ {RUNE_C(0x002E5B), RUNE_C(0x002E5C)},
+ {RUNE_C(0x002E5C), RUNE_C(0x002E5B)},
+ {RUNE_C(0x003008), RUNE_C(0x003009)},
+ {RUNE_C(0x003009), RUNE_C(0x003008)},
+ {RUNE_C(0x00300A), RUNE_C(0x00300B)},
+ {RUNE_C(0x00300B), RUNE_C(0x00300A)},
+ {RUNE_C(0x00300C), RUNE_C(0x00300D)},
+ {RUNE_C(0x00300D), RUNE_C(0x00300C)},
+ {RUNE_C(0x00300E), RUNE_C(0x00300F)},
+ {RUNE_C(0x00300F), RUNE_C(0x00300E)},
+ {RUNE_C(0x003010), RUNE_C(0x003011)},
+ {RUNE_C(0x003011), RUNE_C(0x003010)},
+ {RUNE_C(0x003014), RUNE_C(0x003015)},
+ {RUNE_C(0x003015), RUNE_C(0x003014)},
+ {RUNE_C(0x003016), RUNE_C(0x003017)},
+ {RUNE_C(0x003017), RUNE_C(0x003016)},
+ {RUNE_C(0x003018), RUNE_C(0x003019)},
+ {RUNE_C(0x003019), RUNE_C(0x003018)},
+ {RUNE_C(0x00301A), RUNE_C(0x00301B)},
+ {RUNE_C(0x00301B), RUNE_C(0x00301A)},
+ {RUNE_C(0x00FE59), RUNE_C(0x00FE5A)},
+ {RUNE_C(0x00FE5A), RUNE_C(0x00FE59)},
+ {RUNE_C(0x00FE5B), RUNE_C(0x00FE5C)},
+ {RUNE_C(0x00FE5C), RUNE_C(0x00FE5B)},
+ {RUNE_C(0x00FE5D), RUNE_C(0x00FE5E)},
+ {RUNE_C(0x00FE5E), RUNE_C(0x00FE5D)},
+ {RUNE_C(0x00FF08), RUNE_C(0x00FF09)},
+ {RUNE_C(0x00FF09), RUNE_C(0x00FF08)},
+ {RUNE_C(0x00FF3B), RUNE_C(0x00FF3D)},
+ {RUNE_C(0x00FF3D), RUNE_C(0x00FF3B)},
+ {RUNE_C(0x00FF5B), RUNE_C(0x00FF5D)},
+ {RUNE_C(0x00FF5D), RUNE_C(0x00FF5B)},
+ {RUNE_C(0x00FF5F), RUNE_C(0x00FF60)},
+ {RUNE_C(0x00FF60), RUNE_C(0x00FF5F)},
+ {RUNE_C(0x00FF62), RUNE_C(0x00FF63)},
+ {RUNE_C(0x00FF63), RUNE_C(0x00FF62)},
+};
+
+__MLIB_DEFINE_BSEARCH_KV(rune, lookup, 0)
+
+rune
+uprop_get_bpb(rune ch)
+{
+ return ch < lengthof(lookup_lat1) ? lookup_lat1[ch] : mlib_lookup_kv(ch);
+}
diff --git a/lib/unicode/prop/uprop_get_bpt.c b/lib/unicode/prop/uprop_get_bpt.c
new file mode 100644
index 0000000..7e8c11a
--- /dev/null
+++ b/lib/unicode/prop/uprop_get_bpt.c
@@ -0,0 +1,177 @@
+/* This file is autogenerated by gen/prop/bpt; DO NOT EDIT. */
+
+#include "__bsearch.h"
+#include "macros.h"
+#include "rune.h"
+#include "unicode/prop.h"
+
+static constexpr enum uprop_bpt lookup_lat1[] = {
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_O, BPT_C, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_O, BPT_N, BPT_C, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_O, BPT_N, BPT_C, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+ BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N, BPT_N,
+};
+
+static const struct {
+ rune k;
+ enum uprop_bpt v;
+} lookup[] = {
+ {RUNE_C(0x000F3A), BPT_O},
+ {RUNE_C(0x000F3B), BPT_C},
+ {RUNE_C(0x000F3C), BPT_O},
+ {RUNE_C(0x000F3D), BPT_C},
+ {RUNE_C(0x00169B), BPT_O},
+ {RUNE_C(0x00169C), BPT_C},
+ {RUNE_C(0x002045), BPT_O},
+ {RUNE_C(0x002046), BPT_C},
+ {RUNE_C(0x00207D), BPT_O},
+ {RUNE_C(0x00207E), BPT_C},
+ {RUNE_C(0x00208D), BPT_O},
+ {RUNE_C(0x00208E), BPT_C},
+ {RUNE_C(0x002308), BPT_O},
+ {RUNE_C(0x002309), BPT_C},
+ {RUNE_C(0x00230A), BPT_O},
+ {RUNE_C(0x00230B), BPT_C},
+ {RUNE_C(0x002329), BPT_O},
+ {RUNE_C(0x00232A), BPT_C},
+ {RUNE_C(0x002768), BPT_O},
+ {RUNE_C(0x002769), BPT_C},
+ {RUNE_C(0x00276A), BPT_O},
+ {RUNE_C(0x00276B), BPT_C},
+ {RUNE_C(0x00276C), BPT_O},
+ {RUNE_C(0x00276D), BPT_C},
+ {RUNE_C(0x00276E), BPT_O},
+ {RUNE_C(0x00276F), BPT_C},
+ {RUNE_C(0x002770), BPT_O},
+ {RUNE_C(0x002771), BPT_C},
+ {RUNE_C(0x002772), BPT_O},
+ {RUNE_C(0x002773), BPT_C},
+ {RUNE_C(0x002774), BPT_O},
+ {RUNE_C(0x002775), BPT_C},
+ {RUNE_C(0x0027C5), BPT_O},
+ {RUNE_C(0x0027C6), BPT_C},
+ {RUNE_C(0x0027E6), BPT_O},
+ {RUNE_C(0x0027E7), BPT_C},
+ {RUNE_C(0x0027E8), BPT_O},
+ {RUNE_C(0x0027E9), BPT_C},
+ {RUNE_C(0x0027EA), BPT_O},
+ {RUNE_C(0x0027EB), BPT_C},
+ {RUNE_C(0x0027EC), BPT_O},
+ {RUNE_C(0x0027ED), BPT_C},
+ {RUNE_C(0x0027EE), BPT_O},
+ {RUNE_C(0x0027EF), BPT_C},
+ {RUNE_C(0x002983), BPT_O},
+ {RUNE_C(0x002984), BPT_C},
+ {RUNE_C(0x002985), BPT_O},
+ {RUNE_C(0x002986), BPT_C},
+ {RUNE_C(0x002987), BPT_O},
+ {RUNE_C(0x002988), BPT_C},
+ {RUNE_C(0x002989), BPT_O},
+ {RUNE_C(0x00298A), BPT_C},
+ {RUNE_C(0x00298B), BPT_O},
+ {RUNE_C(0x00298C), BPT_C},
+ {RUNE_C(0x00298D), BPT_O},
+ {RUNE_C(0x00298E), BPT_C},
+ {RUNE_C(0x00298F), BPT_O},
+ {RUNE_C(0x002990), BPT_C},
+ {RUNE_C(0x002991), BPT_O},
+ {RUNE_C(0x002992), BPT_C},
+ {RUNE_C(0x002993), BPT_O},
+ {RUNE_C(0x002994), BPT_C},
+ {RUNE_C(0x002995), BPT_O},
+ {RUNE_C(0x002996), BPT_C},
+ {RUNE_C(0x002997), BPT_O},
+ {RUNE_C(0x002998), BPT_C},
+ {RUNE_C(0x0029D8), BPT_O},
+ {RUNE_C(0x0029D9), BPT_C},
+ {RUNE_C(0x0029DA), BPT_O},
+ {RUNE_C(0x0029DB), BPT_C},
+ {RUNE_C(0x0029FC), BPT_O},
+ {RUNE_C(0x0029FD), BPT_C},
+ {RUNE_C(0x002E22), BPT_O},
+ {RUNE_C(0x002E23), BPT_C},
+ {RUNE_C(0x002E24), BPT_O},
+ {RUNE_C(0x002E25), BPT_C},
+ {RUNE_C(0x002E26), BPT_O},
+ {RUNE_C(0x002E27), BPT_C},
+ {RUNE_C(0x002E28), BPT_O},
+ {RUNE_C(0x002E29), BPT_C},
+ {RUNE_C(0x002E55), BPT_O},
+ {RUNE_C(0x002E56), BPT_C},
+ {RUNE_C(0x002E57), BPT_O},
+ {RUNE_C(0x002E58), BPT_C},
+ {RUNE_C(0x002E59), BPT_O},
+ {RUNE_C(0x002E5A), BPT_C},
+ {RUNE_C(0x002E5B), BPT_O},
+ {RUNE_C(0x002E5C), BPT_C},
+ {RUNE_C(0x003008), BPT_O},
+ {RUNE_C(0x003009), BPT_C},
+ {RUNE_C(0x00300A), BPT_O},
+ {RUNE_C(0x00300B), BPT_C},
+ {RUNE_C(0x00300C), BPT_O},
+ {RUNE_C(0x00300D), BPT_C},
+ {RUNE_C(0x00300E), BPT_O},
+ {RUNE_C(0x00300F), BPT_C},
+ {RUNE_C(0x003010), BPT_O},
+ {RUNE_C(0x003011), BPT_C},
+ {RUNE_C(0x003014), BPT_O},
+ {RUNE_C(0x003015), BPT_C},
+ {RUNE_C(0x003016), BPT_O},
+ {RUNE_C(0x003017), BPT_C},
+ {RUNE_C(0x003018), BPT_O},
+ {RUNE_C(0x003019), BPT_C},
+ {RUNE_C(0x00301A), BPT_O},
+ {RUNE_C(0x00301B), BPT_C},
+ {RUNE_C(0x00FE59), BPT_O},
+ {RUNE_C(0x00FE5A), BPT_C},
+ {RUNE_C(0x00FE5B), BPT_O},
+ {RUNE_C(0x00FE5C), BPT_C},
+ {RUNE_C(0x00FE5D), BPT_O},
+ {RUNE_C(0x00FE5E), BPT_C},
+ {RUNE_C(0x00FF08), BPT_O},
+ {RUNE_C(0x00FF09), BPT_C},
+ {RUNE_C(0x00FF3B), BPT_O},
+ {RUNE_C(0x00FF3D), BPT_C},
+ {RUNE_C(0x00FF5B), BPT_O},
+ {RUNE_C(0x00FF5D), BPT_C},
+ {RUNE_C(0x00FF5F), BPT_O},
+ {RUNE_C(0x00FF60), BPT_C},
+ {RUNE_C(0x00FF62), BPT_O},
+ {RUNE_C(0x00FF63), BPT_C},
+};
+
+__MLIB_DEFINE_BSEARCH_KV(enum uprop_bpt, lookup, BPT_N)
+
+enum uprop_bpt
+uprop_get_bpt(rune ch)
+{
+ return ch < lengthof(lookup_lat1) ? lookup_lat1[ch] : mlib_lookup_kv(ch);
+}