From ce05175372a9ddca1a225db0765ace1127a39293 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 12 Nov 2021 09:22:01 -0800 Subject: chore: simplified organizational structure --- sys/cmd/term/util.c | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 sys/cmd/term/util.c (limited to 'sys/cmd/term/util.c') diff --git a/sys/cmd/term/util.c b/sys/cmd/term/util.c deleted file mode 100644 index 3e7d81b..0000000 --- a/sys/cmd/term/util.c +++ /dev/null @@ -1,30 +0,0 @@ -#include - -static const uchar table[] = { -#include "nonspacing.h" -}; - -static const uchar wtable[] = { -#include "wide.h" -}; - -int -wcwidth(wchar_t wc) -{ - if (wc < 0xffU) - return (wc+1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0; - if ((wc & 0xfffeffffU) < 0xfffe) { - if ((table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1) - return 0; - if ((wtable[wtable[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1) - return 2; - return 1; - } - if ((wc & 0xfffe) == 0xfffe) - return -1; - if (wc-0x20000U < 0x20000) - return 2; - if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100U < 0xef) - return 0; - return 1; -} -- cgit v1.2.1