iconv_compat.c revision 258283
13229Spst/*-
23229Spst * Copyright (c) 2013 Peter Wemm
318471Swosch * All rights reserved.
418471Swosch *
53229Spst * Redistribution and use in source and binary forms, with or without
63229Spst * modification, are permitted provided that the following conditions
73229Spst * are met:
83229Spst * 1. Redistributions of source code must retain the above copyright
93229Spst *    notice, this list of conditions and the following disclaimer.
103229Spst * 2. Redistributions in binary form must reproduce the above copyright
113229Spst *    notice, this list of conditions and the following disclaimer in the
123229Spst *    documentation and/or other materials provided with the distribution.
133229Spst *
143229Spst * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
153229Spst * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
163229Spst * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
173229Spst * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
183229Spst * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
193229Spst * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
203229Spst * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
213229Spst * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
223229Spst * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
233229Spst * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
243229Spst * SUCH DAMAGE.
253229Spst *
263229Spst * $FreeBSD: head/lib/libc/iconv/iconv_compat.c 258283 2013-11-17 22:52:17Z peter $
273229Spst */
283229Spst
293229Spst/*
303229Spst * These are ABI implementations for when the raw iconv_* symbol
313229Spst * space was exposed via libc.so.7 in its early life.  This is
323229Spst * a transition aide, these wrappers will not normally ever be
333229Spst * executed except via __sym_compat() references.
343229Spst */
353229Spst#include <sys/types.h>
363229Spst#include <iconv.h>
373229Spst#include "iconv-internal.h"
383229Spst
393229Spstsize_t
403229Spst__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d,
413229Spst     size_t * e, __uint32_t f, size_t *g)
423229Spst{
433229Spst	return __bsd___iconv(a, b, c, d, e, f, g);
443229Spst}
453229Spst
463229Spstvoid
473229Spst__iconv_free_list_compat(char ** a, size_t b)
483229Spst{
493229Spst	__bsd___iconv_free_list(a, b);
503229Spst}
513229Spst
523229Spstint
533229Spst__iconv_get_list_compat(char ***a, size_t *b, __iconv_bool c)
543229Spst{
553229Spst	return __bsd___iconv_get_list(a, b, c);
563229Spst}
573229Spst
583229Spstsize_t
593229Spsticonv_compat(iconv_t a, const char ** __restrict b,
603229Spst      size_t * __restrict c, char ** __restrict d,
613229Spst      size_t * __restrict e)
623229Spst{
633229Spst	return __bsd_iconv(a, b, c, d, e);
6413572Spst}
653229Spst
663229Spstconst char *
673229Spsticonv_canonicalize_compat(const char *a)
683229Spst{
693229Spst	return __bsd_iconv_canonicalize(a);
703229Spst}
713229Spst
723229Spstint
733229Spsticonv_close_compat(iconv_t a)
743229Spst{
753229Spst	return __bsd_iconv_close(a);
763229Spst}
773229Spst
783229Spsticonv_t
793229Spsticonv_open_compat(const char *a, const char *b)
803229Spst{
813229Spst	return __bsd_iconv_open(a, b);
823229Spst}
833229Spst
843229Spstint
853229Spsticonv_open_into_compat(const char *a, const char *b, iconv_allocation_t *c)
863229Spst{
873229Spst	return __bsd_iconv_open_into(a, b, c);
883229Spst}
893229Spst
903229Spstvoid
913229Spsticonv_set_relocation_prefix_compat(const char *a, const char *b)
923229Spst{
933229Spst	return __bsd_iconv_set_relocation_prefix(a, b);
943229Spst}
953229Spst
963229Spstint
973229Spsticonvctl_compat(iconv_t a, int b, void *c)
983229Spst{
993229Spst	return __bsd_iconvctl(a, b, c);
1003229Spst}
1013229Spst
1023229Spstvoid
1033229Spsticonvlist_compat(int (*a) (unsigned int, const char * const *, void *), void *b)
1043229Spst{
1053229Spst	return __bsd_iconvlist(a, b);
1063229Spst}
1073229Spst
1083229Spstint _iconv_version_compat = 0x0108;	/* Magic - not used */
1093229Spst
1103229Spst__sym_compat(__iconv, __iconv_compat, FBSD_1.2);
1113229Spst__sym_compat(__iconv_free_list, __iconv_free_list_compat, FBSD_1.2);
1123229Spst__sym_compat(__iconv_get_list, __iconv_get_list_compat, FBSD_1.2);
1133229Spst__sym_compat(_iconv_version, _iconv_version_compat, FBSD_1.3);
1143229Spst__sym_compat(iconv, iconv_compat, FBSD_1.3);
1153229Spst__sym_compat(iconv_canonicalize, iconv_canonicalize_compat, FBSD_1.2);
1163229Spst__sym_compat(iconv_close, iconv_close_compat, FBSD_1.3);
1173229Spst__sym_compat(iconv_open, iconv_open_compat, FBSD_1.3);
1183229Spst__sym_compat(iconv_open_into, iconv_open_into_compat, FBSD_1.3);
1193229Spst__sym_compat(iconv_set_relocation_prefix, iconv_set_relocation_prefix_compat, FBSD_1.3);
1203229Spst__sym_compat(iconvctl, iconvctl_compat, FBSD_1.3);
1213229Spst__sym_compat(iconvlist, iconvlist_compat, FBSD_1.3);
1223229Spst