1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 2001 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (* Handling of dynamically-linked libraries *)
17
18 (* Extract the name of a DLLs from its external name (xxx.so or -lxxx) *)
19 val extract_dll_name: string -> string
20
21 type dll_mode =
22 | For_checking (* will just check existence of symbols;
23 no need to do full symbol resolution *)
24 | For_execution (* will call functions from this DLL;
25 must resolve symbols completely *)
26
27 (* Open a list of DLLs. First argument indicates whether to perform
28 full symbol resolution. Raise [Failure msg] in case of error. *)
29 val open_dlls: dll_mode -> string list -> unit
30
31 (* Close all DLLs *)
32 val close_all_dlls: unit -> unit
33
34 (* The abstract type representing C function pointers *)
35 type dll_address
36
37 (* Find a primitive in the currently opened DLLs and return its address.
38 Raise [Not_found] if not found. *)
39 val find_primitive: string -> dll_address
40
41 (* If linking in core (dynlink or toplevel), synchronize the VM
42 table of primitive with the linker's table of primitive
43 by storing the given primitive function at the given position
44 in the VM table of primitives. *)
45 val synchronize_primitive: int -> dll_address -> unit
46
47 (* Add the given directories at the head of the search path for DLLs *)
48 val add_path: string list -> unit
49
50 (* Remove the given directories from the search path for DLLs *)
51 val remove_path: string list -> unit
52
53 (* Initialization for separate compilation.
54 Initialize the DLL search path to the directories given in the
55 environment variable CAML_LD_LIBRARY_PATH, plus contents of ld.conf file
56 if argument is [false]. If argument is [true], ignore ld.conf. *)
57 val init_compile: bool -> unit
58
59 (* Initialization for linking in core (dynlink or toplevel).
60 Initialize the search path to the same path that was used to start
61 the running program (CAML_LD_LIBRARY_PATH + directories in executable +
62 contents of ld.conf file). Take note of the DLLs that were opened
63 when starting the running program. *)
64 val init_toplevel: string -> unit
65
66 val reset: unit -> unit
67