aboutsummaryrefslogtreecommitdiff
path: root/lib/mbstring/u8next.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mbstring/u8next.c')
-rw-r--r--lib/mbstring/u8next.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/mbstring/u8next.c b/lib/mbstring/u8next.c
new file mode 100644
index 0000000..82d2ad7
--- /dev/null
+++ b/lib/mbstring/u8next.c
@@ -0,0 +1,16 @@
+#include "mbstring.h"
+
+int
+u8next(rune *ch, const char8_t **s, size_t *n)
+{
+ rune _;
+ int m = 0;
+
+ if (*n) {
+ m = u8tor(ch ? ch : &_, *s);
+ *n -= m;
+ *s += m;
+ }
+
+ return m;
+}