The mi_scan_nprojs() function returns a value that is 1 less than the number of columns in a query projection.
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 mi_scan_nprojs() function returns 2 to indicate that the following SELECT statement projects three columns:
SELECT column1, column2, column3 FROM table
The integer return value indicates the number of columns that the SELECT clause of a query specifies.
See the description of accessor function mi_scan_projs().