libunibreak
8.0
Toggle main menu visibility
Loading...
Searching...
No Matches
src
graphemebreak.h
Go to the documentation of this file.
1
/*
2
* Grapheme breaking in a Unicode sequence. Designed to be used in a
3
* generic text renderer.
4
*
5
* Copyright (C) 2016-2026 Andreas Röver <roever at users dot sf dot net>
6
*
7
* This software is provided 'as-is', without any express or implied
8
* warranty. In no event will the author be held liable for any damages
9
* arising from the use of this software.
10
*
11
* Permission is granted to anyone to use this software for any purpose,
12
* including commercial applications, and to alter it and redistribute
13
* it freely, subject to the following restrictions:
14
*
15
* 1. The origin of this software must not be misrepresented; you must
16
* not claim that you wrote the original software. If you use this
17
* software in a product, an acknowledgement in the product
18
* documentation would be appreciated but is not required.
19
* 2. Altered source versions must be plainly marked as such, and must
20
* not be misrepresented as being the original software.
21
* 3. This notice may not be removed or altered from any source
22
* distribution.
23
*
24
* The main reference is Unicode Standard Annex 29 (UAX #29):
25
* <URL:http://unicode.org/reports/tr29>
26
*
27
* When this library was designed, this annex was at Revision 29, for
28
* Unicode 9.0.0:
29
* <URL:http://www.unicode.org/reports/tr29/tr29-29.html>
30
*
31
* This library has been updated according to Revision 47, for
32
* Unicode 17.0.0:
33
* <URL:https://www.unicode.org/reports/tr29/tr29-47.html>
34
*
35
* The Unicode Terms of Use are available at
36
* <URL:http://www.unicode.org/copyright.html>
37
*/
38
46
47
#ifndef GRAPHEMEBREAK_H
48
#define GRAPHEMEBREAK_H
49
50
#include <stddef.h>
51
#include "
unibreakbase.h
"
52
53
#ifdef __cplusplus
54
extern
"C"
{
55
#endif
56
57
#define GRAPHEMEBREAK_BREAK 0
58
#define GRAPHEMEBREAK_NOBREAK 1
59
#define GRAPHEMEBREAK_INSIDEACHAR 2
60
61
void
init_graphemebreak
(
void
);
62
void
set_graphemebreaks_utf8
(
const
utf8_t
*s,
size_t
len,
const
char
*lang,
63
char
*brks);
64
void
set_graphemebreaks_utf16
(
const
utf16_t
*s,
size_t
len,
65
const
char
*lang,
char
*brks);
66
void
set_graphemebreaks_utf32
(
const
utf32_t
*s,
size_t
len,
67
const
char
*lang,
char
*brks);
68
69
#ifdef __cplusplus
70
}
71
#endif
72
73
#endif
/* GRAPHEMEBREAK_H */
set_graphemebreaks_utf32
void set_graphemebreaks_utf32(const utf32_t *s, size_t len, const char *lang, char *brks)
Sets the grapheme breaking information for a UTF-32 input string.
Definition
graphemebreak.c:369
set_graphemebreaks_utf16
void set_graphemebreaks_utf16(const utf16_t *s, size_t len, const char *lang, char *brks)
Sets the grapheme breaking information for a UTF-16 input string.
Definition
graphemebreak.c:348
init_graphemebreak
void init_graphemebreak(void)
Initializes the wordbreak internals.
Definition
graphemebreak.c:77
set_graphemebreaks_utf8
void set_graphemebreaks_utf8(const utf8_t *s, size_t len, const char *lang, char *brks)
Sets the grapheme breaking information for a UTF-8 input string.
Definition
graphemebreak.c:327
unibreakbase.h
Header file for common definitions in the libunibreak library.
utf16_t
unsigned short utf16_t
Type for UTF-16 data points.
Definition
unibreakbase.h:48
utf32_t
unsigned int utf32_t
Type for UTF-32 data points.
Definition
unibreakbase.h:49
utf8_t
unsigned char utf8_t
Type for UTF-8 data points.
Definition
unibreakbase.h:47
Generated by
1.18.0