d14d7d31f2a70b1e0a9c933607d6627f5718980eis * CDDL HEADER START
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * The contents of this file are subject to the terms of the
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Common Development and Distribution License (the "License").
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * You may not use this file except in compliance with the License.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * See the License for the specific language governing permissions
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * and limitations under the License.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * When distributing Covered Code, include this CDDL HEADER in each
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * If applicable, add the following below this CDDL HEADER, with the
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * fields enclosed by brackets "[]" replaced with your own identifying
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * information: Portions Copyright [yyyy] [name of copyright owner]
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * CDDL HEADER END
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Use is subject to license terms.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis#pragma ident "%Z%%M% %I% %E% SMI"
d14d7d31f2a70b1e0a9c933607d6627f5718980eisextern "C" {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Supported fromcode/tocode values are saved in the following component type
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * of (name, id) pair. The id values of fromcode and tocode are used to
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * find out the corresponding code conversions.
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Each unique kiconv code conversion identified by tocode and fromcode ids
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * have corresponding module id and internal function pointers to open(),
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * kiconv(), close(), and kiconvstr().
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis size_t (*kiconv)(void *, char **, size_t *, char **, size_t *,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis size_t (*kiconvstr)(char *, size_t *, char *, size_t *, int,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Each module id has a corresponding module name that is used to load
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * the module as needed and a reference counter.
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * The following two data structures are being used to transfer information
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * on the supported kiconv code conversions from a module to the framework.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Details can be found from kiconv_ops(9S) and kiconv_module_info(9S)
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * man pages at PSARC/2007/173.
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis size_t (*kiconv)(void *, char **, size_t *, char **, size_t *,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis size_t (*kiconvstr)(char *, size_t *, char *, size_t *, int,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis/* The kiconv code conversion descriptor data structure. */
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis/* Common conversion state data structure. */
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis/* Common component types for possible code conversion mapping tables. */
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eistypedef struct {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * The maximum name length for any given codeset or alias names; the following
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * should be plenty big enough.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis/* The following characters do not exist in the normalized code names. */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * When we encounter non-identical characters, as like iconv(3C) we have,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * map them into either one of the replacement characters based on what is
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * the current target tocde.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * The 0xefbfdb in UTF-8 is U+FFFD in Unicode scalar value.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis/* Numeric ids for kiconv modules. */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis/* Functions used in kiconv conversion and module management. */
d14d7d31f2a70b1e0a9c933607d6627f5718980eisextern void kiconv_init();
d14d7d31f2a70b1e0a9c933607d6627f5718980eisextern int kiconv_register_module(kiconv_module_info_t *);
d14d7d31f2a70b1e0a9c933607d6627f5718980eisextern int kiconv_unregister_module(kiconv_module_info_t *);
d14d7d31f2a70b1e0a9c933607d6627f5718980eis#endif /* _KERNEL */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis#endif /* _SYS_KICONV_H */