On Sun, Apr 03, 2011 at 07:25:45PM +0100, Nicholas Marriott wrote: > Do we normally have a LIBRARY section? >
mdoc(7) says no, good catch. .\" .Sh LIBRARY .\" For sections 2, 3, & 9 only. .\" Not used in OpenBSD. > Also $OpenBSD$ would be better at the start. Fixed. Index: Makefile.inc =================================================================== RCS file: /cvs/src/lib/libc/locale/Makefile.inc,v retrieving revision 1.16 diff -u -p -r1.16 Makefile.inc --- Makefile.inc 27 Jul 2010 16:59:03 -0000 1.16 +++ Makefile.inc 3 Apr 2011 18:26:01 -0000 @@ -15,7 +15,7 @@ MAN+= nl_langinfo.3 setlocale.3 iswalnum btowc.3 mblen.3 mbrlen.3 mbrtowc.3 mbsinit.3 mbsrtowcs.3 \ mbstowcs.3 mbtowc.3 wcrtomb.3 wcsrtombs.3 wcstod.3 wcstol.3 \ wcstombs.3 wctob.3 wctomb.3 \ - wctype.3 iswctype.3 wctrans.3 towctrans.3 + wctype.3 iswctype.3 wctrans.3 towctrans.3 wcwidth.3 MLINKS+=setlocale.3 localeconv.3 \ iswalnum.3 iswalpha.3 \ iswalnum.3 iswblank.3 \ Index: wcwidth.3 =================================================================== RCS file: wcwidth.3 diff -N wcwidth.3 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ wcwidth.3 3 Apr 2011 18:33:27 -0000 @@ -0,0 +1,61 @@ +.\" $OpenBSD$ +.\" Copyright (c) 2002 Tim J. Robbins +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.Dd $Mdocdate$ +.Dt WCWIDTH 3 +.Os +.Sh NAME +.Nm wcwidth +.Nd number of column positions of a wide-character code +.Sh SYNOPSIS +.In wchar.h +.Ft int +.Fn wcwidth "wchar_t wc" +.Sh DESCRIPTION +The +.Fn wcwidth +function determines the number of column positions required to +display the wide character +.Fa wc . +.Sh RETURN VALUES +The +.Fn wcwidth +function returns 0 if the +.Fa wc +argument is a null wide character (L'\e0'), +\-1 if +.Fa wc +is not printable, +otherwise it returns the number of column positions the +character occupies. +.Sh SEE ALSO +.Xr iswprint 3 , +.Xr wcswidth 3 +.Sh STANDARDS +The +.Fn wcwidth +function conforms to +.St -p1003.1-2001 .