1 /* Display width functions.
2 Copyright (C) 2001-2002, 2005, 2007 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published
6 by the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
27 /* Get locale_charset() declaration. */
28 #include "localcharset.h"
37 /* These functions are locale dependent. The encoding argument identifies
38 the encoding (e.g. "ISO-8859-2" for Polish). */
40 /* Determine number of column positions required for UC. */
42 uc_width (ucs4_t uc, const char *encoding);
44 /* Determine number of column positions required for first N units
45 (or fewer if S ends before this) in S. */
47 u8_width (const uint8_t *s, size_t n, const char *encoding);
49 u16_width (const uint16_t *s, size_t n, const char *encoding);
51 u32_width (const uint32_t *s, size_t n, const char *encoding);
53 /* Determine number of column positions required for S. */
55 u8_strwidth (const uint8_t *s, const char *encoding);
57 u16_strwidth (const uint16_t *s, const char *encoding);
59 u32_strwidth (const uint32_t *s, const char *encoding);
66 #endif /* _UNIWIDTH_H */