date and time created 90/05/15 14:01:13 by bostic
[unix-history] / usr / src / lib / libc / string / string.3
index 894961b..064aaed 100644 (file)
@@ -2,40 +2,44 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)string.3    6.3 (Berkeley) %G%
+.\"    @(#)string.3    6.5 (Berkeley) %G%
 .\"
 .TH STRING 3  ""
 .UC 4
 .SH NAME
 .\"
 .TH STRING 3  ""
 .UC 4
 .SH NAME
-strcat, strncat, strcmp, strncmp, strcasecmp, strcasencmp, strcpy,
+strcat, strncat, strcmp, strncmp, strcasecmp, strncasecmp, strcpy,
 strncpy, strlen, index, rindex \- string operations
 .SH SYNOPSIS
 .nf
 .B #include <strings.h>
 .PP
 strncpy, strlen, index, rindex \- string operations
 .SH SYNOPSIS
 .nf
 .B #include <strings.h>
 .PP
-.B char *strcat(s1, s2)
-.B char *s1, *s2;
+.B char *strcat(s, append)
+.B char *s, *append;
 .PP
 .PP
-.B char *strncat(s1, s2, n)
-.B char *s1, *s2;
+.B char *strncat(s, append, count)
+.B char *s, *append;
+.B int count;
 .PP
 .B strcmp(s1, s2)
 .B char *s1, *s2;
 .PP
 .PP
 .B strcmp(s1, s2)
 .B char *s1, *s2;
 .PP
-.B strncmp(s1, s2, n)
+.B strncmp(s1, s2, count)
 .B char *s1, *s2;
 .B char *s1, *s2;
+.B int count;
 .PP
 .B strcasecmp(s1, s2)
 .B char *s1, *s2;
 .PP
 .PP
 .B strcasecmp(s1, s2)
 .B char *s1, *s2;
 .PP
-.B strcasencmp(s1, s2, n)
+.B strncasecmp(s1, s2, count)
 .B char *s1, *s2;
 .B char *s1, *s2;
+.B int count;
 .PP
 .PP
-.B char *strcpy(s1, s2)
-.B char *s1, *s2;
+.B char *strcpy(to, from)
+.B char *to, *from;
 .PP
 .PP
-.B char *strncpy(s1, s2, n)
-.B char *s1, *s2;
+.B char *strncpy(to, from, count)
+.B char *to, *from;
+.B int count;
 .PP
 .B strlen(s)
 .B char *s;
 .PP
 .B strlen(s)
 .B char *s;
@@ -50,50 +54,25 @@ strncpy, strlen, index, rindex \- string operations
 These functions operate on null-terminated strings.
 They do not check for overflow of any receiving string.
 .PP
 These functions operate on null-terminated strings.
 They do not check for overflow of any receiving string.
 .PP
-.I Strcat
-appends a copy of string
-.I s2
-to the end of string
-.IR s1 .
-.I Strncat
-copies at most
-.I n
-characters.  Both return a pointer to the null-terminated result.
-.PP
-.I Strcmp
-compares its arguments and returns an integer
-greater than, equal to, or less than 0, according as
-.I s1
-is lexicographically greater than, equal to, or less than
-.IR s2 .
-.I Strncmp
-makes the same comparison but looks at at most
-.I n
-characters.  \fIStrcasecmp\fP and \fIstrcasencmp\fP are identical
-in function, but are case insensitive.  The returned lexicographic
-difference reflects a conversion to lower-case.
-.PP
-.I Strcpy
-copies string
-.I s2
-to
-.I s1,
-stopping after the null character has been moved.
-.I Strncpy
-copies exactly
-.I n
-characters, truncating or null-padding
-.I s2;
-the target may not be null-terminated if the length of
-.I s2
-is
-.I n
-or more.  Both return
-.IR s1 .
-.PP
-.I Strlen
-returns the number of non-null characters in
-.IR s .
+\fIStrcat\fP appends a copy of string \fIappend\fP to the end of string
+\fIs\fP. \fIStrncat\fP copies at most \fIcount\fP characters.  Both
+return a pointer to the null-terminated result.
+.PP
+\fIStrcmp\fP compares its arguments and returns an integer greater than,
+equal to, or less than 0, according as \fIs1\fP is lexicographically
+greater than, equal to, or less than \fIs2\fP.  \fIStrncmp\fP makes the
+same comparison but looks at at most \fIcount\fP characters.
+\fIStrcasecmp\fP and \fIstrncasecmp\fP are identical in function, but are
+case insensitive.  The returned lexicographic difference reflects a
+conversion to lower-case.
+.PP
+\fIStrcpy\fP copies string \fIfrom\fP to \fIto\fP, stopping after the
+null character has been moved.  \fIStrncpy\fP copies exactly \fIcount\fP
+characters, appending nulls if \fIfrom\fP is less than \fIcount\fP
+characters in length; the target may not be null-terminated if the
+length of \fIfrom\fP is \fIcount\fP or more.  Both return \fIto\fP.
+.PP
+\fIStrlen\fP returns the number of non-null characters in \fIs\fP.
 .PP
 .I Index
 .RI ( rindex )
 .PP
 .I Index
 .RI ( rindex )