Blame lib/uniwidth.in.h

Packit 33f14e
/* Display width functions.
Packit 33f14e
   Copyright (C) 2001-2002, 2005, 2007, 2009-2017 Free Software Foundation,
Packit 33f14e
   Inc.
Packit 33f14e
Packit 33f14e
   This program is free software: you can redistribute it and/or modify it
Packit 33f14e
   under the terms of the GNU General Public License as published
Packit 33f14e
   by the Free Software Foundation; either version 3 of the License, or
Packit 33f14e
   (at your option) any later version.
Packit 33f14e
Packit 33f14e
   This program is distributed in the hope that it will be useful,
Packit 33f14e
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 33f14e
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 33f14e
   General Public License for more details.
Packit 33f14e
Packit 33f14e
   You should have received a copy of the GNU General Public License
Packit 33f14e
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 33f14e
Packit 33f14e
#ifndef _UNIWIDTH_H
Packit 33f14e
#define _UNIWIDTH_H
Packit 33f14e
Packit 33f14e
#include "unitypes.h"
Packit 33f14e
Packit 33f14e
/* Get size_t.  */
Packit 33f14e
#include <stddef.h>
Packit 33f14e
Packit 33f14e
/* Get locale_charset() declaration.  */
Packit 33f14e
#include "localcharset.h"
Packit 33f14e
Packit 33f14e
#ifdef __cplusplus
Packit 33f14e
extern "C" {
Packit 33f14e
#endif
Packit 33f14e
Packit 33f14e
Packit 33f14e
/* Display width.  */
Packit 33f14e
Packit 33f14e
/* These functions are locale dependent.  The encoding argument identifies
Packit 33f14e
   the encoding (e.g. "ISO-8859-2" for Polish).  */
Packit 33f14e
Packit 33f14e
/* Determine number of column positions required for UC.  */
Packit 33f14e
extern int
Packit 33f14e
       uc_width (ucs4_t uc, const char *encoding)
Packit 33f14e
       _UC_ATTRIBUTE_PURE;
Packit 33f14e
Packit 33f14e
/* Determine number of column positions required for first N units
Packit 33f14e
   (or fewer if S ends before this) in S.  */
Packit 33f14e
extern int
Packit 33f14e
       u8_width (const uint8_t *s, size_t n, const char *encoding)
Packit 33f14e
       _UC_ATTRIBUTE_PURE;
Packit 33f14e
extern int
Packit 33f14e
       u16_width (const uint16_t *s, size_t n, const char *encoding)
Packit 33f14e
       _UC_ATTRIBUTE_PURE;
Packit 33f14e
extern int
Packit 33f14e
       u32_width (const uint32_t *s, size_t n, const char *encoding)
Packit 33f14e
       _UC_ATTRIBUTE_PURE;
Packit 33f14e
Packit 33f14e
/* Determine number of column positions required for S.  */
Packit 33f14e
extern int
Packit 33f14e
       u8_strwidth (const uint8_t *s, const char *encoding)
Packit 33f14e
       _UC_ATTRIBUTE_PURE;
Packit 33f14e
extern int
Packit 33f14e
       u16_strwidth (const uint16_t *s, const char *encoding)
Packit 33f14e
       _UC_ATTRIBUTE_PURE;
Packit 33f14e
extern int
Packit 33f14e
       u32_strwidth (const uint32_t *s, const char *encoding)
Packit 33f14e
       _UC_ATTRIBUTE_PURE;
Packit 33f14e
Packit 33f14e
Packit 33f14e
#ifdef __cplusplus
Packit 33f14e
}
Packit 33f14e
#endif
Packit 33f14e
Packit 33f14e
#endif /* _UNIWIDTH_H */