> (curr->record.arg1 == record->arg1) && \
1. You don't need the \ at the end of these lines. You only need \ at the end of complicated #define code blocks.
2. Make it a separate function you can call.
Code:
if ( record_equal(curr->record,record) ) {
// do stuff
}
3. Your logic should be if / else if
Code:
if (curr->prev == NULL)
{
}
else if (curr->next == NULL)
{
}
else if (curr->prev != NULL && curr->next != NULL)
{
}
You can then have a single free, and a single break.
But it would seem to work as is, fwiw.