fcb_offset_last_n

int fcb_offset_last_n(struct fcb *fcb, uint8_t entries, uint32_t *last_n_off);

Returns the offset of n-th last element.

Arguments

ArgumentsDescription
fcbPoints to FCB.
entriesHow many entries to leave.
last_n_offReturned offset.

Returned values

0 on success; non-zero on failure.

Notes

Returned offset is relative to beginning of the sector where the element is. Therefore, n-th last element must be found within the last sector of FCB.

Example