1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Word breaks in Unicode strings.
3    Copyright (C) 2001-2003, 2005-2018 Free Software Foundation, Inc.
4    Written by Bruno Haible <bruno@clisp.org>, 2009.
5 
6    This program is free software: you can redistribute it and/or
7    modify it under the terms of either:
8 
9      * the GNU Lesser General Public License as published by the Free
10        Software Foundation; either version 3 of the License, or (at your
11        option) any later version.
12 
13    or
14 
15      * the GNU General Public License as published by the Free
16        Software Foundation; either version 2 of the License, or (at your
17        option) any later version.
18 
19    or both in parallel, as here.
20    This program is distributed in the hope that it will be useful,
21    but WITHOUT ANY WARRANTY; without even the implied warranty of
22    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23    Lesser General Public License for more details.
24 
25    You should have received a copy of the GNU Lesser General Public License
26    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
27 
28 #ifndef _UNIWBRK_H
29 #define _UNIWBRK_H
30 
31 /* Get size_t.  */
32 #include <stddef.h>
33 
34 #include "unitypes.h"
35 
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /* ========================================================================= */
42 
43 /* Property defined in Unicode Standard Annex #29, section "Word Boundaries"
44    <http://www.unicode.org/reports/tr29/#Word_Boundaries>  */
45 
46 /* Possible values of the Word_Break property.
47    This enumeration may be extended in the future.  */
48 enum
49 {
50   WBP_OTHER        = 0,
51   WBP_CR           = 11,
52   WBP_LF           = 12,
53   WBP_NEWLINE      = 10,
54   WBP_EXTEND       = 8,
55   WBP_FORMAT       = 9,
56   WBP_KATAKANA     = 1,
57   WBP_ALETTER      = 2,
58   WBP_MIDNUMLET    = 3,
59   WBP_MIDLETTER    = 4,
60   WBP_MIDNUM       = 5,
61   WBP_NUMERIC      = 6,
62   WBP_EXTENDNUMLET = 7,
63   WBP_RI           = 13,
64   WBP_DQ           = 14,
65   WBP_SQ           = 15,
66   WBP_HL           = 16,
67   WBP_ZWJ          = 17,
68   WBP_EB           = 18,
69   WBP_EM           = 19,
70   WBP_GAZ          = 20,
71   WBP_EBG          = 21
72 };
73 
74 /* Return the Word_Break property of a Unicode character.  */
75 extern int
76        uc_wordbreak_property (ucs4_t uc)
77        _UC_ATTRIBUTE_CONST;
78 
79 /* ========================================================================= */
80 
81 /* Word breaks.  */
82 
83 /* Determine the word break points in S, and store the result at p[0..n-1].
84    p[i] = 1 means that there is a word boundary between s[i-1] and s[i].
85    p[i] = 0 means that s[i-1] and s[i] must not be separated.
86  */
87 extern void
88        u8_wordbreaks (const uint8_t *s, size_t n, char *p);
89 extern void
90        u16_wordbreaks (const uint16_t *s, size_t n, char *p);
91 extern void
92        u32_wordbreaks (const uint32_t *s, size_t n, char *p);
93 extern void
94        ulc_wordbreaks (const char *s, size_t n, char *p);
95 
96 /* ========================================================================= */
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 
103 #endif /* _UNIWBRK_H */
104