Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-05-18 08:30:28

0001 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
0002 /* Line breaking of Unicode strings.
0003    Copyright (C) 2001-2003, 2005-2022 Free Software Foundation, Inc.
0004    Written by Bruno Haible <bruno@clisp.org>, 2001.
0005 
0006    This file is free software.
0007    It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
0008    You can redistribute it and/or modify it under either
0009      - the terms of the GNU Lesser General Public License as published
0010        by the Free Software Foundation, either version 3, or (at your
0011        option) any later version, or
0012      - the terms of the GNU General Public License as published by the
0013        Free Software Foundation; either version 2, or (at your option)
0014        any later version, or
0015      - the same dual license "the GNU LGPLv3+ or the GNU GPLv2+".
0016 
0017    This file is distributed in the hope that it will be useful,
0018    but WITHOUT ANY WARRANTY; without even the implied warranty of
0019    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0020    Lesser General Public License and the GNU General Public License
0021    for more details.
0022 
0023    You should have received a copy of the GNU Lesser General Public
0024    License and of the GNU General Public License along with this
0025    program.  If not, see <https://www.gnu.org/licenses/>.  */
0026 
0027 #ifndef _UNILBRK_H
0028 #define _UNILBRK_H
0029 
0030 /* Get size_t.  */
0031 #include <stddef.h>
0032 
0033 #include "unitypes.h"
0034 
0035 /* Get locale_charset() declaration.  */
0036 #include <unistring/localcharset.h>
0037 
0038 
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042 
0043 
0044 /* These functions are locale dependent.  The encoding argument identifies
0045    the encoding (e.g. "ISO-8859-2" for Polish).  */
0046 
0047 
0048 /* Line breaking.  */
0049 
0050 enum
0051 {
0052   UC_BREAK_UNDEFINED,
0053   UC_BREAK_PROHIBITED,
0054   UC_BREAK_POSSIBLE,
0055   UC_BREAK_MANDATORY,
0056   UC_BREAK_HYPHENATION,
0057   UC_BREAK_CR_BEFORE_LF /* only used in _v2 or later */
0058 };
0059 
0060 /* Determine the line break points in S, and store the result at p[0..n-1].
0061    p[i] = UC_BREAK_MANDATORY means that s[i] is a line break character.
0062    p[i] = UC_BREAK_CR_BEFORE_LF means that s[i] and s[i+1] is the CR-LF
0063           character sequence.  (Only used in _v2 or later.)
0064    p[i] = UC_BREAK_POSSIBLE means that a line break may be inserted between
0065           s[i-1] and s[i].
0066    p[i] = UC_BREAK_HYPHENATION means that a hyphen and a line break may be
0067           inserted between s[i-1] and s[i].  But beware of language dependent
0068           hyphenation rules.
0069    p[i] = UC_BREAK_PROHIBITED means that s[i-1] and s[i] must not be separated.
0070  */
0071 extern void
0072        u8_possible_linebreaks (const uint8_t *s, size_t n,
0073                                const char *encoding, char *_UC_RESTRICT p);
0074 extern void
0075        u8_possible_linebreaks_v2 (const uint8_t *s, size_t n,
0076                                   const char *encoding, char *_UC_RESTRICT p);
0077 #define u8_possible_linebreaks u8_possible_linebreaks_v2
0078 
0079 extern void
0080        u16_possible_linebreaks (const uint16_t *s, size_t n,
0081                                 const char *encoding, char *_UC_RESTRICT p);
0082 extern void
0083        u16_possible_linebreaks_v2 (const uint16_t *s, size_t n,
0084                                    const char *encoding, char *_UC_RESTRICT p);
0085 #define u16_possible_linebreaks u16_possible_linebreaks_v2
0086 
0087 extern void
0088        u32_possible_linebreaks (const uint32_t *s, size_t n,
0089                                 const char *encoding, char *_UC_RESTRICT p);
0090 extern void
0091        u32_possible_linebreaks_v2 (const uint32_t *s, size_t n,
0092                                    const char *encoding, char *_UC_RESTRICT p);
0093 #define u32_possible_linebreaks u32_possible_linebreaks_v2
0094 
0095 extern void
0096        ulc_possible_linebreaks (const char *s, size_t n,
0097                                 const char *encoding, char *_UC_RESTRICT p);
0098 extern void
0099        ulc_possible_linebreaks_v2 (const char *s, size_t n,
0100                                    const char *encoding, char *_UC_RESTRICT p);
0101 #define ulc_possible_linebreaks ulc_possible_linebreaks_v2
0102 
0103 /* Choose the best line breaks, assuming the uc_width function.
0104    The string is s[0..n-1].  The maximum number of columns per line is given
0105    as WIDTH.  The starting column of the string is given as START_COLUMN.
0106    If the algorithm shall keep room after the last piece, they can be given
0107    as AT_END_COLUMNS.
0108    o is an optional override; if o[i] != UC_BREAK_UNDEFINED, o[i] takes
0109    precedence over p[i] as returned by the *_possible_linebreaks function.
0110    The given ENCODING is used for disambiguating widths in uc_width.
0111    Return the column after the end of the string, and store the result at
0112    p[0..n-1].
0113  */
0114 extern int
0115        u8_width_linebreaks (const uint8_t *s, size_t n, int width,
0116                             int start_column, int at_end_columns,
0117                             const char *o, const char *encoding,
0118                             char *_UC_RESTRICT p);
0119 extern int
0120        u8_width_linebreaks_v2 (const uint8_t *s, size_t n, int width,
0121                                int start_column, int at_end_columns,
0122                                const char *o, const char *encoding,
0123                                char *_UC_RESTRICT p);
0124 #define u8_width_linebreaks u8_width_linebreaks_v2
0125 
0126 extern int
0127        u16_width_linebreaks (const uint16_t *s, size_t n, int width,
0128                              int start_column, int at_end_columns,
0129                              const char *o, const char *encoding,
0130                              char *_UC_RESTRICT p);
0131 extern int
0132        u16_width_linebreaks_v2 (const uint16_t *s, size_t n, int width,
0133                                 int start_column, int at_end_columns,
0134                                 const char *o, const char *encoding,
0135                                 char *_UC_RESTRICT p);
0136 #define u16_width_linebreaks u16_width_linebreaks_v2
0137 
0138 extern int
0139        u32_width_linebreaks (const uint32_t *s, size_t n, int width,
0140                              int start_column, int at_end_columns,
0141                              const char *o, const char *encoding,
0142                              char *_UC_RESTRICT p);
0143 extern int
0144        u32_width_linebreaks_v2 (const uint32_t *s, size_t n, int width,
0145                                 int start_column, int at_end_columns,
0146                                 const char *o, const char *encoding,
0147                                 char *_UC_RESTRICT p);
0148 #define u32_width_linebreaks u32_width_linebreaks_v2
0149 
0150 extern int
0151        ulc_width_linebreaks (const char *s, size_t n, int width,
0152                              int start_column, int at_end_columns,
0153                              const char *o, const char *encoding,
0154                              char *_UC_RESTRICT p);
0155 extern int
0156        ulc_width_linebreaks_v2 (const char *s, size_t n, int width,
0157                                 int start_column, int at_end_columns,
0158                                 const char *o, const char *encoding,
0159                                 char *_UC_RESTRICT p);
0160 #define ulc_width_linebreaks ulc_width_linebreaks_v2
0161 
0162 
0163 #ifdef __cplusplus
0164 }
0165 #endif
0166 
0167 
0168 #endif /* _UNILBRK_H */