Home | History | Annotate | Line # | Download | only in modules
citrus_utf8.c revision 1.17.2.1
      1  1.17.2.1      yamt /*	$NetBSD: citrus_utf8.c,v 1.17.2.1 2014/05/22 11:36:50 yamt Exp $	*/
      2       1.1  tshiozak 
      3       1.1  tshiozak /*-
      4       1.1  tshiozak  * Copyright (c)2002 Citrus Project,
      5       1.1  tshiozak  * All rights reserved.
      6       1.1  tshiozak  *
      7       1.1  tshiozak  * Redistribution and use in source and binary forms, with or without
      8       1.1  tshiozak  * modification, are permitted provided that the following conditions
      9       1.1  tshiozak  * are met:
     10       1.1  tshiozak  * 1. Redistributions of source code must retain the above copyright
     11       1.1  tshiozak  *    notice, this list of conditions and the following disclaimer.
     12       1.1  tshiozak  * 2. Redistributions in binary form must reproduce the above copyright
     13       1.1  tshiozak  *    notice, this list of conditions and the following disclaimer in the
     14       1.1  tshiozak  *    documentation and/or other materials provided with the distribution.
     15       1.1  tshiozak  *
     16       1.1  tshiozak  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     17       1.1  tshiozak  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     18       1.1  tshiozak  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19       1.1  tshiozak  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     20       1.1  tshiozak  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     21       1.1  tshiozak  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     22       1.1  tshiozak  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23       1.1  tshiozak  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     24       1.1  tshiozak  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25       1.1  tshiozak  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26       1.1  tshiozak  * SUCH DAMAGE.
     27       1.1  tshiozak  */
     28       1.1  tshiozak 
     29       1.1  tshiozak /*-
     30       1.1  tshiozak  * Copyright (c) 1993
     31       1.1  tshiozak  *	The Regents of the University of California.  All rights reserved.
     32       1.1  tshiozak  *
     33       1.1  tshiozak  * This code is derived from software contributed to Berkeley by
     34       1.1  tshiozak  * Paul Borman at Krystal Technologies.
     35       1.1  tshiozak  *
     36       1.1  tshiozak  * Redistribution and use in source and binary forms, with or without
     37       1.1  tshiozak  * modification, are permitted provided that the following conditions
     38       1.1  tshiozak  * are met:
     39       1.1  tshiozak  * 1. Redistributions of source code must retain the above copyright
     40       1.1  tshiozak  *    notice, this list of conditions and the following disclaimer.
     41       1.1  tshiozak  * 2. Redistributions in binary form must reproduce the above copyright
     42       1.1  tshiozak  *    notice, this list of conditions and the following disclaimer in the
     43       1.1  tshiozak  *    documentation and/or other materials provided with the distribution.
     44      1.10       agc  * 3. Neither the name of the University nor the names of its contributors
     45       1.1  tshiozak  *    may be used to endorse or promote products derived from this software
     46       1.1  tshiozak  *    without specific prior written permission.
     47       1.1  tshiozak  *
     48       1.1  tshiozak  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     49       1.1  tshiozak  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     50       1.1  tshiozak  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     51       1.1  tshiozak  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     52       1.1  tshiozak  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     53       1.1  tshiozak  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     54       1.1  tshiozak  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     55       1.1  tshiozak  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     56       1.1  tshiozak  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     57       1.1  tshiozak  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     58       1.1  tshiozak  * SUCH DAMAGE.
     59       1.1  tshiozak  */
     60       1.1  tshiozak 
     61       1.1  tshiozak #include <sys/cdefs.h>
     62       1.1  tshiozak #if defined(LIBC_SCCS) && !defined(lint)
     63  1.17.2.1      yamt __RCSID("$NetBSD: citrus_utf8.c,v 1.17.2.1 2014/05/22 11:36:50 yamt Exp $");
     64       1.1  tshiozak #endif /* LIBC_SCCS and not lint */
     65       1.1  tshiozak 
     66       1.1  tshiozak #include <assert.h>
     67       1.1  tshiozak #include <errno.h>
     68       1.1  tshiozak #include <string.h>
     69       1.1  tshiozak #include <stdio.h>
     70       1.1  tshiozak #include <stdlib.h>
     71       1.1  tshiozak #include <stddef.h>
     72       1.1  tshiozak #include <wchar.h>
     73       1.1  tshiozak #include <sys/types.h>
     74       1.1  tshiozak #include <limits.h>
     75       1.8  tshiozak 
     76       1.8  tshiozak #include "citrus_namespace.h"
     77       1.8  tshiozak #include "citrus_types.h"
     78       1.1  tshiozak #include "citrus_module.h"
     79       1.1  tshiozak #include "citrus_ctype.h"
     80       1.8  tshiozak #include "citrus_stdenc.h"
     81       1.1  tshiozak #include "citrus_utf8.h"
     82       1.1  tshiozak 
     83       1.1  tshiozak 
     84       1.1  tshiozak /* ----------------------------------------------------------------------
     85       1.1  tshiozak  * private stuffs used by templates
     86       1.1  tshiozak  */
     87       1.1  tshiozak 
     88       1.1  tshiozak static int _UTF8_count_array[256];
     89       1.1  tshiozak static int const *_UTF8_count = NULL;
     90       1.1  tshiozak 
     91      1.11      yamt static const u_int32_t _UTF8_range[] = {
     92       1.1  tshiozak 	0,	/*dummy*/
     93       1.1  tshiozak 	0x00000000, 0x00000080, 0x00000800, 0x00010000,
     94       1.1  tshiozak 	0x00200000, 0x04000000, 0x80000000,
     95       1.1  tshiozak };
     96       1.1  tshiozak 
     97       1.1  tshiozak typedef struct {
     98       1.1  tshiozak 	char ch[6];
     99       1.1  tshiozak 	int chlen;
    100       1.1  tshiozak } _UTF8State;
    101       1.1  tshiozak 
    102       1.1  tshiozak typedef struct {
    103       1.1  tshiozak } _UTF8EncodingInfo;
    104       1.8  tshiozak 
    105       1.1  tshiozak typedef struct {
    106       1.1  tshiozak 	_UTF8EncodingInfo	ei;
    107       1.1  tshiozak 	struct {
    108       1.1  tshiozak 		/* for future multi-locale facility */
    109       1.1  tshiozak 		_UTF8State	s_mblen;
    110       1.1  tshiozak 		_UTF8State	s_mbrlen;
    111       1.1  tshiozak 		_UTF8State	s_mbrtowc;
    112       1.1  tshiozak 		_UTF8State	s_mbtowc;
    113       1.1  tshiozak 		_UTF8State	s_mbsrtowcs;
    114  1.17.2.1      yamt 		_UTF8State	s_mbsnrtowcs;
    115       1.1  tshiozak 		_UTF8State	s_wcrtomb;
    116       1.1  tshiozak 		_UTF8State	s_wcsrtombs;
    117  1.17.2.1      yamt 		_UTF8State	s_wcsnrtombs;
    118       1.1  tshiozak 		_UTF8State	s_wctomb;
    119       1.1  tshiozak 	} states;
    120       1.1  tshiozak } _UTF8CTypeInfo;
    121       1.1  tshiozak 
    122       1.1  tshiozak #define _CEI_TO_EI(_cei_)		(&(_cei_)->ei)
    123       1.1  tshiozak #define _CEI_TO_STATE(_ei_, _func_)	(_ei_)->states.s_##_func_
    124       1.1  tshiozak 
    125       1.1  tshiozak #define _FUNCNAME(m)			_citrus_UTF8_##m
    126       1.1  tshiozak #define _ENCODING_INFO			_UTF8EncodingInfo
    127       1.1  tshiozak #define _CTYPE_INFO			_UTF8CTypeInfo
    128       1.1  tshiozak #define _ENCODING_STATE			_UTF8State
    129       1.3      yamt #define _ENCODING_MB_CUR_MAX(_ei_)	6
    130       1.1  tshiozak #define _ENCODING_IS_STATE_DEPENDENT	0
    131       1.5      yamt #define _STATE_NEEDS_EXPLICIT_INIT(_ps_)	0
    132       1.1  tshiozak 
    133       1.1  tshiozak 
    134       1.1  tshiozak static __inline void
    135       1.1  tshiozak _UTF8_init_count(void)
    136       1.1  tshiozak {
    137       1.1  tshiozak 	int i;
    138       1.1  tshiozak 	if (!_UTF8_count) {
    139       1.1  tshiozak 		memset(_UTF8_count_array, 0, sizeof(_UTF8_count_array));
    140       1.1  tshiozak 		for (i = 0; i <= 0x7f; i++)
    141       1.1  tshiozak 			_UTF8_count_array[i] = 1;
    142       1.1  tshiozak 		for (i = 0xc0; i <= 0xdf; i++)
    143       1.1  tshiozak 			_UTF8_count_array[i] = 2;
    144       1.1  tshiozak 		for (i = 0xe0; i <= 0xef; i++)
    145       1.1  tshiozak 			_UTF8_count_array[i] = 3;
    146       1.1  tshiozak 		for (i = 0xf0; i <= 0xf7; i++)
    147       1.1  tshiozak 			_UTF8_count_array[i] = 4;
    148       1.1  tshiozak 		for (i = 0xf8; i <= 0xfb; i++)
    149       1.1  tshiozak 			_UTF8_count_array[i] = 5;
    150       1.1  tshiozak 		for (i = 0xfc; i <= 0xfd; i++)
    151       1.1  tshiozak 			_UTF8_count_array[i] = 6;
    152       1.1  tshiozak 		_UTF8_count = _UTF8_count_array;
    153       1.1  tshiozak 	}
    154       1.1  tshiozak }
    155       1.1  tshiozak 
    156       1.1  tshiozak static int
    157       1.1  tshiozak _UTF8_findlen(wchar_t v)
    158       1.1  tshiozak {
    159       1.1  tshiozak 	int i;
    160       1.1  tshiozak 	u_int32_t c;
    161       1.1  tshiozak 
    162       1.1  tshiozak 	c = (u_int32_t)v;	/*XXX*/
    163      1.15  christos 	for (i = 1; i < sizeof(_UTF8_range) / sizeof(_UTF8_range[0]) - 1; i++)
    164       1.1  tshiozak 		if (c >= _UTF8_range[i] && c < _UTF8_range[i + 1])
    165       1.1  tshiozak 			return i;
    166       1.1  tshiozak 
    167       1.1  tshiozak 	return -1;	/*out of range*/
    168       1.1  tshiozak }
    169       1.1  tshiozak 
    170      1.16   tnozaki static __inline int
    171      1.16   tnozaki _UTF8_surrogate(wchar_t wc)
    172      1.16   tnozaki {
    173      1.16   tnozaki 	return wc >= 0xd800 && wc <= 0xdfff;
    174      1.16   tnozaki }
    175      1.16   tnozaki 
    176       1.1  tshiozak static __inline void
    177       1.1  tshiozak /*ARGSUSED*/
    178       1.1  tshiozak _citrus_UTF8_init_state(_UTF8EncodingInfo *ei, _UTF8State *s)
    179       1.1  tshiozak {
    180      1.16   tnozaki 	s->chlen = 0;
    181       1.1  tshiozak }
    182       1.1  tshiozak 
    183       1.1  tshiozak static __inline void
    184       1.1  tshiozak /*ARGSUSED*/
    185       1.1  tshiozak _citrus_UTF8_pack_state(_UTF8EncodingInfo *ei, void *pspriv,
    186       1.1  tshiozak 			const _UTF8State *s)
    187       1.1  tshiozak {
    188       1.1  tshiozak 	memcpy(pspriv, (const void *)s, sizeof(*s));
    189       1.1  tshiozak }
    190       1.1  tshiozak 
    191       1.1  tshiozak static __inline void
    192       1.1  tshiozak /*ARGSUSED*/
    193       1.1  tshiozak _citrus_UTF8_unpack_state(_UTF8EncodingInfo *ei, _UTF8State *s,
    194       1.1  tshiozak 			  const void *pspriv)
    195       1.1  tshiozak {
    196       1.1  tshiozak 	memcpy((void *)s, pspriv, sizeof(*s));
    197       1.1  tshiozak }
    198       1.1  tshiozak 
    199       1.1  tshiozak static int
    200       1.1  tshiozak _citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s,
    201       1.1  tshiozak 			  size_t n, _UTF8State *psenc, size_t *nresult)
    202       1.1  tshiozak {
    203       1.1  tshiozak 	wchar_t wchar;
    204       1.1  tshiozak 	const char *s0;
    205       1.1  tshiozak 	int c;
    206       1.1  tshiozak 	int i;
    207       1.1  tshiozak 
    208       1.1  tshiozak 	_DIAGASSERT(nresult != 0);
    209       1.1  tshiozak 	_DIAGASSERT(s != NULL);
    210       1.1  tshiozak 	_DIAGASSERT(psenc != NULL);
    211       1.1  tshiozak 
    212       1.2      yamt 	s0 = *s;
    213       1.2      yamt 
    214       1.1  tshiozak 	if (s0 == NULL) {
    215       1.1  tshiozak 		_citrus_UTF8_init_state(ei, psenc);
    216       1.1  tshiozak 		*nresult = 0; /* state independent */
    217      1.16   tnozaki 		return 0;
    218       1.1  tshiozak 	}
    219       1.1  tshiozak 
    220       1.1  tshiozak 	/* make sure we have the first byte in the buffer */
    221      1.16   tnozaki 	if (psenc->chlen == 0) {
    222      1.16   tnozaki 		if (n-- < 1)
    223       1.1  tshiozak 			goto restart;
    224      1.16   tnozaki 		psenc->ch[psenc->chlen++] = *s0++;
    225       1.1  tshiozak 	}
    226       1.1  tshiozak 
    227       1.1  tshiozak 	c = _UTF8_count[psenc->ch[0] & 0xff];
    228      1.16   tnozaki 	if (c < 1 || c < psenc->chlen)
    229       1.1  tshiozak 		goto ilseq;
    230       1.1  tshiozak 
    231      1.16   tnozaki 	if (c == 1)
    232       1.1  tshiozak 		wchar = psenc->ch[0] & 0xff;
    233      1.16   tnozaki 	else {
    234      1.16   tnozaki 		while (psenc->chlen < c) {
    235      1.16   tnozaki 			if (n-- < 1)
    236      1.16   tnozaki 				goto restart;
    237      1.16   tnozaki 			psenc->ch[psenc->chlen++] = *s0++;
    238      1.16   tnozaki 		}
    239       1.1  tshiozak 		wchar = psenc->ch[0] & (0x7f >> c);
    240       1.1  tshiozak 		for (i = 1; i < c; i++) {
    241       1.1  tshiozak 			if ((psenc->ch[i] & 0xc0) != 0x80)
    242       1.1  tshiozak 				goto ilseq;
    243       1.1  tshiozak 			wchar <<= 6;
    244       1.1  tshiozak 			wchar |= (psenc->ch[i] & 0x3f);
    245       1.1  tshiozak 		}
    246      1.16   tnozaki 		if (_UTF8_surrogate(wchar) || _UTF8_findlen(wchar) != c)
    247      1.16   tnozaki 			goto ilseq;
    248       1.1  tshiozak 	}
    249      1.16   tnozaki 	if (pwc != NULL)
    250      1.16   tnozaki 		*pwc = wchar;
    251      1.16   tnozaki 	*nresult = (wchar == 0) ? 0 : s0 - *s;
    252       1.1  tshiozak 	*s = s0;
    253       1.1  tshiozak 	psenc->chlen = 0;
    254       1.1  tshiozak 
    255      1.16   tnozaki 	return 0;
    256       1.1  tshiozak 
    257       1.1  tshiozak ilseq:
    258       1.7  tshiozak 	*nresult = (size_t)-1;
    259      1.16   tnozaki 	return EILSEQ;
    260       1.1  tshiozak 
    261       1.1  tshiozak restart:
    262       1.7  tshiozak 	*s = s0;
    263       1.1  tshiozak 	*nresult = (size_t)-2;
    264      1.16   tnozaki 	return 0;
    265       1.1  tshiozak }
    266       1.1  tshiozak 
    267       1.1  tshiozak static int
    268       1.1  tshiozak _citrus_UTF8_wcrtomb_priv(_UTF8EncodingInfo *ei, char *s, size_t n, wchar_t wc,
    269       1.1  tshiozak 			  _UTF8State *psenc, size_t *nresult)
    270       1.1  tshiozak {
    271       1.8  tshiozak 	int cnt, i, ret;
    272       1.1  tshiozak 	wchar_t c;
    273       1.1  tshiozak 
    274       1.1  tshiozak 	_DIAGASSERT(nresult != 0);
    275       1.1  tshiozak 	_DIAGASSERT(s != NULL);
    276       1.8  tshiozak 
    277      1.16   tnozaki 	if (_UTF8_surrogate(wc)) {
    278      1.16   tnozaki 		ret = EILSEQ;
    279      1.16   tnozaki 		goto err;
    280      1.16   tnozaki 	}
    281       1.1  tshiozak 	cnt = _UTF8_findlen(wc);
    282       1.1  tshiozak 	if (cnt <= 0 || cnt > 6) {
    283       1.1  tshiozak 		/* invalid UCS4 value */
    284       1.8  tshiozak 		ret = EILSEQ;
    285       1.8  tshiozak 		goto err;
    286       1.1  tshiozak 	}
    287       1.1  tshiozak 	if (n < cnt) {
    288       1.1  tshiozak 		/* bound check failure */
    289       1.8  tshiozak 		ret = E2BIG;
    290       1.8  tshiozak 		goto err;
    291       1.1  tshiozak 	}
    292       1.1  tshiozak 
    293       1.1  tshiozak 	c = wc;
    294       1.1  tshiozak 	if (s) {
    295       1.1  tshiozak 		for (i = cnt - 1; i > 0; i--) {
    296       1.1  tshiozak 			s[i] = 0x80 | (c & 0x3f);
    297       1.1  tshiozak 			c >>= 6;
    298       1.1  tshiozak 		}
    299       1.1  tshiozak 		s[0] = c;
    300       1.1  tshiozak 		if (cnt == 1)
    301       1.1  tshiozak 			s[0] &= 0x7f;
    302       1.1  tshiozak 		else {
    303       1.1  tshiozak 			s[0] &= (0x7f >> cnt);
    304       1.1  tshiozak 			s[0] |= ((0xff00 >> cnt) & 0xff);
    305       1.1  tshiozak 		}
    306       1.1  tshiozak 	}
    307       1.1  tshiozak 
    308       1.1  tshiozak 	*nresult = (size_t)cnt;
    309       1.8  tshiozak 	return 0;
    310       1.1  tshiozak 
    311       1.8  tshiozak err:
    312       1.1  tshiozak 	*nresult = (size_t)-1;
    313       1.8  tshiozak 	return ret;
    314       1.8  tshiozak }
    315       1.8  tshiozak 
    316       1.8  tshiozak static __inline int
    317       1.8  tshiozak /*ARGSUSED*/
    318       1.8  tshiozak _citrus_UTF8_stdenc_wctocs(_UTF8EncodingInfo * __restrict ei,
    319       1.8  tshiozak 			   _csid_t * __restrict csid,
    320       1.8  tshiozak 			   _index_t * __restrict idx,
    321       1.8  tshiozak 			   wchar_t wc)
    322       1.8  tshiozak {
    323       1.8  tshiozak 
    324       1.8  tshiozak 	_DIAGASSERT(csid != NULL && idx != NULL);
    325       1.8  tshiozak 
    326       1.8  tshiozak 	*csid = 0;
    327       1.8  tshiozak 	*idx = (_citrus_index_t)wc;
    328       1.8  tshiozak 
    329       1.8  tshiozak 	return (0);
    330       1.1  tshiozak }
    331       1.1  tshiozak 
    332       1.8  tshiozak static __inline int
    333       1.8  tshiozak /*ARGSUSED*/
    334       1.8  tshiozak _citrus_UTF8_stdenc_cstowc(_UTF8EncodingInfo * __restrict ei,
    335       1.8  tshiozak 			   wchar_t * __restrict wc,
    336       1.8  tshiozak 			   _csid_t csid, _index_t idx)
    337       1.8  tshiozak {
    338       1.8  tshiozak 
    339       1.8  tshiozak 	_DIAGASSERT(wc != NULL);
    340       1.8  tshiozak 
    341       1.8  tshiozak 	if (csid != 0)
    342       1.8  tshiozak 		return (EILSEQ);
    343       1.8  tshiozak 
    344       1.8  tshiozak 	*wc = (wchar_t)idx;
    345       1.8  tshiozak 
    346       1.8  tshiozak 	return (0);
    347       1.8  tshiozak }
    348       1.1  tshiozak 
    349      1.13  tshiozak static __inline int
    350      1.13  tshiozak /*ARGSUSED*/
    351      1.13  tshiozak _citrus_UTF8_stdenc_get_state_desc_generic(_UTF8EncodingInfo * __restrict ei,
    352      1.13  tshiozak 					   _UTF8State * __restrict psenc,
    353      1.13  tshiozak 					   int * __restrict rstate)
    354      1.13  tshiozak {
    355      1.13  tshiozak 
    356      1.13  tshiozak 	if (psenc->chlen == 0)
    357      1.13  tshiozak 		*rstate = _STDENC_SDGEN_INITIAL;
    358      1.13  tshiozak 	else
    359      1.13  tshiozak 		*rstate = _STDENC_SDGEN_INCOMPLETE_CHAR;
    360      1.13  tshiozak 
    361      1.13  tshiozak 	return 0;
    362      1.13  tshiozak }
    363      1.13  tshiozak 
    364       1.1  tshiozak static int
    365       1.1  tshiozak /*ARGSUSED*/
    366       1.8  tshiozak _citrus_UTF8_encoding_module_init(_UTF8EncodingInfo * __restrict ei,
    367       1.8  tshiozak 				  const void * __restrict var, size_t lenvar)
    368       1.1  tshiozak {
    369       1.1  tshiozak 	_UTF8_init_count();
    370       1.1  tshiozak 
    371       1.8  tshiozak 	return 0;
    372       1.1  tshiozak }
    373       1.1  tshiozak 
    374       1.1  tshiozak static void
    375       1.1  tshiozak /*ARGSUSED*/
    376       1.8  tshiozak _citrus_UTF8_encoding_module_uninit(_UTF8EncodingInfo *ei)
    377       1.1  tshiozak {
    378       1.1  tshiozak }
    379       1.1  tshiozak 
    380       1.1  tshiozak 
    381       1.1  tshiozak /* ----------------------------------------------------------------------
    382       1.1  tshiozak  * public interface for ctype
    383       1.1  tshiozak  */
    384       1.1  tshiozak 
    385       1.1  tshiozak _CITRUS_CTYPE_DECLS(UTF8);
    386       1.1  tshiozak _CITRUS_CTYPE_DEF_OPS(UTF8);
    387       1.1  tshiozak 
    388       1.1  tshiozak #include "citrus_ctype_template.h"
    389       1.8  tshiozak 
    390       1.8  tshiozak /* ----------------------------------------------------------------------
    391       1.8  tshiozak  * public interface for stdenc
    392       1.8  tshiozak  */
    393       1.8  tshiozak 
    394       1.8  tshiozak _CITRUS_STDENC_DECLS(UTF8);
    395       1.8  tshiozak _CITRUS_STDENC_DEF_OPS(UTF8);
    396       1.8  tshiozak 
    397       1.8  tshiozak #include "citrus_stdenc_template.h"
    398