package git
Git format and protocol in pure OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
git-3.15.0.tbz
sha256=e26cca9f887c95f2c7e9966c1f414f11292522b52b64f218a3c58b4094e055d1
sha512=64ace1d29ba78d634be8eebe55fd49316230f3b156e497c7a05496b104465f5c03b0df898c5374296a33a504d2c21502c1e1a6d39004bd095695e494643d1342
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)"
>