aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/man/u8gnext.3
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-21 03:03:58 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-21 03:03:58 +0100
commit4f93f935dc7a981ca073a322425c3f5929ffb644 (patch)
tree4460586408ec7fdfcecf3ba4584f0435067125a6 /vendor/librune/man/u8gnext.3
parent72ea25a4d73e3e026366d4165f5bc4ec9e7418cb (diff)
Support line- & column-based match locations
Diffstat (limited to 'vendor/librune/man/u8gnext.3')
-rw-r--r--vendor/librune/man/u8gnext.372
1 files changed, 72 insertions, 0 deletions
diff --git a/vendor/librune/man/u8gnext.3 b/vendor/librune/man/u8gnext.3
new file mode 100644
index 0000000..0053aa5
--- /dev/null
+++ b/vendor/librune/man/u8gnext.3
@@ -0,0 +1,72 @@
+.Dd January 18 2024
+.Dt U8GNEXT 3
+.Os
+.Sh NAME
+.Nm u8gnext ,
+.Nd iterate over Unicode codepoints
+.Sh LIBRARY
+.Lb librune
+.Sh SYNOPSIS
+.In gbrk.h
+.Ft "const char8_t *"
+.Fn u8gnext "struct u8view *v" "const char8_t **s" "size_t *n"
+.Sh DESCRIPTION
+The
+.Fn u8gnext
+function stores a view of the first grapheme in the buffer
+.Fa s
+of length
+.Fa n
+in the structure pointed to by
+.Fa v .
+It then updates
+.Fa s
+to point to the next grapheme in the buffer and also updates
+.Fa n
+accordingly.
+.Pp
+The
+.Vt "struct u8view"
+type is described in the
+.Xr u8view 3
+manual.
+.Sh RETURN VALUES
+The
+.Fn u8gnext
+function returns the updated value of
+.Fa s
+or
+.Dv NULL
+at the end of iteration.
+.Sh EXAMPLES
+The following calls to
+.Fn u8gnext
+iterate over and print all the graphemes in
+.Va s .
+.Bd -literal -offset indent
+#define STRING u8"नमस्कार विश्व"
+
+struct u8view v;
+const char8_t *s = STRING;
+size_t n = sizeof(STRING) - 1;
+
+while (u8gnext(&v, &s, &n))
+ printf("‘%.*s’\en", (int)g.len, g.p);
+.Ed
+.Sh SEE ALSO
+.Xr u8next 3 ,
+.Xr u8view 3 ,
+.Xr unicode 7 ,
+.Xr utf\-8 7
+.Sh STANDARDS
+.Rs
+.%A F. Yergeau
+.%D November 2003
+.%R RFC 3629
+.%T UTF-8, a transformation format of ISO 10646
+.Re
+.Pp
+.Lk https://www.unicode.org/versions/Unicode15.1.0/ \
+"The Unicode\(rg Standard Version 15.1.0"
+.Sh AUTHORS
+.An Thomas Voss Aq Mt mail@thomasvoss.com