From 3dc9ec53041b4b34a601c2d454d0e47005561b30 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Wed, 15 Apr 2020 19:09:34 +0200 Subject: Move the ObjFile module to its own file. --- lib/objFile.mli | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/objFile.mli (limited to 'lib/objFile.mli') diff --git a/lib/objFile.mli b/lib/objFile.mli new file mode 100644 index 0000000000..36db7f4208 --- /dev/null +++ b/lib/objFile.mli @@ -0,0 +1,34 @@ +(************************************************************************) +(* * The Coq Proof Assistant / The Coq Development Team *) +(* v * Copyright INRIA, CNRS and contributors *) +(* in_handle +val close_in : in_handle -> unit +val marshal_in_segment : in_handle -> segment:string -> 'a * Digest.t +val get_segment : in_handle -> segment:string -> segment +val segments : in_handle -> segment CString.Map.t + +val open_out : file:string -> out_handle +val close_out : out_handle -> unit +val marshal_out_segment : out_handle -> segment:string -> 'a -> unit +val marshal_out_binary : out_handle -> segment:string -> out_channel * (unit -> unit) +(** Low-level API. This function returns a channel and a closure. The channel + should only be written to, and once done, the closure should be invoked. *) -- cgit v1.2.3 From e16aab42641f0b79827c4598bf065b1607a08c43 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Wed, 15 Apr 2020 19:16:16 +0200 Subject: Tweak a comment on the low-level objfile API. --- lib/objFile.mli | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/objFile.mli') diff --git a/lib/objFile.mli b/lib/objFile.mli index 36db7f4208..b15b04ee54 100644 --- a/lib/objFile.mli +++ b/lib/objFile.mli @@ -30,5 +30,8 @@ val open_out : file:string -> out_handle val close_out : out_handle -> unit val marshal_out_segment : out_handle -> segment:string -> 'a -> unit val marshal_out_binary : out_handle -> segment:string -> out_channel * (unit -> unit) -(** Low-level API. This function returns a channel and a closure. The channel - should only be written to, and once done, the closure should be invoked. *) +(** [marshal_out_binary oh segment] is a low level, stateful, API returning + [oc, stop]. Once called no other API can be used on the same [oh] and only + [Stdlib.output_*] APIs should be used on [oc]. [stop ()] must be invoked in + order to signal that all data was written to [oc] (which should not be used + afterwards). Only after calling [stop] the other API can be used on [oh]. *) -- cgit v1.2.3