aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/unicode/string.h2
-rw-r--r--lib/unicode/string/u8gcnt.c (renamed from lib/unicode/string/u8glen.c)2
-rw-r--r--man/u8len.34
3 files changed, 4 insertions, 4 deletions
diff --git a/include/unicode/string.h b/include/unicode/string.h
index 0cee934..e989380 100644
--- a/include/unicode/string.h
+++ b/include/unicode/string.h
@@ -17,7 +17,7 @@ enum [[clang::flag_enum]] caseflags {
/* clang-format on */
-[[nodiscard]] size_t u8glen(const char8_t *, size_t);
+[[nodiscard]] size_t u8gcnt(const char8_t *, size_t);
size_t u8gnext(struct u8view *, const char8_t **, size_t *);
#define mlib_warn_trunc nodiscard("don’t forget to check for truncation")
diff --git a/lib/unicode/string/u8glen.c b/lib/unicode/string/u8gcnt.c
index 394a62d..81a0f97 100644
--- a/lib/unicode/string/u8glen.c
+++ b/lib/unicode/string/u8gcnt.c
@@ -1,7 +1,7 @@
#include "unicode/string.h"
size_t
-u8glen(const char8_t *s, size_t n)
+u8gcnt(const char8_t *s, size_t n)
{
size_t m = 0;
while (u8gnext(nullptr, &s, &n))
diff --git a/man/u8len.3 b/man/u8len.3
index a2968e7..ad5002f 100644
--- a/man/u8len.3
+++ b/man/u8len.3
@@ -39,7 +39,7 @@ size_t blen = strlen((char *)sv.p);
size_t cplen = u8len(U8_ARGS(sv));
.Ed
.Sh SEE ALSO
-.Xr u8glen 3 ,
+.Xr u8gcnt 3 ,
.Xr U8V 3 ,
.Xr unicode 7 ,
.Xr utf\-8 7
@@ -62,5 +62,5 @@ that spans a single column.
To count user-preceived codepoints
.Pq also known as graphemes ,
you may want to use the
-.Xr u8glen 3
+.Xr u8gcnt 3
function.