The mi_scan_nprojs() function returns a value that is 1 less than the number of key columns.
mi_integer mi_scan_nprojs(MI_AM_SCAN_DESC *scanDesc)
Use the return value from this function to determine the number of times to loop through the related mi_scan_projs() function.
The integer return value indicates the number of key columns in an index entry.
See the description of accessor function mi_scan_projs().