1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192(*
* Copyright (c) 2018-2021 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!ImportmoduletypeS=sigincludeIrmin_pack.Inode.PersistentmoduleU:Irmin_pack.Pack_store.Swithtypeindex:=indexmoduleL:Irmin_pack.Pack_store.Swithtypeindex:=indexvalv:readU.t->readU.t->readL.toption->flip:bool->freeze_in_progress:(unit->bool)->readtvallayer_id:readt->key->Irmin_layers.Layer_id.tLwt.ttype'alayer_type=|Upper:readU.tlayer_type|Lower:readL.tlayer_typevalcopy:'llayer_type*'l->readt->key->unitvalmem_lower:'at->key->boolLwt.tvalmem_next:[>read]t->key->boolLwt.tvalnext_upper:'at->readU.tvalcurrent_upper:'at->readU.tvallower:'at->readL.tincludeS.Layered_generalwithtype'at:='atvalclear_caches_next_upper:'at->unitvalsync:?on_generation_change:(unit->unit)->?on_generation_change_next_upper:(unit->unit)->'at->boolvalintegrity_check:offset:int63->length:int->layer:Irmin_layers.Layer_id.t->key->'at->(unit,Irmin_pack.Checks.integrity_error)resultvalflush:?index:bool->'at->unitvalcopy_from_lower:dst:'aU.t->readt->key->unitLwt.tvalconsume_newies:'at->keylistvalcheck:'at->?none:(unit->unitLwt.t)->?some:(U.value->unitLwt.t)->key->unitLwt.tendmoduleIndex=Irmin_pack.IndexmoduletypeSigs=sigmoduletypeS=SmoduleMake(_:Irmin_pack.Conf.S)(H:Irmin.Hash.S)(_:S.Content_addressable_makerwithtypekey=H.tandtypeindex=Index.Make(H).t)(Node:Irmin.Private.Node.Swithtypehash=H.t):Swithtypekey=H.tandtypeVal.metadata=Node.metadataandtypeVal.step=Node.stepandtypeindex=Index.Make(H).tend