1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768moduleTags_table=Tags_tablemoduleDecoder=structtype'at=Metadata.Header_structure.value->'aoptionopenMetadata.Header_structureletnull=functionNull->Some`Null|_->Noneandchar=functionCharch->Somech|_->Noneandint=function|Intx->Somex|Int32x->Some(Int32.to_intx)|Int64x->Some(Int64.to_intx)|_->Noneandint32=functionInt32x->Somex|_->Noneandint64=functionInt64x->Somex|_->Noneandstring=functionStringx->Somex|_->Noneandbinary=functionBinaryx->Somex|_->Noneandstring_array=functionStringArrayx->Somex|_->Noneandarraydecode=function|Arraylist->letrecaux=function|hd::tl->Option.bind(decodehd)@@funhd->Option.map(List.conshd)@@auxtl|[]->Some[]inauxlist|_->Noneendletfind_exn?name~tag~decode:value_decodeentires=matchHashtbl.findentirestag|>value_decodewith|None->failwith@@Printf.sprintf"fail to decode '%s' entry"(Option.value~default:(string_of_inttag)name)|Somevalue->valueopenDecoderletnamem=find_exn~name:"name"~tag:Tags_table.name~decode:stringm.Metadata.headerandreleasem=find_exn~name:"release"~tag:Tags_table.release~decode:stringm.Metadata.headerandepochm=find_exn~name:"epoch"~tag:Tags_table.epoch~decode:stringm.Metadata.headerandsummerym=find_exn~name:"summery"~tag:Tags_table.summary~decode:string_arraym.Metadata.headeranddescriptionm=find_exn~name:"description"~tag:Tags_table.description~decode:string_arraym.Metadata.headerandsizesm=find_exn~name:"sizes"~tag:1028~decode:(arrayint)m.Metadata.headerandcompressorm=find_exn~name:"compressor"~tag:1125~decode:stringm.Metadata.header