xref: /utopia/UTPA2-700.0.x/projects/tools/lint/aeon_include/sys/iconvnls.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /*
2*53ee8cc1Swenshuai.xi  * Copyright (c) 2003-2004, Artem B. Bityuckiy.
3*53ee8cc1Swenshuai.xi  * Rights transferred to Franklin Electronic Publishers.
4*53ee8cc1Swenshuai.xi  *
5*53ee8cc1Swenshuai.xi  * Redistribution and use in source and binary forms, with or without
6*53ee8cc1Swenshuai.xi  * modification, are permitted provided that the following conditions
7*53ee8cc1Swenshuai.xi  * are met:
8*53ee8cc1Swenshuai.xi  * 1. Redistributions of source code must retain the above copyright
9*53ee8cc1Swenshuai.xi  *    notice, this list of conditions and the following disclaimer.
10*53ee8cc1Swenshuai.xi  * 2. Redistributions in binary form must reproduce the above copyright
11*53ee8cc1Swenshuai.xi  *    notice, this list of conditions and the following disclaimer in the
12*53ee8cc1Swenshuai.xi  *    documentation and/or other materials provided with the distribution.
13*53ee8cc1Swenshuai.xi  *
14*53ee8cc1Swenshuai.xi  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*53ee8cc1Swenshuai.xi  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*53ee8cc1Swenshuai.xi  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*53ee8cc1Swenshuai.xi  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*53ee8cc1Swenshuai.xi  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*53ee8cc1Swenshuai.xi  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*53ee8cc1Swenshuai.xi  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*53ee8cc1Swenshuai.xi  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*53ee8cc1Swenshuai.xi  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*53ee8cc1Swenshuai.xi  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*53ee8cc1Swenshuai.xi  * SUCH DAMAGE.
25*53ee8cc1Swenshuai.xi  */
26*53ee8cc1Swenshuai.xi 
27*53ee8cc1Swenshuai.xi /*
28*53ee8cc1Swenshuai.xi  * Funtions, macros, etc implimented in iconv library but used by other
29*53ee8cc1Swenshuai.xi  * NLS-related subsystems too.
30*53ee8cc1Swenshuai.xi  */
31*53ee8cc1Swenshuai.xi #ifndef __SYS_ICONVNLS_H__
32*53ee8cc1Swenshuai.xi #define __SYS_ICONVNLS_H__
33*53ee8cc1Swenshuai.xi 
34*53ee8cc1Swenshuai.xi #include <_ansi.h>
35*53ee8cc1Swenshuai.xi #include <reent.h>
36*53ee8cc1Swenshuai.xi #include <wchar.h>
37*53ee8cc1Swenshuai.xi #include <iconv.h>
38*53ee8cc1Swenshuai.xi 
39*53ee8cc1Swenshuai.xi /* Iconv data path environment variable name */
40*53ee8cc1Swenshuai.xi #define NLS_ENVVAR_NAME  "NLSPATH"
41*53ee8cc1Swenshuai.xi /* Default NLSPATH value */
42*53ee8cc1Swenshuai.xi #define ICONV_DEFAULT_NLSPATH "/usr/locale"
43*53ee8cc1Swenshuai.xi /* Direction markers */
44*53ee8cc1Swenshuai.xi #define ICONV_NLS_FROM 0
45*53ee8cc1Swenshuai.xi #define ICONV_NLS_TO   1
46*53ee8cc1Swenshuai.xi 
47*53ee8cc1Swenshuai.xi _VOID
48*53ee8cc1Swenshuai.xi _EXFUN(_iconv_nls_get_state, (iconv_t cd, mbstate_t *ps, int direction));
49*53ee8cc1Swenshuai.xi 
50*53ee8cc1Swenshuai.xi int
51*53ee8cc1Swenshuai.xi _EXFUN(_iconv_nls_set_state, (iconv_t cd, mbstate_t *ps, int direction));
52*53ee8cc1Swenshuai.xi 
53*53ee8cc1Swenshuai.xi int
54*53ee8cc1Swenshuai.xi _EXFUN(_iconv_nls_is_stateful, (iconv_t cd, int direction));
55*53ee8cc1Swenshuai.xi 
56*53ee8cc1Swenshuai.xi int
57*53ee8cc1Swenshuai.xi _EXFUN(_iconv_nls_get_mb_cur_max, (iconv_t cd, int direction));
58*53ee8cc1Swenshuai.xi 
59*53ee8cc1Swenshuai.xi size_t
60*53ee8cc1Swenshuai.xi _EXFUN(_iconv_nls_conv, (struct _reent *rptr, iconv_t cd,
61*53ee8cc1Swenshuai.xi                         _CONST char **inbuf, size_t *inbytesleft,
62*53ee8cc1Swenshuai.xi                         char **outbuf, size_t *outbytesleft));
63*53ee8cc1Swenshuai.xi 
64*53ee8cc1Swenshuai.xi _CONST char *
65*53ee8cc1Swenshuai.xi _EXFUN(_iconv_nls_construct_filename, (struct _reent *rptr, _CONST char *file,
66*53ee8cc1Swenshuai.xi                                       _CONST char *dir, _CONST char *ext));
67*53ee8cc1Swenshuai.xi 
68*53ee8cc1Swenshuai.xi 
69*53ee8cc1Swenshuai.xi int
70*53ee8cc1Swenshuai.xi _EXFUN(_iconv_nls_open, (struct _reent *rptr, _CONST char *encoding,
71*53ee8cc1Swenshuai.xi                         iconv_t *towc, iconv_t *fromwc, int flag));
72*53ee8cc1Swenshuai.xi 
73*53ee8cc1Swenshuai.xi char *
74*53ee8cc1Swenshuai.xi _EXFUN(_iconv_resolve_encoding_name, (struct _reent *rptr, _CONST char *ca));
75*53ee8cc1Swenshuai.xi 
76*53ee8cc1Swenshuai.xi #endif /* __SYS_ICONVNLS_H__ */
77*53ee8cc1Swenshuai.xi 
78