?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. /*-------------------------------------------------------------------------
  2.    uchar.h: Unicode utilities  (ISO C 11 7.28)
  3.  
  4.    Copyright (C) 2015-2016, Philipp Klaus Krause, pkk@spth.de
  5.  
  6.    This library is free software; you can redistribute it and/or modify it
  7.    under the terms of the GNU General Public License as published by the
  8.    Free Software Foundation; either version 2, or (at your option) any
  9.    later version.
  10.  
  11.    This library 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
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this library; see the file COPYING. If not, write to the
  18.    Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
  19.    MA 02110-1301, USA.
  20.  
  21.    As a special exception, if you link this library with other files,
  22.    some of which are compiled with SDCC, to produce an executable,
  23.    this library does not by itself cause the resulting executable to
  24.    be covered by the GNU General Public License. This exception does
  25.    not however invalidate any other reasons why the executable file
  26.    might be covered by the GNU General Public License.
  27. -------------------------------------------------------------------------*/
  28.  
  29. #ifndef __SDCC_UCHAR_H
  30. #define __SDCC_UCHAR_H 1
  31.  
  32. #ifndef __MBSTATE_T_DEFINED
  33. #define __MBSTATE_T_DEFINED
  34.   typedef struct {unsigned char c[3];} mbstate_t;
  35. #endif
  36.  
  37. #ifndef __SIZE_T_DEFINED
  38. #define __SIZE_T_DEFINED
  39.   typedef unsigned int size_t;
  40. #endif
  41.  
  42. #ifndef __CHAR16_T_DEFINED
  43. #define __CHAR16_T_DEFINED
  44.   typedef unsigned int char16_t;
  45. #endif
  46.  
  47. #ifndef __CHAR32_T_DEFINED
  48. #define __CHAR32_T_DEFINED
  49.   typedef unsigned long int char32_t;
  50. #endif
  51.  
  52. size_t mbrtoc16(char16_t *restrict pc16, const char *restrict s, size_t n, mbstate_t *restrict ps);
  53. size_t c16rtomb(char *restrict s, char16_t c16, mbstate_t *restrict ps);
  54. size_t mbrtoc32(char32_t *restrict pc32, const char *restrict s, size_t n, mbstate_t *restrict ps);
  55. size_t c32rtomb(char *restrict s, char32_t c32, mbstate_t *restrict ps);
  56.  
  57. size_t __mbstoc16s(char16_t *restrict c16s, const char *restrict s, size_t n);
  58. size_t __c16stombs(char *restrict s, const char16_t *restrict c16s, size_t n);
  59.  
  60. #endif
  61.  
  62.