iconv_converter_if.m revision 120492
175332Sbp#
275332Sbp# Copyright (c) 2000-2001, Boris Popov
375332Sbp# All rights reserved.
475332Sbp#
575332Sbp# Redistribution and use in source and binary forms, with or without
675332Sbp# modification, are permitted provided that the following conditions
775332Sbp# are met:
875332Sbp# 1. Redistributions of source code must retain the above copyright
975332Sbp#    notice, this list of conditions and the following disclaimer.
1075332Sbp# 2. Redistributions in binary form must reproduce the above copyright
1175332Sbp#    notice, this list of conditions and the following disclaimer in the
1275332Sbp#    documentation and/or other materials provided with the distribution.
1375332Sbp# 3. All advertising materials mentioning features or use of this software
1475332Sbp#    must display the following acknowledgement:
1575332Sbp#    This product includes software developed by Boris Popov.
1675332Sbp# 4. Neither the name of the author nor the names of any co-contributors
1775332Sbp#    may be used to endorse or promote products derived from this software
1875332Sbp#    without specific prior written permission.
1975332Sbp#
2075332Sbp# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2175332Sbp# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2275332Sbp# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2375332Sbp# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2475332Sbp# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2575332Sbp# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2675332Sbp# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2775332Sbp# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2875332Sbp# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2975332Sbp# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3075332Sbp# SUCH DAMAGE.
3175332Sbp#
3275332Sbp# $FreeBSD: head/sys/libkern/iconv_converter_if.m 120492 2003-09-26 20:26:25Z fjoe $
3375332Sbp#
3475332Sbp
3575332Sbp#include <sys/iconv.h>
3675332Sbp
3775332SbpINTERFACE iconv_converter;
3875332Sbp
3975332SbpSTATICMETHOD int open {
4075332Sbp	struct iconv_converter_class *dcp;
4175332Sbp	struct iconv_cspair *cspto;
4275332Sbp	struct iconv_cspair *cspfrom;
4375332Sbp	void **hpp;
4475332Sbp};
4575332Sbp
4675332SbpMETHOD int close {
4775332Sbp	void *handle;
4875332Sbp};
4975332Sbp
5075332SbpMETHOD int conv {
5175332Sbp	void *handle;
5275332Sbp	const char **inbuf;
5375332Sbp        size_t *inbytesleft;
5475332Sbp	char **outbuf;
5575332Sbp	size_t *outbytesleft;
56120492Sfjoe	int convchar;
57120492Sfjoe	int casetype;
5875332Sbp};
5975332Sbp
6075332SbpSTATICMETHOD int init {
6175332Sbp	struct iconv_converter_class *dcp;
6275332Sbp} DEFAULT iconv_converter_initstub;
6375332Sbp
6475332SbpSTATICMETHOD void done {
6575332Sbp	struct iconv_converter_class *dcp;
6675332Sbp} DEFAULT iconv_converter_donestub;
6775332Sbp
6875332SbpSTATICMETHOD const char * name {
6975332Sbp	struct iconv_converter_class *dcp;
7075332Sbp};
71