resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cm_utf8.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3 #pragma once
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 extern unsigned char const cm_utf8_ones[256];
10
11 /** Decode one UTF-8 character from the input byte range.  On success,
12     stores the unicode character number in *pc and returns the first
13     position not extracted.  On failure, returns 0.  */
14 const char* cm_utf8_decode_character(const char* first, const char* last,
15                                      unsigned int* pc);
16
17 /** Returns whether a C string is a sequence of valid UTF-8 encoded Unicode
18     codepoints.  Returns non-zero on success. */
19 int cm_utf8_is_valid(const char* s);
20
21 #ifdef __cplusplus
22 } /* extern "C" */
23 #endif