-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bitfield support #76
Comments
struct BGZF {
// Reserved bits should be written as 0; read as "don't care"
unsigned errcode:16, reserved:1, is_write:1, no_eof_block:1, is_be:1;
signed compress_level:9;
unsigned last_block_eof:1, is_compressed:1, is_gzip:1;
int cache_size;
int block_length, block_clength, block_offset;
int64_t block_address, uncompressed_address;
void *uncompressed_block, *compressed_block;
bgzf_cache_t *cache;
struct hFILE *fp; // actual file handle
struct bgzf_mtaux_t *mt; // only used for multi-threading
bgzidx_t *idx; // BGZF index
int idx_build_otf; // build index on the fly, set by bgzf_index_build_init()
struct z_stream_s *gz_stream; // for gzip-compressed files
int64_t seeked; // virtual offset of last seek
}; Actual code generated by crystal_lib: struct Bgzf
errcode : LibC::UInt
reserved : LibC::UInt
is_write : LibC::UInt
no_eof_block : LibC::UInt
is_be : LibC::UInt
compress_level : LibC::Int
last_block_eof : LibC::UInt
is_compressed : LibC::UInt
is_gzip : LibC::UInt
cache_size : LibC::Int
block_length : LibC::Int
block_clength : LibC::Int
block_offset : LibC::Int
block_address : Int64T
uncompressed_address : Int64T
uncompressed_block : Void*
compressed_block : Void*
cache : BgzfCacheT
fp : HFile*
mt : BgzfMtauxT*
idx : BgzidxT
idx_build_otf : LibC::Int
gz_stream : ZStreamS*
seeked : Int64T
end Bad but somewhat better code: struct Bgzf
bitfields : Uint32T # Fixme
# errcode : LibC::UInt
# reserved : LibC::UInt
# is_write : LibC::UInt
# no_eof_block : LibC::UInt
# is_be : LibC::UInt
# compress_level : LibC::Int
# last_block_eof : LibC::UInt
# is_compressed : LibC::UInt
# is_gzip : LibC::UInt
cache_size : LibC::Int
block_length : LibC::Int
block_clength : LibC::Int
block_offset : LibC::Int
block_address : Int64T
uncompressed_address : Int64T
uncompressed_block : Void*
compressed_block : Void*
cache : BgzfCacheT
fp : HFile*
mt : BgzfMtauxT*
idx : BgzidxT
idx_build_otf : LibC::Int
gz_stream : ZStreamS*
seeked : Int64T
end |
It would be better if we could link bindings created with crystal_lib with this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello. Thanks for the great tool.
However, the tool seems to fail to parse structs with bit fields.
Please provide support for bit fields.
The text was updated successfully, but these errors were encountered: