diff --git a/src/lib/libc/string/bcmp.3 b/src/lib/libc/string/bcmp.3 deleted file mode 100644 index a3709e5..0000000 --- a/src/lib/libc/string/bcmp.3 +++ /dev/null @@ -1,81 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)bcmp.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/bcmp.3,v 1.10 2003/09/08 19:57:15 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt BCMP 3 -.Os -.Sh NAME -.Nm bcmp -.Nd compare byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In strings.h -.Ft int -.Fn bcmp "const void *b1" "const void *b2" "size_t len" -.Sh DESCRIPTION -The -.Fn bcmp -function -compares byte string -.Fa b1 -against byte string -.Fa b2 , -returning zero if they are identical, non-zero otherwise. -Both strings are assumed to be -.Fa len -bytes long. -Zero-length strings are always identical. -.Pp -The strings may overlap. -.Sh SEE ALSO -.Xr memcmp 3 , -.Xr strcasecmp 3 , -.Xr strcmp 3 , -.Xr strcoll 3 , -.Xr strxfrm 3 -.Sh HISTORY -A -.Fn bcmp -function first appeared in -.Bx 4.2 . -Its prototype existed previously in -.In string.h -before it was moved to -.In strings.h -for -.St -p1003.1-2001 -compliance. diff --git a/src/lib/libc/string/bcopy.3 b/src/lib/libc/string/bcopy.3 deleted file mode 100644 index 6513af4..0000000 --- a/src/lib/libc/string/bcopy.3 +++ /dev/null @@ -1,81 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)bcopy.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/bcopy.3,v 1.9 2003/09/08 19:57:15 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt BCOPY 3 -.Os -.Sh NAME -.Nm bcopy -.Nd copy byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In strings.h -.Ft void -.Fn bcopy "const void *src" "void *dst" "size_t len" -.Sh DESCRIPTION -The -.Fn bcopy -function -copies -.Fa len -bytes from string -.Fa src -to string -.Fa dst . -The two strings may overlap. -If -.Fa len -is zero, no bytes are copied. -.Sh SEE ALSO -.Xr memccpy 3 , -.Xr memcpy 3 , -.Xr memmove 3 , -.Xr strcpy 3 , -.Xr strncpy 3 -.Sh HISTORY -A -.Fn bcopy -function appeared in -.Bx 4.2 . -Its prototype existed previously in -.In string.h -before it was moved to -.In strings.h -for -.St -p1003.1-2001 -compliance. diff --git a/src/lib/libc/string/bstring.3 b/src/lib/libc/string/bstring.3 deleted file mode 100644 index 3629a3e..0000000 --- a/src/lib/libc/string/bstring.3 +++ /dev/null @@ -1,112 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)bstring.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/bstring.3,v 1.7 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt BSTRING 3 -.Os -.Sh NAME -.Nm bcmp , -.Nm bcopy , -.Nm bzero , -.Nm memccpy , -.Nm memchr , -.Nm memcmp , -.Nm memcpy , -.Nm memmove , -.Nm memset -.Nd byte string operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft int -.Fn bcmp "const void *b1" "const void *b2" "size_t len" -.Ft void -.Fn bcopy "const void *src" "void *dst" "size_t len" -.Ft void -.Fn bzero "void *b" "size_t len" -.Ft void * -.Fn memchr "const void *b" "int c" "size_t len" -.Ft int -.Fn memcmp "const void *b1" "const void *b2" "size_t len" -.Ft void * -.Fn memccpy "void *dst" "const void *src" "int c" "size_t len" -.Ft void * -.Fn memcpy "void *dst" "const void *src" "size_t len" -.Ft void * -.Fn memmove "void *dst" "const void *src" "size_t len" -.Ft void * -.Fn memset "void *b" "int c" "size_t len" -.Sh DESCRIPTION -These functions operate on variable length strings of bytes. -They do not check for terminating null bytes as the routines -listed in -.Xr string 3 -do. -.Pp -See the specific manual pages for more information. -.Sh SEE ALSO -.Xr bcmp 3 , -.Xr bcopy 3 , -.Xr bzero 3 , -.Xr memccpy 3 , -.Xr memchr 3 , -.Xr memcmp 3 , -.Xr memcpy 3 , -.Xr memmove 3 , -.Xr memset 3 -.Sh STANDARDS -The functions -.Fn memchr , -.Fn memcmp , -.Fn memcpy , -.Fn memmove , -and -.Fn memset -conform to -.St -isoC . -.Sh HISTORY -The functions -.Fn bzero -and -.Fn memccpy -appeared in -.Bx 4.3 ; -the functions -.Fn bcmp , -.Fn bcopy , -appeared in -.Bx 4.2 . diff --git a/src/lib/libc/string/bzero.3 b/src/lib/libc/string/bzero.3 deleted file mode 100644 index 8a10597..0000000 --- a/src/lib/libc/string/bzero.3 +++ /dev/null @@ -1,78 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)bzero.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/bzero.3,v 1.9 2003/09/08 19:57:15 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt BZERO 3 -.Os -.Sh NAME -.Nm bzero -.Nd write zeroes to a byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In strings.h -.Ft void -.Fn bzero "void *b" "size_t len" -.Sh DESCRIPTION -The -.Fn bzero -function -writes -.Fa len -zero bytes to the string -.Fa b . -If -.Fa len -is zero, -.Fn bzero -does nothing. -.Sh SEE ALSO -.Xr memset 3 , -.Xr swab 3 -.Sh HISTORY -A -.Fn bzero -function -appeared in -.Bx 4.3 . -Its prototype existed previously in -.In string.h -before it was moved to -.In strings.h -for -.St -p1003.1-2001 -compliance. diff --git a/src/lib/libc/string/ffs.3 b/src/lib/libc/string/ffs.3 deleted file mode 100644 index 5879e02..0000000 --- a/src/lib/libc/string/ffs.3 +++ /dev/null @@ -1,100 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)ffs.3 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/string/ffs.3,v 1.8 2004/01/13 16:05:47 des Exp $ -.\" -.Dd April 19, 1994 -.Dt FFS 3 -.Os -.Sh NAME -.Nm ffs , -.Nm ffsl , -.Nm fls , -.Nm flsl -.Nd find first or last bit set in a bit string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In strings.h -.Ft int -.Fn ffs "int value" -.Ft int -.Fn ffsl "long value" -.Ft int -.Fn fls "int value" -.Ft int -.Fn flsl "long value" -.Sh DESCRIPTION -The -.Fn ffs -and -.Fn ffsl -functions find the first bit set in -.Fa value -and return the index of that bit. -.Pp -The -.Fn fls -and -.Fn flsl -functions find the last bit set in -.Fa value -and return the index of that bit. -.Pp -Bits are numbered starting from 1, starting at the right-most -(least significant) bit. -A return value of zero from any of these functions means that the -argument was zero. -.Sh SEE ALSO -.Xr bitstring 3 -.Sh HISTORY -The -.Fn ffs -function appeared in -.Bx 4.3 . -Its prototype existed previously in -.In string.h -before it was moved to -.In strings.h -for -.St -p1003.1-2001 -compliance. -.Pp -The -.Fn ffsl , -.Fn fls -and -.Fn flsl -functions appeared in -.Fx 5.3 . diff --git a/src/lib/libc/string/index.3 b/src/lib/libc/string/index.3 deleted file mode 100644 index c47e964..0000000 --- a/src/lib/libc/string/index.3 +++ /dev/null @@ -1,106 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)index.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/index.3,v 1.11 2003/09/08 19:57:15 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt INDEX 3 -.Os -.Sh NAME -.Nm index , rindex -.Nd locate character in string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In strings.h -.Ft "char *" -.Fn index "const char *s" "int c" -.Ft "char *" -.Fn rindex "const char *s" "int c" -.Sh DESCRIPTION -The -.Fn index -function -locates the first occurrence of -.Fa c -(converted to a -.Vt char ) -in the string pointed to by -.Fa s . -The terminating null character is considered part of the string; -therefore if -.Fa c -is -.Ql \e0 , -the functions locate the terminating -.Ql \e0 . -.Pp -The -.Fn rindex -function is identical to -.Fn index , -except it locates the last occurrence of -.Fa c . -.Sh RETURN VALUES -The functions -.Fn index -and -.Fn rindex -return a pointer to the located character, or -.Dv NULL -if the character does not appear in the string. -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh HISTORY -The -.Fn index -and -.Fn rindex -functions appeared in -.At v6 . -Their prototypes existed previously in -.In string.h -before they were moved to -.In strings.h -for -.St -p1003.1-2001 -compliance. diff --git a/src/lib/libc/string/memccpy.3 b/src/lib/libc/string/memccpy.3 deleted file mode 100644 index 44a457f..0000000 --- a/src/lib/libc/string/memccpy.3 +++ /dev/null @@ -1,76 +0,0 @@ -.\" Copyright (c) 1990, 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/string/memccpy.3,v 1.6 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 9, 1993 -.Dt MEMCCPY 3 -.Os -.Sh NAME -.Nm memccpy -.Nd copy string until character found -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft void * -.Fn memccpy "void *dst" "const void *src" "int c" "size_t len" -.Sh DESCRIPTION -The -.Fn memccpy -function -copies bytes from string -.Fa src -to string -.Fa dst . -If the character -.Fa c -(as converted to an unsigned char) occurs in the string -.Fa src , -the copy stops and a pointer to the byte after the copy of -.Fa c -in the string -.Fa dst -is returned. -Otherwise, -.Fa len -bytes are copied, and a NULL pointer is returned. -.Sh SEE ALSO -.Xr bcopy 3 , -.Xr memcpy 3 , -.Xr memmove 3 , -.Xr strcpy 3 -.Sh HISTORY -The -.Fn memccpy -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/string/memchr.3 b/src/lib/libc/string/memchr.3 deleted file mode 100644 index b363185..0000000 --- a/src/lib/libc/string/memchr.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)memchr.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/memchr.3,v 1.7 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt MEMCHR 3 -.Os -.Sh NAME -.Nm memchr -.Nd locate byte in byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft void * -.Fn memchr "const void *b" "int c" "size_t len" -.Sh DESCRIPTION -The -.Fn memchr -function -locates the first occurrence of -.Fa c -(converted to an unsigned char) -in string -.Fa b . -.Sh RETURN VALUES -The -.Fn memchr -function -returns a pointer to the byte located, -or NULL if no such byte exists within -.Fa len -bytes. -.Sh SEE ALSO -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh STANDARDS -The -.Fn memchr -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/memcmp.3 b/src/lib/libc/string/memcmp.3 deleted file mode 100644 index 980af28..0000000 --- a/src/lib/libc/string/memcmp.3 +++ /dev/null @@ -1,85 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)memcmp.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/memcmp.3,v 1.8 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt MEMCMP 3 -.Os -.Sh NAME -.Nm memcmp -.Nd compare byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft int -.Fn memcmp "const void *b1" "const void *b2" "size_t len" -.Sh DESCRIPTION -The -.Fn memcmp -function -compares byte string -.Fa b1 -against byte string -.Fa b2 . -Both strings are assumed to be -.Fa len -bytes long. -.Sh RETURN VALUES -The -.Fn memcmp -function -returns zero if the two strings are identical, -otherwise returns the difference between the first two differing bytes -(treated as unsigned char values, so that -.Sq Li \e200 -is greater than -.Sq Li \&\e0 , -for example). -Zero-length strings are always identical. -.Sh SEE ALSO -.Xr bcmp 3 , -.Xr strcasecmp 3 , -.Xr strcmp 3 , -.Xr strcoll 3 , -.Xr strxfrm 3 -.Sh STANDARDS -The -.Fn memcmp -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/memcpy.3 b/src/lib/libc/string/memcpy.3 deleted file mode 100644 index ba9cae9..0000000 --- a/src/lib/libc/string/memcpy.3 +++ /dev/null @@ -1,91 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)memcpy.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/memcpy.3,v 1.7 2002/01/07 06:03:37 dd Exp $ -.\" -.Dd June 4, 1993 -.Dt MEMCPY 3 -.Os -.Sh NAME -.Nm memcpy -.Nd copy byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft void * -.Fn memcpy "void *dst" "const void *src" "size_t len" -.Sh DESCRIPTION -The -.Fn memcpy -function -copies -.Fa len -bytes from string -.Fa src -to string -.Fa dst . -.Sh RETURN VALUES -The -.Fn memcpy -function -returns the original value of -.Fa dst . -.Sh SEE ALSO -.Xr bcopy 3 , -.Xr memccpy 3 , -.Xr memmove 3 , -.Xr strcpy 3 -.Sh STANDARDS -The -.Fn memcpy -function -conforms to -.St -isoC . -.Sh BUGS -In this implementation -.Fn memcpy -is implemented using -.Xr bcopy 3 , -and therefore the strings may overlap. -On other systems, copying overlapping strings may produce surprises. -Programs intended to be portable should use -.Xr memmove 3 -when -.Fa src -and -.Fa dst -may overlap. diff --git a/src/lib/libc/string/memmove.3 b/src/lib/libc/string/memmove.3 deleted file mode 100644 index 8f4f2cc..0000000 --- a/src/lib/libc/string/memmove.3 +++ /dev/null @@ -1,78 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)memmove.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/memmove.3,v 1.6 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt MEMMOVE 3 -.Os -.Sh NAME -.Nm memmove -.Nd copy byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft void * -.Fn memmove "void *dst" "const void *src" "size_t len" -.Sh DESCRIPTION -The -.Fn memmove -function -copies -.Fa len -bytes from string -.Fa src -to string -.Fa dst . -The two strings may overlap; -the copy is always done in a non-destructive manner. -.Sh RETURN VALUES -The -.Fn memmove -function returns the original value of -.Fa dst . -.Sh SEE ALSO -.Xr bcopy 3 , -.Xr memccpy 3 , -.Xr memcpy 3 , -.Xr strcpy 3 -.Sh STANDARDS -The -.Fn memmove -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/memset.3 b/src/lib/libc/string/memset.3 deleted file mode 100644 index 3f1ba5e..0000000 --- a/src/lib/libc/string/memset.3 +++ /dev/null @@ -1,73 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)memset.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/memset.3,v 1.7 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt MEMSET 3 -.Os -.Sh NAME -.Nm memset -.Nd write a byte to byte string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft void * -.Fn memset "void *b" "int c" "size_t len" -.Sh DESCRIPTION -The -.Fn memset -function -writes -.Fa len -bytes of value -.Fa c -(converted to an unsigned char) to the string -.Fa b . -.Sh RETURN VALUES -The -.Fn memset -function returns its first argument. -.Sh SEE ALSO -.Xr bzero 3 , -.Xr swab 3 -.Sh STANDARDS -The -.Fn memset -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/strcasecmp.3 b/src/lib/libc/string/strcasecmp.3 deleted file mode 100644 index 4da0d23..0000000 --- a/src/lib/libc/string/strcasecmp.3 +++ /dev/null @@ -1,104 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/string/strcasecmp.3,v 1.11 2003/09/08 19:57:15 ru Exp $ -.\" -.Dd June 9, 1993 -.Dt STRCASECMP 3 -.Os -.Sh NAME -.Nm strcasecmp , -.Nm strncasecmp -.Nd compare strings, ignoring case -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In strings.h -.Ft int -.Fn strcasecmp "const char *s1" "const char *s2" -.Ft int -.Fn strncasecmp "const char *s1" "const char *s2" "size_t len" -.Sh DESCRIPTION -The -.Fn strcasecmp -and -.Fn strncasecmp -functions -compare the null-terminated strings -.Fa s1 -and -.Fa s2 . -.Pp -The -.Fn strncasecmp -compares at most -.Fa len -characters. -.Sh RETURN VALUES -The -.Fn strcasecmp -and -.Fn strncasecmp -return an integer greater than, equal to, or less than 0, -according as -.Fa s1 -is lexicographically greater than, equal to, or less than -.Fa s2 -after translation of each corresponding character to lower-case. -The strings themselves are not modified. -The comparison is done using unsigned characters, so that -.Sq Li \e200 -is greater than -.Ql \e0 . -.Sh SEE ALSO -.Xr bcmp 3 , -.Xr memcmp 3 , -.Xr strcmp 3 , -.Xr strcoll 3 , -.Xr strxfrm 3 , -.Xr tolower 3 -.Sh HISTORY -The -.Fn strcasecmp -and -.Fn strncasecmp -functions first appeared in -.Bx 4.4 . -Their prototypes existed previously in -.In string.h -before they were moved to -.In strings.h -for -.St -p1003.1-2001 -compliance. diff --git a/src/lib/libc/string/strcat.3 b/src/lib/libc/string/strcat.3 deleted file mode 100644 index 7367895..0000000 --- a/src/lib/libc/string/strcat.3 +++ /dev/null @@ -1,164 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strcat.3,v 1.13 2002/09/06 11:24:06 tjr Exp $ -.\" -.Dd June 4, 1993 -.Dt STRCAT 3 -.Os -.Sh NAME -.Nm strcat -.Nd concatenate strings -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn strcat "char * restrict s" "const char * restrict append" -.Ft char * -.Fn strncat "char * restrict s" "const char * restrict append" "size_t count" -.Sh DESCRIPTION -The -.Fn strcat -and -.Fn strncat -functions -append a copy of the null-terminated string -.Fa append -to the end of the null-terminated string -.Fa s , -then add a terminating -.Ql \e0 . -The string -.Fa s -must have sufficient space to hold the result. -.Pp -The -.Fn strncat -function -appends not more than -.Fa count -characters from -.Fa append , -and then adds a terminating -.Ql \e0 . -.Sh RETURN VALUES -The -.Fn strcat -and -.Fn strncat -functions -return the pointer -.Fa s . -.Sh SECURITY CONSIDERATIONS -The -.Fn strcat -function is easily misused in a manner -which enables malicious users to arbitrarily change -a running program's functionality through a buffer overflow attack. -(See -the FSA.) -.Pp -Avoid using -.Fn strcat . -Instead, use -.Fn strncat -or -.Fn strlcat -and ensure that no more characters are copied to the destination buffer -than it can hold. -.Pp -Note that -.Fn strncat -can also be problematic. -It may be a security concern for a string to be truncated at all. -Since the truncated string will not be as long as the original, -it may refer to a completely different resource -and usage of the truncated resource -could result in very incorrect behavior. -Example: -.Bd -literal -void -foo(const char *arbitrary_string) -{ - char onstack[8]; - -#if defined(BAD) - /* - * This first strcat is bad behavior. Do not use strcat! - */ - (void)strcat(onstack, arbitrary_string); /* BAD! */ -#elif defined(BETTER) - /* - * The following two lines demonstrate better use of - * strncat(). - */ - (void)strncat(onstack, arbitrary_string, - sizeof(onstack) - strlen(onstack) - 1); -#elif defined(BEST) - /* - * These lines are even more robust due to testing for - * truncation. - */ - if (strlen(arbitrary_string) + 1 > - sizeof(onstack) - strlen(onstack)) - err(1, "onstack would be truncated"); - (void)strncat(onstack, arbitrary_string, - sizeof(onstack) - strlen(onstack) - 1); -#endif -} -.Ed -.Sh SEE ALSO -.Xr bcopy 3 , -.Xr memccpy 3 , -.Xr memcpy 3 , -.Xr memmove 3 , -.Xr strcpy 3 , -.Xr strlcat 3 , -.Xr strlcpy 3 -.Rs -.%T "The FreeBSD Security Architecture" -.Re -(See -.Pa "/usr/share/doc/{to be decided}" . ) -.Sh STANDARDS -The -.Fn strcat -and -.Fn strncat -functions -conform to -.St -isoC . diff --git a/src/lib/libc/string/strchr.3 b/src/lib/libc/string/strchr.3 deleted file mode 100644 index f6780e0..0000000 --- a/src/lib/libc/string/strchr.3 +++ /dev/null @@ -1,98 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strchr.3 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/string/strchr.3,v 1.11 2003/09/04 20:36:54 simon Exp $ -.\" -.Dd April 19, 1994 -.Dt STRCHR 3 -.Os -.Sh NAME -.Nm strchr , strrchr -.Nd locate character in string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft "char *" -.Fn strchr "const char *s" "int c" -.Ft "char *" -.Fn strrchr "const char *s" "int c" -.Sh DESCRIPTION -The -.Fn strchr -function locates the first occurrence of -.Fa c -(converted to a -.Vt char ) -in the string pointed to by -.Fa s . -The terminating null character is considered part of the string; -therefore if -.Fa c -is -.Ql \e0 , -the functions locate the terminating -.Ql \e0 . -.Pp -The -.Fn strrchr -function is identical to -.Fn strchr -except it locates the last occurrence of -.Fa c . -.Sh RETURN VALUES -The functions -.Fn strchr -and -.Fn strrchr -return a pointer to the located character, or -.Dv NULL -if the character does not appear in the string. -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh STANDARDS -The functions -.Fn strchr -and -.Fn strrchr -conform to -.St -isoC . diff --git a/src/lib/libc/string/strcmp.3 b/src/lib/libc/string/strcmp.3 deleted file mode 100644 index 101d71b..0000000 --- a/src/lib/libc/string/strcmp.3 +++ /dev/null @@ -1,104 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strcmp.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strcmp.3,v 1.10 2001/10/11 17:02:44 mike Exp $ -.\" -.Dd October 11, 2001 -.Dt STRCMP 3 -.Os -.Sh NAME -.Nm strcmp , -.Nm strncmp -.Nd compare strings -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft int -.Fn strcmp "const char *s1" "const char *s2" -.Ft int -.Fn strncmp "const char *s1" "const char *s2" "size_t len" -.Sh DESCRIPTION -The -.Fn strcmp -and -.Fn strncmp -functions -lexicographically compare the null-terminated strings -.Fa s1 -and -.Fa s2 . -.Pp -The -.Fn strncmp -function -compares not more than -.Fa len -characters. -Because -.Fn strncmp -is designed for comparing strings rather than binary data, -characters that appear after a -.Ql \e0 -character are not compared. -.Sh RETURN VALUES -The -.Fn strcmp -and -.Fn strncmp -return an integer greater than, equal to, or less than 0, according -as the string -.Fa s1 -is greater than, equal to, or less than the string -.Fa s2 . -The comparison is done using unsigned characters, so that -.Ql \e200 -is greater than -.Ql \e0 . -.Sh SEE ALSO -.Xr bcmp 3 , -.Xr memcmp 3 , -.Xr strcasecmp 3 , -.Xr strcoll 3 , -.Xr strxfrm 3 -.Sh STANDARDS -The -.Fn strcmp -and -.Fn strncmp -functions -conform to -.St -isoC . diff --git a/src/lib/libc/string/strcoll.3 b/src/lib/libc/string/strcoll.3 deleted file mode 100644 index d2e1ae4..0000000 --- a/src/lib/libc/string/strcoll.3 +++ /dev/null @@ -1,76 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strcoll.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strcoll.3,v 1.12 2002/10/15 10:11:53 tjr Exp $ -.\" -.Dd June 4, 1993 -.Dt STRCOLL 3 -.Os -.Sh NAME -.Nm strcoll -.Nd compare strings according to current collation -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft int -.Fn strcoll "const char *s1" "const char *s2" -.Sh DESCRIPTION -The -.Fn strcoll -function -lexicographically compares the null-terminated strings -.Fa s1 -and -.Fa s2 -according to the current locale collation if any, otherwise call -.Fa strcmp , -and returns an integer greater than, equal to, or less than 0, -according as -.Fa s1 -is greater than, equal to, or less than -.Fa s2 . -.Sh SEE ALSO -.Xr setlocale 3 , -.Xr strcmp 3 , -.Xr strxfrm 3 , -.Xr wcscoll 3 -.Sh STANDARDS -The -.Fn strcoll -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3 deleted file mode 100644 index 138bace..0000000 --- a/src/lib/libc/string/strcpy.3 +++ /dev/null @@ -1,207 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strcpy.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strcpy.3,v 1.24 2002/12/19 09:40:24 ru Exp $ -.\" -.Dd August 9, 2001 -.Dt STRCPY 3 -.Os -.Sh NAME -.Nm strcpy , strncpy -.Nd copy strings -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn stpcpy "char *dst" "const char *src" -.Ft char * -.Fn strcpy "char * restrict dst" "const char * restrict src" -.Ft char * -.Fn strncpy "char * restrict dst" "const char * restrict src" "size_t len" -.Sh DESCRIPTION -The -.Fn stpcpy -and -.Fn strcpy -functions -copy the string -.Fa src -to -.Fa dst -(including the terminating -.Ql \e0 -character.) -.Pp -The -.Fn strncpy -function copies at most -.Fa len -characters from -.Fa src -into -.Fa dst . -If -.Fa src -is less than -.Fa len -characters long, -the remainder of -.Fa dst -is filled with -.Ql \e0 -characters. -Otherwise, -.Fa dst -is -.Em not -terminated. -.Sh RETURN VALUES -The -.Fn strcpy -and -.Fn strncpy -functions -return -.Fa dst . -The -.Fn stpcpy -function returns a pointer to the terminating -.Ql \e0 -character of -.Fa dst . -.Sh EXAMPLES -The following sets -.Va chararray -to -.Dq Li abc\e0\e0\e0 : -.Bd -literal -offset indent -char chararray[6]; - -(void)strncpy(chararray, "abc", sizeof(chararray)); -.Ed -.Pp -The following sets -.Va chararray -to -.Dq Li abcdef : -.Bd -literal -offset indent -char chararray[6]; - -(void)strncpy(chararray, "abcdefgh", sizeof(chararray)); -.Ed -.Pp -Note that it does -.Em not -.Tn NUL -terminate -.Va chararray -because the length of the source string is greater than or equal -to the length argument. -.Pp -The following copies as many characters from -.Va input -to -.Va buf -as will fit and -.Tn NUL -terminates the result. -Because -.Fn strncpy -does -.Em not -guarantee to -.Tn NUL -terminate the string itself, this must be done explicitly. -.Bd -literal -offset indent -char buf[1024]; - -(void)strncpy(buf, input, sizeof(buf) - 1); -buf[sizeof(buf) - 1] = '\e0'; -.Ed -.Pp -This could be better achieved using -.Xr strlcpy 3 , -as shown in the following example: -.Pp -.Dl "(void)strlcpy(buf, input, sizeof(buf));" -.Pp -Note that because -.Xr strlcpy 3 -is not defined in any standards, it should -only be used when portability is not a concern. -.Sh SECURITY CONSIDERATIONS -The -.Fn strcpy -function is easily misused in a manner which enables malicious users -to arbitrarily change a running program's functionality through a -buffer overflow attack. -(See -the FSA -and -.Sx EXAMPLES . ) -.Sh SEE ALSO -.Xr bcopy 3 , -.Xr memccpy 3 , -.Xr memcpy 3 , -.Xr memmove 3 , -.Xr strlcpy 3 -.Rs -.%T "The FreeBSD Security Architecture" -.Re -(See -.Pa "/usr/share/doc/{to be decided}" . ) -.Sh STANDARDS -The -.Fn strcpy -and -.Fn strncpy -functions -conform to -.St -isoC . -The -.Fn stpcpy -function is an MS-DOS and GNUism. -The -.Fn stpcpy -function -conforms to no standard. -.Sh HISTORY -The -.Fn stpcpy -function first appeared in -.Fx 4.4 , -coming from 1998-vintage Linux. diff --git a/src/lib/libc/string/strcspn.3 b/src/lib/libc/string/strcspn.3 deleted file mode 100644 index c105c12..0000000 --- a/src/lib/libc/string/strcspn.3 +++ /dev/null @@ -1,85 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strcspn.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strcspn.3,v 1.7 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt STRCSPN 3 -.Os -.Sh NAME -.Nm strcspn -.Nd span the complement of a string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft size_t -.Fn strcspn "const char *s" "const char *charset" -.Sh DESCRIPTION -The -.Fn strcspn -function -spans the initial part of the null-terminated string -.Fa s -as long as the characters from -.Fa s -do not occur in string -.Fa charset -(it -spans the -.Em complement -of -.Fa charset ) . -.Sh RETURN VALUES -The -.Fn strcspn -function -returns the number of characters spanned. -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh STANDARDS -The -.Fn strcspn -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/strdup.3 b/src/lib/libc/string/strdup.3 deleted file mode 100644 index 3bb2516..0000000 --- a/src/lib/libc/string/strdup.3 +++ /dev/null @@ -1,70 +0,0 @@ -.\" Copyright (c) 1990, 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/string/strdup.3,v 1.10 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 9, 1993 -.Dt STRDUP 3 -.Os -.Sh NAME -.Nm strdup -.Nd save a copy of a string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn strdup "const char *str" -.Sh DESCRIPTION -The -.Fn strdup -function -allocates sufficient memory for a copy -of the string -.Fa str , -does the copy, and returns a pointer to it. -The pointer may subsequently be used as an -argument to the function -.Xr free 3 . -.Pp -If insufficient memory is available, NULL is returned and -.Va errno -is set to -.Er ENOMEM . -.Sh SEE ALSO -.Xr free 3 , -.Xr malloc 3 -.Sh HISTORY -The -.Fn strdup -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/string/strerror.3 b/src/lib/libc/string/strerror.3 deleted file mode 100644 index 1462c65..0000000 --- a/src/lib/libc/string/strerror.3 +++ /dev/null @@ -1,191 +0,0 @@ -.\" Copyright (c) 1980, 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strerror.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/string/strerror.3,v 1.22 2002/12/19 10:24:52 tjr Exp $ -.\" -.Dd December 19, 2002 -.Dt STRERROR 3 -.Os -.Sh NAME -.Nm perror , -.Nm strerror , -.Nm strerror_r , -.Nm sys_errlist , -.Nm sys_nerr -.Nd system error messages -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdio.h -.Ft void -.Fn perror "const char *string" -.Vt extern const char * const sys_errlist[] ; -.Vt extern const int sys_nerr ; -.In string.h -.Ft "char *" -.Fn strerror "int errnum" -.Ft int -.Fn strerror_r "int errnum" "char *strerrbuf" "size_t buflen" -.Sh DESCRIPTION -The -.Fn strerror , -.Fn strerror_r -and -.Fn perror -functions look up the error message string corresponding to an -error number. -.Pp -The -.Fn strerror -function accepts an error number argument -.Fa errnum -and returns a pointer to the corresponding -message string. -.Pp -The -.Fn strerror_r -function renders the same result into -.Fa strerrbuf -for a maximum of -.Fa buflen -characters and returns 0 upon success. -.Pp -The -.Fn perror -function finds the error message corresponding to the current -value of the global variable -.Va errno -.Pq Xr intro 2 -and writes it, followed by a newline, to the -standard error file descriptor. -If the argument -.Fa string -is -.Pf non- Dv NULL -and does not point to the null character, -this string is prepended to the message -string and separated from it by -a colon and space -.Pq Dq Li ":\ " ; -otherwise, only the error message string is printed. -.Pp -If -.Fa errnum -is not a recognized error number, -.Fn strerror -returns an error message string containing -.Dq Li "Unknown error:\ " -followed by the error number in decimal, while -.Fn strerror_r -leaves -.Fa strerrbuf -unchanged and returns -.Er EINVAL . -Error numbers recognized by this implementation fall in -the range 0 < -.Fa errnum -< -.Fa sys_nerr . -.Pp -If insufficient storage is provided in -.Fa strerrbuf -(as specified in -.Fa buflen ) -to contain the error string, -.Fn strerror_r -returns -.Er ERANGE -and -.Fa strerrbuf -will contain an error message that has been truncated and -.Dv NUL -terminated to fit the length specified by -.Fa buflen . -.Pp -The message strings can be accessed directly using the external -array -.Va sys_errlist . -The external value -.Va sys_nerr -contains a count of the messages in -.Va sys_errlist . -The use of these variables is deprecated; -.Fn strerror -or -.Fn strerror_r -should be used instead. -.Sh SEE ALSO -.Xr intro 2 , -.Xr psignal 3 -.Sh STANDARDS -The -.Fn perror -and -.Fn strerror -functions conform to -.St -isoC-99 . -The -.Fn strerror_r -function conforms to -.St -p1003.1-2001 . -.Sh HISTORY -The -.Fn strerror -and -.Fn perror -functions first appeared in -.Bx 4.4 . -The -.Fn strerror_r -function was implemented in -.Fx 4.4 -by -.An Wes Peters Aq wes@FreeBSD.org . -.Sh BUGS -For unknown error numbers, the -.Fn strerror -function will return its result in a static buffer which -may be overwritten by subsequent calls. -.Pp -The return type for -.Fn strerror -is missing a type-qualifier; it should actually be -.Vt const char * . -.Pp -Programs that use the deprecated -.Va sys_errlist -variable often fail to compile because they declare it -inconsistently. diff --git a/src/lib/libc/string/string.3 b/src/lib/libc/string/string.3 deleted file mode 100644 index 0a59cec..0000000 --- a/src/lib/libc/string/string.3 +++ /dev/null @@ -1,161 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)string.3 8.2 (Berkeley) 12/11/93 -.\" $FreeBSD: src/lib/libc/string/string.3,v 1.13 2002/10/19 13:41:22 tjr Exp $ -.\" -.Dd December 11, 1993 -.Dt STRING 3 -.Os -.Sh NAME -.Nm stpcpy , -.Nm strcat , -.Nm strncat , -.Nm strchr , -.Nm strrchr , -.Nm strcmp , -.Nm strncmp , -.Nm strcasecmp , -.Nm strncasecmp , -.Nm strcpy , -.Nm strncpy , -.Nm strerror , -.Nm strlen , -.Nm strpbrk , -.Nm strsep , -.Nm strspn , -.Nm strcspn , -.Nm strstr , -.Nm strtok , -.Nm index , -.Nm rindex -.Nd string specific functions -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn stpcpy "char *dst" "const char *src" -.Ft char * -.Fn strcat "char *s" "const char * append" -.Ft char * -.Fn strncat "char *s" "const char *append" "size_t count" -.Ft char * -.Fn strchr "const char *s" "int c" -.Ft char * -.Fn strrchr "const char *s" "int c" -.Ft int -.Fn strcmp "const char *s1" "const char *s2" -.Ft int -.Fn strncmp "const char *s1" "const char *s2" "size_t count" -.Ft int -.Fn strcasecmp "const char *s1" "const char *s2" -.Ft int -.Fn strncasecmp "const char *s1" "const char *s2" "size_t count" -.Ft char * -.Fn strcpy "char *dst" "const char *src" -.Ft char * -.Fn strncpy "char *dst" "const char *src" "size_t count" -.Ft char * -.Fn strerror "int errno" -.Ft size_t -.Fn strlen "const char *s" -.Ft char * -.Fn strpbrk "const char *s" "const char *charset" -.Ft char * -.Fn strsep "char **stringp" "const char *delim" -.Ft size_t -.Fn strspn "const char *s" "const char *charset" -.Ft size_t -.Fn strcspn "const char *s" "const char *charset" -.Ft char * -.Fn strstr "const char *big" "const char *little" -.Ft char * -.Fn strtok "char *s" "const char *delim" -.Ft char * -.Fn index "const char *s" "int c" -.Ft char * -.Fn rindex "const char *s" "int c" -.Sh DESCRIPTION -The string -functions manipulate strings terminated by a -null byte. -.Pp -See the specific manual pages for more information. -For manipulating variable length generic objects as byte -strings (without the null byte check), see -.Xr bstring 3 . -.Pp -Except as noted in their specific manual pages, -the string functions do not test the destination -for size limitations. -.Sh SEE ALSO -.Xr bstring 3 , -.Xr index 3 , -.Xr rindex 3 , -.Xr stpcpy 3 , -.Xr strcasecmp 3 , -.Xr strcat 3 , -.Xr strchr 3 , -.Xr strcmp 3 , -.Xr strcpy 3 , -.Xr strcspn 3 , -.Xr strerror 3 , -.Xr strlen 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh STANDARDS -The -.Fn strcat , -.Fn strncat , -.Fn strchr , -.Fn strrchr , -.Fn strcmp , -.Fn strncmp , -.Fn strcpy , -.Fn strncpy , -.Fn strerror , -.Fn strlen , -.Fn strpbrk , -.Fn strspn , -.Fn strcspn , -.Fn strstr , -and -.Fn strtok -functions -conform to -.St -isoC . diff --git a/src/lib/libc/string/strlcpy.3 b/src/lib/libc/string/strlcpy.3 deleted file mode 100644 index 974cd95..0000000 --- a/src/lib/libc/string/strlcpy.3 +++ /dev/null @@ -1,202 +0,0 @@ -.\" $OpenBSD: strlcpy.3,v 1.5 1999/06/06 15:17:32 aaron Exp $ -.\" -.\" Copyright (c) 1998 Todd C. Miller -.\" 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. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``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 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/string/strlcpy.3,v 1.12 2002/12/18 12:45:11 ru Exp $ -.\" -.Dd June 22, 1998 -.Dt STRLCPY 3 -.Os -.Sh NAME -.Nm strlcpy , -.Nm strlcat -.Nd size-bounded string copying and concatenation -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft size_t -.Fn strlcpy "char *dst" "const char *src" "size_t size" -.Ft size_t -.Fn strlcat "char *dst" "const char *src" "size_t size" -.Sh DESCRIPTION -The -.Fn strlcpy -and -.Fn strlcat -functions copy and concatenate strings respectively. They are designed -to be safer, more consistent, and less error prone replacements for -.Xr strncpy 3 -and -.Xr strncat 3 . -Unlike those functions, -.Fn strlcpy -and -.Fn strlcat -take the full size of the buffer (not just the length) and guarantee to -NUL-terminate the result (as long as -.Fa size -is larger than 0 or, in the case of -.Fn strlcat , -as long as there is at least one byte free in -.Fa dst ) . -Note that you should include a byte for the NUL in -.Fa size . -Also note that -.Fn strlcpy -and -.Fn strlcat -only operate on true -.Dq C -strings. -This means that for -.Fn strlcpy -.Fa src -must be NUL-terminated and for -.Fn strlcat -both -.Fa src -and -.Fa dst -must be NUL-terminated. -.Pp -The -.Fn strlcpy -function copies up to -.Fa size -- 1 characters from the NUL-terminated string -.Fa src -to -.Fa dst , -NUL-terminating the result. -.Pp -The -.Fn strlcat -function appends the NUL-terminated string -.Fa src -to the end of -.Fa dst . -It will append at most -.Fa size -- strlen(dst) - 1 bytes, NUL-terminating the result. -.Sh RETURN VALUES -The -.Fn strlcpy -and -.Fn strlcat -functions return the total length of the string they tried to -create. For -.Fn strlcpy -that means the length of -.Fa src . -For -.Fn strlcat -that means the initial length of -.Fa dst -plus -the length of -.Fa src . -While this may seem somewhat confusing it was done to make -truncation detection simple. -.Pp -Note however, that if -.Fn strlcat -traverses -.Fa size -characters without finding a NUL, the length of the string is considered -to be -.Fa size -and the destination string will not be NUL-terminated (since there was -no space for the NUL). -This keeps -.Fn strlcat -from running off the end of a string. -In practice this should not happen (as it means that either -.Fa size -is incorrect or that -.Fa dst -is not a proper -.Dq C -string). -The check exists to prevent potential security problems in incorrect code. -.Sh EXAMPLES -The following code fragment illustrates the simple case: -.Bd -literal -offset indent -char *s, *p, buf[BUFSIZ]; - -\&... - -(void)strlcpy(buf, s, sizeof(buf)); -(void)strlcat(buf, p, sizeof(buf)); -.Ed -.Pp -To detect truncation, perhaps while building a pathname, something -like the following might be used: -.Bd -literal -offset indent -char *dir, *file, pname[MAXPATHLEN]; - -\&... - -if (strlcpy(pname, dir, sizeof(pname)) >= sizeof(pname)) - goto toolong; -if (strlcat(pname, file, sizeof(pname)) >= sizeof(pname)) - goto toolong; -.Ed -.Pp -Since we know how many characters we copied the first time, we can -speed things up a bit by using a copy instead of an append: -.Bd -literal -offset indent -char *dir, *file, pname[MAXPATHLEN]; -size_t n; - -\&... - -n = strlcpy(pname, dir, sizeof(pname)); -if (n >= sizeof(pname)) - goto toolong; -if (strlcpy(pname + n, file, sizeof(pname) - n) >= sizeof(pname) - n) - goto toolong; -.Ed -.Pp -However, one may question the validity of such optimizations, as they -defeat the whole purpose of -.Fn strlcpy -and -.Fn strlcat . -As a matter of fact, the first version of this manual page got it wrong. -.Sh SEE ALSO -.Xr snprintf 3 , -.Xr strncat 3 , -.Xr strncpy 3 -.Sh HISTORY -The -.Fn strlcpy -and -.Fn strlcat -functions first appeared in -.Ox 2.4 , -and made their appearance in -.Fx 3.3 . diff --git a/src/lib/libc/string/strlen.3 b/src/lib/libc/string/strlen.3 deleted file mode 100644 index b490ced..0000000 --- a/src/lib/libc/string/strlen.3 +++ /dev/null @@ -1,73 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strlen.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strlen.3,v 1.6 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt STRLEN 3 -.Os -.Sh NAME -.Nm strlen -.Nd find length of string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft size_t -.Fn strlen "const char *s" -.Sh DESCRIPTION -The -.Fn strlen -function -computes the length of the string -.Fa s . -.Sh RETURN VALUES -The -.Fn strlen -function -returns -the number of characters that precede the -terminating -.Dv NUL -character. -.Sh SEE ALSO -.Xr string 3 -.Sh STANDARDS -The -.Fn strlen -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/strmode.3 b/src/lib/libc/string/strmode.3 deleted file mode 100644 index f306a5b..0000000 --- a/src/lib/libc/string/strmode.3 +++ /dev/null @@ -1,148 +0,0 @@ -.\" Copyright (c) 1990, 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strmode.3 8.3 (Berkeley) 7/28/94 -.\" $FreeBSD: src/lib/libc/string/strmode.3,v 1.9 2003/07/01 15:28:05 maxim Exp $ -.\" -.Dd July 28, 1994 -.Dt STRMODE 3 -.Os -.Sh NAME -.Nm strmode -.Nd convert inode status information into a symbolic string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft void -.Fn strmode "mode_t mode" "char *bp" -.Sh DESCRIPTION -The -.Fn strmode -function -converts a file -.Fa mode -(the type and permission information associated with an inode, see -.Xr stat 2 ) -into a symbolic string which is stored in the location referenced by -.Fa bp . -This stored string is eleven characters in length plus a trailing -.Dv NUL . -.Pp -The first character is the inode type, and will be one of the following: -.Pp -.Bl -tag -width flag -offset indent -compact -.It \- -regular file -.It b -block special -.It c -character special -.It d -directory -.It l -symbolic link -.It p -fifo -.It s -socket -.It w -whiteout -.It ? -unknown inode type -.El -.Pp -The next nine characters encode three sets of permissions, in three -characters each. -The first three characters are the permissions for the owner of the -file, the second three for the group the file belongs to, and the -third for the ``other'', or default, set of users. -.Pp -Permission checking is done as specifically as possible. -If read permission is denied to the owner of a file in the first set -of permissions, the owner of the file will not be able to read the file. -This is true even if the owner is in the file's group and the group -permissions allow reading or the ``other'' permissions allow reading. -.Pp -If the first character of the three character set is an ``r'', the file is -readable for that set of users; if a dash ``\-'', it is not readable. -.Pp -If the second character of the three character set is a ``w'', the file is -writable for that set of users; if a dash ``\-'', it is not writable. -.Pp -The third character is the first of the following characters that apply: -.Bl -tag -width xxxx -.It S -If the character is part of the owner permissions and the file is not -executable or the directory is not searchable by the owner, and the -set-user-id bit is set. -.It S -If the character is part of the group permissions and the file is not -executable or the directory is not searchable by the group, and the -set-group-id bit is set. -.It T -If the character is part of the other permissions and the file is not -executable or the directory is not searchable by others, and the ``sticky'' -.Pq Dv S_ISVTX -bit is set. -.It s -If the character is part of the owner permissions and the file is -executable or the directory searchable by the owner, and the set-user-id -bit is set. -.It s -If the character is part of the group permissions and the file is -executable or the directory searchable by the group, and the set-group-id -bit is set. -.It t -If the character is part of the other permissions and the file is -executable or the directory searchable by others, and the ``sticky'' -.Pq Dv S_ISVTX -bit is set. -.It x -The file is executable or the directory is searchable. -.It \- -None of the above apply. -.El -.Pp -The last character is a plus sign ``+'' if any there are any alternate -or additional access control methods associated with the inode, otherwise -it will be a space. -.Sh SEE ALSO -.Xr chmod 1 , -.Xr find 1 , -.Xr stat 2 , -.Xr getmode 3 , -.Xr setmode 3 -.Sh HISTORY -The -.Fn strmode -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/string/strpbrk.3 b/src/lib/libc/string/strpbrk.3 deleted file mode 100644 index 715bb71..0000000 --- a/src/lib/libc/string/strpbrk.3 +++ /dev/null @@ -1,80 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strpbrk.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strpbrk.3,v 1.7 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt STRPBRK 3 -.Os -.Sh NAME -.Nm strpbrk -.Nd locate multiple characters in string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn strpbrk "const char *s" "const char *charset" -.Sh DESCRIPTION -The -.Fn strpbrk -function -locates in the null-terminated string -.Fa s -the first occurrence of any character in the string -.Fa charset -and returns a pointer to this character. -If no characters from -.Fa charset -occur anywhere in -.Fa s -.Fn strpbrk -returns NULL. -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh STANDARDS -The -.Fn strpbrk -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/strsep.3 b/src/lib/libc/string/strsep.3 deleted file mode 100644 index 0218aea..0000000 --- a/src/lib/libc/string/strsep.3 +++ /dev/null @@ -1,124 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" -.\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strsep.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/string/strsep.3,v 1.13 2002/11/29 15:57:49 ru Exp $ -.\" -.Dd June 9, 1993 -.Dt STRSEP 3 -.Os -.Sh NAME -.Nm strsep -.Nd separate strings -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn strsep "char **stringp" "const char *delim" -.Sh DESCRIPTION -The -.Fn strsep -function locates, in the string referenced by -.Fa *stringp , -the first occurrence of any character in the string -.Fa delim -(or the terminating -.Ql \e0 -character) and replaces it with a -.Ql \e0 . -The location of the next character after the delimiter character -(or NULL, if the end of the string was reached) is stored in -.Fa *stringp . -The original value of -.Fa *stringp -is returned. -.Pp -An -.Dq empty -field (i.e., a character in the string -.Fa delim -occurs as the first character of -.Fa *stringp ) -can be detected by comparing the location referenced by the returned pointer -to -.Ql \e0 . -.Pp -If -.Fa *stringp -is initially -.Dv NULL , -.Fn strsep -returns -.Dv NULL . -.Sh EXAMPLES -The following uses -.Fn strsep -to parse a string, containing tokens delimited by white space, into an -argument vector: -.Bd -literal -offset indent -char **ap, *argv[10], *inputstring; - -for (ap = argv; (*ap = strsep(&inputstring, " \et")) != NULL;) - if (**ap != '\e0') - if (++ap >= &argv[10]) - break; -.Ed -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh HISTORY -The -.Fn strsep -function -is intended as a replacement for the -.Fn strtok -function. -While the -.Fn strtok -function should be preferred for portability reasons (it conforms to -.St -isoC ) -it is unable to handle empty fields, i.e. detect fields delimited by -two adjacent delimiter characters, or to be used for more than a single -string at a time. -The -.Fn strsep -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/string/strspn.3 b/src/lib/libc/string/strspn.3 deleted file mode 100644 index b55b12c..0000000 --- a/src/lib/libc/string/strspn.3 +++ /dev/null @@ -1,80 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strspn.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strspn.3,v 1.8 2001/10/01 16:09:00 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt STRSPN 3 -.Os -.Sh NAME -.Nm strspn -.Nd span a string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft size_t -.Fn strspn "const char *s" "const char *charset" -.Sh DESCRIPTION -The -.Fn strspn -function -spans the initial part of the null-terminated string -.Fa s -as long as the characters from -.Fa s -occur in string -.Fa charset . -.Sh RETURN VALUES -The -.Fn strspn -function -returns the number of characters spanned. -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh STANDARDS -The -.Fn strspn -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/strstr.3 b/src/lib/libc/string/strstr.3 deleted file mode 100644 index 83d7bed..0000000 --- a/src/lib/libc/string/strstr.3 +++ /dev/null @@ -1,147 +0,0 @@ -.\" Copyright (c) 2001 Mike Barcroft -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strstr.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strstr.3,v 1.12 2001/11/20 14:11:07 ru Exp $ -.\" -.Dd October 11, 2001 -.Dt STRSTR 3 -.Os -.Sh NAME -.Nm strstr , strcasestr , strnstr -.Nd locate a substring in a string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn strstr "const char *big" "const char *little" -.Ft char * -.Fn strcasestr "const char *big" "const char *little" -.Ft char * -.Fn strnstr "const char *big" "const char *little" "size_t len" -.Sh DESCRIPTION -The -.Fn strstr -function -locates the first occurrence of the null-terminated string -.Fa little -in the null-terminated string -.Fa big . -.Pp -The -.Fn strcasestr -function is similar to -.Fn strstr , -but ignores the case of both strings. -.Pp -The -.Fn strnstr -function -locates the first occurrence of the null-terminated string -.Fa little -in the string -.Fa big , -where not more than -.Fa len -characters are searched. -Characters that appear after a -.Ql \e0 -character are not searched. -Since the -.Fn strnstr -function is a -.Fx -specific API, it should only be used when portability is not a concern. -.Sh RETURN VALUES -If -.Fa little -is an empty string, -.Fa big -is returned; -if -.Fa little -occurs nowhere in -.Fa big , -.Dv NULL -is returned; -otherwise a pointer to the first character of the first occurrence of -.Fa little -is returned. -.Sh EXAMPLES -The following sets the pointer -.Va ptr -to the -.Qq Li Bar Baz -portion of -.Va largestring : -.Bd -literal -offset indent -const char *largestring = "Foo Bar Baz"; -const char *smallstring = "Bar"; -char *ptr; - -ptr = strstr(largestring, smallstring); -.Ed -.Pp -The following sets the pointer -.Va ptr -to -.Dv NULL , -because only the first 4 characters of -.Va largestring -are searched: -.Bd -literal -offset indent -const char *largestring = "Foo Bar Baz"; -const char *smallstring = "Bar"; -char *ptr; - -ptr = strnstr(largestring, smallstring, 4); -.Ed -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strtok 3 -.Sh STANDARDS -The -.Fn strstr -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/strtok.3 b/src/lib/libc/string/strtok.3 deleted file mode 100644 index b1d41b9..0000000 --- a/src/lib/libc/string/strtok.3 +++ /dev/null @@ -1,178 +0,0 @@ -.\" Copyright (c) 1998 Softweyr LLC. All rights reserved. -.\" -.\" strtok_r, from Berkeley strtok -.\" Oct 13, 1998 by Wes Peters -.\" -.\" Copyright (c) 1988, 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 -.\" notices, this list of conditions and the following disclaimer. -.\" -.\" 2. Redistributions in binary form must reproduce the above -.\" copyright notices, this list of conditions and the following -.\" disclaimer in the documentation and/or other materials provided -.\" with the distribution. -.\" -.\" 3. All advertising materials mentioning features or use of this -.\" software must display the following acknowledgement: -.\" -.\" This product includes software developed by Softweyr LLC, the -.\" University of California, Berkeley, and its contributors. -.\" -.\" 4. Neither the name of Softweyr LLC, 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 SOFTWEYR LLC, 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 SOFTWEYR LLC, 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. -.\" -.\" @(#)strtok.3 8.2 (Berkeley) 2/3/94 -.\" $FreeBSD: src/lib/libc/string/strtok.3,v 1.24 2002/12/18 12:45:11 ru Exp $ -.\" -.Dd November 27, 1998 -.Dt STRTOK 3 -.Os -.Sh NAME -.Nm strtok , strtok_r -.Nd string tokens -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft char * -.Fn strtok "char *str" "const char *sep" -.Ft char * -.Fn strtok_r "char *str" "const char *sep" "char **last" -.Sh DESCRIPTION -.Bf -symbolic -This interface is obsoleted by -.Xr strsep 3 . -.Ef -.Pp -The -.Fn strtok -function -is used to isolate sequential tokens in a null-terminated string, -.Fa str . -These tokens are separated in the string by at least one of the -characters in -.Fa sep . -The first time that -.Fn strtok -is called, -.Fa str -should be specified; subsequent calls, wishing to obtain further tokens -from the same string, should pass a null pointer instead. -The separator string, -.Fa sep , -must be supplied each time, and may change between calls. -.Pp -The implementation will behave as if no library function calls -.Fn strtok . -.Pp -The -.Fn strtok_r -function is a reentrant version of -.Fn strtok . -The context pointer -.Fa last -must be provided on each call. -The -.Fn strtok_r -function -may also be used to nest two parsing loops within one another, as -long as separate context pointers are used. -.Pp -The -.Fn strtok -and -.Fn strtok_r -functions -return a pointer to the beginning of each subsequent token in the string, -after replacing the token itself with a -.Dv NUL -character. -When no more tokens remain, a null pointer is returned. -.Sh EXAMPLES -The following uses -.Fn strtok_r -to parse two strings using separate contexts: -.Bd -literal -char test[80], blah[80]; -char *sep = "\e\e/:;=-"; -char *word, *phrase, *brkt, *brkb; - -strcpy(test, "This;is.a:test:of=the/string\e\etokenizer-function."); - -for (word = strtok_r(test, sep, &brkt); - word; - word = strtok_r(NULL, sep, &brkt)) -{ - strcpy(blah, "blah:blat:blab:blag"); - - for (phrase = strtok_r(blah, sep, &brkb); - phrase; - phrase = strtok_r(NULL, sep, &brkb)) - { - printf("So far we're at %s:%s\en", word, phrase); - } -} -.Ed -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr wcstok 3 -.Sh STANDARDS -The -.Fn strtok -function -conforms to -.St -isoC . -.Sh BUGS -The System V -.Fn strtok , -if handed a string containing only delimiter characters, -will not alter the next starting point, so that a call to -.Fn strtok -with a different (or empty) delimiter string -may return a -.Pf non- Dv NULL -value. -Since this implementation always alters the next starting point, -such a sequence of calls would always return -.Dv NULL . -.Sh AUTHORS -.An Wes Peters , -Softweyr LLC: -.Aq wes@softweyr.com -.Pp -Based on the -.Fx 3.0 -implementation. diff --git a/src/lib/libc/string/strxfrm.3 b/src/lib/libc/string/strxfrm.3 deleted file mode 100644 index 14b6bbc..0000000 --- a/src/lib/libc/string/strxfrm.3 +++ /dev/null @@ -1,100 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strxfrm.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/strxfrm.3,v 1.17 2002/10/15 10:11:53 tjr Exp $ -.\" -.Dd June 4, 1993 -.Dt STRXFRM 3 -.Os -.Sh NAME -.Nm strxfrm -.Nd transform a string under locale -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft size_t -.Fn strxfrm "char * restrict dst" "const char * restrict src" "size_t n" -.Sh DESCRIPTION -The -.Fn strxfrm -function transforms a null-terminated string pointed to by -.Fa src -according to the current locale collation if any, -then copies the transformed string -into -.Fa dst . -Not more than -.Fa n -characters are copied into -.Fa dst , -including the terminating null character added. -If -.Fa n -is set to 0 -(it helps to determine an actual size needed -for transformation), -.Fa dst -is permitted to be a NULL pointer. -.Pp -Comparing two strings using -.Fn strcmp -after -.Fn strxfrm -is equal to comparing -two original strings with -.Fn strcoll . -.Sh RETURN VALUES -Upon successful completion, -.Fn strxfrm -returns the length of the transformed string not including -the terminating null character. -If this value is -.Fa n -or more, the contents of -.Fa dst -are indeterminate. -.Sh SEE ALSO -.Xr setlocale 3 , -.Xr strcmp 3 , -.Xr strcoll 3 , -.Xr wcsxfrm 3 -.Sh STANDARDS -The -.Fn strxfrm -function -conforms to -.St -isoC . diff --git a/src/lib/libc/string/swab.3 b/src/lib/libc/string/swab.3 deleted file mode 100644 index c449add..0000000 --- a/src/lib/libc/string/swab.3 +++ /dev/null @@ -1,68 +0,0 @@ -.\" Copyright (c) 1990, 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)swab.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/swab.3,v 1.7 2002/08/30 21:18:39 robert Exp $ -.\" -.Dd June 4, 1993 -.Dt SWAB 3 -.Os -.Sh NAME -.Nm swab -.Nd swap adjacent bytes -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft void -.Fn swab "const void * restrict src" "void * restrict dst" "size_t len" -.Sh DESCRIPTION -The function -.Fn swab -copies -.Fa len -bytes from the location referenced by -.Fa src -to the location referenced by -.Fa dst , -swapping adjacent bytes. -.Pp -The argument -.Fa len -must be an even number. -.Sh SEE ALSO -.Xr bzero 3 , -.Xr memset 3 -.Sh HISTORY -A -.Fn swab -function appeared in -.At v7 . diff --git a/src/lib/libc/string/wcscoll.3 b/src/lib/libc/string/wcscoll.3 deleted file mode 100644 index 18a9ef7..0000000 --- a/src/lib/libc/string/wcscoll.3 +++ /dev/null @@ -1,112 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strcoll.3 8.1 (Berkeley) 6/4/93 -.\" FreeBSD: src/lib/libc/string/strcoll.3,v 1.11 2001/10/01 16:09:00 ru Exp -.\" $FreeBSD: src/lib/libc/string/wcscoll.3,v 1.2 2002/12/09 14:04:05 ru Exp $ -.\" -.Dd October 4, 2002 -.Dt WCSCOLL 3 -.Os -.Sh NAME -.Nm wcscoll -.Nd compare wide strings according to current collation -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In wchar.h -.Ft int -.Fn wcscoll "const wchar_t *s1" "const wchar_t *s2" -.Sh DESCRIPTION -The -.Fn wcscoll -function compares the null-terminated strings -.Fa s1 -and -.Fa s2 -according to the current locale collation order. -In the -.Dq Li C -locale, -.Fn wcscoll -is equivalent to -.Fn wcscmp . -.Sh RETURN VALUES -The -.Fn wcscoll -function -returns an integer greater than, equal to, or less than 0, -if -.Fa s1 -is greater than, equal to, or less than -.Fa s2 . -.Pp -No return value is reserved to indicate errors; -callers should set -.Va errno -to 0 before calling -.Fn wcscoll . -If it is non-zero upon return from -.Fn wcscoll , -an error has occurred. -.Sh ERRORS -The -.Fn wcscoll -function will fail if: -.Bl -tag -width Er -.It Bq Er EILSEQ -An invalid wide character code was specified. -.It Bq Er ENOMEM -Cannot allocate enough memory for temporary buffers. -.El -.Sh SEE ALSO -.Xr setlocale 3 , -.Xr strcoll 3 , -.Xr wcscmp 3 , -.Xr wcsxfrm 3 -.Sh STANDARDS -The -.Fn wcscoll -function -conforms to -.St -isoC-99 . -.Sh BUGS -The current implementation of -.Fn wcscoll -only works in single-byte -.Dv LC_CTYPE -locales, and falls back to using -.Fn wcscmp -in locales with extended character sets. diff --git a/src/lib/libc/string/wcstok.3 b/src/lib/libc/string/wcstok.3 deleted file mode 100644 index 4ddfb04..0000000 --- a/src/lib/libc/string/wcstok.3 +++ /dev/null @@ -1,133 +0,0 @@ -.\" Copyright (c) 1998 Softweyr LLC. All rights reserved. -.\" -.\" strtok_r, from Berkeley strtok -.\" Oct 13, 1998 by Wes Peters -.\" -.\" Copyright (c) 1988, 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 -.\" notices, this list of conditions and the following disclaimer. -.\" -.\" 2. Redistributions in binary form must reproduce the above -.\" copyright notices, this list of conditions and the following -.\" disclaimer in the documentation and/or other materials provided -.\" with the distribution. -.\" -.\" 3. All advertising materials mentioning features or use of this -.\" software must display the following acknowledgement: -.\" -.\" This product includes software developed by Softweyr LLC, the -.\" University of California, Berkeley, and its contributors. -.\" -.\" 4. Neither the name of Softweyr LLC, 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 SOFTWEYR LLC, 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 SOFTWEYR LLC, 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: src/lib/libc/string/wcstok.3,v 1.4 2002/10/15 09:49:54 tjr Exp $ -.\" -.Dd October 3, 2002 -.Dt WCSTOK 3 -.Os -.Sh NAME -.Nm wcstok -.Nd split wide-character string into tokens -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In wchar.h -.Ft wchar_t * -.Fn wcstok "wchar_t * restrict str" "const wchar_t * restrict sep" "wchar_t ** restrict last" -.Sh DESCRIPTION -The -.Fn wcstok -function -is used to isolate sequential tokens in a null-terminated wide character -string, -.Fa str . -These tokens are separated in the string by at least one of the -characters in -.Fa sep . -The first time that -.Fn wcstok -is called, -.Fa str -should be specified; subsequent calls, wishing to obtain further tokens -from the same string, should pass a null pointer instead. -The separator string, -.Fa sep , -must be supplied each time, and may change between calls. -The context pointer -.Fa last -must be provided on each call. -.Pp -The -.Fn wcstok -function is the wide character counterpart of the -.Fn strtok_r -function. -.Sh RETURN VALUES -The -.Fn wcstok -function -returns a pointer to the beginning of each subsequent token in the string, -after replacing the token itself with a null wide character (L'\e0'). -When no more tokens remain, a null pointer is returned. -.Sh EXAMPLES -The following code fragment splits a wide character string on -.Tn ASCII -space, tab and newline characters and writes the tokens to -standard output: -.Bd -literal -offset indent -const wchar_t *seps = L" \et\en"; -wchar_t *last, *tok, text[] = L" \enone\ettwo\et\etthree \en"; - -for (tok = wcstok(text, seps, &last); tok != NULL; - tok = wcstok(NULL, seps, &last)) - wprintf(L"%ls\en", tok); -.Ed -.Sh COMPATIBILITY -Some early implementations of -.Fn wcstok -omit the -context pointer argument, -.Fa last , -and maintain state across calls in a static variable like -.Fn strtok -does. -.Sh SEE ALSO -.Xr strtok 3 , -.Xr wcschr 3 , -.Xr wcscspn 3 , -.Xr wcspbrk 3 , -.Xr wcsrchr 3 , -.Xr wcsspn 3 -.Sh STANDARDS -The -.Fn wcstok -function -conforms to -.St -isoC-99 . diff --git a/src/lib/libc/string/wcswidth.3 b/src/lib/libc/string/wcswidth.3 deleted file mode 100644 index 973bfe0..0000000 --- a/src/lib/libc/string/wcswidth.3 +++ /dev/null @@ -1,62 +0,0 @@ -.\" 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/string/wcswidth.3,v 1.2 2002/12/09 14:04:05 ru Exp $ -.\" -.Dd August 20, 2002 -.Dt WCSWIDTH 3 -.Os -.Sh NAME -.Nm wcswidth -.Nd "number of column positions in wide-character string" -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In wchar.h -.Ft int -.Fn wcswidth "const wchar_t *pwcs" "size_t n" -.Sh DESCRIPTION -The -.Fn wcswidth -function determines the number of column positions required for the first -.Fa n -characters of -.Fa pwcs , -or until a null wide character (L'\e0') is encountered. -.Sh RETURN VALUES -The -.Fn wcswidth -function returns 0 if -.Fa pwcs -is an empty string (L""), -\-1 if a non-printing wide character is encountered, -otherwise it returns the number of column positions occupied. -.Sh SEE ALSO -.Xr iswprint 3 , -.Xr wcwidth 3 -.Sh STANDARDS -The -.Fn wcswidth -function conforms to -.St -p1003.1-2001 . diff --git a/src/lib/libc/string/wcsxfrm.3 b/src/lib/libc/string/wcsxfrm.3 deleted file mode 100644 index e85ebb0..0000000 --- a/src/lib/libc/string/wcsxfrm.3 +++ /dev/null @@ -1,126 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" @(#)strxfrm.3 8.1 (Berkeley) 6/4/93 -.\" FreeBSD: src/lib/libc/string/strxfrm.3,v 1.16 2002/09/06 11:24:06 tjr Exp -.\" $FreeBSD: src/lib/libc/string/wcsxfrm.3,v 1.2 2002/12/09 14:04:05 ru Exp $ -.\" -.Dd October 4, 2002 -.Dt WCSXFRM 3 -.Os -.Sh NAME -.Nm wcsxfrm -.Nd transform a wide string under locale -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In wchar.h -.Ft size_t -.Fn wcsxfrm "wchar_t * restrict dst" "const wchar_t * restrict src" "size_t n" -.Sh DESCRIPTION -The -.Fn wcsxfrm -function transforms a null-terminated wide character string pointed to by -.Fa src -according to the current locale collation order -then copies the transformed string -into -.Fa dst . -No more than -.Fa n -wide characters are copied into -.Fa dst , -including the terminating null character added. -If -.Fa n -is set to 0 -(it helps to determine an actual size needed -for transformation), -.Fa dst -is permitted to be a -.Dv NULL -pointer. -.Pp -Comparing two strings using -.Fn wcscmp -after -.Fn wcsxfrm -is equivalent to comparing -two original strings with -.Fn wcscoll . -.Sh RETURN VALUES -Upon successful completion, -.Fn wcsxfrm -returns the length of the transformed string not including -the terminating null character. -If this value is -.Fa n -or more, the contents of -.Fa dst -are indeterminate. -.Sh SEE ALSO -.Xr setlocale 3 , -.Xr strxfrm 3 , -.Xr wcscmp 3 , -.Xr wcscoll 3 -.Sh STANDARDS -The -.Fn wcsxfrm -function -conforms to -.St -isoC-99 . -.Sh BUGS -The current implementation of -.Fn wcsxfrm -only works in single-byte -.Dv LC_CTYPE -locales, and falls back to using -.Fn wcsncpy -in locales with extended character sets. -.Pp -Comparing two strings using -.Fn wcscmp -after -.Fn wcsxfrm -is -.Em not -always equivalent to comparison with -.Fn wcscoll ; -.Fn wcsxfrm -only stores information about primary collation weights into -.Fa dst , -whereas -.Fn wcscoll -compares characters using both primary and secondary weights. diff --git a/src/lib/libc/string/wmemchr.3 b/src/lib/libc/string/wmemchr.3 deleted file mode 100644 index de091a6..0000000 --- a/src/lib/libc/string/wmemchr.3 +++ /dev/null @@ -1,145 +0,0 @@ -.\" $NetBSD: wmemchr.3,v 1.4 2001/01/02 11:26:23 itojun Exp $ -.\" -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. 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. -.\" -.\" from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93 -.\" -.\" $FreeBSD: src/lib/libc/string/wmemchr.3,v 1.6 2002/09/07 04:07:00 tjr Exp $ -.\" -.Dd December 22, 2000 -.Dt WMEMCHR 3 -.Os -.Sh NAME -.Nm wmemchr , -.Nm wmemcmp , -.Nm wmemcpy , -.Nm wmemmove , -.Nm wmemset , -.Nm wcscat , -.Nm wcschr , -.Nm wcscmp , -.Nm wcscpy , -.Nm wcscspn , -.Nm wcslcat , -.Nm wcslcpy , -.Nm wcslen , -.Nm wcsncat , -.Nm wcsncmp , -.Nm wcsncpy , -.Nm wcspbrk , -.Nm wcsrchr , -.Nm wcsspn , -.Nm wcsstr -.Nd wide character string manipulation operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In wchar.h -.Ft wchar_t * -.Fn wmemchr "const wchar_t *s" "wchar_t c" "size_t n" -.Ft int -.Fn wmemcmp "const wchar_t *s1" "const wchar_t *s2" "size_t n" -.Ft wchar_t * -.Fn wmemcpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n" -.Ft wchar_t * -.Fn wmemmove "wchar_t *s1" "const wchar_t *s2" "size_t n" -.Ft wchar_t * -.Fn wmemset "wchar_t *s" "wchar_t c" "size_t n" -.Ft wchar_t * -.Fn wcscat "wchar_t * restrict s1" "const wchar_t * restrict s2" -.Ft wchar_t * -.Fn wcschr "const wchar_t *s" "wchar_t c" -.Ft int -.Fn wcscmp "const wchar_t *s1" "const wchar_t *s2" -.Ft wchar_t * -.Fn wcscpy "wchar_t * restrict s1" "const wchar_t * restrict s2" -.Ft size_t -.Fn wcscspn "const wchar_t *s1" "const wchar_t *s2" -.Ft size_t -.Fn wcslcat "wchar_t *s1" "const wchar_t *s2" "size_t n" -.Ft size_t -.Fn wcslcpy "wchar_t *s1" "const wchar_t *s2" "size_t n" -.Ft size_t -.Fn wcslen "const wchar_t *s" -.Ft wchar_t * -.Fn wcsncat "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n" -.Ft int -.Fn wcsncmp "const wchar_t *s1" "const wchar_t * s2" "size_t n" -.Ft wchar_t * -.Fn wcsncpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n" -.Ft wchar_t * -.Fn wcspbrk "const wchar_t *s1" "const wchar_t *s2" -.Ft wchar_t * -.Fn wcsrchr "const wchar_t *s" "wchar_t c" -.Ft size_t -.Fn wcsspn "const wchar_t *s1" "const wchar_t *s2" -.Ft wchar_t * -.Fn wcsstr "const wchar_t * restrict s1" "const wchar_t * restrict s2" -.Sh DESCRIPTION -The functions implement string manipulation operations over wide character -strings. -For a detailed description, refer to documents for the respective single-byte -counterpart, such as -.Xr memchr 3 . -.Sh SEE ALSO -.Xr memchr 3 , -.Xr memcmp 3 , -.Xr memcpy 3 , -.Xr memmove 3 , -.Xr memset 3 , -.Xr strcat 3 , -.Xr strchr 3 , -.Xr strcmp 3 , -.Xr strcpy 3 , -.Xr strcspn 3 , -.Xr strlcat 3 , -.Xr strlcpy 3 , -.Xr strlen 3 , -.Xr strncat 3 , -.Xr strncmp 3 , -.Xr strncpy 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strspn 3 , -.Xr strstr 3 -.Sh STANDARDS -These functions conform to -.St -isoC-99 , -with the exception of -.Fn wcslcat -and -.Fn wcslcpy , -which are extensions.