cursor/printParentNames.c
static RDM_RETCODE printParentNames (RDM_CURSOR child)
{
char name[32];
RDM_CURSOR parent = NULL;
rc = rdm_cursorGetOwnerRow (child, REF_MOTHERS_CHILDREN, &parent);
if (rc == eNOTLINKED)
{
rc = sOKAY;
printf ("Unknown mother\n");
}
else if (rc == sOKAY)
{
parent, COL_ADULT_ADULT_NAME, name, sizeof (name), NULL);
if (rc == sOKAY)
{
printf ("Mother: %s\n", name);
}
}
if (rc == sOKAY)
{
rc = rdm_cursorGetOwnerRow (child, REF_FATHERS_CHILDREN, &parent);
}
if (rc == eNOTLINKED)
{
rc = sOKAY;
printf ("Unknown father\n");
}
else if (rc == sOKAY)
{
parent, COL_ADULT_ADULT_NAME, name, sizeof (name), NULL);
if (rc == sOKAY)
{
printf ("Father: %s\n", name);
}
}
rdm_cursorFree (parent);
return rc;
}
struct RDM_CURSOR_S * RDM_CURSOR
Definition: rdmtypes.h:306
@ eNOTLINKED
Definition: rdmretcodetypes.h:250
@ sOKAY
Definition: rdmretcodetypes.h:96
RDM_RETCODE rdm_cursorFree(RDM_CURSOR cursor)
Free an RDM_CURSOR.
RDM_RETCODE rdm_cursorReadColumn(RDM_CURSOR cursor, RDM_COLUMN_ID columnId, void *columnValue, size_t bytesIn, size_t *bytesOut)
Read a single column from a table row.
RDM_RETCODE rdm_cursorGetOwnerRow(RDM_CURSOR memberCursor, RDM_REF_ID refId, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with a set owner.
RDM_RETCODE
RDM status and error return codes.
Definition: rdmretcodetypes.h:44