1 (***********************************************************************)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the GNU Library General Public License, with *)
10 (* the special exception on linking described in file ../LICENSE. *)
12 (***********************************************************************)
16 (** Registering Caml values with the C runtime.
18 This module allows Caml values to be registered with the C runtime
19 under a symbolic name, so that C code can later call back registered
20 Caml functions, or raise registered Caml exceptions.
23 val register
: string -> 'a
-> unit
24 (** [Callback.register n v] registers the value [v] under
25 the name [n]. C code can later retrieve a handle to [v]
26 by calling [caml_named_value(n)]. *)
28 val register_exception
: string -> exn
-> unit
29 (** [Callback.register_exception n exn] registers the
30 exception contained in the exception value [exn]
31 under the name [n]. C code can later retrieve a handle to
32 the exception by calling [caml_named_value(n)]. The exception
33 value thus obtained is suitable for passign as first argument
34 to [raise_constant] or [raise_with_arg]. *)