Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flexible array member to the bam1_t struct to facilitate a BAM … #393

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions htslib/sam.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ typedef struct {
@field l_data current length of bam1_t::data
@field m_data maximum length of bam1_t::data
@field data all variable-length data, concatenated; structure: qname-cigar-seq-qual-aux
@field fam_data flexible array member for contiguous-memory optimization

@discussion Notes:

Expand All @@ -171,6 +172,10 @@ typedef struct {
on reading or from CIGAR.
3. cigar data is encoded 4 bytes per CIGAR operation.
4. seq is nybble-encoded according to bam_nt16_table.
5. fam_data can be used to allow the variable-length data to exist in
the same contiguous memory as the rest of the bam1_t. In that case,
for compatibility the data member should point to fam_data, and
m_data set to a large value (e.g., INT_MAX).
*/
typedef struct {
bam1_core_t core;
Expand All @@ -179,6 +184,7 @@ typedef struct {
#ifndef BAM_NO_ID
uint64_t id;
#endif
uint8_t fam_data[];
} bam1_t;

/*! @function
Expand Down