package bin

  1. Overview
  2. Docs
A DSL to describe binary formats

Install

dune-project
 Dependency

Authors

Maintainers

Sources

bstr-0.1.1.tbz
sha256=e657cffda56910b14b98c76dd6e0382ea4bc5d0167e88391aba93196b016eee0
sha512=80dccae9308f57185a2c2fcfc63727043a5d0c7a0cf9b3687064882d64449404a51352d90160042f12f9bd3173aaf19ec715d1c796f4e808c0677ea9dbcb9ca8

doc/bin/Bin_type/index.html

Module Bin_typeSource

Sourcemodule Witness : sig ... end
Sourcemodule Staged : sig ... end
Sourcemodule Len : sig ... end
Sourcemodule Off : sig ... end
Sourcetype 'a s =
  1. | Static of int
  2. | Dynamic of 'a -> int
Sourcetype 'a size = {
  1. layout : Len.t option;
  2. of_value : 'a s;
}
Sourceval have : limit:'a Off.t -> offset:'a Off.t -> Len.t
Sourcetype endianness =
  1. | Big_endian
  2. | Little_endian
  3. | Native_endian
Sourcetype bit_order =
  1. | Msb_first
  2. | Lsb_first
Sourcetype bits_base =
  1. | B8
  2. | B16 of endianness
  3. | B32 of endianness
Sourcetype _ t =
  1. | Primary : 'a primary -> 'a t
  2. | Record : 'a record -> 'a t
  3. | Variant : 'a variant -> 'a t
  4. | Map : ('a, 'b) map -> 'b t
  5. | Seq : ('a, 'b) seq -> 'b t
  6. | Bind : ('a, 'b) bind -> 'b t
  7. | Bits : 'a bits -> 'a t
  8. | Fix : 'a fix -> 'a t
Sourceand _ primary =
  1. | Char : char primary
  2. | UInt8 : int primary
  3. | Int8 : int primary
  4. | UInt16 : endianness -> int primary
  5. | Int16 : endianness -> int primary
  6. | Int32 : endianness -> int32 primary
  7. | Int64 : endianness -> int64 primary
  8. | Var_int : int primary
  9. | Bytes : len -> string primary
  10. | Bstr : len -> Bstr.t primary
  11. | Until : char -> string primary
  12. | Const : 'a -> 'a primary
Sourceand len =
  1. | Fixed of int
  2. | Prefix of int t
  3. | Delim of char
  4. | Rest
Sourceand ('a, 'b) seq = {
  1. slen : len;
  2. selt : 'a t;
  3. skind : ('a, 'b) seq_kind;
}
Sourceand (_, _) seq_kind =
  1. | Sarray : ('a, 'a array) seq_kind
  2. | Slist : ('a, 'a list) seq_kind
Sourceand _ a_case =
  1. | C0 : 'a case0 -> 'a a_case
  2. | C1 : ('a, 'b) case1 -> 'a a_case
Sourceand _ case_v =
  1. | CV0 : 'a case0 -> 'a case_v
  2. | CV1 : ('a, 'b) case1 * 'b -> 'a case_v
Sourceand 'a case0 = {
  1. ctag0 : int;
  2. cidx0 : int;
  3. cname0 : string;
  4. c0 : 'a;
}
Sourceand ('a, 'b) case1 = {
  1. ctag1 : int;
  2. cidx1 : int;
  3. cname1 : string;
  4. ctype1 : 'b t;
  5. cwitn1 : 'b Witness.t;
  6. c1 : 'b -> 'a;
}
Sourceand 'a record = {
  1. rname : string;
  2. rfields : 'a fields_and_constr;
}
Sourceand 'a fields_and_constr =
  1. | Fields : ('a, 'b) fields * 'b -> 'a fields_and_constr
Sourceand ('a, 'b) fields =
  1. | F0 : ('a, 'a) fields
  2. | F1 : ('a, 'b) field * ('a, 'c) fields -> ('a, 'b -> 'c) fields
Sourceand ('a, 'b) field = {
  1. fid : int;
  2. fname : string;
  3. ftype : 'b t;
  4. fget : 'a -> 'b;
}
Sourceand 'a variant = {
  1. vname : string;
  2. vcases : 'a a_case array;
  3. vget : 'a -> 'a case_v;
  4. vtag : int t;
}
Sourceand ('a, 'b) map = {
  1. x : 'a t;
  2. f : 'a -> 'b;
  3. g : 'b -> 'a;
  4. mwit : 'b Witness.t;
}
Sourceand ('a, 'b) bind = {
  1. bx : 'a t;
  2. bf : 'a -> 'b t;
  3. bg : 'b -> 'a;
}
Sourceand _ a_field =
  1. | Field : ('a, 'b) field -> 'a a_field
Sourceand 'a bits = {
  1. bname : string;
  2. bbase : bits_base;
  3. border : bit_order;
  4. bfields : 'a bits_and_constr;
}
Sourceand 'a bits_and_constr =
  1. | BFields : ('a, 'b) bit_fields * 'b -> 'a bits_and_constr
Sourceand ('a, 'b) bit_fields =
  1. | BF0 : ('a, 'a) bit_fields
  2. | BF1 : ('a, 'b) bit_field * ('a, 'c) bit_fields -> ('a, 'b -> 'c) bit_fields
Sourceand ('a, 'b) bit_field = {
  1. bfname : string;
  2. bfwidth : int;
  3. bfget : 'a -> 'b;
  4. bfkind : 'b bit_kind;
}
Sourceand _ bit_kind =
  1. | Bint : int bit_kind
  2. | Bbool : bool bit_kind
Sourceand 'a fix = {
  1. runroll : 'a t Lazy.t;
  2. mutable rsizer : 'a size option;
  3. rwitn : 'a Witness.t;
}
Sourcetype _ a_bit_field =
  1. | Bit_field : ('a, 'b) bit_field -> 'a a_bit_field
Sourceval fields : 'a record -> 'a a_field list
Sourceval a_bit_fields : 'a 'b. ('a, 'b) bit_fields -> 'a a_bit_field list
Sourceval bit_fields : 'a. 'a bits -> 'a a_bit_field list
Sourceval shift : order:bit_order -> total:int -> used:int -> width:int -> int
Sourceval bits_layout : 'a. 'a bits -> (int * int) array
Sourcemodule Fields_folder (Acc : sig ... end) : sig ... end
Sourceval a_fields : 'a 'b. ('a, 'b) fields -> 'a a_field list
Sourceval record_fields : 'a. 'a record -> 'a a_field list
Sourcemodule Dispatch : sig ... end
Sourcemodule Case_folder : sig ... end
Sourceval fold_variant : 'a 'r. ('a, 'r) Case_folder.t -> 'a variant -> 'a -> 'r
Sourcemodule Case : sig ... end
Sourcemodule Bits_folder (Acc : sig ... end) : sig ... end