diff options
Diffstat (limited to 'src/lib/libc/string/memchr.3')
-rw-r--r-- | src/lib/libc/string/memchr.3 | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/src/lib/libc/string/memchr.3 b/src/lib/libc/string/memchr.3 index 265711e3b5..558848ac23 100644 --- a/src/lib/libc/string/memchr.3 +++ b/src/lib/libc/string/memchr.3 | |||
@@ -13,11 +13,7 @@ | |||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | 13 | .\" 2. Redistributions in binary form must reproduce the above copyright |
14 | .\" notice, this list of conditions and the following disclaimer in the | 14 | .\" notice, this list of conditions and the following disclaimer in the |
15 | .\" documentation and/or other materials provided with the distribution. | 15 | .\" documentation and/or other materials provided with the distribution. |
16 | .\" 3. All advertising materials mentioning features or use of this software | 16 | .\" 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 | 17 | .\" may be used to endorse or promote products derived from this software |
22 | .\" without specific prior written permission. | 18 | .\" without specific prior written permission. |
23 | .\" | 19 | .\" |
@@ -33,10 +29,9 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
35 | .\" | 31 | .\" |
36 | .\" from: @(#)memchr.3 5.4 (Berkeley) 6/29/91 | 32 | .\" $OpenBSD: memchr.3,v 1.9 2007/09/03 16:50:14 jmc Exp $ |
37 | .\" $Id: memchr.3,v 1.1.1.1 1995/10/18 08:42:21 deraadt Exp $ | ||
38 | .\" | 33 | .\" |
39 | .Dd June 29, 1991 | 34 | .Dd $Mdocdate: September 3 2007 $ |
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 , |
@@ -77,6 +83,11 @@ bytes. | |||
77 | .Sh STANDARDS | 83 | .Sh STANDARDS |
78 | The | 84 | The |
79 | .Fn memchr | 85 | .Fn memchr |
80 | function | 86 | function conforms to |
81 | conforms to | ||
82 | .St -ansiC . | 87 | .St -ansiC . |
88 | .Pp | ||
89 | The | ||
90 | .Fn memrchr | ||
91 | function is an | ||
92 | .Ox | ||
93 | extension. | ||