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 (newMother);
rdm_cursorFree (newFather);
return rc;
}
struct RDM_CURSOR_S * RDM_CURSOR
Definition: rdmtypes.h:306
@ sOKAY
Definition: rdmretcodetypes.h:96
RDM_RETCODE rdm_dbGetRowsByKeyAtKey(RDM_DB db, RDM_KEY_ID keyId, const void *keyValue, size_t len, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with a row set that is ordered by key value and is initially positioned at th...
RDM_RETCODE rdm_cursorFree(RDM_CURSOR cursor)
Free an RDM_CURSOR.
RDM_RETCODE rdm_cursorRelinkRow(RDM_CURSOR cursor, RDM_REF_ID refId, RDM_CURSOR cursorOwner)
Unlink a row from one owner and link to another.
struct RDM_DB_S * RDM_DB
Definition: rdmtypes.h:305
RDM_RETCODE
RDM status and error return codes.
Definition: rdmretcodetypes.h:44