wcwidth.c revision 227753
1102033Sache/* 2102033Sache * Copyright (c) 1989, 1993 3102033Sache * The Regents of the University of California. All rights reserved. 4102033Sache * (c) UNIX System Laboratories, Inc. 5102033Sache * All or some portions of this file are derived from material licensed 6102033Sache * to the University of California by American Telephone and Telegraph 7102033Sache * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8102033Sache * the permission of UNIX System Laboratories, Inc. 9102033Sache * 10102033Sache * This code is derived from software contributed to Berkeley by 11102033Sache * Paul Borman at Krystal Technologies. 12102033Sache * 13227753Stheraven * Copyright (c) 2011 The FreeBSD Foundation 14227753Stheraven * All rights reserved. 15227753Stheraven * Portions of this software were developed by David Chisnall 16227753Stheraven * under sponsorship from the FreeBSD Foundation. 17227753Stheraven * 18102033Sache * Redistribution and use in source and binary forms, with or without 19102033Sache * modification, are permitted provided that the following conditions 20102033Sache * are met: 21102033Sache * 1. Redistributions of source code must retain the above copyright 22102033Sache * notice, this list of conditions and the following disclaimer. 23102033Sache * 2. Redistributions in binary form must reproduce the above copyright 24102033Sache * notice, this list of conditions and the following disclaimer in the 25102033Sache * documentation and/or other materials provided with the distribution. 26102033Sache * 4. Neither the name of the University nor the names of its contributors 27102033Sache * may be used to endorse or promote products derived from this software 28102033Sache * without specific prior written permission. 29102033Sache * 30102033Sache * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 31102033Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 32102033Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 33102033Sache * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 34102033Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 35102033Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 36102033Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37102033Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38102033Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39102033Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40102033Sache * SUCH DAMAGE. 41102033Sache */ 42102033Sache 43102033Sache#include <sys/cdefs.h> 44102033Sache__FBSDID("$FreeBSD: head/lib/libc/locale/wcwidth.c 227753 2011-11-20 14:45:42Z theraven $"); 45102033Sache 46102033Sache#include <wchar.h> 47227753Stheraven#include <wctype.h> 48227753Stheraven#include <xlocale.h> 49102033Sache 50133564Stjr#undef wcwidth 51102096Sache 52102033Sacheint 53102137Sachewcwidth(wchar_t wc) 54102033Sache{ 55133564Stjr return (__wcwidth(wc)); 56102033Sache} 57227753Stheravenint 58227753Stheravenwcwidth_l(wchar_t wc, locale_t locale) 59227753Stheraven{ 60227753Stheraven return (__wcwidth_l(wc, locale)); 61227753Stheraven} 62