From 426f25eeb71aae2e15bcce601a65fd77b71d3e88 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 16 Apr 2024 13:48:52 +0200 Subject: Add uprop_get_vo() --- lib/unicode/prop/uprop_get_vo.c | 224 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 lib/unicode/prop/uprop_get_vo.c (limited to 'lib') diff --git a/lib/unicode/prop/uprop_get_vo.c b/lib/unicode/prop/uprop_get_vo.c new file mode 100644 index 0000000..6485daa --- /dev/null +++ b/lib/unicode/prop/uprop_get_vo.c @@ -0,0 +1,224 @@ +/* This file is autogenerated by gen/prop/vo; DO NOT EDIT. */ + +#include "_bsearch.h" +#include "macros.h" +#include "rune.h" +#include "unicode/prop.h" + +static constexpr enum uprop_vo lookup_lat1[] = { + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_U, + VO_R, VO_U, VO_R, VO_R, VO_R, VO_R, VO_U, VO_R, + VO_R, VO_U, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_U, VO_U, VO_U, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_U, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_U, + VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, VO_R, +}; + +static const struct { + rune lo, hi; + enum uprop_vo val; +} lookup[] = { + {RUNE_C(0x0002EA), RUNE_C(0x0002EB), VO_U}, + {RUNE_C(0x001100), RUNE_C(0x0011FF), VO_U}, + {RUNE_C(0x001401), RUNE_C(0x00167F), VO_U}, + {RUNE_C(0x0018B0), RUNE_C(0x0018FF), VO_U}, + {RUNE_C(0x002016), RUNE_C(0x002016), VO_U}, + {RUNE_C(0x002020), RUNE_C(0x002021), VO_U}, + {RUNE_C(0x002030), RUNE_C(0x002031), VO_U}, + {RUNE_C(0x00203B), RUNE_C(0x00203C), VO_U}, + {RUNE_C(0x002042), RUNE_C(0x002042), VO_U}, + {RUNE_C(0x002047), RUNE_C(0x002049), VO_U}, + {RUNE_C(0x002051), RUNE_C(0x002051), VO_U}, + {RUNE_C(0x002065), RUNE_C(0x002065), VO_U}, + {RUNE_C(0x0020DD), RUNE_C(0x0020E0), VO_U}, + {RUNE_C(0x0020E2), RUNE_C(0x0020E4), VO_U}, + {RUNE_C(0x002100), RUNE_C(0x002101), VO_U}, + {RUNE_C(0x002103), RUNE_C(0x002109), VO_U}, + {RUNE_C(0x00210F), RUNE_C(0x00210F), VO_U}, + {RUNE_C(0x002113), RUNE_C(0x002114), VO_U}, + {RUNE_C(0x002116), RUNE_C(0x002117), VO_U}, + {RUNE_C(0x00211E), RUNE_C(0x002123), VO_U}, + {RUNE_C(0x002125), RUNE_C(0x002125), VO_U}, + {RUNE_C(0x002127), RUNE_C(0x002127), VO_U}, + {RUNE_C(0x002129), RUNE_C(0x002129), VO_U}, + {RUNE_C(0x00212E), RUNE_C(0x00212E), VO_U}, + {RUNE_C(0x002135), RUNE_C(0x00213F), VO_U}, + {RUNE_C(0x002145), RUNE_C(0x00214A), VO_U}, + {RUNE_C(0x00214C), RUNE_C(0x00214D), VO_U}, + {RUNE_C(0x00214F), RUNE_C(0x002189), VO_U}, + {RUNE_C(0x00218C), RUNE_C(0x00218F), VO_U}, + {RUNE_C(0x00221E), RUNE_C(0x00221E), VO_U}, + {RUNE_C(0x002234), RUNE_C(0x002235), VO_U}, + {RUNE_C(0x002300), RUNE_C(0x002307), VO_U}, + {RUNE_C(0x00230C), RUNE_C(0x00231F), VO_U}, + {RUNE_C(0x002324), RUNE_C(0x002328), VO_U}, + {RUNE_C(0x002329), RUNE_C(0x00232A), VO_TR}, + {RUNE_C(0x00232B), RUNE_C(0x00232B), VO_U}, + {RUNE_C(0x00237D), RUNE_C(0x00239A), VO_U}, + {RUNE_C(0x0023BE), RUNE_C(0x0023CD), VO_U}, + {RUNE_C(0x0023CF), RUNE_C(0x0023CF), VO_U}, + {RUNE_C(0x0023D1), RUNE_C(0x0023DB), VO_U}, + {RUNE_C(0x0023E2), RUNE_C(0x002422), VO_U}, + {RUNE_C(0x002424), RUNE_C(0x0024FF), VO_U}, + {RUNE_C(0x0025A0), RUNE_C(0x002619), VO_U}, + {RUNE_C(0x002620), RUNE_C(0x002767), VO_U}, + {RUNE_C(0x002776), RUNE_C(0x002793), VO_U}, + {RUNE_C(0x002B12), RUNE_C(0x002B2F), VO_U}, + {RUNE_C(0x002B50), RUNE_C(0x002B59), VO_U}, + {RUNE_C(0x002B97), RUNE_C(0x002B97), VO_U}, + {RUNE_C(0x002BB8), RUNE_C(0x002BD1), VO_U}, + {RUNE_C(0x002BD3), RUNE_C(0x002BEB), VO_U}, + {RUNE_C(0x002BF0), RUNE_C(0x002BFF), VO_U}, + {RUNE_C(0x002E50), RUNE_C(0x002E51), VO_U}, + {RUNE_C(0x002E80), RUNE_C(0x003000), VO_U}, + {RUNE_C(0x003001), RUNE_C(0x003002), VO_TU}, + {RUNE_C(0x003003), RUNE_C(0x003007), VO_U}, + {RUNE_C(0x003008), RUNE_C(0x003011), VO_TR}, + {RUNE_C(0x003012), RUNE_C(0x003013), VO_U}, + {RUNE_C(0x003014), RUNE_C(0x00301F), VO_TR}, + {RUNE_C(0x003020), RUNE_C(0x00302F), VO_U}, + {RUNE_C(0x003030), RUNE_C(0x003030), VO_TR}, + {RUNE_C(0x003031), RUNE_C(0x003040), VO_U}, + {RUNE_C(0x003041), RUNE_C(0x003041), VO_TU}, + {RUNE_C(0x003042), RUNE_C(0x003042), VO_U}, + {RUNE_C(0x003043), RUNE_C(0x003043), VO_TU}, + {RUNE_C(0x003044), RUNE_C(0x003044), VO_U}, + {RUNE_C(0x003045), RUNE_C(0x003045), VO_TU}, + {RUNE_C(0x003046), RUNE_C(0x003046), VO_U}, + {RUNE_C(0x003047), RUNE_C(0x003047), VO_TU}, + {RUNE_C(0x003048), RUNE_C(0x003048), VO_U}, + {RUNE_C(0x003049), RUNE_C(0x003049), VO_TU}, + {RUNE_C(0x00304A), RUNE_C(0x003062), VO_U}, + {RUNE_C(0x003063), RUNE_C(0x003063), VO_TU}, + {RUNE_C(0x003064), RUNE_C(0x003082), VO_U}, + {RUNE_C(0x003083), RUNE_C(0x003083), VO_TU}, + {RUNE_C(0x003084), RUNE_C(0x003084), VO_U}, + {RUNE_C(0x003085), RUNE_C(0x003085), VO_TU}, + {RUNE_C(0x003086), RUNE_C(0x003086), VO_U}, + {RUNE_C(0x003087), RUNE_C(0x003087), VO_TU}, + {RUNE_C(0x003088), RUNE_C(0x00308D), VO_U}, + {RUNE_C(0x00308E), RUNE_C(0x00308E), VO_TU}, + {RUNE_C(0x00308F), RUNE_C(0x003094), VO_U}, + {RUNE_C(0x003095), RUNE_C(0x003096), VO_TU}, + {RUNE_C(0x003097), RUNE_C(0x00309A), VO_U}, + {RUNE_C(0x00309B), RUNE_C(0x00309C), VO_TU}, + {RUNE_C(0x00309D), RUNE_C(0x00309F), VO_U}, + {RUNE_C(0x0030A0), RUNE_C(0x0030A0), VO_TR}, + {RUNE_C(0x0030A1), RUNE_C(0x0030A1), VO_TU}, + {RUNE_C(0x0030A2), RUNE_C(0x0030A2), VO_U}, + {RUNE_C(0x0030A3), RUNE_C(0x0030A3), VO_TU}, + {RUNE_C(0x0030A4), RUNE_C(0x0030A4), VO_U}, + {RUNE_C(0x0030A5), RUNE_C(0x0030A5), VO_TU}, + {RUNE_C(0x0030A6), RUNE_C(0x0030A6), VO_U}, + {RUNE_C(0x0030A7), RUNE_C(0x0030A7), VO_TU}, + {RUNE_C(0x0030A8), RUNE_C(0x0030A8), VO_U}, + {RUNE_C(0x0030A9), RUNE_C(0x0030A9), VO_TU}, + {RUNE_C(0x0030AA), RUNE_C(0x0030C2), VO_U}, + {RUNE_C(0x0030C3), RUNE_C(0x0030C3), VO_TU}, + {RUNE_C(0x0030C4), RUNE_C(0x0030E2), VO_U}, + {RUNE_C(0x0030E3), RUNE_C(0x0030E3), VO_TU}, + {RUNE_C(0x0030E4), RUNE_C(0x0030E4), VO_U}, + {RUNE_C(0x0030E5), RUNE_C(0x0030E5), VO_TU}, + {RUNE_C(0x0030E6), RUNE_C(0x0030E6), VO_U}, + {RUNE_C(0x0030E7), RUNE_C(0x0030E7), VO_TU}, + {RUNE_C(0x0030E8), RUNE_C(0x0030ED), VO_U}, + {RUNE_C(0x0030EE), RUNE_C(0x0030EE), VO_TU}, + {RUNE_C(0x0030EF), RUNE_C(0x0030F4), VO_U}, + {RUNE_C(0x0030F5), RUNE_C(0x0030F6), VO_TU}, + {RUNE_C(0x0030F7), RUNE_C(0x0030FB), VO_U}, + {RUNE_C(0x0030FC), RUNE_C(0x0030FC), VO_TR}, + {RUNE_C(0x0030FD), RUNE_C(0x003126), VO_U}, + {RUNE_C(0x003127), RUNE_C(0x003127), VO_TU}, + {RUNE_C(0x003128), RUNE_C(0x0031EF), VO_U}, + {RUNE_C(0x0031F0), RUNE_C(0x0031FF), VO_TU}, + {RUNE_C(0x003200), RUNE_C(0x0032FE), VO_U}, + {RUNE_C(0x0032FF), RUNE_C(0x003357), VO_TU}, + {RUNE_C(0x003358), RUNE_C(0x00337A), VO_U}, + {RUNE_C(0x00337B), RUNE_C(0x00337F), VO_TU}, + {RUNE_C(0x003380), RUNE_C(0x00A4CF), VO_U}, + {RUNE_C(0x00A960), RUNE_C(0x00A97F), VO_U}, + {RUNE_C(0x00AC00), RUNE_C(0x00D7FF), VO_U}, + {RUNE_C(0x00E000), RUNE_C(0x00FAFF), VO_U}, + {RUNE_C(0x00FE10), RUNE_C(0x00FE1F), VO_U}, + {RUNE_C(0x00FE30), RUNE_C(0x00FE48), VO_U}, + {RUNE_C(0x00FE50), RUNE_C(0x00FE52), VO_TU}, + {RUNE_C(0x00FE53), RUNE_C(0x00FE57), VO_U}, + {RUNE_C(0x00FE59), RUNE_C(0x00FE5E), VO_TR}, + {RUNE_C(0x00FE5F), RUNE_C(0x00FE62), VO_U}, + {RUNE_C(0x00FE67), RUNE_C(0x00FE6F), VO_U}, + {RUNE_C(0x00FF01), RUNE_C(0x00FF01), VO_TU}, + {RUNE_C(0x00FF02), RUNE_C(0x00FF07), VO_U}, + {RUNE_C(0x00FF08), RUNE_C(0x00FF09), VO_TR}, + {RUNE_C(0x00FF0A), RUNE_C(0x00FF0B), VO_U}, + {RUNE_C(0x00FF0C), RUNE_C(0x00FF0C), VO_TU}, + {RUNE_C(0x00FF0E), RUNE_C(0x00FF0E), VO_TU}, + {RUNE_C(0x00FF0F), RUNE_C(0x00FF19), VO_U}, + {RUNE_C(0x00FF1A), RUNE_C(0x00FF1B), VO_TR}, + {RUNE_C(0x00FF1F), RUNE_C(0x00FF1F), VO_TU}, + {RUNE_C(0x00FF20), RUNE_C(0x00FF3A), VO_U}, + {RUNE_C(0x00FF3B), RUNE_C(0x00FF3B), VO_TR}, + {RUNE_C(0x00FF3C), RUNE_C(0x00FF3C), VO_U}, + {RUNE_C(0x00FF3D), RUNE_C(0x00FF3D), VO_TR}, + {RUNE_C(0x00FF3E), RUNE_C(0x00FF3E), VO_U}, + {RUNE_C(0x00FF3F), RUNE_C(0x00FF3F), VO_TR}, + {RUNE_C(0x00FF40), RUNE_C(0x00FF5A), VO_U}, + {RUNE_C(0x00FF5B), RUNE_C(0x00FF60), VO_TR}, + {RUNE_C(0x00FFE0), RUNE_C(0x00FFE2), VO_U}, + {RUNE_C(0x00FFE3), RUNE_C(0x00FFE3), VO_TR}, + {RUNE_C(0x00FFE4), RUNE_C(0x00FFE7), VO_U}, + {RUNE_C(0x00FFF0), RUNE_C(0x00FFF8), VO_U}, + {RUNE_C(0x00FFFC), RUNE_C(0x00FFFD), VO_U}, + {RUNE_C(0x010980), RUNE_C(0x01099F), VO_U}, + {RUNE_C(0x011580), RUNE_C(0x0115FF), VO_U}, + {RUNE_C(0x011A00), RUNE_C(0x011ABF), VO_U}, + {RUNE_C(0x013000), RUNE_C(0x01345F), VO_U}, + {RUNE_C(0x014400), RUNE_C(0x01467F), VO_U}, + {RUNE_C(0x016FE0), RUNE_C(0x018D7F), VO_U}, + {RUNE_C(0x01AFF0), RUNE_C(0x01B2FF), VO_U}, + {RUNE_C(0x01CF00), RUNE_C(0x01CFCF), VO_U}, + {RUNE_C(0x01D000), RUNE_C(0x01D1FF), VO_U}, + {RUNE_C(0x01D2E0), RUNE_C(0x01D37F), VO_U}, + {RUNE_C(0x01D800), RUNE_C(0x01DAAF), VO_U}, + {RUNE_C(0x01F000), RUNE_C(0x01F1FF), VO_U}, + {RUNE_C(0x01F200), RUNE_C(0x01F201), VO_TU}, + {RUNE_C(0x01F202), RUNE_C(0x01F7FF), VO_U}, + {RUNE_C(0x01F900), RUNE_C(0x01FAFF), VO_U}, + {RUNE_C(0x020000), RUNE_C(0x02FFFD), VO_U}, + {RUNE_C(0x030000), RUNE_C(0x03FFFD), VO_U}, + {RUNE_C(0x0F0000), RUNE_C(0x0FFFFD), VO_U}, + {RUNE_C(0x100000), RUNE_C(0x10FFFD), VO_U}, +}; + +_MLIB_DEFINE_BSEARCH(enum uprop_vo, lookup, VO_R) + +enum uprop_vo +uprop_get_vo(rune ch) +{ + return ch < lengthof(lookup_lat1) ? lookup_lat1[ch] : mlib_lookup(ch); +} -- cgit v1.2.3