1da2e3ebdSchin
2da2e3ebdSchin/* : : generated by proto : : */
3*b30d1939SAndy Fiddaman/* : : generated from contrib/ast/src/lib/libast/features/iconv by iffe version 2012-07-17 : : */
4*b30d1939SAndy Fiddaman
5da2e3ebdSchin#ifndef _def_iconv_ast
6da2e3ebdSchin#if !defined(__PROTO__)
7da2e3ebdSchin#  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
8da2e3ebdSchin#    if defined(__cplusplus)
9da2e3ebdSchin#      define __LINKAGE__	"C"
10da2e3ebdSchin#    else
11da2e3ebdSchin#      define __LINKAGE__
12da2e3ebdSchin#    endif
13da2e3ebdSchin#    define __STDARG__
14da2e3ebdSchin#    define __PROTO__(x)	x
15da2e3ebdSchin#    define __OTORP__(x)
16da2e3ebdSchin#    define __PARAM__(n,o)	n
17da2e3ebdSchin#    if !defined(__STDC__) && !defined(__cplusplus)
18da2e3ebdSchin#      if !defined(c_plusplus)
19da2e3ebdSchin#      	define const
20da2e3ebdSchin#      endif
21da2e3ebdSchin#      define signed
22da2e3ebdSchin#      define void		int
23da2e3ebdSchin#      define volatile
24da2e3ebdSchin#      define __V_		char
25da2e3ebdSchin#    else
26da2e3ebdSchin#      define __V_		void
27da2e3ebdSchin#    endif
28da2e3ebdSchin#  else
29da2e3ebdSchin#    define __PROTO__(x)	()
30da2e3ebdSchin#    define __OTORP__(x)	x
31da2e3ebdSchin#    define __PARAM__(n,o)	o
32da2e3ebdSchin#    define __LINKAGE__
33da2e3ebdSchin#    define __V_		char
34da2e3ebdSchin#    define const
35da2e3ebdSchin#    define signed
36da2e3ebdSchin#    define void		int
37da2e3ebdSchin#    define volatile
38da2e3ebdSchin#  endif
39da2e3ebdSchin#  define __MANGLE__	__LINKAGE__
40da2e3ebdSchin#  if defined(__cplusplus) || defined(c_plusplus)
41da2e3ebdSchin#    define __VARARG__	...
42da2e3ebdSchin#  else
43da2e3ebdSchin#    define __VARARG__
44da2e3ebdSchin#  endif
45da2e3ebdSchin#  if defined(__STDARG__)
46da2e3ebdSchin#    define __VA_START__(p,a)	va_start(p,a)
47da2e3ebdSchin#  else
48da2e3ebdSchin#    define __VA_START__(p,a)	va_start(p)
49da2e3ebdSchin#  endif
50da2e3ebdSchin#  if !defined(__INLINE__)
51da2e3ebdSchin#    if defined(__cplusplus)
52da2e3ebdSchin#      define __INLINE__	extern __MANGLE__ inline
53da2e3ebdSchin#    else
54da2e3ebdSchin#      if defined(_WIN32) && !defined(__GNUC__)
55da2e3ebdSchin#      	define __INLINE__	__inline
56da2e3ebdSchin#      endif
57da2e3ebdSchin#    endif
58da2e3ebdSchin#  endif
59da2e3ebdSchin#endif
60da2e3ebdSchin#if !defined(__LINKAGE__)
61da2e3ebdSchin#define __LINKAGE__		/* 2004-08-11 transition */
62da2e3ebdSchin#endif
63da2e3ebdSchin
64da2e3ebdSchin#define _def_iconv_ast	1
65da2e3ebdSchin#define _sys_types	1	/* #include <sys/types.h> ok */
66da2e3ebdSchin#define _hdr_iconv	1	/* #include <iconv.h> ok */
67da2e3ebdSchin#define _lib_iconv_open	1	/* iconv_open() in default lib(s) */
68da2e3ebdSchin#define _lib_iconv_close	1	/* iconv_close() in default lib(s) */
69da2e3ebdSchin#define _lib_iconv	1	/* iconv() in default lib(s) */
70da2e3ebdSchin#define _nxt_iconv <../include/iconv.h>	/* include path for the native <iconv.h> */
71da2e3ebdSchin#define _nxt_iconv_str "../include/iconv.h"	/* include string for the native <iconv.h> */
72da2e3ebdSchin#include <ast_common.h>
73da2e3ebdSchin#include <ccode.h>
74da2e3ebdSchin#include <../include/iconv.h>	/* the native iconv.h */
75da2e3ebdSchin
76*b30d1939SAndy Fiddaman#define ICONV_VERSION		20110111L
77*b30d1939SAndy Fiddaman
78*b30d1939SAndy Fiddaman#define ICONV_FATAL		0x02
79*b30d1939SAndy Fiddaman#define ICONV_OMIT		0x04
80*b30d1939SAndy Fiddaman
81*b30d1939SAndy Fiddaman#define CC_ICONV		(-1)
82*b30d1939SAndy Fiddaman#define CC_UCS			(-2)
83*b30d1939SAndy Fiddaman#define CC_SCU			(-3)
84*b30d1939SAndy Fiddaman#define CC_UTF			(-4)
85*b30d1939SAndy Fiddaman#define CC_UME			(-5)
86da2e3ebdSchin
87da2e3ebdSchin#ifndef _ICONV_LIST_PRIVATE_
88da2e3ebdSchin#undef	iconv_t
89da2e3ebdSchin#define	iconv_t		_ast_iconv_t
90da2e3ebdSchin#undef	iconv_f
91da2e3ebdSchin#define	iconv_f		_ast_iconv_f
92da2e3ebdSchin#undef	iconv_list_t
93da2e3ebdSchin#define	iconv_list_t	_ast_iconv_list_t
94da2e3ebdSchin#undef	iconv_open
95da2e3ebdSchin#define iconv_open	_ast_iconv_open
96da2e3ebdSchin#undef	iconv
97da2e3ebdSchin#define	iconv		_ast_iconv
98da2e3ebdSchin#undef	iconv_close
99da2e3ebdSchin#define iconv_close	_ast_iconv_close
100da2e3ebdSchin#undef	iconv_list
101da2e3ebdSchin#define iconv_list	_ast_iconv_list
102da2e3ebdSchin#undef	iconv_move
103da2e3ebdSchin#define iconv_move	_ast_iconv_move
104da2e3ebdSchin#undef	iconv_name
105da2e3ebdSchin#define iconv_name	_ast_iconv_name
106da2e3ebdSchin#undef	iconv_write
107da2e3ebdSchin#define iconv_write	_ast_iconv_write
108da2e3ebdSchin#endif
109da2e3ebdSchin
110*b30d1939SAndy Fiddamantypedef int (*Iconv_error_f) __PROTO__((__V_*, __V_*, int, ...));
111*b30d1939SAndy Fiddaman
112*b30d1939SAndy Fiddamantypedef struct Iconv_disc_s
113*b30d1939SAndy Fiddaman{
114*b30d1939SAndy Fiddaman	uint32_t		version;
115*b30d1939SAndy Fiddaman	Iconv_error_f		errorf;
116*b30d1939SAndy Fiddaman	size_t			errors;
117*b30d1939SAndy Fiddaman	uint32_t		flags;
118*b30d1939SAndy Fiddaman	int			fill;
119*b30d1939SAndy Fiddaman} Iconv_disc_t;
120*b30d1939SAndy Fiddaman
121da2e3ebdSchintypedef Ccmap_t _ast_iconv_list_t;
122da2e3ebdSchintypedef __V_* _ast_iconv_t;
123da2e3ebdSchintypedef size_t (*_ast_iconv_f) __PROTO__((_ast_iconv_t, char**, size_t*, char**, size_t*));
124da2e3ebdSchin
125*b30d1939SAndy Fiddaman#define iconv_init(d,e)		(memset(d,0,sizeof(*(d))),(d)->version=ICONV_VERSION,(d)->errorf=(Iconv_error_f)(e),(d)->fill=(-1))
126*b30d1939SAndy Fiddaman
127da2e3ebdSchin#if _BLD_ast && defined(__EXPORT__)
128da2e3ebdSchin#undef __MANGLE__
129da2e3ebdSchin#define __MANGLE__ __LINKAGE__		__EXPORT__
130da2e3ebdSchin#endif
131da2e3ebdSchin
132da2e3ebdSchinextern __MANGLE__ _ast_iconv_t	_ast_iconv_open __PROTO__((const char*, const char*));
133da2e3ebdSchinextern __MANGLE__ size_t		_ast_iconv __PROTO__((_ast_iconv_t, char**, size_t*, char**, size_t*));
134da2e3ebdSchinextern __MANGLE__ int		_ast_iconv_close __PROTO__((_ast_iconv_t));
135da2e3ebdSchinextern __MANGLE__ _ast_iconv_list_t*	_ast_iconv_list __PROTO__((_ast_iconv_list_t*));
136da2e3ebdSchinextern __MANGLE__ int		_ast_iconv_name __PROTO__((const char*, char*, size_t));
137da2e3ebdSchin#if _SFIO_H
138*b30d1939SAndy Fiddamanextern __MANGLE__ ssize_t		_ast_iconv_move __PROTO__((_ast_iconv_t, Sfio_t*, Sfio_t*, size_t, Iconv_disc_t*));
139*b30d1939SAndy Fiddamanextern __MANGLE__ ssize_t		_ast_iconv_write __PROTO__((_ast_iconv_t, Sfio_t*, char**, size_t*, Iconv_disc_t*));
140da2e3ebdSchin#else
141da2e3ebdSchin#if _SFSTDIO_H
142*b30d1939SAndy Fiddamanextern __MANGLE__ ssize_t		_ast_iconv_move __PROTO__((_ast_iconv_t, FILE*, FILE*, size_t, Iconv_disc_t*));
143*b30d1939SAndy Fiddamanextern __MANGLE__ ssize_t		_ast_iconv_write __PROTO__((_ast_iconv_t, FILE*, char**, size_t*, Iconv_disc_t*));
144da2e3ebdSchin#endif
145da2e3ebdSchin#endif
146da2e3ebdSchin
147da2e3ebdSchin#undef __MANGLE__
148da2e3ebdSchin#define __MANGLE__ __LINKAGE__
149da2e3ebdSchin
150da2e3ebdSchin#endif
151