diff options
Diffstat (limited to 'src/lib/libc/string/strtok.3')
| -rw-r--r-- | src/lib/libc/string/strtok.3 | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/lib/libc/string/strtok.3 b/src/lib/libc/string/strtok.3 index ed7d5158ed..fbf0abfc26 100644 --- a/src/lib/libc/string/strtok.3 +++ b/src/lib/libc/string/strtok.3 | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | .\" $OpenBSD: strtok.3,v 1.20 2011/07/25 00:38:53 schwarze Exp $ | ||
| 2 | .\" | ||
| 1 | .\" Copyright (c) 1988, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1988, 1991 The Regents of the University of California. |
| 2 | .\" All rights reserved. | 4 | .\" All rights reserved. |
| 3 | .\" | 5 | .\" |
| @@ -29,9 +31,7 @@ | |||
| 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 30 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
| 31 | .\" | 33 | .\" |
| 32 | .\" $OpenBSD: strtok.3,v 1.19 2007/05/31 19:19:32 jmc Exp $ | 34 | .Dd $Mdocdate: July 25 2011 $ |
| 33 | .\" | ||
| 34 | .Dd $Mdocdate: May 31 2007 $ | ||
| 35 | .Dt STRTOK 3 | 35 | .Dt STRTOK 3 |
| 36 | .Os | 36 | .Os |
| 37 | .Sh NAME | 37 | .Sh NAME |
| @@ -73,6 +73,14 @@ function is a version of | |||
| 73 | .Fn strtok | 73 | .Fn strtok |
| 74 | that takes an explicit context argument and is reentrant. | 74 | that takes an explicit context argument and is reentrant. |
| 75 | .Pp | 75 | .Pp |
| 76 | Since | ||
| 77 | .Fn strtok | ||
| 78 | and | ||
| 79 | .Fn strtok_r | ||
| 80 | modify the string, | ||
| 81 | .Fa str | ||
| 82 | should not point to an area in the initialized data segment. | ||
| 83 | .Sh RETURN VALUES | ||
| 76 | The | 84 | The |
| 77 | .Fn strtok | 85 | .Fn strtok |
| 78 | and | 86 | and |
| @@ -82,14 +90,6 @@ in the string, after replacing the separator character itself with an | |||
| 82 | .Tn ASCII NUL | 90 | .Tn ASCII NUL |
| 83 | character. | 91 | character. |
| 84 | When no more tokens remain, a null pointer is returned. | 92 | When no more tokens remain, a null pointer is returned. |
| 85 | .Pp | ||
| 86 | Since | ||
| 87 | .Fn strtok | ||
| 88 | and | ||
| 89 | .Fn strtok_r | ||
| 90 | modify the string, | ||
| 91 | .Fa str | ||
| 92 | should not point to an area in the initialized data segment. | ||
| 93 | .Sh EXAMPLES | 93 | .Sh EXAMPLES |
| 94 | The following will construct an array of pointers to each individual word in | 94 | The following will construct an array of pointers to each individual word in |
| 95 | the string | 95 | the string |
| @@ -133,12 +133,26 @@ will point to | |||
| 133 | .Xr strrchr 3 , | 133 | .Xr strrchr 3 , |
| 134 | .Xr strsep 3 , | 134 | .Xr strsep 3 , |
| 135 | .Xr strspn 3 , | 135 | .Xr strspn 3 , |
| 136 | .Xr strstr 3 | 136 | .Xr strstr 3 , |
| 137 | .Xr wcstok 3 | ||
| 137 | .Sh STANDARDS | 138 | .Sh STANDARDS |
| 138 | The | 139 | The |
| 139 | .Fn strtok | 140 | .Fn strtok |
| 140 | function conforms to | 141 | function conforms to |
| 141 | .St -ansiC . | 142 | .St -ansiC . |
| 143 | .Sh HISTORY | ||
| 144 | The | ||
| 145 | .Fn strtok | ||
| 146 | function first appeared in | ||
| 147 | .At III | ||
| 148 | and was reimplemented for | ||
| 149 | .Bx 4.3 Tahoe . | ||
| 150 | The | ||
| 151 | .Fn strtok_r | ||
| 152 | function first appeared in | ||
| 153 | .Nx 1.3 | ||
| 154 | and was reimplemented for | ||
| 155 | .Ox 2.7 . | ||
| 142 | .Sh BUGS | 156 | .Sh BUGS |
| 143 | The System V | 157 | The System V |
| 144 | .Fn strtok , | 158 | .Fn strtok , |
