summaryrefslogtreecommitdiff
path: root/zap/src/mem/utf8declen.c
diff options
context:
space:
mode:
Diffstat (limited to 'zap/src/mem/utf8declen.c')
-rw-r--r--zap/src/mem/utf8declen.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/zap/src/mem/utf8declen.c b/zap/src/mem/utf8declen.c
deleted file mode 100644
index 85062b9..0000000
--- a/zap/src/mem/utf8declen.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Copyright 2022 Gabriel Jensen.
- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
- If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
-*/
-
-#include <zap/priv.h>
-
-#include <zap/mem.h>
-
-#include <stddef.h>
-
-zap_sz zap_utf8declen(zap_chr8 const * const _in) {
- zap_sz len = 0x0u;
- zap_chr8 const * in;
- for (in = _in;;++len) {
- zap_chr8 const oct = *in;
- if (oct == 0x0u) {break;}
- if (oct >= 0xF0u) {
- in += 0x4u;
- continue;
- }
- if (oct >= 0xE0u) {
- in += 0x3u;
- continue;
- }
- if (oct >= 0xC0u) {
- in += 0x2u;
- continue;
- }
- ++in;
- continue;
- }
- return len;
-}