From 679f7928e27a95e559eb3a69febf0c6336e40234 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 27 Jan 2024 23:26:42 +0100 Subject: Bump librune --- vendor/librune/man/u8gnext.3 | 11 ++++------- vendor/librune/man/u8next.3 | 24 ++++++++++-------------- vendor/librune/man/u8set.3 | 6 +++--- 3 files changed, 17 insertions(+), 24 deletions(-) (limited to 'vendor/librune/man') diff --git a/vendor/librune/man/u8gnext.3 b/vendor/librune/man/u8gnext.3 index 0053aa5..e50c250 100644 --- a/vendor/librune/man/u8gnext.3 +++ b/vendor/librune/man/u8gnext.3 @@ -1,4 +1,4 @@ -.Dd January 18 2024 +.Dd January 27 2024 .Dt U8GNEXT 3 .Os .Sh NAME @@ -8,7 +8,7 @@ .Lb librune .Sh SYNOPSIS .In gbrk.h -.Ft "const char8_t *" +.Ft size_t .Fn u8gnext "struct u8view *v" "const char8_t **s" "size_t *n" .Sh DESCRIPTION The @@ -33,11 +33,8 @@ manual. .Sh RETURN VALUES The .Fn u8gnext -function returns the updated value of -.Fa s -or -.Dv NULL -at the end of iteration. +function returns the length of the grapheme iterated over in bytes, +or 0 at the end of iteration. .Sh EXAMPLES The following calls to .Fn u8gnext diff --git a/vendor/librune/man/u8next.3 b/vendor/librune/man/u8next.3 index 93a4f5d..eabf2a2 100644 --- a/vendor/librune/man/u8next.3 +++ b/vendor/librune/man/u8next.3 @@ -1,4 +1,4 @@ -.Dd January 18 2024 +.Dd January 27 2024 .Dt U8NEXT 3 .Os .Sh NAME @@ -9,9 +9,9 @@ .Lb librune .Sh SYNOPSIS .In utf8.h -.Ft "const char8_t *" +.Ft int .Fn u8next "rune *ch" "const char8_t **s" "size_t *n" -.Ft "const char8_t *" +.Ft int .Fn u8prev "rune *ch" "const char8_t **s" "const char8_t *start" .Sh DESCRIPTION The @@ -48,11 +48,9 @@ The .Fn u8next and .Fn u8prev -functions return the updated value of -.Fa s -or -.Dv NULL -at the end of iteration. +functions return the length of the UTF-8-encoded rune iterated over in +bytes, +or 0 at the end of iteration. .Sh EXAMPLES The following calls to .Fn u8next @@ -63,14 +61,13 @@ iterate over and print all the codepoints in #define STRING u8"Ta’ Ħaġrat" +int w; rune ch; const char8_t *s = STRING; size_t n = sizeof(STRING) - 1; -while (u8next(&ch, &s, &n)) { - int w = u8wdth(ch); +while (w = u8next(&ch, &s, &n)) printf("U+%04" PRIXRUNE ": ‘%.*s’\en", ch, w, s - w); -} .Ed .Pp The following example is the same as the previous, @@ -82,6 +79,7 @@ function to iterate backwards. #define STRING u8"Ta’ Ħaġrat" +int w; rune ch; const char8_t *s, *start; size_t n = sizeof(STRING) - 1; @@ -89,10 +87,8 @@ size_t n = sizeof(STRING) - 1; start = STRING; s = start + n; -while (u8prev(&ch, &s, start)) { - int w = u8wdth(ch); +while (w = u8prev(&ch, &s, start)) printf("U+%04" PRIXRUNE ": ‘%.*s’\en", ch, w, s); -} .Ed .Sh SEE ALSO .Xr rune 3 , diff --git a/vendor/librune/man/u8set.3 b/vendor/librune/man/u8set.3 index 307f84e..d579b0b 100644 --- a/vendor/librune/man/u8set.3 +++ b/vendor/librune/man/u8set.3 @@ -1,4 +1,4 @@ -.Dd January 18 2024 +.Dd January 27 2024 .Dt U8SET 3 .Os .Sh NAME @@ -10,9 +10,9 @@ .Sh SYNOPSIS .In utf8.h .Ft int -.Fn rtou8 "const char8_t *s" "rune ch" "size_t n" +.Fn rtou8 "char8_t *s" "rune ch" "size_t n" .Ft size_t -.Fn u8set "const char8_t *s" "rune ch" "size_t n" +.Fn u8set "char8_t *s" "rune ch" "size_t n" .Sh DESCRIPTION The .Fn rtou8 -- cgit v1.2.3