summaryrefslogtreecommitdiff
path: root/zap/source/any/str/utf8declen.c
diff options
context:
space:
mode:
Diffstat (limited to 'zap/source/any/str/utf8declen.c')
-rw-r--r--zap/source/any/str/utf8declen.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/zap/source/any/str/utf8declen.c b/zap/source/any/str/utf8declen.c
deleted file mode 100644
index f8b7ae8..0000000
--- a/zap/source/any/str/utf8declen.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Copyright 2022-2023 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/str.h>
-
-zap_sz zap_utf8declen(zap_i8 const * buf) {
- zap_sz len = 0x0u;
- for (;;++len) {
- zap_i8 const oct = *buf;
- if (oct == 0x0u) break;
- if (oct >= 0xF0u) {
- buf += 0x4u;
- continue;
- }
- if (oct >= 0xE0u) {
- buf += 0x3u;
- continue;
- }
- if (oct >= 0xC0u) {
- buf += 0x2u;
- continue;
- }
- ++buf;
- }
- return len;
-}