123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116(*
* Copyright (c) 2018-2022 Tarides <contact@tarides.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)open!Importtypelength_header=[`Varint]optionmoduletypeS=sigincludeIrmin.Type.Stypehashtypekeytypekindvalhash:t->hashvalkind:t->kindvallength_header:kind->length_header(** Describes the length header formats for the {i data} sections of pack
entries. *)valweight:t->int(** [weight t] is the [t]'s LRU weight. *)valencode_bin:dict:(string->intoption)->offset_of_key:(key->int63option)->hash->tIrmin.Type.encode_binvaldecode_bin:dict:(int->stringoption)->key_of_offset:(int63->key)->key_of_hash:(hash->key)->tIrmin.Type.decode_binvaldecode_bin_length:string->int->intendmoduletypeT=sigtypetend(* A subset of [Irmin_pack.Conf.S] relevant to the format of pack entries,
copied here to avoid cyclic dependencies. *)moduletypeConfig=sigvalcontents_length_header:length_headerendmoduletypeSigs=sigmoduleKind:sigtypet=|Commit_v1|Commit_v2|Contents|Inode_v1_unstable|Inode_v1_stable|Inode_v2_root|Inode_v2_nonroot|Dangling_parent_commit[@@derivingirmin]valall:tlistvalto_enum:t->intvalto_magic:t->charvalof_magic_exn:char->tvalpp:tFmt.tvallength_header_exn:t->length_header(** Raises an exception on [Contents], as the availability of a length
header is user defined. *)endmoduletypeS=Swithtypekind:=Kind.tmoduletypeConfig=ConfigmoduleOf_contents(_:Config)(Hash:Irmin.Hash.S)(Key:T)(Contents:Irmin.Contents.S):Swithtypet=Contents.tandtypehash=Hash.tandtypekey=Key.tmoduleOf_commit(Hash:Irmin.Hash.S)(Key:Irmin.Key.Swithtypehash=Hash.t)(Commit:Irmin.Commit.Generic_key.Swithtypenode_key=Key.tandtypecommit_key=Key.t):sigincludeSwithtypet=Commit.tandtypehash=Hash.tandtypekey=Key.tmoduleCommit_direct:sigtypeaddress=Offsetofint63|Hashofhash[@@derivingirmin]typet={node_offset:address;parent_offsets:addresslist;info:Commit.Info.t;}[@@derivingirmin]endendend