From 79e6af86ca526d5fb56af6f6ca3da713e3a5e9f9 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 13 Feb 2024 13:02:28 +0100 Subject: Genesis commit --- vendor/librune/lib/mbstring/u8rlen.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vendor/librune/lib/mbstring/u8rlen.c (limited to 'vendor/librune/lib/mbstring/u8rlen.c') diff --git a/vendor/librune/lib/mbstring/u8rlen.c b/vendor/librune/lib/mbstring/u8rlen.c new file mode 100644 index 0000000..ac579c7 --- /dev/null +++ b/vendor/librune/lib/mbstring/u8rlen.c @@ -0,0 +1,20 @@ +#include + +#include "mbstring.h" + +#include "internal/common.h" + +int +u8rlen(const char8_t *s) +{ + if (U1(*s)) + return 1; + else if (U2(*s)) + return 2; + else if (U3(*s)) + return 3; + else if (U4(*s)) + return 4; + + unreachable(); +} -- cgit v1.2.3