cam3, gen functions, separate header with BufIndex