@param fp File handle for the data file being written.
@param h Bam header structured (needed for BAI and CSI).
@param min_shift 0 for BAI, or larger for CSI (CSI defaults to 14).
@param fnidx Filename to write index to. This pointer must remain valid
until after sam_idx_save is called.
@return 0 on success, <0 on failure.
@note This must be called after the header has been written, but before
any other data.
@param fp File handle for the data file being written. @param h Bam header structured (needed for BAI and CSI). @param min_shift 0 for BAI, or larger for CSI (CSI defaults to 14). @param fnidx Filename to write index to. This pointer must remain valid until after sam_idx_save is called. @return 0 on success, <0 on failure.
@note This must be called after the header has been written, but before any other data.