diff options
| author | millert <> | 2007-09-03 14:36:40 +0000 |
|---|---|---|
| committer | millert <> | 2007-09-03 14:36:40 +0000 |
| commit | 6fdd2cf23672d7bc626fee11d4ca588e6882a436 (patch) | |
| tree | 6e615c7bca555d0215313900997eb8f344809aca /src/lib/libc/string/memchr.3 | |
| parent | 4dce4206f0cafd0811f23aedc04a436aa9d145c1 (diff) | |
| download | openbsd-6fdd2cf23672d7bc626fee11d4ca588e6882a436.tar.gz openbsd-6fdd2cf23672d7bc626fee11d4ca588e6882a436.tar.bz2 openbsd-6fdd2cf23672d7bc626fee11d4ca588e6882a436.zip | |
add memrchr(3)
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/string/memchr.3 | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/lib/libc/string/memchr.3 b/src/lib/libc/string/memchr.3 index bab262964e..7ce07f8ea2 100644 --- a/src/lib/libc/string/memchr.3 +++ b/src/lib/libc/string/memchr.3 | |||
| @@ -29,9 +29,9 @@ | |||
| 29 | .\" 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 |
| 30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
| 31 | .\" | 31 | .\" |
| 32 | .\" $OpenBSD: memchr.3,v 1.7 2007/05/31 19:19:32 jmc Exp $ | 32 | .\" $OpenBSD: memchr.3,v 1.8 2007/09/03 14:36:40 millert Exp $ |
| 33 | .\" | 33 | .\" |
| 34 | .Dd $Mdocdate: May 31 2007 $ | 34 | .Dd $Mdocdate: September 3 2007 $ |
| 35 | .Dt MEMCHR 3 | 35 | .Dt MEMCHR 3 |
| 36 | .Os | 36 | .Os |
| 37 | .Sh NAME | 37 | .Sh NAME |
| @@ -41,6 +41,8 @@ | |||
| 41 | .Fd #include <string.h> | 41 | .Fd #include <string.h> |
| 42 | .Ft void * | 42 | .Ft void * |
| 43 | .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" | ||
| 44 | .Sh DESCRIPTION | 46 | .Sh DESCRIPTION |
| 45 | The | 47 | The |
| 46 | .Fn memchr | 48 | .Fn memchr |
| @@ -50,10 +52,21 @@ function locates the first occurrence of | |||
| 50 | .Li unsigned char ) | 52 | .Li unsigned char ) |
| 51 | in string | 53 | in string |
| 52 | .Fa b . | 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 | ||
| 61 | .Fa c | ||
| 62 | in string | ||
| 63 | .Fa b . | ||
| 53 | .Sh RETURN VALUES | 64 | .Sh RETURN VALUES |
| 54 | The | 65 | The |
| 55 | .Fn memchr | 66 | .Fn memchr |
| 56 | function returns a pointer to the byte located, or | 67 | and |
| 68 | .Fn memrchr | ||
| 69 | functions return a pointer to the byte located, or | ||
| 57 | .Dv NULL | 70 | .Dv NULL |
| 58 | if no such byte exists within | 71 | if no such byte exists within |
| 59 | .Fa len | 72 | .Fa len |
| @@ -72,3 +85,9 @@ The | |||
| 72 | .Fn memchr | 85 | .Fn memchr |
| 73 | function conforms to | 86 | function conforms to |
| 74 | .St -ansiC . | 87 | .St -ansiC . |
| 88 | .Pp | ||
| 89 | The | ||
| 90 | .Fn memrchr | ||
| 91 | function is an | ||
| 92 | .Ox | ||
| 93 | extension. | ||
