aboutsummaryrefslogtreecommitdiffstats
path: root/man3/string.3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2014-01-05 00:28:50 +1300
committerMichael Kerrisk <mtk.manpages@gmail.com>2014-01-05 00:34:01 +1300
commitdd827c27b0c155c07481bb6819f28e15f85223c6 (patch)
tree4911dfc78e1c8a813befa2600f5c55842ee6fb3d /man3/string.3
parent0612e12ee7c94f5934dcbe6dc33a0800087005f1 (diff)
downloadman-pages-dd827c27b0c155c07481bb6819f28e15f85223c6.tar.gz
string.3: Fixes and enhancements to Moritz Str?be's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3/string.3')
-rw-r--r--man3/string.3107
1 files changed, 58 insertions, 49 deletions
diff --git a/man3/string.3 b/man3/string.3
index 5e27a651ba..0dee9e0245 100644
--- a/man3/string.3
+++ b/man3/string.3
@@ -27,7 +27,7 @@
.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages
.\" Modified Sun Jul 25 10:54:31 1993, Rik Faith (faith@cs.unc.edu)
-.TH STRING 3 2010-02-25 "" "Linux Programmer's Manual"
+.TH STRING 3 2014-01-04 "" "Linux Programmer's Manual"
.SH NAME
stpcpy, strcasecmp, strcat, strchr, strcmp, strcoll, strcpy, strcspn,
strdup, strfry, strlen, strncat, strncmp, strncpy, strncasecmp, strpbrk,
@@ -37,34 +37,33 @@ strrchr, strsep, strspn, strstr, strtok, strxfrm, index, rindex
.B #include <strings.h>
.TP
.BI "int strcasecmp(const char *" s1 ", const char *" s2 );
-Compares
+Compare the strings
.I s1
and
.I s2
-ignoring the case.
+ignoring case.
.TP
.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n );
-Compares the first
+Compare the first
.I n
-characters of
+characters of the strings
.I s1
and
.I s2
-ignoring the case.
+ignoring case.
.TP
.BI "char *index(const char *" s ", int " c );
-Returns the first occurrence of
+Return a pointer to the first occurrence of the character
.I c
-in
+in the string
.IR s .
.TP
.BI "char *rindex(const char *" s ", int " c );
-Returns the last occurrence of
+Return a pointer to the last occurrence of the character
.I c
-in
+in the string
.IR s .
.TP
-.TP
.B #include <string.h>
.TP
.TP
@@ -72,71 +71,79 @@ in
Copy a string from
.I src
to
+.IR dest ,
+returning a pointer to the end of the resulting string at
.IR dest .
.TP
.BI "char *strcat(char *" dest ", const char *" src );
-Concatenate
+Append the string
.I src
-to
+to the string
+.IR dest ,
+returning a pointer
.IR dest .
.TP
.BI "char *strchr(const char *" s ", int " c );
-Find the first occurence of
+Return a pointer to the first occurrence of the character
.I c
-in
+in the string
.IR s .
.TP
.BI "int strcmp(const char *" s1 ", const char *" s2 );
-Compare
+Compare the strings
.I s1
with
-.IR s2.
+.IR s2 .
.TP
.BI "int strcoll(const char *" s1 ", const char *" s2 );
-Compare
+Compare the strings
.I s1
with
.I s2
using the current locale.
.TP
.BI "char *strcpy(char *" dest ", const char *" src );
-Copy
+Copy the string
.I src
to
-.IR dst .
+.IR dest ,
+returning a pointer to the start of
+.IR dest .
.TP
.BI "size_t strcspn(const char *" s ", const char *" reject );
-Calculate the length of the initial segment of
+Calculate the length of the initial segment of the string
.I s
-which does not contain
-.IR reject .
+which does not contain any of bytes in the string
+.IR reject ,
.TP
.BI "char *strdup(const char *" s );
-Copy
+Return a duplicate of the string
.I s
-to memory allocated using
+in memory allocated using
.IR malloc (3).
.TP
.BI "char *strfry(char *" string );
Randomly swap the characters in
-.IR string.
+.IR string .
.TP
.BI "size_t strlen(const char *" s );
-Calculate the length of
+Return the length of the string
.IR s .
.TP
.BI "char *strncat(char *" dest ", const char *" src ", size_t " n );
-Copy at most
+Append at most
.I n
-characters from
+characters from the string
.I src
-to
+to the string
+.IR dest ,
+returning a pointer to
.IR dest .
.TP
.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n );
Compare at most
.I n
-bytes of
+bytes of the strings
.I s1
and
.IR s2.
@@ -144,46 +151,48 @@ and
.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n );
Copy at most
.I n
-bytes
-from
+bytes from string
.I src
to
-.IR dst .
+.IR dest ,
+returning a pointer to the start of
+.IR dest .
.TP
.BI "char *strpbrk(const char *" s ", const char *" accept );
-Return the first occurrence of
+Return a pointer to the first occurrence in the string
.I s
-in
+of one of the bytes in the string
.IR accept .
.TP
.BI "char *strrchr(const char *" s ", int " c );
-Return the first occurrence of
-.I s
-in
-.IR c .
+Return a pointer to the last occurrence of the character
+.I c
+in the string
+.IR s .
.TP
.BI "char *strsep(char **" stringp ", const char *" delim );
-Tokenise
+Extract the initial token in
.I stringp
-at
+that is delimited by one of the bytes in
.IR delim .
.TP
.BI "size_t strspn(const char *" s ", const char *" accept );
-Calculate the size of the starting segment in
+Calculate the length of the starting segment in the string
.I s
-that consists of
+that consists entirely of bytes in
.IR accept .
.TP
.BI "char *strstr(const char *" haystack ", const char *" needle );
-Find the first occurrence of
+Find the first occurrence of the substring
.I needle
-in
-.IR haystack .
+in the string
+.IR haystack ,
+returning a pointer to the found substring.
.TP
.BI "char *strtok(char *" s ", const char *" delim );
-Tokenize
+Extract tokens from the string
.I s
-at
+that are delimited by one of the bytes in
.IR delim .
.TP
.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n );