NAME
genalloc_catb, genalloc_cat, genalloc_copyb, genalloc_copy, genalloc_insertb, genalloc_insert, genalloc_append - adding data into a genalloc
SYNOPSIS
#include <limb/genalloc.h>
int genalloc_catb(type, genalloc *ga, const type *el, int num) int genalloc_cat(type, genalloc *ga, const genalloc *gasce) int genalloc_copyb(type, genalloc *ga, const type *el, int num) int genalloc_copy(type, genalloc *ga, const genalloc *gasce) int genalloc_insertb(type, genalloc *ga, size_t offset, const type *el, int num) int genalloc_insert(type, genalloc *ga, size_t offset, const genalloc *gasce) int genalloc_append(type, genalloc *ga, type *el)
DESCRIPTION
The genalloc_catb
() macro appends the content of memory pointed by el
-
which must be num
elements of type type
- into the genalloc pointed by ga
.
The genalloc_cat
() macro is similar to genalloc_catb
() macro but
appending the content of genalloc gasce
.
The genalloc_copyb
() macro copies the content of memory pointed by el
-
which must be num
elements of type type
- into the genalloc pointed by ga
.
That is, the genalloc will only contain el
afterwards.
The genalloc_copy
() macro is similar to genalloc_copyb
() macro but
copying the content of genalloc gasce
.
The genalloc_insertb
() macro inserts the content of memory pointed by
el
- which must be num
elements of type type
- into the genalloc pointed
by ga
at offset offset
.
The genalloc_insert
() macro is similar to genalloc_insertb
() macro but
inserting the content of genalloc gasce
.
The genalloc_append
() macro appends the element of type type
pointed be
el
into the genalloc pointed by ga
.
Obviously all these macros ensure that there is enough room available in the
genalloc ga
before writing data into it.
RETURN VALUE
These functions return 1 on success. Otherwise they return 0 and set errno
to
indicate the error.
ERRORS
The genalloc_catb
(), genalloc_cat
(), genalloc_copyb
(), genalloc_copy
(),
genalloc_insertb
() and genalloc_insert
() functions may fail for the errors
described for stralloc_catb(3), stralloc_cat(3), stralloc_copyb(3),
stralloc_copy(3), stralloc_insertb(3) and stralloc_insert(3) respectively.
The genalloc_append
() function may fail for the error described for
stralloc_catb(3).