aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/mbstring/u8rlen.c
blob: ac579c77355d15d2fd1120a20dd3ed83b22b5dec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stddef.h>

#include "mbstring.h"

#include "internal/common.h"

int
u8rlen(const char8_t *s)
{
	if (U1(*s))
		return 1;
	else if (U2(*s))
		return 2;
	else if (U3(*s))
		return 3;
	else if (U4(*s))
		return 4;

	unreachable();
}