]> git.saurik.com Git - apple/libc.git/blame - string/memset_pattern.3
Libc-583.tar.gz
[apple/libc.git] / string / memset_pattern.3
CommitLineData
224c7076
A
1.Dd October 14, 2005
2.Dt MEMSET_PATTERN 3
3.Os Darwin
4.Sh NAME
5.Nm memset_pattern4 ,
6.Nm memset_pattern8 ,
7.Nm memset_pattern16
8.Nd memset of a multi-byte pattern
9.Sh LIBRARY
10.Lb libc
11.Sh SYNOPSIS
12.In string.h
13.Ft void
14.Fn memset_pattern4 "void *b" "const void *pattern4" "size_t len"
15.Ft void
16.Fn memset_pattern8 "void *b" "const void *pattern8" "size_t len"
17.Ft void
18.Fn memset_pattern16 "void *b" "const void *pattern16" "size_t len"
19.Sh DESCRIPTION
20These are analogous to
21.Fn memset ,
22except that they
23fill memory with a replicated pattern either 4, 8, or 16 bytes long.
24.Fa b
25points to a buffer of size
26.Fa len
27bytes which is to be filled. The second parameter points to the pattern.
28If the buffer length is not an even multiple
29of the pattern length, the last instance of the pattern will be truncated.
30Neither the buffer nor the pattern pointer need be aligned.
31.Sh EXAMPLES
32The following example:
33.Bd -literal -offset indent
34char buf[10];
35
36memset_pattern4( buf, "1234", sizeof(buf) );
37.Ed
38.Pp
39will set the buffer to the value "1234123412".
40.Sh SEE ALSO
41.Xr memset 3
42.Sh HISTORY
43These functions first appeared in Mac OS 10.5.