Blame lib/uniwidth.in.h

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