cursor/adoptChild.c
static RDM_RETCODE adoptChild (
uint32_t childId,
uint32_t newMotherId,
uint32_t newFatherId,
RDM_DB db)
{
RDM_CURSOR child = NULL;
RDM_CURSOR newMother = NULL;
RDM_CURSOR newFather = NULL;
db, KEY_ADULT_ADULT_ID, &newMotherId, sizeof (newMotherId), &newMother);
if (rc == sOKAY)
{
db, KEY_ADULT_ADULT_ID, &newFatherId, sizeof (newFatherId),
&newFather);
}
if (rc == sOKAY)
{
db, KEY_CHILD_CHILD_ID, &childId, sizeof (childId), &child);
}
if (rc == sOKAY)
{
rc = rdm_cursorRelinkRow (child, REF_MOTHERS_CHILDREN, newMother);
}
if (rc == sOKAY)
{
rc = rdm_cursorRelinkRow (child, REF_FATHERS_CHILDREN, newFather);
}
rdm_cursorFree (child);
rdm_cursorFree (newMother);
rdm_cursorFree (newFather);
return rc;
}