]> git.saurik.com Git - apple/libc.git/blob - string/memset_pattern.3
Libc-1244.50.9.tar.gz
[apple/libc.git] / string / memset_pattern.3
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
20 These are analogous to
21 .Fn memset ,
22 except that they
23 fill memory with a replicated pattern either 4, 8, or 16 bytes long.
24 .Fa b
25 points to a buffer of size
26 .Fa len
27 bytes which is to be filled. The second parameter points to the pattern.
28 If the buffer length is not an even multiple
29 of the pattern length, the last instance of the pattern will be truncated.
30 Neither the buffer nor the pattern pointer need be aligned.
31 .Sh EXAMPLES
32 The following example:
33 .Bd -literal -offset indent
34 char buf[10];
35
36 memset_pattern4( buf, "1234", sizeof(buf) );
37 .Ed
38 .Pp
39 will set the buffer to the value "1234123412".
40 .Sh SEE ALSO
41 .Xr memset 3
42 .Sh HISTORY
43 These functions first appeared in Mac OS 10.5.