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