From e9a910b33c7837b4b868e3abda18eb4810df7f02 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 4 Oct 2025 09:14:33 +0100 Subject: config/git: import suckless sbase i currently use the output of sha512sum in several places of xbmk, which is a bit unreliable in case output changes. other cases where i use util outputs in variables are probably reliable, because i'm using mostly posix utilities in those. to mitigate this, i now import suckless sbase, which has a reasonable sha512sum implementation. *every* binary it builds is being placed in build.list, because i'll probably start using more of them. for example, i may start modifying the "date" implementation, adding the GNU-specific options that i need as mentioned on init.sh i'm importing it in util/ because the sha512sum util is needed for verifying project sources, so if sbase itself is a "project source", that means we can into a chicken and egg bootstrapping problem. this is sbase at revision: 055cc1ae1b3a13c3d8f25af0a4a3316590efcd48 Signed-off-by: Leah Rowe --- util/sbase/libutf/isdigitrune.c | 80 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 util/sbase/libutf/isdigitrune.c (limited to 'util/sbase/libutf/isdigitrune.c') diff --git a/util/sbase/libutf/isdigitrune.c b/util/sbase/libutf/isdigitrune.c new file mode 100644 index 00000000..c8901bc4 --- /dev/null +++ b/util/sbase/libutf/isdigitrune.c @@ -0,0 +1,80 @@ +/* Automatically generated by mkrunetype.awk */ +#include + +#include "../utf.h" +#include "runetype.h" + +static const Rune digit2[][2] = { + { 0x0030, 0x0039 }, + { 0x0660, 0x0669 }, + { 0x06F0, 0x06F9 }, + { 0x07C0, 0x07C9 }, + { 0x0966, 0x096F }, + { 0x09E6, 0x09EF }, + { 0x0A66, 0x0A6F }, + { 0x0AE6, 0x0AEF }, + { 0x0B66, 0x0B6F }, + { 0x0BE6, 0x0BEF }, + { 0x0C66, 0x0C6F }, + { 0x0CE6, 0x0CEF }, + { 0x0D66, 0x0D6F }, + { 0x0DE6, 0x0DEF }, + { 0x0E50, 0x0E59 }, + { 0x0ED0, 0x0ED9 }, + { 0x0F20, 0x0F29 }, + { 0x1040, 0x1049 }, + { 0x1090, 0x1099 }, + { 0x17E0, 0x17E9 }, + { 0x1810, 0x1819 }, + { 0x1946, 0x194F }, + { 0x19D0, 0x19D9 }, + { 0x1A80, 0x1A89 }, + { 0x1A90, 0x1A99 }, + { 0x1B50, 0x1B59 }, + { 0x1BB0, 0x1BB9 }, + { 0x1C40, 0x1C49 }, + { 0x1C50, 0x1C59 }, + { 0xA620, 0xA629 }, + { 0xA8D0, 0xA8D9 }, + { 0xA900, 0xA909 }, + { 0xA9D0, 0xA9D9 }, + { 0xA9F0, 0xA9F9 }, + { 0xAA50, 0xAA59 }, + { 0xABF0, 0xABF9 }, + { 0xFF10, 0xFF19 }, + { 0x104A0, 0x104A9 }, + { 0x10D30, 0x10D39 }, + { 0x11066, 0x1106F }, + { 0x110F0, 0x110F9 }, + { 0x11136, 0x1113F }, + { 0x111D0, 0x111D9 }, + { 0x112F0, 0x112F9 }, + { 0x11450, 0x11459 }, + { 0x114D0, 0x114D9 }, + { 0x11650, 0x11659 }, + { 0x116C0, 0x116C9 }, + { 0x11730, 0x11739 }, + { 0x118E0, 0x118E9 }, + { 0x11950, 0x11959 }, + { 0x11C50, 0x11C59 }, + { 0x11D50, 0x11D59 }, + { 0x11DA0, 0x11DA9 }, + { 0x11F50, 0x11F59 }, + { 0x16A60, 0x16A69 }, + { 0x16AC0, 0x16AC9 }, + { 0x16B50, 0x16B59 }, + { 0x1D7CE, 0x1D7FF }, + { 0x1E140, 0x1E149 }, + { 0x1E2F0, 0x1E2F9 }, + { 0x1E4F0, 0x1E4F9 }, + { 0x1E950, 0x1E959 }, + { 0x1FBF0, 0x1FBF9 }, +}; + +int +isdigitrune(Rune r) +{ + if(bsearch(&r, digit2, nelem(digit2), sizeof *digit2, &rune2cmp)) + return 1; + return 0; +} -- cgit v1.2.1