Hi everyone,

Has ctypes some support for bit fields in C struct? If not is it correct to
encode:

typedef struct {
   int32_t pos;
   uint32_t bin:16, qual:8, l_qname:8;
   ...
} bam1_core_t

as:

   type bam1_core_t
   let bam1_core_t : bam1_core_t structure typ = structure "bam1_core_t"
   let bam1_core_t_pos_f = field bam1_core_t "pos" int32_t
   let bam1_core_t_props_f = field bam1_core_t "props" int32_t
   ...
   let () = seal bam1_core_t

and then play with the fake "props" field directly?

Cheers,
  Philippe.
_______________________________________________
Ctypes mailing list
[email protected]
http://lists.ocaml.org/listinfo/ctypes

Reply via email to