package devkit
Development kit - general purpose library
Install
Dune Dependency
Authors
Maintainers
Sources
devkit-1.20240429.tbz
sha256=222f8ac131b1d970dab7eeb2714bfd6b9338b88b1082e6e01c136ae19e7eaef4
sha512=c9e6d93e3d21e5530c0f4d5baca51bf1f0a5d19248f8af7678d0665bb5cdf295d7aaaaa3e50eb2e44b8720e55097cc675af4dc8ec45acf9da39feb3eae1405d5
doc/src/devkit.core/gzip_io.ml.html
Source file gzip_io.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
(** gzip IO *) let input io = let iz = Gzip_stream.open_in io in IO.create_in ~read:(fun () -> Gzip_stream.input_char iz) ~input:(Gzip_stream.input iz) ~close:(fun () -> Gzip_stream.close_in iz) let output io = let oz = Gzip_stream.open_out io in IO.create_out ~write:(Gzip_stream.output_char oz) ~output:(fun s o l -> Gzip_stream.output oz s o l; l) ~flush:(fun () -> IO.flush io) ~close:(fun () -> Gzip_stream.close_out oz) let input_ch ch = input (IO.input_channel ch) let output_ch ch = output (IO.output_channel ch) (* let pipe_in f = bracket (Filename.open_temp_file ~mode:[Open_binary] "gzip_io" "gz") (fun (tmpname,ch) -> close_out_noerr ch; Sys.remove tmpname) (fun (tmpname,ch) -> bracket (output_ch ch) (suppress IO.close_out) (fun out -> f out; IO.close_out out; Std.input_file ~bin:true tmpname ) ) *) let string s = let out = output (IO.output_string ()) in IO.nwrite out (Bytes.unsafe_of_string s); (* IO wrong type *) IO.close_out out let to_string s = let inp = input (IO.input_string s) in let out = IO.output_string () in try while true do IO.write out (IO.read inp) done; assert false with IO.No_more_input -> IO.close_in inp; IO.close_out out
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>