Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-155
repmem (supplementary)
repmem (supplementary)
The repmem function replicates values through memory; that is, it copies a small block
of values (a template) repeatedly into a larger block of memory.
dest_blk
points to the block of memory to fill.
template
points to the template to replicate through *dest_blk.
tmpl_size
specifies the size in bytes of the template.
rep_count
specifies the number of times to replicate *template into *dest_blk.
Return Value
none.
Usage Guidelines
•
Note that the pointers used by repmem have type pointer to char. To use other types
of pointers, first convert them to pointers to char using the cast operator.
Example
This example replicates 10 templates of 10 bytes each:
#include <memoryh>
char dest[100];
char temp[10];
/* ... */
repmem(dest, temp, sizeof temp, 10);
#include <memoryh>
void repmem(char *dest_blk, char *template,
size_t tmpl_size, size_t rep_count);