]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - iconvdata/cns11643.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / iconvdata / cns11643.h
index 2e50a1f77cfa495afd8e6c530b864d77fda3cb19..892e3f7b04fba4ccc1a3f3541267b39944daa1e7 100644 (file)
@@ -1,22 +1,21 @@
 /* Access functions for CNS 11643 handling.
-   Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1998-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <stdint.h>
 
@@ -40,7 +39,8 @@ extern const uint32_t __cns11643l15_to_ucs4_tab[];
 
 
 static inline uint32_t
-cns11643_to_ucs4 (const char **s, size_t avail, unsigned char offset)
+__attribute ((always_inline))
+cns11643_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)
 {
   unsigned char ch = *(*s);
   unsigned char ch2;
@@ -136,10 +136,12 @@ extern const char __cns11643l1_from_ucs4_tab13[][2];
 extern const char __cns11643l1_from_ucs4_tab14[][2];
 extern const char __cns11643_from_ucs4p0_tab[][3];
 extern const char __cns11643_from_ucs4p2_tab[][3];
+extern const char __cns11643_from_ucs4p2c_tab[][3];
 
 
 static inline size_t
-ucs4_to_cns11643 (uint32_t wch, char *s, size_t avail)
+__attribute ((always_inline))
+ucs4_to_cns11643 (uint32_t wch, unsigned char *s, size_t avail)
 {
   unsigned int ch = (unsigned int) wch;
   char buf[2];
@@ -225,6 +227,10 @@ ucs4_to_cns11643 (uint32_t wch, char *s, size_t avail)
       needed = 3;
       cp = __cns11643_from_ucs4p0_tab[ch - 0x3400];
       break;
+    case 0xfa28:
+      needed = 3;
+      cp = "\x0f\x58\x4c";
+      break;
     case 0xfe30 ... 0xfe6b:
       cp = __cns11643l1_from_ucs4_tab13[ch - 0xfe30];
       break;
@@ -244,6 +250,10 @@ ucs4_to_cns11643 (uint32_t wch, char *s, size_t avail)
       needed = 3;
       cp = __cns11643_from_ucs4p2_tab[ch - 0x20000];
       break;
+    case 0x2f800 ... 0x2fa1d:
+      needed = 3;
+      cp = __cns11643_from_ucs4p2c_tab[ch - 0x2f800];
+      break;
     default:
       return __UNKNOWN_10646_CHAR;
     }