12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697(*
* Copyright (c) 2021 Tarides <contact@tarides.com>
* Copyright (c) 2021 Gabriel Belouze <gabriel.belouze@ens.psl.eu>
*
* 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.
*)moduletypeFIELD=sig(** Modules of this type are an abstraction barrier between the in-memory and on-disk
representation of the metadata. *)typettypeconvertvalset:marker:(unit->unit)->bytes->off:int->t->unit(** [set marker buff off t] sets the field value in [buff] at offset [off]. [marker] is a function
to mark a page as dirty. *)valget:bytes->off:int->tvalsize:intvalto_t:convert->tvalfrom_t:t->convertvalpp:tFmt.tvalpp_raw:Format.formatter->bytes->off:int->unitendtypekind=Leaf|Nodeofint[@@derivingrepr]moduletypeINT=FIELDwithtypeconvert:=intmoduletypeBOOL=FIELDwithtypeconvert:=boolmoduletypeSTRING=FIELDwithtypeconvert:=stringmoduletypeKIND=sigincludeFIELDwithtypeconvert:=kindvalof_depth:int->t(** [of_depth depth] returns the kind of a vertex based on its depth.*)valto_depth:t->int(** [to_depth t] returns the depth a vertex from its kind. *)endmoduletypeSIZE=sigvalsize:intendmoduletypeCOMMON=sigmoduleVersion:INTmoduleMagic:STRING(** Magic strings are used to mark the header of a btree or of a page. *)moduleAddress:INT(** The address of a page. *)modulePointer:INT(** A pointer is an offset inside a page. *)moduleKind:KIND(** The kind of a vertex, either a Node or a Leaf. *)endmoduletypeField=sigtypenonreckind=kindmoduletypeINT=INTmoduletypeBOOL=BOOLmoduletypeCOMMON=COMMONmoduleMakeInt:functor(Size:SIZE)->INTmoduleMakeBool:functor(Size:SIZE)->BOOLmoduleMakeString:functor(Size:SIZE)->STRINGmoduleMakeCommon:functor(Params:Params.S)->COMMONend