summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2009-02-28 06:00:58 +0000
committerdas <das@FreeBSD.org>2009-02-28 06:00:58 +0000
commita67fbaa46cbdf18a03eefb3f83e2f74f68918753 (patch)
treef258384b92d5c4bde23e95d4c44fa3547a0364cd /lib/libc/string
parentb739b3fb48f28ef6b6e7efeeceb832d3dec3fc9c (diff)
downloadFreeBSD-src-a67fbaa46cbdf18a03eefb3f83e2f74f68918753.zip
FreeBSD-src-a67fbaa46cbdf18a03eefb3f83e2f74f68918753.tar.gz
- Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),
wcscasecmp(), and wcsncasecmp(). - Make some previously non-standard extensions visible if POSIX_VISIBLE >= 200809. - Use restrict qualifiers in stpcpy(). - Declare off_t and size_t in stdio.h. - Bump __FreeBSD_version in case the new symbols (particularly getline()) cause issues with ports. Reviewed by: standards@
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/Makefile.inc19
-rw-r--r--lib/libc/string/Symbol.map5
-rw-r--r--lib/libc/string/stpncpy.c45
-rw-r--r--lib/libc/string/strcpy.339
-rw-r--r--lib/libc/string/strlen.325
-rw-r--r--lib/libc/string/strnlen.c42
-rw-r--r--lib/libc/string/wcscasecmp.c45
-rw-r--r--lib/libc/string/wcsncasecmp.c49
-rw-r--r--lib/libc/string/wcsnlen.c42
-rw-r--r--lib/libc/string/wmemchr.322
10 files changed, 312 insertions, 21 deletions
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index dffaf87..cc46ceb 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -8,14 +8,16 @@ CFLAGS+= -I${.CURDIR}/locale
# machine-independent string sources
MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \
index.c memccpy.c memchr.c memrchr.c memcmp.c \
- memcpy.c memmem.c memmove.c memset.c rindex.c stpcpy.c strcasecmp.c \
+ memcpy.c memmem.c memmove.c memset.c rindex.c \
+ stpcpy.c stpncpy.c strcasecmp.c \
strcat.c strcasestr.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c \
strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c strncat.c \
- strncmp.c strncpy.c strndup.c strnstr.c \
+ strncmp.c strncpy.c strndup.c strnlen.c strnstr.c \
strpbrk.c strrchr.c strsep.c strsignal.c strspn.c strstr.c strtok.c \
- strxfrm.c swab.c wcscat.c wcschr.c wcscmp.c wcscoll.c wcscpy.c \
- wcscspn.c wcsdup.c \
- wcslcat.c wcslcpy.c wcslen.c wcsncat.c wcsncmp.c wcsncpy.c wcspbrk.c \
+ strxfrm.c swab.c wcscasecmp.c wcscat.c \
+ wcschr.c wcscmp.c wcscoll.c wcscpy.c wcscspn.c wcsdup.c \
+ wcslcat.c wcslcpy.c wcslen.c wcsncasecmp.c wcsncat.c wcsncmp.c \
+ wcsncpy.c wcsnlen.c wcspbrk.c \
wcsrchr.c wcsspn.c wcsstr.c wcstok.c wcswidth.c wcsxfrm.c wmemchr.c \
wmemcmp.c \
wmemcpy.c wmemmove.c wmemset.c
@@ -47,6 +49,7 @@ MLINKS+=strcat.3 strncat.3
MLINKS+=strchr.3 strrchr.3
MLINKS+=strcmp.3 strncmp.3
MLINKS+=strcpy.3 stpcpy.3 \
+ strcpy.3 stpncpy.3 \
strcpy.3 strncpy.3
MLINKS+=strdup.3 strndup.3
MLINKS+=strerror.3 perror.3 \
@@ -54,10 +57,12 @@ MLINKS+=strerror.3 perror.3 \
strerror.3 sys_errlist.3 \
strerror.3 sys_nerr.3
MLINKS+=strlcpy.3 strlcat.3
+MLINKS+=strlen.3 strnlen.3
MLINKS+=strstr.3 strcasestr.3 \
strstr.3 strnstr.3
MLINKS+=strtok.3 strtok_r.3
-MLINKS+=wmemchr.3 wcscat.3 \
+MLINKS+=wmemchr.3 wcscasecmp.3 \
+ wmemchr.3 wcscat.3 \
wmemchr.3 wcschr.3 \
wmemchr.3 wcscmp.3 \
wmemchr.3 wcscpy.3 \
@@ -66,9 +71,11 @@ MLINKS+=wmemchr.3 wcscat.3 \
wmemchr.3 wcslcat.3 \
wmemchr.3 wcslcpy.3 \
wmemchr.3 wcslen.3 \
+ wmemchr.3 wcsncasecmp.3 \
wmemchr.3 wcsncat.3 \
wmemchr.3 wcsncmp.3 \
wmemchr.3 wcsncpy.3 \
+ wmemchr.3 wcsnlen.3 \
wmemchr.3 wcspbrk.3 \
wmemchr.3 wcsrchr.3 \
wmemchr.3 wcsspn.3 \
diff --git a/lib/libc/string/Symbol.map b/lib/libc/string/Symbol.map
index c69f0b5..4829559 100644
--- a/lib/libc/string/Symbol.map
+++ b/lib/libc/string/Symbol.map
@@ -81,7 +81,12 @@ FBSD_1.1 {
ffsll;
flsll;
memrchr;
+ stpncpy;
strndup;
+ strnlen;
+ wcscasecmp;
+ wcsncasecmp;
+ wcsnlen;
};
FBSDprivate_1.0 {
diff --git a/lib/libc/string/stpncpy.c b/lib/libc/string/stpncpy.c
new file mode 100644
index 0000000..df70dc6
--- /dev/null
+++ b/lib/libc/string/stpncpy.c
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2009 David Schultz <das@FreeBSD.org>
+ * 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <string.h>
+
+char *
+stpncpy(char * __restrict dst, const char * __restrict src, size_t n)
+{
+
+ for (; n--; dst++, src++) {
+ if (!(*dst = *src)) {
+ char *ret = dst;
+ while (n--)
+ *++dst = '\0';
+ return (ret);
+ }
+ }
+ return (dst);
+}
diff --git a/lib/libc/string/strcpy.3 b/lib/libc/string/strcpy.3
index 8284753..619b4e7 100644
--- a/lib/libc/string/strcpy.3
+++ b/lib/libc/string/strcpy.3
@@ -32,18 +32,20 @@
.\" @(#)strcpy.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd August 9, 2001
+.Dd February 28, 2009
.Dt STRCPY 3
.Os
.Sh NAME
-.Nm strcpy , strncpy
+.Nm stpcpy, stpncpy, strcpy , strncpy
.Nd copy strings
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In string.h
.Ft char *
-.Fn stpcpy "char *dst" "const char *src"
+.Fn stpcpy "char * restrict dst" "const char * restrict src"
+.Ft char *
+.Fn stpncpy "char * restrict dst" "const char * restrict src" "size_t len"
.Ft char *
.Fn strcpy "char * restrict dst" "const char * restrict src"
.Ft char *
@@ -63,8 +65,10 @@ to
character.)
.Pp
The
+.Fn stpncpy
+and
.Fn strncpy
-function copies at most
+functions copy at most
.Fa len
characters from
.Fa src
@@ -95,10 +99,21 @@ return
.Fa dst .
The
.Fn stpcpy
-function returns a pointer to the terminating
+and
+.Fn stpncpy
+functions return a pointer to the terminating
.Ql \e0
character of
.Fa dst .
+If
+.Fn stpncpy
+does not terminate
+.Fa dst
+with a
+.Dv NUL
+character, it instead returns a pointer to
+.Li dst[n]
+(which does not necessarily refer to a valid memory location.)
.Sh EXAMPLES
The following sets
.Va chararray
@@ -185,14 +200,16 @@ conform to
.St -isoC .
The
.Fn stpcpy
-function is an MS-DOS and GNUism.
-The
-.Fn stpcpy
-function
-conforms to no standard.
+and
+.Fn stpncpy
+functions conform to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn stpcpy
function first appeared in
.Fx 4.4 ,
-coming from 1998-vintage Linux.
+and
+.Fn stpncpy
+was added in
+.Fx 8.0 .
diff --git a/lib/libc/string/strlen.3 b/lib/libc/string/strlen.3
index 29c3515..f7aa033 100644
--- a/lib/libc/string/strlen.3
+++ b/lib/libc/string/strlen.3
@@ -32,11 +32,11 @@
.\" @(#)strlen.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd February 28, 2009
.Dt STRLEN 3
.Os
.Sh NAME
-.Nm strlen
+.Nm strlen, strnlen
.Nd find length of string
.Sh LIBRARY
.Lb libc
@@ -44,12 +44,22 @@
.In string.h
.Ft size_t
.Fn strlen "const char *s"
+.Ft size_t
+.Fn strnlen "const char *s" "size_t maxlen"
.Sh DESCRIPTION
The
.Fn strlen
function
computes the length of the string
.Fa s .
+The
+.Fn strnlen
+function attempts to compute the length of
+.Fa s ,
+but never scans beyond the first
+.Fa maxlen
+bytes of
+.Fa s .
.Sh RETURN VALUES
The
.Fn strlen
@@ -59,6 +69,13 @@ the number of characters that precede the
terminating
.Dv NUL
character.
+The
+.Fn strnlen
+function returns either the same result as
+.Fn strlen
+or
+.Fa maxlen ,
+whichever is smaller.
.Sh SEE ALSO
.Xr string 3
.Sh STANDARDS
@@ -67,3 +84,7 @@ The
function
conforms to
.St -isoC .
+The
+.Fn strnlen
+function conforms to
+.St -p1003.1-2008 .
diff --git a/lib/libc/string/strnlen.c b/lib/libc/string/strnlen.c
new file mode 100644
index 0000000..f44151f
--- /dev/null
+++ b/lib/libc/string/strnlen.c
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2009 David Schultz <das@FreeBSD.org>
+ * 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <string.h>
+
+size_t
+strnlen(const char *s, size_t maxlen)
+{
+ size_t len;
+
+ for (len = 0; len < maxlen; len++, s++) {
+ if (!*s)
+ break;
+ }
+ return (len);
+}
diff --git a/lib/libc/string/wcscasecmp.c b/lib/libc/string/wcscasecmp.c
new file mode 100644
index 0000000..0143543
--- /dev/null
+++ b/lib/libc/string/wcscasecmp.c
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2009 David Schultz <das@FreeBSD.org>
+ * 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <wchar.h>
+#include <wctype.h>
+
+int
+wcscasecmp(const wchar_t *s1, const wchar_t *s2)
+{
+ wchar_t c1, c2;
+
+ for (; *s1; s1++, s2++) {
+ c1 = towlower(*s1);
+ c2 = towlower(*s2);
+ if (c1 != c2)
+ return ((int)c1 - c2);
+ }
+ return (-*s2);
+}
diff --git a/lib/libc/string/wcsncasecmp.c b/lib/libc/string/wcsncasecmp.c
new file mode 100644
index 0000000..a42d98c
--- /dev/null
+++ b/lib/libc/string/wcsncasecmp.c
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2009 David Schultz <das@FreeBSD.org>
+ * 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <wchar.h>
+#include <wctype.h>
+
+int
+wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+ wchar_t c1, c2;
+
+ if (n == 0)
+ return (0);
+ for (; *s1; s1++, s2++) {
+ c1 = towlower(*s1);
+ c2 = towlower(*s2);
+ if (c1 != c2)
+ return ((int)c1 - c2);
+ if (--n == 0)
+ return (0);
+ }
+ return (-*s2);
+}
diff --git a/lib/libc/string/wcsnlen.c b/lib/libc/string/wcsnlen.c
new file mode 100644
index 0000000..f03cf76
--- /dev/null
+++ b/lib/libc/string/wcsnlen.c
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2009 David Schultz <das@FreeBSD.org>
+ * 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <wchar.h>
+
+size_t
+wcsnlen(const wchar_t *s, size_t maxlen)
+{
+ size_t len;
+
+ for (len = 0; len < maxlen; len++, s++) {
+ if (!*s)
+ break;
+ }
+ return (len);
+}
diff --git a/lib/libc/string/wmemchr.3 b/lib/libc/string/wmemchr.3
index 26ff1df..8812ca3 100644
--- a/lib/libc/string/wmemchr.3
+++ b/lib/libc/string/wmemchr.3
@@ -35,7 +35,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 13, 2005
+.Dd February 28, 2009
.Dt WMEMCHR 3
.Os
.Sh NAME
@@ -44,6 +44,7 @@
.Nm wmemcpy ,
.Nm wmemmove ,
.Nm wmemset ,
+.Nm wcscasecmp ,
.Nm wcscat ,
.Nm wcschr ,
.Nm wcscmp ,
@@ -53,9 +54,11 @@
.Nm wcslcat ,
.Nm wcslcpy ,
.Nm wcslen ,
+.Nm wcsncasecmp ,
.Nm wcsncat ,
.Nm wcsncmp ,
.Nm wcsncpy ,
+.Nm wcsnlen ,
.Nm wcspbrk ,
.Nm wcsrchr ,
.Nm wcsspn ,
@@ -75,6 +78,8 @@
.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 int
+.Fn wcscasecmp "const wchar_t *s1" "const wchar_t *s2"
.Ft wchar_t *
.Fn wcscat "wchar_t * restrict s1" "const wchar_t * restrict s2"
.Ft wchar_t *
@@ -93,12 +98,16 @@
.Fn wcslcpy "wchar_t *s1" "const wchar_t *s2" "size_t n"
.Ft size_t
.Fn wcslen "const wchar_t *s"
+.Ft int
+.Fn wcsncasecmp "const wchar_t *s1" "const wchar_t *s2" "size_t n"
.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 size_t
+.Fn wcsnlen "const wchar_t *s" "size_t maxlen"
.Ft wchar_t *
.Fn wcspbrk "const wchar_t *s1" "const wchar_t *s2"
.Ft wchar_t *
@@ -119,6 +128,7 @@ counterpart, such as
.Xr memcpy 3 ,
.Xr memmove 3 ,
.Xr memset 3 ,
+.Xr strcasecmp 3 ,
.Xr strcat 3 ,
.Xr strchr 3 ,
.Xr strcmp 3 ,
@@ -131,6 +141,7 @@ counterpart, such as
.Xr strncat 3 ,
.Xr strncmp 3 ,
.Xr strncpy 3 ,
+.Xr strnlen 3 ,
.Xr strpbrk 3 ,
.Xr strrchr 3 ,
.Xr strspn 3 ,
@@ -139,8 +150,15 @@ counterpart, such as
These functions conform to
.St -isoC-99 ,
with the exception of
+.Fn wcscasecmp ,
.Fn wcsdup ,
-.Fn wcslcat ,
+.Fn wcsncasecmp ,
+and
+.Fn wcsnlen ,
+which conform to
+.St -p1003.1-2008 ;
+and
+.Fn wcslcat
and
.Fn wcslcpy ,
which are extensions.
OpenPOWER on IntegriCloud