cursor/storeDNA.c
static
RDM_RETCODE
storeDNA (
RDM_CURSOR
adult,
const
char
*dna,
uint64_t pos,
size_t
len)
{
RDM_RETCODE
rc =
sOKAY
;
uint64_t size;
/* We do not need to check and set the size before we set the
* blob. Here we do this just to show how to call
* dc_getBlobSize and dc_setBlobSize */
rc =
rdm_cursorGetBlobSize
(adult, COL_ADULT_DNA, &size);
if
(pos > size)
{
printf (
"We have a hole in the DNA, lets hope it will be filled in later"
);
}
if
(rc ==
sOKAY
)
{
rc =
rdm_cursorSetBlobSize
(adult, COL_ADULT_DNA, pos + len);
}
if
(rc ==
sOKAY
)
{
rc =
rdm_cursorUpdateBlob
(adult, COL_ADULT_DNA, pos, dna, len);
}
return
rc;
}