package git
Git format and protocol in pure OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
git-3.18.0.tbz
sha256=925795627e6daae0b4bd16aa506879df11cb201e65fefe38e81378f18d517d4b
sha512=8e407d49808ec26445b0c706f7b010b35050d274b534e265487cb82bcac1f29cd5c41365851d42f84794ddbceb57b90143768a23154117e902b45419d156c410
doc/src/unixiz/unixiz.ml.html
Source file unixiz.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 54
let blit0 src src_off dst dst_off len = let dst = Cstruct.of_bigarray ~off:dst_off ~len dst in Cstruct.blit src src_off dst 0 len let blit1 src src_off dst dst_off len = let src = Cstruct.of_bigarray ~off:src_off ~len src in Cstruct.blit src 0 dst dst_off len open Lwt.Infix open Rresult let ( >>? ) = Lwt_result.bind module Make (Flow : Mirage_flow.S) = struct type +'a fiber = 'a Lwt.t type t = { queue : (char, Bigarray.int8_unsigned_elt) Ke.Rke.t; flow : Flow.flow; } type error = [ `Error of Flow.error | `Write_error of Flow.write_error ] let pp_error ppf = function | `Error err -> Flow.pp_error ppf err | `Write_error err -> Flow.pp_write_error ppf err let make flow = { flow; queue = Ke.Rke.create ~capacity:0x1000 Bigarray.char } let recv flow payload = if Ke.Rke.is_empty flow.queue then ( Flow.read flow.flow >|= R.reword_error (fun err -> `Error err) >>? function | `Eof -> Lwt.return_ok `End_of_flow | `Data res -> Ke.Rke.N.push flow.queue ~blit:blit0 ~length:Cstruct.length res; let len = min (Cstruct.length payload) (Ke.Rke.length flow.queue) in Ke.Rke.N.keep_exn flow.queue ~blit:blit1 ~length:Cstruct.length ~off:0 ~len payload; Ke.Rke.N.shift_exn flow.queue len; Lwt.return_ok (`Input len)) else let len = min (Cstruct.length payload) (Ke.Rke.length flow.queue) in Ke.Rke.N.keep_exn flow.queue ~blit:blit1 ~length:Cstruct.length ~len payload; Ke.Rke.N.shift_exn flow.queue len; Lwt.return_ok (`Input len) let send flow payload = Flow.write flow.flow payload >|= function | Error `Closed -> R.error (`Write_error `Closed) | Error err -> R.error (`Write_error err) | Ok () -> R.ok (Cstruct.length payload) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>