package chamelon
Subset of littlefs filesystem fulfilling MirageOS KV
Install
Dune Dependency
Authors
Maintainers
Sources
chamelon-0.0.8.tbz
sha256=6f02ee1ed4d73a28dec7e351c26caf0036846845f597f10fcff1da54f9edb58c
sha512=a5781e2b183f6c78c8ef289950476274e19d4d56df85b99d8887c5155f24e79d0dac440bbc395a072b9e39f7666d4fd27ee94e65aa0117646bf305511d93def6
doc/src/chamelon/dir.ml.html
Source file dir.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
let dirstruct id = Tag.({ valid = true; type3 = (Tag.LFS_TYPE_STRUCT, 0x00); id; length = 4 * 2 ;(* content is pointers to the metadata pair, two 32-bit values *) }) let soft_tail = Tag.({ valid = true; type3 = Tag.LFS_TYPE_TAIL, 0x00; id = 0x3ff; length = 4 * 2; }) let hard_tail = {soft_tail with type3 = Tag.LFS_TYPE_TAIL, 0x01} let hard_tail_at (a, b) = let data = Cstruct.create 8 in Cstruct.LE.set_uint32 data 0 (Int64.to_int32 a); Cstruct.LE.set_uint32 data 4 (Int64.to_int32 b); (hard_tail, data) let name n id = Tag.({ valid = true; type3 = (Tag.LFS_TYPE_NAME, 0x02); id; length = String.length n; }, Cstruct.of_string n) let mkdir ~to_pair id = let data = Cstruct.create 8 in Cstruct.LE.set_uint32 data 0 (Int64.to_int32 @@ fst to_pair); Cstruct.LE.set_uint32 data 4 (Int64.to_int32 @@ snd to_pair); (dirstruct id, data) let dirstruct_of_cstruct cs = if Cstruct.length cs < (4 + 4) then None else Some (Cstruct.LE.(get_uint32 cs 0 |> Int64.of_int32, get_uint32 cs 4 |> Int64.of_int32)) let hard_tail_links (tag, data) = match tag.Tag.type3 with | Tag.LFS_TYPE_TAIL, 0x01 -> (* both hard_tail and dirstruct have a two-pointer metadata structure *) dirstruct_of_cstruct data | _ -> None let of_entry (tag, data) = let open Tag in match tag.type3 with | LFS_TYPE_STRUCT, 0x00 -> dirstruct_of_cstruct data | _, _ -> None
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>