129964Sache/*- 229964Sache * SPDX-License-Identifier: BSD-3-Clause 322347Spst * 422347Spst * Copyright (c) 1989, 1993 522347Spst * The Regents of the University of California. All rights reserved. 622347Spst * (c) UNIX System Laboratories, Inc. 722347Spst * All or some portions of this file are derived from material licensed 822347Spst * to the University of California by American Telephone and Telegraph 922347Spst * Co. or Unix System Laboratories, Inc. and are reproduced herein with 1022347Spst * the permission of UNIX System Laboratories, Inc. 1122347Spst * 1222347Spst * This code is derived from software contributed to Berkeley by 1322347Spst * Paul Borman at Krystal Technologies. 1422347Spst * 1522347Spst * Copyright (c) 2011 The FreeBSD Foundation 1622347Spst * 1722347Spst * Portions of this software were developed by David Chisnall 1822347Spst * under sponsorship from the FreeBSD Foundation. 1922347Spst * 2022347Spst * Redistribution and use in source and binary forms, with or without 2122347Spst * modification, are permitted provided that the following conditions 2222347Spst * are met: 2322347Spst * 1. Redistributions of source code must retain the above copyright 2422347Spst * notice, this list of conditions and the following disclaimer. 2522347Spst * 2. Redistributions in binary form must reproduce the above copyright 2622347Spst * notice, this list of conditions and the following disclaimer in the 2722347Spst * documentation and/or other materials provided with the distribution. 2822347Spst * 3. Neither the name of the University nor the names of its contributors 2929964Sache * may be used to endorse or promote products derived from this software 3029964Sache * without specific prior written permission. 3129964Sache * 3229964Sache * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 3329964Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 3422347Spst * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 3522347Spst * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3622347Spst * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3722347Spst * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3822347Spst * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3922347Spst * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 4022347Spst * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 4122347Spst * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 4229964Sache * SUCH DAMAGE. 4322347Spst */ 4422347Spst 4522347Spst#include <wchar.h> 4622347Spst#include <wctype.h> 4722347Spst#include <xlocale.h> 4822347Spst 4922347Spst#undef wcwidth 5022347Spst 5122347Spstint 5222347Spstwcwidth(wchar_t wc) 5322347Spst{ 5422347Spst return (__wcwidth(wc)); 5522347Spst} 5629964Sacheint 5722347Spstwcwidth_l(wchar_t wc, locale_t locale) 5822347Spst{ 5922347Spst return (__wcwidth_l(wc, locale)); 6022347Spst} 6122347Spst