Skip to content

Commit

Permalink
Runtime: caml_ml_is_binary_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Jan 3, 2024
1 parent c4a19a4 commit 845c932
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/tests-full/stdlib.cma.expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,8 @@
caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
caml_wrap_exception = runtime.caml_wrap_exception,
global_data = runtime.caml_get_global_data(),
ocaml_version = "5.2.0+dev0-2023-04-11",
ocaml_release = [0, 5, 2, 0, [0, [0, 0, "dev0-2023-04-11"]]],
ocaml_version = "5.2.0+dev2-2023-12-22",
ocaml_release = [0, 5, 2, 0, [0, [0, 0, "dev2-2023-12-22"]]],
Stdlib = global_data.Stdlib,
/*<<sys.ml.in:36:22>>*/ executable_name =
/*<<sys.ml.in:36:22>>*/ runtime.caml_sys_executable_name(0),
Expand Down Expand Up @@ -23889,6 +23889,7 @@
pos,
length,
set_binary_mode,
runtime.caml_ml_is_binary_mode,
runtime.caml_sys_isatty];
runtime.caml_register_global(9, Stdlib_In_channel, "Stdlib__In_channel");
return;
Expand Down Expand Up @@ -24001,6 +24002,7 @@
pos,
length,
set_binary_mode,
runtime.caml_ml_is_binary_mode,
runtime.caml_ml_set_buffered,
runtime.caml_ml_is_buffered,
runtime.caml_sys_isatty];
Expand Down
7 changes: 7 additions & 0 deletions runtime/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ function caml_ml_set_binary_mode(chanid,mode){
return 0;
}

//Provides: caml_ml_is_binary_mode
//Requires: caml_ml_channels
function caml_ml_is_binary_mode(chanid) {
var chan = caml_ml_channels[chanid];
return chan.file.flags.binary
}

//Input from in_channel

//Provides: caml_ml_close_channel
Expand Down

0 comments on commit 845c932

Please sign in to comment.