1// C wrapper of the utf8proc library
2
3#pragma once
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9//! Returns whether or not the string is valid UTF8
10int utf8proc_is_valid(const char *s, size_t len);
11
12//! Returns the position (in bytes) of the next grapheme cluster
13size_t utf8proc_next_grapheme_cluster(const char *s, size_t len, size_t pos);
14
15//! Returns the position (in bytes) of the previous grapheme cluster
16size_t utf8proc_prev_grapheme_cluster(const char *s, size_t len, size_t pos);
17
18//! Returns the render width [0, 1 or 2] of the grapheme cluster as the specified position
19size_t utf8proc_render_width(const char *s, size_t len, size_t pos);
20
21#ifdef __cplusplus
22};
23#endif
24