Skip to content

Commit

Permalink
Rename set_channel_{unbuffered => buffered}
Browse files Browse the repository at this point in the history
  • Loading branch information
nojb committed Jul 29, 2021
1 parent dbfe03c commit 4bef4a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Working version
- #10526: add Random.bits32, Random.bits64, Random.nativebits
(Xavier Leroy, review by Gabriel Scherer and François Bobot)

- #10538: add Stdlib.set_channel_unbuffered to allow disabling
- #10538: add Stdlib.set_channel_buffered to allow disabling
buffering on an output channel.
(Nicolás Ojeda Bär)

Expand Down
6 changes: 3 additions & 3 deletions runtime/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,14 +650,14 @@ CAMLprim value caml_ml_set_binary_mode(value vchannel, value mode)
return Val_unit;
}

CAMLprim value caml_ml_set_channel_unbuffered(value vchannel, value mode)
CAMLprim value caml_ml_set_channel_buffered(value vchannel, value mode)
{
struct channel * channel = Channel(vchannel);
if (Bool_val(mode)) {
channel->flags &= ~CHANNEL_FLAG_UNBUFFERED;
} else {
channel->flags |= CHANNEL_FLAG_UNBUFFERED;
caml_flush(channel);
} else {
channel->flags &= ~CHANNEL_FLAG_UNBUFFERED;
}
return Val_unit;
}
Expand Down
4 changes: 2 additions & 2 deletions stdlib/stdlib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ let close_out_noerr oc =
(try close_out_channel oc with _ -> ())
external set_binary_mode_out : out_channel -> bool -> unit
= "caml_ml_set_binary_mode"
external set_channel_unbuffered : out_channel -> bool -> unit
= "caml_ml_set_channel_unbuffered"
external set_channel_buffered : out_channel -> bool -> unit
= "caml_ml_set_channel_buffered"

(* General input functions *)

Expand Down
4 changes: 2 additions & 2 deletions stdlib/stdlib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,8 @@ val set_binary_mode_out : out_channel -> bool -> unit
This function has no effect under operating systems that
do not distinguish between text mode and binary mode. *)

val set_channel_unbuffered : out_channel -> bool -> unit
(** [set_channel_unbuffered oc true] sets the channel [oc] to
val set_channel_buffered : out_channel -> bool -> unit
(** [set_channel_buffered oc false] sets the channel [oc] to
unbuffered mode: the data passed to output functions on [oc]
will be visible as soon as they return.
Expand Down

0 comments on commit 4bef4a1

Please sign in to comment.