debian man page for memins

Query: memins

OS: debian

Section: 3pub

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

MEMINS(3pub)						       C Programmer's Manual						      MEMINS(3pub)

NAME
memins - insert bytes at beginning of memory block
SYNOPSIS
#include <publib.h> void *memins(void *tgt, size_t tgtsize, const void *src, size_t srcsize);
DESCRIPTION
memins inserts srcsize bytes from src at the beginning of tgt, but moves the first tgtsize out of the way. The source and target memory blocks must not overlap.
RETURN VALUE
memins returns its first argument.
EXAMPLE
To insert a new element at the ith position of an array, one might do the following. int new, array[10]; memins(array+i, (10-i-1)*sizeof(array[0]), &new, sizeof(new)); Please note that the above code carefully avoids the trap of moving the last element of the array past the end of the array.
SEE ALSO
publib(3), strins(3)
AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual MEMINS(3pub)
Related Man Pages
memdup(3pub) - debian
memshuffle(3pub) - debian
strcstr(3pub) - debian
strmaxcpy(3pub) - debian
xmalloc(3pub) - opensolaris
Similar Topics in the Unix Linux Community
awk or sed - Convert 2 lines to 1 line
A (ksh) Library For and From UNIX.com
How to copy a column of multiple files and paste into new excel file (next to column)?
New UNIX and Linux History Sections