diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/locale/Makefile.inc | 13 | ||||
-rw-r--r-- | lib/libc/locale/wcstol.3 | 88 |
2 files changed, 97 insertions, 4 deletions
diff --git a/lib/libc/locale/Makefile.inc b/lib/libc/locale/Makefile.inc index 70f1b5a1535..2df2495699e 100644 --- a/lib/libc/locale/Makefile.inc +++ b/lib/libc/locale/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.10 2005/08/08 05:53:01 espie Exp $ +# $OpenBSD: Makefile.inc,v 1.11 2008/12/20 23:08:08 kettenis Exp $ # locale sources .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/locale ${LIBCSRCDIR}/locale @@ -12,8 +12,8 @@ SRCS+= _def_messages.c _def_monetary.c _def_numeric.c _def_time.c \ MAN+= nl_langinfo.3 setlocale.3 iswalnum.3 towlower.3 \ btowc.3 mblen.3 mbrlen.3 mbrtowc.3 mbsinit.3 mbsrtowcs.3 \ - mbstowcs.3 mbtowc.3 wcrtomb.3 wcsrtombs.3 wcstombs.3 wctob.3 \ - wctomb.3 wctype.3 iswctype.3 wctrans.3 towctrans.3 + mbstowcs.3 mbtowc.3 wcrtomb.3 wcsrtombs.3 wcstombs.3 wcstol.3 \ + wctob.3 wctomb.3 wctype.3 iswctype.3 wctrans.3 towctrans.3 MLINKS+=setlocale.3 localeconv.3 \ iswalnum.3 iswalpha.3 \ iswalnum.3 iswblank.3 \ @@ -26,6 +26,11 @@ MLINKS+=setlocale.3 localeconv.3 \ iswalnum.3 iswspace.3 \ iswalnum.3 iswupper.3 \ iswalnum.3 iswxdigit.3 \ - towlower.3 towupper.3 + towlower.3 towupper.3 \ + wcstol.3 wcstoul.3 \ + wcstol.3 wcstoll.3 \ + wcstol.3 wcstoull.3 \ + wcstol.3 wcstoimax.3 \ + wcstol.3 wcstoumax.3 CFLAGS+=-I${.CURDIR} diff --git a/lib/libc/locale/wcstol.3 b/lib/libc/locale/wcstol.3 new file mode 100644 index 00000000000..e8f1dedf14b --- /dev/null +++ b/lib/libc/locale/wcstol.3 @@ -0,0 +1,88 @@ +.\" $OpenBSD: wcstol.3,v 1.1 2008/12/20 23:08:08 kettenis Exp $ +.\" $NetBSD: wcstol.3,v 1.2 2006/08/08 17:32:05 wiz Exp $ +.\" +.\" 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. +.\" +.\" $FreeBSD: src/lib/libc/locale/wcstol.3,v 1.4 2002/11/29 17:35:09 ru Exp $ +.\" +.Dd $Mdocdate: December 20 2008 $ +.Dt WCSTOL 3 +.Os +.Sh NAME +.Nm wcstol , wcstoul , +.Nm wcstoll , wcstoull , +.Nm wcstoimax , wcstoumax +.Nd "convert a wide character string value to a long, unsigned long," +long long, unsigned long long, intmax_t or uintmax_t integer +.Sh SYNOPSIS +.In wchar.h +.Ft long +.Fn wcstol "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "int base" +.Ft "unsigned long" +.Fn wcstoul "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "int base" +.Ft "long long" +.Fn wcstoll "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "int base" +.Ft "unsigned long long" +.Fn wcstoull "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "int base" +.In inttypes.h +.Ft intmax_t +.Fn wcstoimax "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "int base" +.Ft uintmax_t +.Fn wcstoumax "const wchar_t * restrict nptr" "wchar_t ** restrict endptr" "int base" +.Sh DESCRIPTION +The +.Fn wcstol , +.Fn wcstoul , +.Fn wcstoll , +.Fn wcstoull , +.Fn wcstoimax +and +.Fn wcstoumax +functions are wide-character versions of the +.Fn strtol , +.Fn strtoul , +.Fn strtoll , +.Fn strtoull , +.Fn strtoimax +and +.Fn strtoumax +functions, respectively. +Refer to their manual pages (for example +.Xr strtol 3 ) +for details. +.Sh SEE ALSO +.Xr strtol 3 , +.Xr strtoul 3 +.Sh STANDARDS +The +.Fn wcstol , +.Fn wcstoul , +.Fn wcstoll , +.Fn wcstoull , +.Fn wcstoimax +and +.Fn wcstoumax +functions conform to +.St -isoC-99 . |