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