/* : : generated from /pobj/ksh-1.0.10/ksh-1.0.10/src/lib/libast/features/iconv by iffe version 2024-03-20 : : */
#ifndef _def_iconv_ast
#define _def_iconv_ast	1
#define _sys_types	1	/* #include <sys/types.h> ok */
#include <ast_common.h>
#include <ccode.h>
#undef	_hdr_iconv
#undef	_lib_iconv_open

#define ICONV_VERSION		20110111L

#define ICONV_FATAL		0x02
#define ICONV_OMIT		0x04

#define CC_ICONV		(-1)
#define CC_UCS			(-2)
#define CC_SCU			(-3)
#define CC_UTF			(-4)
#define CC_UME			(-5)


typedef int (*Iconv_error_f)(void*, void*, int, ...);

typedef struct Iconv_disc_s
{
	uint32_t		version;
	Iconv_error_f		errorf;
	size_t			errors;
	uint32_t		flags;
	int			fill;
} Iconv_disc_t;

typedef Ccmap_t iconv_list_t;
typedef void* iconv_t;
typedef size_t (*iconv_f)(iconv_t, char**, size_t*, char**, size_t*);

#define iconv_init(d,e)		(memset(d,0,sizeof(*(d))),(d)->version=ICONV_VERSION,(d)->errorf=(Iconv_error_f)(e),(d)->fill=(-1))

extern iconv_t	iconv_open(const char*, const char*);
extern size_t		iconv(iconv_t, char**, size_t*, char**, size_t*);
extern int		iconv_close(iconv_t);
extern iconv_list_t*	iconv_list(iconv_list_t*);
extern int		iconv_name(const char*, char*, size_t);
#if _SFIO_H
extern ssize_t		iconv_move(iconv_t, Sfio_t*, Sfio_t*, size_t, Iconv_disc_t*);
extern ssize_t		iconv_write(iconv_t, Sfio_t*, char**, size_t*, Iconv_disc_t*);
#else
#if _SFSTDIO_H
extern ssize_t		iconv_move(iconv_t, FILE*, FILE*, size_t, Iconv_disc_t*);
extern ssize_t		iconv_write(iconv_t, FILE*, char**, size_t*, Iconv_disc_t*);
#endif
#endif

#endif
