1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Line breaking of Unicode strings.
3 Copyright (C) 2001-2003, 2005-2014 Free Software Foundation, Inc.
4 Written by Bruno Haible <bruno@clisp.org>, 2001.
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.
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.
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/>. */
27 /* Get locale_charset() declaration. */
28 #include <unistring/localcharset.h>
36 /* These functions are locale dependent. The encoding argument identifies
37 the encoding (e.g. "ISO-8859-2" for Polish). */
51 /* Determine the line break points in S, and store the result at p[0..n-1].
52 p[i] = UC_BREAK_MANDATORY means that s[i] is a line break character.
53 p[i] = UC_BREAK_POSSIBLE means that a line break may be inserted between
55 p[i] = UC_BREAK_HYPHENATION means that a hyphen and a line break may be
56 inserted between s[i-1] and s[i]. But beware of language dependent
58 p[i] = UC_BREAK_PROHIBITED means that s[i-1] and s[i] must not be separated.
61 u8_possible_linebreaks (const uint8_t *s, size_t n,
62 const char *encoding, char *p);
64 u16_possible_linebreaks (const uint16_t *s, size_t n,
65 const char *encoding, char *p);
67 u32_possible_linebreaks (const uint32_t *s, size_t n,
68 const char *encoding, char *p);
70 ulc_possible_linebreaks (const char *s, size_t n,
71 const char *encoding, char *p);
73 /* Choose the best line breaks, assuming the uc_width function.
74 The string is s[0..n-1]. The maximum number of columns per line is given
75 as WIDTH. The starting column of the string is given as START_COLUMN.
76 If the algorithm shall keep room after the last piece, they can be given
78 o is an optional override; if o[i] != UC_BREAK_UNDEFINED, o[i] takes
79 precedence over p[i] as returned by the *_possible_linebreaks function.
80 The given ENCODING is used for disambiguating widths in uc_width.
81 Return the column after the end of the string, and store the result at
85 u8_width_linebreaks (const uint8_t *s, size_t n, int width,
86 int start_column, int at_end_columns,
87 const char *o, const char *encoding,
90 u16_width_linebreaks (const uint16_t *s, size_t n, int width,
91 int start_column, int at_end_columns,
92 const char *o, const char *encoding,
95 u32_width_linebreaks (const uint32_t *s, size_t n, int width,
96 int start_column, int at_end_columns,
97 const char *o, const char *encoding,
100 ulc_width_linebreaks (const char *s, size_t n, int width,
101 int start_column, int at_end_columns,
102 const char *o, const char *encoding,
111 #endif /* _UNILBRK_H */