diff options
Diffstat (limited to 'src/lib/libc/string/memchr.3')
| -rw-r--r-- | src/lib/libc/string/memchr.3 | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/src/lib/libc/string/memchr.3 b/src/lib/libc/string/memchr.3 index 265711e3b5..56a4e4780e 100644 --- a/src/lib/libc/string/memchr.3 +++ b/src/lib/libc/string/memchr.3 | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | .\" $OpenBSD: memchr.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $ | ||
| 2 | .\" | ||
| 1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
| 2 | .\" All rights reserved. | 4 | .\" All rights reserved. |
| 3 | .\" | 5 | .\" |
| @@ -13,11 +15,7 @@ | |||
| 13 | .\" 2. Redistributions in binary form must reproduce the above copyright | 15 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 14 | .\" notice, this list of conditions and the following disclaimer in the | 16 | .\" notice, this list of conditions and the following disclaimer in the |
| 15 | .\" documentation and/or other materials provided with the distribution. | 17 | .\" documentation and/or other materials provided with the distribution. |
| 16 | .\" 3. All advertising materials mentioning features or use of this software | 18 | .\" 3. Neither the name of the University nor the names of its contributors |
| 17 | .\" must display the following acknowledgement: | ||
| 18 | .\" This product includes software developed by the University of | ||
| 19 | .\" California, Berkeley and its contributors. | ||
| 20 | .\" 4. Neither the name of the University nor the names of its contributors | ||
| 21 | .\" may be used to endorse or promote products derived from this software | 19 | .\" may be used to endorse or promote products derived from this software |
| 22 | .\" without specific prior written permission. | 20 | .\" without specific prior written permission. |
| 23 | .\" | 21 | .\" |
| @@ -33,10 +31,7 @@ | |||
| 33 | .\" 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 |
| 34 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
| 35 | .\" | 33 | .\" |
| 36 | .\" from: @(#)memchr.3 5.4 (Berkeley) 6/29/91 | 34 | .Dd $Mdocdate: July 25 2011 $ |
| 37 | .\" $Id: memchr.3,v 1.1.1.1 1995/10/18 08:42:21 deraadt Exp $ | ||
| 38 | .\" | ||
| 39 | .Dd June 29, 1991 | ||
| 40 | .Dt MEMCHR 3 | 35 | .Dt MEMCHR 3 |
| 41 | .Os | 36 | .Os |
| 42 | .Sh NAME | 37 | .Sh NAME |
| @@ -46,26 +41,37 @@ | |||
| 46 | .Fd #include <string.h> | 41 | .Fd #include <string.h> |
| 47 | .Ft void * | 42 | .Ft void * |
| 48 | .Fn memchr "const void *b" "int c" "size_t len" | 43 | .Fn memchr "const void *b" "int c" "size_t len" |
| 44 | .Ft void * | ||
| 45 | .Fn memrchr "const void *b" "int c" "size_t len" | ||
| 49 | .Sh DESCRIPTION | 46 | .Sh DESCRIPTION |
| 50 | The | 47 | The |
| 51 | .Fn memchr | 48 | .Fn memchr |
| 52 | function | 49 | function locates the first occurrence of |
| 53 | locates the first occurrence of | 50 | .Fa c |
| 51 | (converted to an | ||
| 52 | .Li unsigned char ) | ||
| 53 | in string | ||
| 54 | .Fa b . | ||
| 55 | .Pp | ||
| 56 | The | ||
| 57 | .Fn memrchr | ||
| 58 | function behaves like | ||
| 59 | .Fn memchr , | ||
| 60 | except that it locates the last occurrence of | ||
| 54 | .Fa c | 61 | .Fa c |
| 55 | (converted to an unsigned char) | ||
| 56 | in string | 62 | in string |
| 57 | .Fa b . | 63 | .Fa b . |
| 58 | .Sh RETURN VALUES | 64 | .Sh RETURN VALUES |
| 59 | The | 65 | The |
| 60 | .Fn memchr | 66 | .Fn memchr |
| 61 | function | 67 | and |
| 62 | returns a pointer to the byte located, | 68 | .Fn memrchr |
| 63 | or NULL if no such byte exists within | 69 | functions return a pointer to the byte located, or |
| 70 | .Dv NULL | ||
| 71 | if no such byte exists within | ||
| 64 | .Fa len | 72 | .Fa len |
| 65 | bytes. | 73 | bytes. |
| 66 | .Sh SEE ALSO | 74 | .Sh SEE ALSO |
| 67 | .Xr index 3 , | ||
| 68 | .Xr rindex 3 , | ||
| 69 | .Xr strchr 3 , | 75 | .Xr strchr 3 , |
| 70 | .Xr strcspn 3 , | 76 | .Xr strcspn 3 , |
| 71 | .Xr strpbrk 3 , | 77 | .Xr strpbrk 3 , |
| @@ -73,10 +79,23 @@ bytes. | |||
| 73 | .Xr strsep 3 , | 79 | .Xr strsep 3 , |
| 74 | .Xr strspn 3 , | 80 | .Xr strspn 3 , |
| 75 | .Xr strstr 3 , | 81 | .Xr strstr 3 , |
| 76 | .Xr strtok 3 | 82 | .Xr strtok 3 , |
| 83 | .Xr wmemchr 3 | ||
| 77 | .Sh STANDARDS | 84 | .Sh STANDARDS |
| 78 | The | 85 | The |
| 79 | .Fn memchr | 86 | .Fn memchr |
| 80 | function | 87 | function conforms to |
| 81 | conforms to | ||
| 82 | .St -ansiC . | 88 | .St -ansiC . |
| 89 | .Pp | ||
| 90 | The | ||
| 91 | .Fn memrchr | ||
| 92 | function is an | ||
| 93 | .Ox | ||
| 94 | extension. | ||
| 95 | .Sh HISTORY | ||
| 96 | The | ||
| 97 | .Fn memchr | ||
| 98 | function first appeared in | ||
| 99 | .At V | ||
| 100 | and was reimplemented for | ||
| 101 | .Bx 4.3 Tahoe . | ||
