diff --git a/lib/libc/locale/Makefile.inc b/lib/libc/locale/Makefile.inc index a8daa1ff284e..017a767ef9dc 100644 --- a/lib/libc/locale/Makefile.inc +++ b/lib/libc/locale/Makefile.inc @@ -1,90 +1,104 @@ # from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ # locale sources .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/locale ${LIBC_SRCTOP}/locale SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ gb18030.c gb2312.c gbk.c ctype.c isctype.c iswctype.c \ ldpart.c lmessages.c lmonetary.c lnumeric.c localeconv.c mblen.c \ mbrlen.c \ mbrtowc.c mbsinit.c mbsnrtowcs.c \ mbsrtowcs.c mbtowc.c mbstowcs.c \ mskanji.c nextwctype.c nl_langinfo.c nomacros.c none.c rpmatch.c \ rune.c \ runetype.c setlocale.c setrunelocale.c \ table.c \ tolower.c toupper.c utf8.c wcrtomb.c wcsnrtombs.c \ wcsrtombs.c wcsftime.c \ wcstof.c wcstod.c \ wcstoimax.c wcstol.c wcstold.c wcstoll.c \ wcstombs.c \ wcstoul.c wcstoull.c wcstoumax.c wctob.c wctomb.c wctrans.c wctype.c \ wcwidth.c\ xlocale.c .if ${MK_ICONV} != "no" SRCS+= c16rtomb_iconv.c c32rtomb_iconv.c mbrtoc16_iconv.c mbrtoc32_iconv.c .else SRCS+= c16rtomb.c c32rtomb.c mbrtoc16.c mbrtoc32.c .endif SYM_MAPS+=${LIBC_SRCTOP}/locale/Symbol.map MAN+= btowc.3 \ ctype_l.3 \ ctype.3 digittoint.3 isalnum.3 isalpha.3 isascii.3 isblank.3 iscntrl.3 \ isdigit.3 isgraph.3 isideogram.3 islower.3 isphonogram.3 isprint.3 \ ispunct.3 isrune.3 isspace.3 isspecial.3 \ isupper.3 iswalnum.3 iswalnum_l.3 isxdigit.3 \ localeconv.3 mblen.3 mbrlen.3 \ mbrtowc.3 \ mbsinit.3 \ mbsrtowcs.3 mbstowcs.3 mbtowc.3 multibyte.3 \ nextwctype.3 nl_langinfo.3 rpmatch.3 \ setlocale.3 toascii.3 tolower.3 toupper.3 towlower.3 towupper.3 \ wcsftime.3 \ wcrtomb.3 \ wcsrtombs.3 wcstod.3 wcstol.3 wcstombs.3 wctomb.3 \ wctrans.3 wctype.3 wcwidth.3 \ duplocale.3 freelocale.3 newlocale.3 querylocale.3 uselocale.3 xlocale.3 MAN+= big5.5 euc.5 gb18030.5 gb2312.5 gbk.5 mskanji.5 utf8.5 MLINKS+=btowc.3 wctob.3 -MLINKS+=isdigit.3 isnumber.3 +MLINKS+=digittoint.3 digittoint_l.3 +MLINKS+=isalnum.3 isalnum_l.3 +MLINKS+=isalpha.3 isalpha_l.3 +MLINKS+=isblank.3 isblank_l.3 +MLINKS+=iscntrl.3 iscntrl_l.3 +MLINKS+=isdigit.3 isnumber.3 isdigit.3 isdigit_l.3 isdigit.3 isnumber_l.3 MLINKS+=isgraph.3 isgraph_l.3 +MLINKS+=isideogram.3 isideogram_l.3 MLINKS+=islower.3 islower_l.3 +MLINKS+=isphonogram.3 isphonogram_l.3 +MLINKS+=isprint.3 isprint_l.3 MLINKS+=ispunct.3 ispunct_l.3 +MLINKS+=isrune.3 isrune_l.3 MLINKS+=isspace.3 isspace_l.3 +MLINKS+=isspecial.3 isspecial_l.3 +MLINKS+=isupper.3 isupper_l.3 +MLINKS+=tolower.3 tolower_l.3 +MLINKS+=toupper.3 toupper_l.3 MLINKS+=nl_langinfo.3 nl_langinfo_l.3 MLINKS+=iswalnum.3 iswalpha.3 iswalnum.3 iswascii.3 iswalnum.3 iswblank.3 \ iswalnum.3 iswcntrl.3 iswalnum.3 iswdigit.3 iswalnum.3 iswgraph.3 \ iswalnum.3 iswhexnumber.3 \ iswalnum.3 iswideogram.3 iswalnum.3 iswlower.3 iswalnum.3 iswnumber.3 \ iswalnum.3 iswphonogram.3 iswalnum.3 iswprint.3 iswalnum.3 iswpunct.3 \ iswalnum.3 iswrune.3 iswalnum.3 iswspace.3 iswalnum.3 iswspecial.3 \ iswalnum.3 iswupper.3 iswalnum.3 iswxdigit.3 MLINKS+=iswalnum_l.3 iswalpha_l.3 iswalnum_l.3 iswcntrl_l.3 \ iswalnum_l.3 iswctype_l.3 iswalnum_l.3 iswdigit_l.3 \ iswalnum_l.3 iswgraph_l.3 iswalnum_l.3 iswlower_l.3 \ iswalnum_l.3 iswprint_l.3 iswalnum_l.3 iswpunct_l.3 \ iswalnum_l.3 iswspace_l.3 iswalnum_l.3 iswupper_l.3 \ iswalnum_l.3 iswxdigit_l.3 iswalnum_l.3 towlower_l.3 \ iswalnum_l.3 towupper_l.3 iswalnum_l.3 wctype_l.3 \ iswalnum_l.3 iswblank_l.3 iswalnum_l.3 iswhexnumber_l.3 \ iswalnum_l.3 iswideogram_l.3 iswalnum_l.3 iswnumber_l.3 \ iswalnum_l.3 iswphonogram_l.3 iswalnum_l.3 iswrune_l.3 \ iswalnum_l.3 iswspecial_l.3 iswalnum_l.3 nextwctype_l.3 \ iswalnum_l.3 towctrans_l.3 iswalnum_l.3 wctrans_l.3 -MLINKS+=isxdigit.3 ishexnumber.3 +MLINKS+=isxdigit.3 ishexnumber.3 isxdigit.3 isxdigit_l.3 \ + isxdigit.3 ishexnumber_l.3 MLINKS+=localeconv.3 localeconv_l.3 MLINKS+=mbrtowc.3 mbrtoc16.3 mbrtowc.3 mbrtoc32.3 MLINKS+=mbsrtowcs.3 mbsnrtowcs.3 MLINKS+=wcrtomb.3 c16rtomb.3 wcrtomb.3 c32rtomb.3 MLINKS+=wcsrtombs.3 wcsnrtombs.3 MLINKS+=wcstod.3 wcstof.3 wcstod.3 wcstold.3 MLINKS+=wcstol.3 wcstoul.3 wcstol.3 wcstoll.3 wcstol.3 wcstoull.3 \ wcstol.3 wcstoimax.3 wcstol.3 wcstoumax.3 MLINKS+=wctrans.3 towctrans.3 MLINKS+=wctype.3 iswctype.3 diff --git a/lib/libc/locale/ctype_l.3 b/lib/libc/locale/ctype_l.3 index 7680803667d2..fc5c1c370f76 100644 --- a/lib/libc/locale/ctype_l.3 +++ b/lib/libc/locale/ctype_l.3 @@ -1,150 +1,145 @@ .\" Copyright (c) 2011 The FreeBSD Foundation .\" .\" This documentation was written by David Chisnall under sponsorship from .\" the FreeBSD Foundation. .\" .\" 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 REGENTS 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 REGENTS 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$ .\" -.Dd March 6, 2012 +.Dd December 19, 2022 .Dt CTYPE_L 3 .Os .Sh NAME .Nm digittoint_l , .Nm isalnum_l , .Nm isalpha_l , -.Nm isascii_l , .Nm isblank_l , .Nm iscntrl_l , .Nm isdigit_l , .Nm isgraph_l , .Nm ishexnumber_l , .Nm isideogram_l , .Nm islower_l , .Nm isnumber_l , .Nm isphonogram_l , .Nm isprint_l , .Nm ispunct_l , .Nm isrune_l , .Nm isspace_l , .Nm isspecial_l , .Nm isupper_l , .Nm isxdigit_l , .Nm tolower_l , .Nm toupper_l .Nd character classification functions .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn digittoint_l "int c" "locale_t loc" .Ft int .Fn isalnum_l "int c" "locale_t loc" .Ft int .Fn isalpha_l "int c" "locale_t loc" .Ft int -.Fn isascii_l "int c" "locale_t loc" -.Ft int .Fn iscntrl_l "int c" "locale_t loc" .Ft int .Fn isdigit_l "int c" "locale_t loc" .Ft int .Fn isgraph_l "int c" "locale_t loc" .Ft int .Fn ishexnumber_l "int c" "locale_t loc" .Ft int .Fn isideogram_l "int c" "locale_t loc" .Ft int .Fn islower_l "int c" "locale_t loc" .Ft int .Fn isnumber_l "int c" "locale_t loc" .Ft int .Fn isphonogram_l "int c" "locale_t loc" .Ft int .Fn isspecial_l "int c" "locale_t loc" .Ft int .Fn isprint_l "int c" "locale_t loc" .Ft int .Fn ispunct_l "int c" "locale_t loc" .Ft int .Fn isrune_l "int c" "locale_t loc" .Ft int .Fn isspace_l "int c" "locale_t loc" .Ft int .Fn isupper_l "int c" "locale_t loc" .Ft int .Fn isxdigit_l "int c" "locale_t loc" .Ft int .Fn tolower_l "int c" "locale_t loc" .Ft int .Fn toupper_l "int c" "locale_t loc" .Sh DESCRIPTION The above functions perform character tests and conversions on the integer .Fa c in the locale .Fa loc . They behave in the same way as the versions without the _l suffix, but use the specified locale rather than the global or per-thread locale. .In ctype.h , or as true functions in the C library. See the specific manual pages for more information. .Sh SEE ALSO -.Xr digittoint 3 , -.Xr isalnum 3 , -.Xr isalpha 3 , -.Xr isascii 3 , -.Xr isblank 3 , -.Xr iscntrl 3 , -.Xr isdigit 3 , -.Xr isgraph 3 , -.Xr isideogram 3 , -.Xr islower 3 , -.Xr isphonogram 3 , -.Xr isprint 3 , -.Xr ispunct 3 , -.Xr isrune 3 , -.Xr isspace 3 , -.Xr isspecial 3 , -.Xr isupper 3 , -.Xr isxdigit 3 , -.Xr tolower 3 , -.Xr toupper 3 , -.Xr wctype 3 , -.Xr xlocale 3 +.Xr digittoint_l 3 , +.Xr isalnum_l 3 , +.Xr isalpha_l 3 , +.Xr isblank_l 3 , +.Xr iscntrl_l 3 , +.Xr isdigit_l 3 , +.Xr isgraph_l 3 , +.Xr isideogram_l 3 , +.Xr islower_l 3 , +.Xr isphonogram_l 3 , +.Xr isprint_l 3 , +.Xr ispunct_l 3 , +.Xr isrune_l 3 , +.Xr isspace_l 3 , +.Xr isspecial_l 3 , +.Xr isupper_l 3 , +.Xr isxdigit_l 3 , +.Xr tolower_l 3 , +.Xr toupper_l 3 , +.Xr wctype_l 3 , +.Xr xlocale_l 3 .Sh STANDARDS These functions conform to .St -p1003.1-2008 , except for .Fn digittoint_l , -.Fn isascii_l , .Fn ishexnumber_l , .Fn isideogram_l , .Fn isnumber_l , .Fn isphonogram_l , .Fn isrune_l and .Fn isspecial_l which are .Fx extensions. diff --git a/lib/libc/locale/digittoint.3 b/lib/libc/locale/digittoint.3 index 5caef66461e4..887910ac95b8 100644 --- a/lib/libc/locale/digittoint.3 +++ b/lib/libc/locale/digittoint.3 @@ -1,68 +1,78 @@ .\" Copyright (c) 1993 .\" The Regents of the University of California. 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)digittoint.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 6, 2001 +.Dd December 19, 2022 .Dt DIGITTOINT 3 .Os .Sh NAME -.Nm digittoint +.Nm digittoint , +.Nm digittoint_l .Nd convert a numeric character to its integer value .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn digittoint "int c" .Ft int .Fn digittoint_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn digittoint -function converts a numeric character to its corresponding integer value. +and +.Fn digittoint_l +functions convert a numeric character to its corresponding integer value. The character can be any decimal digit or hexadecimal digit. With hexadecimal characters, the case of the values does not matter. .Pp The .Fn digittoint_l function takes an explicit locale argument, whereas the .Fn digittoint function use the current global or per-thread locale. .Sh RETURN VALUES The .Fn digittoint -function always returns an integer from the range of 0 to 15. +and +.Fn digittoint_l +functions always return an integer from the range of 0 to 15. If the given character was not a digit as defined by -.Xr isxdigit 3 , +.Xr isxdigit 3 +or +.Xr isxdigit_l 3 , the function will return 0. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr isdigit 3 , +.Xr isdigit_l 3 , .Xr isxdigit 3 , +.Xr isxdigit_l 3 , .Xr xlocale 3 diff --git a/lib/libc/locale/isalnum.3 b/lib/libc/locale/isalnum.3 index 85e846332352..ca2c510c8fa2 100644 --- a/lib/libc/locale/isalnum.3 +++ b/lib/libc/locale/isalnum.3 @@ -1,120 +1,133 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isalnum.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2022 +.Dd December 19, 2022 .Dt ISALNUM 3 .Os .Sh NAME -.Nm isalnum +.Nm isalnum , +.Nm isalnum_l .Nd alphanumeric character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isalnum "int c" .Ft int .Fn isalnum_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isalnum -function tests for any character for which -.Xr isalpha 3 +and +.Fn isalnum_l +functions test for any character for which +.Xr isalpha 3 , +.Xr isalpha_l 3 or -.Xr isdigit 3 +.Xr isdigit 3 , +.Xr isdigit_l 3 is true. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" Ta "064\ ``4''" .It "\&065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" Ta "071\ ``9''" .It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" .It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" .It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" .It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" .It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" .It "\&132\ ``Z''" Ta "141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" .It "\&145\ ``e''" Ta "146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" .It "\&152\ ``j''" Ta "153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" .It "\&157\ ``o''" Ta "160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" .It "\&164\ ``t''" Ta "165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" .It "\&171\ ``y''" Ta "172\ ``z''" Ta \& Ta \& Ta \& .El .Pp The .Fn isalnum_l function takes an explicit locale argument, whereas the .Fn isalnum function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isalnum -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isalnum_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswalnum +or +.Fn iswalnum_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr isalpha 3 , +.Xr isalpha_l 3 , .Xr isdigit 3 , +.Xr isdigit_l 3 , .Xr iswalnum 3 , +.Xr iswalnum_l 3 , .Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isalnum function conforms to .St -isoC . The .Fn isalnum_l function conforms to .St -p1003.1-2008 . .Sh HISTORY The .Fn isalnum function first appeared in .At v7 . diff --git a/lib/libc/locale/isalpha.3 b/lib/libc/locale/isalpha.3 index 1a7330f3a0d1..d66e813d2986 100644 --- a/lib/libc/locale/isalpha.3 +++ b/lib/libc/locale/isalpha.3 @@ -1,113 +1,126 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isalpha.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd December 19, 2022 .Dt ISALPHA 3 .Os .Sh NAME -.Nm isalpha +.Nm isalpha , +.Nm isalpha_l .Nd alphabetic character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isalpha "int c" .Ft int .Fn isalpha_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isalpha -function tests for any character for which -.Xr isupper 3 +and +.Fn isalpha_l +functions test for any character for which +.Xr isupper 3 , +.Xr isupper_l 3 or -.Xr islower 3 +.Xr islower 3 , +.Xr islower_l 3 is true. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" .It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" .It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" .It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" .It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" .It "\&132\ ``Z''" Ta "141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" .It "\&145\ ``e''" Ta "146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" .It "\&152\ ``j''" Ta "153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" .It "\&157\ ``o''" Ta "160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" .It "\&164\ ``t''" Ta "165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" .It "\&171\ ``y''" Ta "172\ ``z''" Ta \& Ta \& Ta \& .El .Pp The .Fn isalpha_l function takes an explicit locale argument, whereas the .Fn isalpha function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isalpha -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isalpha_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswalpha +or +.Fn iswalpha_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr islower 3 , +.Xr islower_l 3 , .Xr isupper 3 , +.Xr isupper_l 3 , .Xr iswalpha 3 , +.Xr iswalpha_l 3 , .Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isalpha function conforms to .St -isoC . The .Fn isalpha_l function conforms to .St -p1003.1-2008 . diff --git a/lib/libc/locale/isblank.3 b/lib/libc/locale/isblank.3 index b3e805ae0085..b901a9b9ad95 100644 --- a/lib/libc/locale/isblank.3 +++ b/lib/libc/locale/isblank.3 @@ -1,96 +1,107 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isblank.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd December 19, 2022 .Dt ISBLANK 3 .Os .Sh NAME -.Nm isblank +.Nm isblank , +.Nm isblank_l .Nd space or tab character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isblank "int c" .Ft int .Fn isblank_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isblank -function tests for a space or tab character. +and +.Fn isblank_l +functions test for a space or tab character. For any locale, this includes the following standard characters: .Bl -column XXXX .It Do \et Dc Ta Dq " " .El .Pp In the "C" locale, a successful .Fn isblank +or +.Fn isblank_l test is limited to these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp The .Fn isblank_l function takes an explicit locale argument, whereas the .Fn isblank function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isblank -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isblank_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswblank +or +.Fn iswblank_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswblank 3 , +.Xr iswblank_l 3 , .Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isblank function conforms to .St -isoC-99 . The .Fn isblank_l function conforms to .St -p1003.1-2008 . diff --git a/lib/libc/locale/iscntrl.3 b/lib/libc/locale/iscntrl.3 index b61563735f74..adfda27fb531 100644 --- a/lib/libc/locale/iscntrl.3 +++ b/lib/libc/locale/iscntrl.3 @@ -1,108 +1,117 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)iscntrl.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2022 +.Dd December 19, 2022 .Dt ISCNTRL 3 .Os .Sh NAME -.Nm iscntrl +.Nm iscntrl , +.Nm iscntrl_l .Nd control character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn iscntrl "int c" .Ft int .Fn iscntrl_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn iscntrl -function tests for any control character. +and +.Fn iscntrl_l +functions test for any control character. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&000\ NUL" Ta "001\ SOH" Ta "002\ STX" Ta "003\ ETX" Ta "004\ EOT" .It "\&005\ ENQ" Ta "006\ ACK" Ta "007\ BEL" Ta "010\ BS" Ta "011\ HT" .It "\&012\ NL" Ta "013\ VT" Ta "014\ NP" Ta "015\ CR" Ta "016\ SO" .It "\&017\ SI" Ta "020\ DLE" Ta "021\ DC1" Ta "022\ DC2" Ta "023\ DC3" .It "\&024\ DC4" Ta "025\ NAK" Ta "026\ SYN" Ta "027\ ETB" Ta "030\ CAN" .It "\&031\ EM" Ta "032\ SUB" Ta "033\ ESC" Ta "034\ FS" Ta "035\ GS" .It "\&036\ RS" Ta "037\ US" Ta "177\ DEL" Ta \& Ta \& .El .Pp The .Fn iscntrl_l function takes an explicit locale argument, whereas the .Fn iscntrl function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn iscntrl -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn iscntrl_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswcntrl +or +.Fn iswcntrl_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswcntrl 3 , +.Xr iswcntrl_l 3 , .Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn iscntrl function conforms to .St -isoC . The .Fn iscntrl_l function conforms to .St -p1003.1-2008 . .Sh HISTORY The .Fn iscntrl function first appeared in .At v7 . diff --git a/lib/libc/locale/isdigit.3 b/lib/libc/locale/isdigit.3 index d1a75465e277..c627e58d85d5 100644 --- a/lib/libc/locale/isdigit.3 +++ b/lib/libc/locale/isdigit.3 @@ -1,114 +1,128 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isdigit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 4, 2007 +.Dd December 19, 2022 .Dt ISDIGIT 3 .Os .Sh NAME .Nm isdigit , -.Nm isnumber +.Nm isnumber , +.Nm isdigit_l , +.Nm isnumber_l .Nd decimal-digit character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isdigit "int c" .Ft int .Fn isnumber "int c" .Ft int .Fn isdigit_l "int c" "locale_t loc" .Ft int .Fn isnumber_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isdigit -function tests for a decimal digit character. +and +.Fn isdigit_l +functions test for a decimal digit character. Regardless of locale, this includes the following characters only: .Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ .It "\&``0''" Ta "``1''" Ta "``2''" Ta "``3''" Ta "``4''" .It "\&``5''" Ta "``6''" Ta "``7''" Ta "``8''" Ta "``9''" .El .Pp The .Fn isnumber -function behaves similarly to -.Fn isdigit , +and +.Fn isnumber_l +functions behave similarly to +.Fn isdigit +and +.Fn isdigit_l , but may recognize additional characters, depending on the current locale setting. .Pp The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp The _l-suffixed versions take an explicit locale argument, whereas the non-suffixed versions use the current global or per-thread locale. .Sh RETURN VALUES The -.Fn isdigit +.Fn isdigit , +.Fn isdigit_l , +.Fn isnumber , and -.Fn isnumber +.Fn isnumber_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswdigit +or +.Fn iswdigit_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswdigit 3 , +.Xr iswdigit_l 3 , .Xr multibyte 3 , .Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isdigit function conforms to .St -isoC . The .Fn isdigit_l function conforms to .St -p1003.1-2008 . .Sh HISTORY The .Fn isnumber function appeared in .Bx 4.4 . diff --git a/lib/libc/locale/isgraph.3 b/lib/libc/locale/isgraph.3 index b3c078cea079..93bbb59139f7 100644 --- a/lib/libc/locale/isgraph.3 +++ b/lib/libc/locale/isgraph.3 @@ -1,119 +1,127 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isgraph.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd July 30, 2012 +.Dd December 19, 2022 .Dt ISGRAPH 3 .Os .Sh NAME -.Nm isgraph +.Nm isgraph , +.Nm isgraph_l .Nd printing character test (space character exclusive) .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isgraph "int c" .Ft int .Fn isgraph_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isgraph -function tests for any printing character except space +and +.Fn isgraph_l +functions test for any printing character except space .Pq Ql "\~" and other locale-specific space-like characters. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" Ta "045\ ``%''" .It "\&046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" Ta "052\ ``*''" .It "\&053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" Ta "057\ ``/''" .It "\&060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" Ta "064\ ``4''" .It "\&065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" Ta "071\ ``9''" .It "\&072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" Ta "076\ ``>''" .It "\&077\ ``?''" Ta "100\ ``@''" Ta "101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" .It "\&104\ ``D''" Ta "105\ ``E''" Ta "106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" .It "\&111\ ``I''" Ta "112\ ``J''" Ta "113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" .It "\&116\ ``N''" Ta "117\ ``O''" Ta "120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" .It "\&123\ ``S''" Ta "124\ ``T''" Ta "125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" .It "\&130\ ``X''" Ta "131\ ``Y''" Ta "132\ ``Z''" Ta "133\ ``[''" Ta "134\ ``\e\|''" .It "\&135\ ``]''" Ta "136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" Ta "141\ ``a''" .It "\&142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" Ta "146\ ``f''" .It "\&147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" Ta "153\ ``k''" .It "\&154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" Ta "160\ ``p''" .It "\&161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" Ta "165\ ``u''" .It "\&166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" Ta "172\ ``z''" .It "\&173\ ``{''" Ta "174\ ``|''" Ta "175\ ``}''" Ta "176\ ``~''" Ta \& .El .Pp The .Fn isgraph_l function takes an explicit locale argument, whereas the .Fn isgraph function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isgraph and .Fn isgraph_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswgraph +or +.Fn iswgraph_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswgraph 3 , +.Xr iswgraph_l 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isgraph function conforms to .St -isoC . The .Fn isgraph_l function conforms to .St -p1003.1-2008 . diff --git a/lib/libc/locale/isideogram.3 b/lib/libc/locale/isideogram.3 index cbaa625e91df..59b58f541a8d 100644 --- a/lib/libc/locale/isideogram.3 +++ b/lib/libc/locale/isideogram.3 @@ -1,57 +1,86 @@ .\" .\" Copyright (c) 2004 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$ .\" -.Dd March 30, 2004 +.Dd December 19, 2022 .Dt ISIDEOGRAM 3 .Os .Sh NAME -.Nm isideogram +.Nm isideogram , +.Nm isideogram_l .Nd ideographic character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isideogram "int c" +.Ft int +.Fn isideogram_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isideogram -function tests for an ideographic character. +and +.Fn isideogram_l +functions test for an ideographic character. +.Pp +The +.Fn isideogram_l +function takes an explicit locale argument, whereas the +.Fn isideogram +function use the current global or per-thread locale. .Sh RETURN VALUES The .Fn isideogram -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isideogram_l +functions return zero if the character tests false and +return non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswideogram +or +.Fn iswideogram_l +function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr isphonogram 3 , -.Xr iswideogram 3 +.Xr isphonogram_l 3 , +.Xr iswideogram 3 , +.Xr iswideogram_l 3 , +.Xr xlocale 3 .Sh HISTORY The .Fn isideogram function appeared in .Bx 4.4 . diff --git a/lib/libc/locale/islower.3 b/lib/libc/locale/islower.3 index 2097510acb93..0ef171788548 100644 --- a/lib/libc/locale/islower.3 +++ b/lib/libc/locale/islower.3 @@ -1,108 +1,117 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)islower.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2022 +.Dd December 19, 2022 .Dt ISLOWER 3 .Os .Sh NAME -.Nm islower +.Nm islower , +.Nm islower_l .Nd lower-case character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn islower "int c" .Ft int .Fn islower_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn islower -function tests for any lower-case letters. +and +.Fn islower_l +functions test for any lower-case letters. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" .It "\&146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" .It "\&153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" .It "\&160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" .It "\&165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" .It "\&172\ ``z''" Ta \& Ta \& Ta \& Ta \& .El The .Fn islower_l function takes an explicit locale argument, whereas the .Fn islower function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn islower and .Fn islower_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswlower +or +.Fn iswlower_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswlower 3 , +.Xr iswlower_l 3 , .Xr tolower 3 , +.Xr tolower_l 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn islower function conforms to .St -isoC . The .Fn islower_l function conforms to .St -p1003.1-2008 . .Sh HISTORY The .Fn islower function first appeared in .At v7 . diff --git a/lib/libc/locale/isphonogram.3 b/lib/libc/locale/isphonogram.3 index b0d82c428cba..6b4f29f50319 100644 --- a/lib/libc/locale/isphonogram.3 +++ b/lib/libc/locale/isphonogram.3 @@ -1,57 +1,74 @@ .\" .\" Copyright (c) 2004 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$ .\" -.Dd March 30, 2004 +.Dd December 19, 2022 .Dt ISPHONOGRAM 3 .Os .Sh NAME -.Nm isphonogram +.Nm isphonogram , +.Nm isphonogram_l .Nd phonographic character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isphonogram "int c" +.Ft int +.Fn isphonogram_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isphonogram -function tests for a phonographic character. +and +.Fn isphonogram_l +functions test for a phonographic character. +.Pp +The +.Fn isphonogram_l +function takes an explicit locale argument, whereas the +.Fn isphonogram +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isphonogram -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isphonogram_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr isideogram 3 , -.Xr iswphonogram 3 +.Xr isideogram_l 3 , +.Xr iswphonogram 3 , +.Xr iswphonogram_l 3 , +.Xr xlocale 3 .Sh HISTORY The .Fn isphonogram function appeared in .Bx 4.4 . diff --git a/lib/libc/locale/isprint.3 b/lib/libc/locale/isprint.3 index 6e740d3e850d..56f8ae828611 100644 --- a/lib/libc/locale/isprint.3 +++ b/lib/libc/locale/isprint.3 @@ -1,108 +1,126 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isprint.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2022 +.Dd December 19, 2022 .Dt ISPRINT 3 .Os .Sh NAME -.Nm isprint +.Nm isprint , +.Nm isprint_l .Nd printing character test (space character inclusive) .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isprint "int c" +.Ft int +.Fn isprint_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isprint -function tests for any printing character, including space +and +.Fn isprint_l +functions test for any printing character, including space .Pq Ql "\ " . The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&040\ sp" Ta "041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" .It "\&045\ ``%''" Ta "046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" .It "\&052\ ``*''" Ta "053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" .It "\&057\ ``/''" Ta "060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" .It "\&064\ ``4''" Ta "065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" .It "\&071\ ``9''" Ta "072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" .It "\&076\ ``>''" Ta "077\ ``?''" Ta "100\ ``@''" Ta "101\ ``A''" Ta "102\ ``B''" .It "\&103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" Ta "106\ ``F''" Ta "107\ ``G''" .It "\&110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" Ta "113\ ``K''" Ta "114\ ``L''" .It "\&115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" Ta "120\ ``P''" Ta "121\ ``Q''" .It "\&122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" Ta "125\ ``U''" Ta "126\ ``V''" .It "\&127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" Ta "132\ ``Z''" Ta "133\ ``[''" .It "\&134\ ``\e\|''" Ta "135\ ``]''" Ta "136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" .It "\&141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" .It "\&146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" .It "\&153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" .It "\&160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" .It "\&165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" .It "\&172\ ``z''" Ta "173\ ``{''" Ta "174\ ``|''" Ta "175\ ``}''" Ta "176\ ``~''" .El +.Pp +The +.Fn isprint_l +function takes an explicit locale argument, whereas the +.Fn isprint +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isprint -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isprint_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswprint +or +.Fn iswprint_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswprint 3 , +.Xr iswprint_l 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isprint function conforms to .St -isoC . .Sh HISTORY The .Fn isprint function first appeared in .At v7 . diff --git a/lib/libc/locale/ispunct.3 b/lib/libc/locale/ispunct.3 index f0c838d069a3..424723377a01 100644 --- a/lib/libc/locale/ispunct.3 +++ b/lib/libc/locale/ispunct.3 @@ -1,114 +1,124 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)ispunct.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2022 +.Dd December 19, 2022 .Dt ISPUNCT 3 .Os .Sh NAME -.Nm ispunct +.Nm ispunct , +.Nm ispunct_l .Nd punctuation character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn ispunct "int c" .Ft int .Fn ispunct_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn ispunct -function tests for any printing character except for space +and +.Fn ispunct_l +functions test for any printing character except for space .Pq Ql "\ " or a character for which .Xr isalnum 3 +or +.Xr isalnum_l 3 is true. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" Ta "045\ ``%''" .It "\&046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" Ta "052\ ``*''" .It "\&053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" Ta "057\ ``/''" .It "\&072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" Ta "076\ ``>''" .It "\&077\ ``?''" Ta "100\ ``@''" Ta "133\ ``[''" Ta "134\ ``\e\|''" Ta "135\ ``]''" .It "\&136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" Ta "173\ ``{''" Ta "174\ ``|''" .It "\&175\ ``}''" Ta "176\ ``~''" Ta \& Ta \& Ta \& .El .Pp The .Fn ispunct_l function takes an explicit locale argument, whereas the .Fn ispunct function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn ispunct and .Fn ispunct_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswpunct +or +.Fn iswpunct_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswpunct 3 , +.Xr iswpunct_l 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn ispunct function conforms to .St -isoC . The .Fn ispunct_l function conforms to .St -p1003.1-2008 . .Sh HISTORY The .Fn ispunct function first appeared in .At v7 . diff --git a/lib/libc/locale/isrune.3 b/lib/libc/locale/isrune.3 index 424c367d2014..1592eb8574f5 100644 --- a/lib/libc/locale/isrune.3 +++ b/lib/libc/locale/isrune.3 @@ -1,63 +1,91 @@ .\" .\" Copyright (c) 2004 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$ .\" -.Dd March 30, 2004 +.Dd December 19, 2022 .Dt ISRUNE 3 .Os .Sh NAME -.Nm isrune +.Nm isrune , +.Nm isrune_l .Nd valid character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isrune "int c" +.Ft int +.Fn isrune_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isrune -function tests for any character that is valid in the current +and +.Fn isrune_l +functions test for any character that is valid in the current character set. In the .Tn ASCII character set, this is equivalent to .Fn isascii . +.Pp +The +.Fn isrune_l +function takes an explicit locale argument, whereas the +.Fn isrune +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isrune -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isrune_l +functions return zero if the character tests false and +return non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswrune +or +.Fn iswrune_l +function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr isascii 3 , .Xr iswrune 3 , +.Xr iswrune_l 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh HISTORY The .Fn isrune function appeared in .Bx 4.4 . diff --git a/lib/libc/locale/isspace.3 b/lib/libc/locale/isspace.3 index 67eb1b956c83..370b5ff091a2 100644 --- a/lib/libc/locale/isspace.3 +++ b/lib/libc/locale/isspace.3 @@ -1,106 +1,116 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isspace.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2022 +.Dd December 19, 2022 .Dt ISSPACE 3 .Os .Sh NAME -.Nm isspace +.Nm isspace , +.Nm isspace_l .Nd white-space character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isspace "int c" .Ft int .Fn isspace_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isspace -function tests for white-space characters. +and +.Fn isspace_l +functions test for white-space characters. For any locale, this includes the following standard characters: .Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ .It "\&``\et''" Ta "``\en''" Ta "``\ev''" Ta "``\ef''" Ta "``\er''" Ta "`` ''" .El .Pp In the "C" locale, .Fn isspace -returns non-zero for these characters only. +and +.Fn isspace_l +return non-zero for these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp The .Fn isspace_l function takes an explicit locale argument, whereas the .Fn isspace function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isspace and .Fn isspace_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswspace +or +.Fn iswspace_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswspace 3 , +.Xr iswspace_l 3 , .Xr multibyte 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isspace function conforms to .St -isoC . The .Fn isspace_l function conforms to .St -p1003.1-2008 . .Sh HISTORY The .Fn isspace function first appeared in .At v7 . diff --git a/lib/libc/locale/isspecial.3 b/lib/libc/locale/isspecial.3 index de361d28f96b..ea0071a8c56e 100644 --- a/lib/libc/locale/isspecial.3 +++ b/lib/libc/locale/isspecial.3 @@ -1,56 +1,84 @@ .\" .\" Copyright (c) 2004 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$ .\" -.Dd March 30, 2004 +.Dd December 19, 2022 .Dt ISSPECIAL 3 .Os .Sh NAME -.Nm isspecial +.Nm isspecial , +.Nm isspecial_l .Nd special character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isspecial "int c" +.Ft int +.Fn isspecial_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isspecial -function tests for a special character. +and +.Fn isspecial_l +functions test for a special character. +.Pp +The +.Fn isspecial_l +function takes an explicit locale argument, whereas the +.Fn isspecial +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isspecial -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isspecial_l +functions return zero if the character tests false and +return non-zero if the character tests true. +.Sh COMPATIBILITY +The +.Bx 4.4 +extension of accepting arguments outside of the range of the +.Vt "unsigned char" +type in locales with large character sets is considered obsolete +and may not be supported in future releases. +The +.Fn iswspecial +or +.Fn iswspecial_l +function should be used instead. .Sh SEE ALSO .Xr ctype 3 , -.Xr iswspecial 3 +.Xr ctype_l 3 , +.Xr iswspecial 3 , +.Xr iswspecial_l 3 , +.Xr xlocale 3 .Sh HISTORY The .Fn isspecial function appeared in .Bx 4.4 . diff --git a/lib/libc/locale/isupper.3 b/lib/libc/locale/isupper.3 index a26fc9c610a9..9e9f27c6242c 100644 --- a/lib/libc/locale/isupper.3 +++ b/lib/libc/locale/isupper.3 @@ -1,95 +1,114 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isupper.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2022 +.Dd December 19, 2022 .Dt ISUPPER 3 .Os .Sh NAME -.Nm isupper +.Nm isupper , +.Nm isupper_l .Nd upper-case character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isupper "int c" +.Ft int +.Fn isupper_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isupper -function tests for any upper-case letter. +and +.Fn isupper_l +functions test for any upper-case letter. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" .It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" .It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" .It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" .It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" .It "\&132\ ``Z''" Ta \& Ta \& Ta \& Ta \& .El +.Pp +The +.Fn isupper_l +function takes an explicit locale argument, whereas the +.Fn isupper +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isupper -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isupper_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswupper +or +.Fn iswupper_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswupper 3 , +.Xr iswupper_l 3 , .Xr toupper 3 , +.Xr toupper_l 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isupper function conforms to .St -isoC . .Sh HISTORY The .Fn isupper function first appeared in .At v7 . diff --git a/lib/libc/locale/isxdigit.3 b/lib/libc/locale/isxdigit.3 index 7e065a4e255a..e812c2e12361 100644 --- a/lib/libc/locale/isxdigit.3 +++ b/lib/libc/locale/isxdigit.3 @@ -1,102 +1,124 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)isxdigit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd December 19, 2022 .Dt ISXDIGIT 3 .Os .Sh NAME .Nm isxdigit , -.Nm ishexnumber +.Nm ishexnumber , +.Nm isxdigit_l , +.Nm ishexnumber_l .Nd hexadecimal-digit character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isxdigit "int c" .Ft int .Fn ishexnumber "int c" +.Ft int +.Fn isxdigit_l "int c" "locale_t loc" +.Ft int +.Fn ishexnumber_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isxdigit -function tests for any hexadecimal-digit character. +and +.Fn isxdigit_l +functions test for any hexadecimal-digit character. Regardless of locale, this includes the following characters only: .Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ .It "\&``0''" Ta "``1''" Ta "``2''" Ta "``3''" Ta "``4''" .It "\&``5''" Ta "``6''" Ta "``7''" Ta "``8''" Ta "``9''" .It "\&``A''" Ta "``B''" Ta "``C''" Ta "``D''" Ta "``E''" .It "\&``F''" Ta "``a''" Ta "``b''" Ta "``c''" Ta "``d''" .It "\&``e''" Ta "``f''" Ta \& Ta \& Ta \& .El .Pp The .Fn ishexnumber -function behaves similarly to -.Fn isxdigit , +and +.Fn ishexnumber_l +functions behave similarly to +.Fn isxdigit +and +.Fn isxdigit_l , but may recognize additional characters, depending on the current locale setting. .Pp The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . +.Pp +The _l-suffixed versions take an explicit locale argument, whereas the +non-suffixed versions use the current global or per-thread locale. .Sh RETURN VALUES The .Fn isxdigit -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isxdigit_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswxdigit +or +.Fn iswxdigit_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr iswxdigit 3 , +.Xr iswxdigit_l 3 , +.Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isxdigit function conforms to .St -isoC . .Sh HISTORY The .Fn ishexnumber function appeared in .Bx 4.4 . diff --git a/lib/libc/locale/tolower.3 b/lib/libc/locale/tolower.3 index 0c6dfd9349fb..e109bed7f319 100644 --- a/lib/libc/locale/tolower.3 +++ b/lib/libc/locale/tolower.3 @@ -1,79 +1,98 @@ .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)tolower.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 25, 2010 +.Dd December 19, 2022 .Dt TOLOWER 3 .Os .Sh NAME -.Nm tolower +.Nm tolower , +.Nm tolower_l .Nd upper case to lower case letter conversion .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn tolower "int c" +.Ft int +.Fn tolower_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn tolower -function converts an upper-case letter to the corresponding lower-case +and +.Fn tolower_l +functions convert an upper-case letter to the corresponding lower-case letter. The argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . +.Pp +The +.Fn tolower_l +function takes an explicit locale argument, whereas the +.Fn tolower +function uses the current global or per-thread locale. .Sh RETURN VALUES If the argument is an upper-case letter, the .Fn tolower -function returns the corresponding lower-case letter if there is +and +.Fn tolower_l +functions return the corresponding lower-case letter if there is one; otherwise, the argument is returned unchanged. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn towlower +or +.Fn towlower_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr islower 3 , -.Xr towlower 3 +.Xr islower_l 3 , +.Xr towlower 3 , +.Xr towlower_l 3 , +.Xr xlocale 3 .Sh STANDARDS The .Fn tolower function conforms to .St -isoC . diff --git a/lib/libc/locale/toupper.3 b/lib/libc/locale/toupper.3 index 5a3cf3fadeff..e8b0329a4619 100644 --- a/lib/libc/locale/toupper.3 +++ b/lib/libc/locale/toupper.3 @@ -1,79 +1,98 @@ .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)toupper.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 25, 2010 +.Dd December 19, 2022 .Dt TOUPPER 3 .Os .Sh NAME -.Nm toupper +.Nm toupper , +.Nm toupper_l .Nd lower case to upper case letter conversion .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn toupper "int c" +.Ft int +.Fn toupper_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn toupper -function converts a lower-case letter to the corresponding +and +.Fn toupper_l +functions convert a lower-case letter to the corresponding upper-case letter. The argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . +.Pp +The +.Fn toupper_l +function takes an explicit locale argument, whereas the +.Fn toupper +function uses the current global or per-thread locale. .Sh RETURN VALUES If the argument is a lower-case letter, the .Fn toupper -function returns the corresponding upper-case letter if there is +and +.Fn toupper_l +functions return the corresponding upper-case letter if there is one; otherwise, the argument is returned unchanged. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn towupper +or +.Fn towupper_l function should be used instead. .Sh SEE ALSO .Xr ctype 3 , +.Xr ctype_l 3 , .Xr isupper 3 , -.Xr towupper 3 +.Xr isupper_l 3 , +.Xr towupper 3 , +.Xr towupper_l 3 , +.Xr xlocale 3 .Sh STANDARDS The .Fn toupper function conforms to .St -isoC .