obj: ajout de marshal et unmarshal.

pervasives: close_out fait maintenant flush en ML, plus en C
sys: ajout de sigprof (pour les interval timers du module Unix)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@751 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1996-04-18 16:33:41 +00:00
parent efde39b847
commit 758adc066d
6 changed files with 11 additions and 4 deletions

View File

@ -23,3 +23,5 @@ external size : t -> int = "%obj_size"
external field : t -> int -> t = "%obj_field"
external set_field : t -> int -> t -> unit = "%obj_set_field"
external new_block : int -> int -> t = "obj_block"
external marshal : t -> string = "output_value_to_string"
external unmarshal : string -> int -> t * int = "input_value_from_string"

View File

@ -25,3 +25,5 @@ external size : t -> int = "%obj_size"
external field : t -> int -> t = "%obj_field"
external set_field : t -> int -> t -> unit = "%obj_set_field"
external new_block : int -> int -> t = "obj_block"
external marshal : t -> string = "output_value_to_string"
external unmarshal : string -> int -> t * int = "input_value_from_string"

View File

@ -189,7 +189,8 @@ external output_value : out_channel -> 'a -> unit = "output_value"
external seek_out : out_channel -> int -> unit = "seek_out"
external pos_out : out_channel -> int = "pos_out"
external out_channel_length : out_channel -> int = "channel_size"
external close_out : out_channel -> unit = "close_out"
external close_out_channel : out_channel -> unit = "close_channel"
let close_out oc = flush oc; close_out_channel oc
(* General input functions *)
@ -250,7 +251,7 @@ external input_value : in_channel -> 'a = "input_value"
external seek_in : in_channel -> int -> unit = "seek_in"
external pos_in : in_channel -> int = "pos_in"
external in_channel_length : in_channel -> int = "channel_size"
external close_in : in_channel -> unit = "close_in"
external close_in : in_channel -> unit = "close_channel"
(* Output functions on standard output *)

View File

@ -412,7 +412,7 @@ external out_channel_length : out_channel -> int = "channel_size"
(* Return the total length (number of characters) of the
given channel. This works only for regular files. On files of
other kinds, the result is meaningless. *)
external close_out : out_channel -> unit = "close_out"
val close_out : out_channel -> unit
(* Close the given channel, flushing all buffered write operations.
The behavior is unspecified if any of the functions above is
called on a closed channel. *)
@ -491,7 +491,7 @@ external in_channel_length : in_channel -> int = "channel_size"
(* Return the total length (number of characters) of the
given channel. This works only for regular files. On files of
other kinds, the result is meaningless. *)
external close_in : in_channel -> unit = "close_in"
external close_in : in_channel -> unit = "close_channel"
(* Close the given channel. Anything can happen if any of the
functions above is called on a closed channel. *)

View File

@ -54,6 +54,7 @@ let sigtstp = -17
let sigttin = -18
let sigttou = -19
let sigvtalrm = -20
let sigprof = -21
exception Break

View File

@ -74,6 +74,7 @@ val sigtstp: int (* Interactive stop *)
val sigttin: int (* Terminal read from background process *)
val sigttou: int (* Terminal write from background process *)
val sigvtalrm: int (* Timeout in virtual time *)
val sigprof: int (* Profiling interrupt *)
(* Signal numbers for the standard POSIX signals. *)
exception Break