1Callback(3) OCaml library Callback(3)
2
3
4
6 Callback - Registering OCaml values with the C runtime.
7
9 Module Callback
10
12 Module Callback
13 : sig end
14
15
16 Registering OCaml values with the C runtime.
17
18 This module allows OCaml values to be registered with the C runtime
19 under a symbolic name, so that C code can later call back registered
20 OCaml functions, or raise registered OCaml exceptions.
21
22
23
24
25
26
27 val register : string -> 'a -> unit
28
29
30 Callback.register n v registers the value v under the name n . C code
31 can later retrieve a handle to v by calling caml_named_value(n) .
32
33
34
35 val register_exception : string -> exn -> unit
36
37
38 Callback.register_exception n exn registers the exception contained in
39 the exception value exn under the name n . C code can later retrieve a
40 handle to the exception by calling caml_named_value(n) . The exception
41 value thus obtained is suitable for passing as first argument to
42 raise_constant or raise_with_arg .
43
44
45
46
47
48OCamldoc 2019-02-02 Callback(3)