diff options
author | Robert Mustacchi <rm@joyent.com> | 2014-12-21 23:20:59 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2014-12-27 08:30:23 -0800 |
commit | bad51a906c423d0d7ab33fcc1a4e317d789e3c49 (patch) | |
tree | 0f58ce34da49bb2fb8d3ca4beb75cf45a3999cc8 | |
parent | e232d9863a8486cf94eaa4bc06c2e9ff52bf3140 (diff) | |
download | illumos-joyent-bad51a906c423d0d7ab33fcc1a4e317d789e3c49.tar.gz |
5474 missing various string family manuals
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r-- | usr/src/man/man3c/Makefile | 16 | ||||
-rw-r--r-- | usr/src/man/man3c/string.3c | 91 | ||||
-rw-r--r-- | usr/src/pkg/manifests/system-library.man3c.inc | 8 |
3 files changed, 98 insertions, 17 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile index 517319c7fb..7fe87e9bee 100644 --- a/usr/src/man/man3c/Makefile +++ b/usr/src/man/man3c/Makefile @@ -1128,15 +1128,21 @@ MANLINKS= FD_CLR.3c \ stderr.3c \ stdin.3c \ stdout.3c \ + stpcpy.3c \ + stpncpy.3c \ strcasecmp.3c \ strcasecmp_l.3c \ + strcasestr.3c \ + strcasestr_l.3c \ strcat.3c \ strchr.3c \ + strchrnul.3c \ strcmp.3c \ strcoll_l.3c \ strcpy.3c \ strcspn.3c \ strdup.3c \ + strdupa.3c \ strerror_r.3c \ strfmon_l.3c \ strftime_l.3c \ @@ -1148,6 +1154,8 @@ MANLINKS= FD_CLR.3c \ strncat.3c \ strncmp.3c \ strncpy.3c \ + strndup.3c \ + strndupa.3c \ strnlen.3c \ strnstr.3c \ strpbrk.3c \ @@ -2124,14 +2132,20 @@ ascftime.3c := LINKSRC = strftime.3c cftime.3c := LINKSRC = strftime.3c strftime_l.3c := LINKSRC = strftime.3c +stpcpy.3c := LINKSRC = string.3c +stpncpy.3c := LINKSRC = string.3c strcasecmp.3c := LINKSRC = string.3c strcasecmp_l.3c := LINKSRC = string.3c +strcasestr.3c := LINKSRC = string.3c +strcasestr_l.3c := LINKSRC = string.3c strcat.3c := LINKSRC = string.3c strchr.3c := LINKSRC = string.3c +strchrnul.3c := LINKSRC = string.3c strcmp.3c := LINKSRC = string.3c strcpy.3c := LINKSRC = string.3c strcspn.3c := LINKSRC = string.3c strdup.3c := LINKSRC = string.3c +strdupa.3c := LINKSRC = string.3c strlcat.3c := LINKSRC = string.3c strlcpy.3c := LINKSRC = string.3c strlen.3c := LINKSRC = string.3c @@ -2140,6 +2154,8 @@ strncasecmp_l.3c := LINKSRC = string.3c strncat.3c := LINKSRC = string.3c strncmp.3c := LINKSRC = string.3c strncpy.3c := LINKSRC = string.3c +strndup.3c := LINKSRC = string.3c +strndupa.3c := LINKSRC = string.3c strnlen.3c := LINKSRC = string.3c strnstr.3c := LINKSRC = string.3c strpbrk.3c := LINKSRC = string.3c diff --git a/usr/src/man/man3c/string.3c b/usr/src/man/man3c/string.3c index 145fc54ea1..cc934221e3 100644 --- a/usr/src/man/man3c/string.3c +++ b/usr/src/man/man3c/string.3c @@ -13,12 +13,13 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH STRING 3C "Jun 21, 2013" +.TH STRING 3C "Dec 20, 2014" .SH NAME string, strcasecmp, strcasecmp_l, strncasecmp, strncasecmp_l, strcat, strncat, -strlcat, strchr, strrchr, -strcmp, strncmp, strcpy, strncpy, strlcpy, strcspn, strspn, strdup, strlen, -strnlen, strpbrk, strsep, strstr, strnstr, strtok, strtok_r \- string operations +strlcat, strchr, strchrnul, strrchr, strcmp, strncmp, stpcpy, stpncpy, strcpy, +strncpy, strlcpy, strcspn, strspn, strdup, strndup, strdupa, strndupa, strlen, +strnlen, strpbrk, strsep, strstr, strnstr, strcasestr, strtok, strtok_r \- +string operations .SH SYNOPSIS .LP .nf @@ -70,6 +71,14 @@ strnlen, strpbrk, strsep, strstr, strnstr, strtok, strtok_r \- string operations .fi .LP .nf +\fBchar *\fR\fBstpcpy\fR(\fBchar *restrict\fR \fIs1\fR, \fBconst char *restrict\fR \fIs2\fR); +.fi +.LP +.nf +\fBchar *\fR\fBstpncpy\fR(\fBchar *restrict\fR \fIs1\fR, \fBconst char *restrict\fR \fIs2\fR, \fBsize_t\fR \fIn\fR); +.fi +.LP +.nf \fBchar *\fR\fBstrcpy\fR(\fBchar *restrict\fR \fIs1\fR, \fBconst char *restrict\fR \fIs2\fR); .fi .LP @@ -94,6 +103,18 @@ strnlen, strpbrk, strsep, strstr, strnstr, strtok, strtok_r \- string operations .fi .LP .nf +\fBchar *\fR\fBstrndup\fR(\fBconst char *\fR\fIs1\fR, \fBsize_t\fR \fIn\fR); +.fi +.LP +.nf +\fBchar *\fR\fBstrdupa\fR(\fBconst char *\fR\fIs1\fR); +.fi +.LP +.nf +\fBchar *\fR\fBstrndupa\fR(\fBconst char *\fR\fIs1\fR, \fBsize_t\fR \fIn\fR); +.fi +.LP +.nf \fBsize_t\fR \fBstrlen\fR(\fBconst char *\fR\fIs\fR); .fi .LP @@ -118,6 +139,14 @@ strnlen, strpbrk, strsep, strstr, strnstr, strtok, strtok_r \- string operations .fi .LP .nf +\fBchar *\fR\fBstrcasestr\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); +.fi +.LP +.nf +\fBchar *\fR\fBstrcasestr_l\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR, \fBlocale_t\fR \fIloc\fR); +.fi +.LP +.nf \fBchar *\fR\fBstrtok\fR(\fBchar *restrict\fR \fIs1\fR, \fBconst char *restrict\fR \fIs2\fR); .fi .LP @@ -134,6 +163,10 @@ strnlen, strpbrk, strsep, strstr, strnstr, strtok, strtok_r \- string operations .fi .LP .nf +\fBconst char *\fR\fBstrchrnul\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR); +.fi +.LP +.nf \fBconst char *\fR\fBstrpbrk\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi .LP @@ -165,11 +198,12 @@ strnlen, strpbrk, strsep, strstr, strnstr, strtok, strtok_r \- string operations .SH DESCRIPTION .LP The arguments \fIs\fR, \fIs1\fR, and \fIs2\fR point to strings (arrays of -characters terminated by a null character). The \fBstrcat()\fR, -\fBstrncat()\fR, \fBstrlcat()\fR, \fBstrcpy()\fR, \fBstrncpy()\fR, -\fBstrlcpy()\fR, \fBstrsep()\fR, \fBstrtok()\fR, and \fBstrtok_r()\fR functions -all alter their first argument. Additionally, the \fBstrcat()\fR and -\fBstrcpy()\fR functions do not check for overflow of the array. +characters terminated by a null character). The \fBstrcat()\fR, \fBstrncat()\fR, +\fBstrlcat()\fR, \fBstrcpy()\fR, \fBstpcpy()\fR, \fBstpncpy()\fR, +\fBstrncpy()\fR, \fBstrlcpy()\fR, \fBstrsep()\fR, \fBstrtok()\fR, and +\fBstrtok_r()\fR functions all alter their first argument. Additionally, the +\fBstrcat()\fR, \fBstpcpy()\fR, and \fBstrcpy()\fR functions do not check for +overflow of the array. .SS "\fBstrcasecmp()\fR, \fBstrncasecmp()\fR" .LP The \fBstrcasecmp()\fR and \fBstrncasecmp()\fR functions are case-insensitive @@ -224,13 +258,16 @@ if (strlcat(dst, src, dstsize) >= dstsize) return \(mi1; .fi .in -2 -.SS "\fBstrchr()\fR, \fBstrrchr()\fR" +.SS "\fBstrchr()\fR, \fBstrrchr()\fR, \fBstrchrnul()\fR" .LP The \fBstrchr()\fR function returns a pointer to the first occurrence of \fIc\fR (converted to a \fBchar\fR) in string \fIs\fR, or a null pointer if \fIc\fR does not occur in the string. The \fBstrrchr()\fR function returns a pointer to the last occurrence of \fIc\fR. The null character terminating a -string is considered to be part of the string. +string is considered to be part of the string. The \fBstrchrnul()\fR function +behaves similarly to \fBstrchr()\fR, except when the character \fBc\fR is not +found, it returns a pointer to the null terminator of the string \fBs\fR and not +a null pointer. .SS "\fBstrcmp()\fR, \fBstrncmp()\fR" .LP The \fBstrcmp()\fR function compares two strings byte-by-byte, according to the @@ -264,21 +301,34 @@ if (strlcpy(dst, src, dstsize) >= dstsize) return \(mi1; .fi .in -2 - +.SS "\fBstpcpy()\fR, \fBstpncpy()\fR" +.LP +The \fBstpcpy()\fR and \fBstpncpy()\fR functions behave identically to +\fBstrcpy()\fR and \fBstrncpy()\fR respectively; however, instead of returning a +pointer to the beginning of \fIs1\fR, they return a pointer to the terminating +null character. .SS "\fBstrcspn()\fR, \fBstrspn()\fR" .LP The \fBstrcspn()\fR function returns the length of the initial segment of string \fIs1\fR that consists entirely of characters not from string \fIs2\fR. The \fBstrspn()\fR function returns the length of the initial segment of string \fIs1\fR that consists entirely of characters from string \fIs2\fR. -.SS "\fBstrdup()\fR" +.SS "\fBstrdup()\fR, \fBstrndup()\fR, \fBstrdupa()\fR, \fBstrndupa()\fR" .LP The \fBstrdup()\fR function returns a pointer to a new string that is a duplicate of the string pointed to by \fIs1\fR. The returned pointer can be passed to \fBfree()\fR. The space for the new string is obtained using \fBmalloc\fR(3C). If the new string cannot be created, a null pointer is returned and \fBerrno\fR may be set to \fBENOMEM\fR to indicate that the -storage space available is insufficient. +storage space available is insufficient. The \fBstrndup()\fR function is +identical to \fBstrdup()\fR, execept it copies at most \fIn\fR bytes from +\fBs1\fR and ensures the copied string is awlays null terminated. +.LP +The functions \fBstrdupa()\fR and \fBstrndupa()\fR behave identically to +\fBstrdup()\fr and \fBstrndup()\fR respectively; however, instead of allocating +memory using \fBmalloc\fR(3C), they use \fBalloca\fR(3C). These functions are +provided for compatibility only, their use is strongly discouraged due to their +use of \fBalloca\fR(3C). .SS "\fBstrlen()\fR, \fBstrnlen()\fR" The \fBstrlen()\fR function returns the number of bytes in \fIs\fR, not including the terminating null character. @@ -306,7 +356,7 @@ detected by comparing the location referenced by the pointer returned by \fBstrsep()\fR to `\e0'. .LP If *\fIstringp\fR is initially \fINULL\fR, \fBstrsep()\fR returns \fINULL\fR. -.SS "\fBstrstr()\fR, \fBstrnstr()\fR" +.SS "\fBstrstr()\fR, \fBstrnstr()\fR, \fBstrcasestr()\fR, \fBstrcasestr_l()\fR" .LP The \fBstrstr()\fR function locates the first occurrence of the string \fIs2\fR (excluding the terminating null character) in string \fIs1\fR and returns a @@ -315,6 +365,13 @@ pointer to the located string, or a null pointer if the string is not found. If the function returns \fIs1\fR. The \fBstrnstr()\fR function performs the same search as \fBstrstr()\fR, but only considers up to \fIn\fR bytes of \fIs1\fR. Bytes following a null byte are not compared. +.sp +.LP +The \fBstrcasestr()\fR and \fBstrcasestr_l()\fR functions are similar to +\fBstrstr()\fR, but both functions ignore the case of both \fBs1\fR and +\fBs2\fR. Where as the \fBstrcasestr()\fR function operates in the current +locale, the \fBstrcasestr_l()\fR function operates in the locale specified by +\fIloc\fR. .SS "\fBstrtok()\fR" .LP A sequence of calls to \fBstrtok()\fR breaks the string pointed to by \fIs1\fR @@ -492,8 +549,8 @@ The \fBstrlcat()\fR, \fBstrlcpy()\fR, and \fBstrsep()\fR functions are Committed. All the rest are Standard. .LP -The \fBstrtok()\fR and \fBstrdup()\fR functions are MT-Safe. The remaining -functions are Async-Signal-Safe. +The \fBstrtok()\fR, \fBstrdup()\fR, and \fBstrndup()\fR functions are MT-Safe. +The remaining functions are Async-Signal-Safe. .LP For all except \fBstrlcat()\fR, \fBstrlcpy()\fR, and \fBstrsep()\fR, see \fBstandards\fR(5). diff --git a/usr/src/pkg/manifests/system-library.man3c.inc b/usr/src/pkg/manifests/system-library.man3c.inc index 2bb5fabf58..5fcd5a0bbb 100644 --- a/usr/src/pkg/manifests/system-library.man3c.inc +++ b/usr/src/pkg/manifests/system-library.man3c.inc @@ -1197,15 +1197,21 @@ link path=usr/share/man/man3c/sscanf.3c target=scanf.3c link path=usr/share/man/man3c/stderr.3c target=stdio.3c link path=usr/share/man/man3c/stdin.3c target=stdio.3c link path=usr/share/man/man3c/stdout.3c target=stdio.3c +link path=usr/share/man/man3c/stpcpy.3c target=string.3c +link path=usr/share/man/man3c/stpncpy.3c target=string.3c link path=usr/share/man/man3c/strcasecmp.3c target=string.3c link path=usr/share/man/man3c/strcasecmp_l.3c target=string.3c +link path=usr/share/man/man3c/strcasestr.3c target=string.3c +link path=usr/share/man/man3c/strcasestr_l.3c target=string.3c link path=usr/share/man/man3c/strcat.3c target=string.3c link path=usr/share/man/man3c/strchr.3c target=string.3c +link path=usr/share/man/man3c/strchrnul.3c target=string.3c link path=usr/share/man/man3c/strcmp.3c target=string.3c link path=usr/share/man/man3c/strcoll_l.3c target=strcoll.3c link path=usr/share/man/man3c/strcpy.3c target=string.3c link path=usr/share/man/man3c/strcspn.3c target=string.3c link path=usr/share/man/man3c/strdup.3c target=string.3c +link path=usr/share/man/man3c/strdupa.3c target=string.3c link path=usr/share/man/man3c/strerror_r.3c target=strerror.3c link path=usr/share/man/man3c/strfmon_l.3c target=strfmon.3c link path=usr/share/man/man3c/strftime_l.3c target=strftime.3c @@ -1217,6 +1223,8 @@ link path=usr/share/man/man3c/strncasecmp_l.3c target=string.3c link path=usr/share/man/man3c/strncat.3c target=string.3c link path=usr/share/man/man3c/strncmp.3c target=string.3c link path=usr/share/man/man3c/strncpy.3c target=string.3c +link path=usr/share/man/man3c/strndup.3c target=string.3c +link path=usr/share/man/man3c/strndupa.3c target=string.3c link path=usr/share/man/man3c/strnlen.3c target=string.3c link path=usr/share/man/man3c/strnstr.3c target=string.3c link path=usr/share/man/man3c/strpbrk.3c target=string.3c |