wdresolve.c revision b599bd937c305a895426e8c412ca920ce7824850
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER START
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner * The contents of this file are subject to the terms of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Common Development and Distribution License (the "License").
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You may not use this file except in compliance with the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * See the License for the specific language governing permissions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * and limitations under the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * When distributing Covered Code, include this CDDL HEADER in each
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * If applicable, add the following below this CDDL HEADER, with the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * fields enclosed by brackets "[]" replaced with your own identifying
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * information: Portions Copyright [yyyy] [name of copyright owner]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER END
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner * Use is subject to license terms.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstatic wchar_t *(*wddlm)(wchar_t, wchar_t, int) = wddelim_C;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstatic int initialized = 0;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (_DFLTLOCPATH_LEN + loclen + _WDMODPATH_LEN >= sizeof (wdmodpath)) {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin /* pathname too long */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin (void) strcpy(wdmodpath + _DFLTLOCPATH_LEN + loclen, _WDMOD_PATH);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((modhandle = dlopen(wdmodpath, RTLD_LAZY)) != NULL) {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin wdchknd = (int(*)(wchar_t))dlsym(modhandle, "_wdchkind_");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin wdbdg = (int(*)(wchar_t, wchar_t, int))dlsym(modhandle,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "_wdbindf_");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin mcfllr = (wchar_t(*)(void))dlsym(modhandle, "_mcfiller_");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return (-1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * wdinit() initializes other word-analyzing routines according to the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * current locale. Programmers are supposed to call this routine every
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * time the locale for the LC_CTYPE category is changed. It returns 0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * when every initialization completes successfully, or -1 otherwise.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* XXX: wdinit() is not exported from libc. Should it be? */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * wdchkind() returns a non-negative integral value unique to the kind
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * of the character represented by given argument.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return (i);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return (2);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return (3);
if (!initialized)
(void) _wdinitialize();
wchar_t *
wchar_t *i;
if (!initialized)
(void) _wdinitialize();
static wchar_t *
mcfiller(void)
if (!initialized)
(void) _wdinitialize();
if (mcfllr) {
if (!fillerchar)
return (fillerchar);
mcwrap(void)
if (!initialized)
(void) _wdinitialize();
if (mcwrp)
if ((*mcwrp)() == 0) {