SCM Repository
[smlnj] Annotation of /sml/releases/release-110.35/src/ml-nlffi-lib/memory/linkage.sig
Annotation of /sml/releases/release-110.35/src/ml-nlffi-lib/memory/linkage.sig
Parent Directory
|
Revision Log
Revision 917 -
(view)
(download)
(as text)
1 : |
blume |
828 |
(*
|
2 : |
|
|
* This module defines a high-level interface for dlopen.
|
3 : |
|
|
* While addresses (those obtained by applying function "addr" below
|
4 : |
|
|
* or addresses derived from those) will not remain valid across
|
5 : |
|
|
* export{ML,Fn}/restart, handles *will* stay valid.
|
6 : |
|
|
*
|
7 : |
|
|
* (C) 2001, Lucent Technologies, Bell Laboratories
|
8 : |
|
|
*
|
9 : |
|
|
* author: Matthias Blume
|
10 : |
|
|
*)
|
11 : |
|
|
signature DYN_LINKAGE = sig
|
12 : |
|
|
|
13 : |
|
|
exception DynLinkError of string
|
14 : |
|
|
|
15 : |
|
|
type lib_handle (* handle on dynamically linked library (DL) *)
|
16 : |
|
|
type addr_handle (* handle on address obtained from a DL *)
|
17 : |
|
|
|
18 : |
|
|
val main_lib : lib_handle (* the runtime system itself *)
|
19 : |
|
|
|
20 : |
|
|
(* link new library and return its handle *)
|
21 : |
|
|
val open_lib : { name: string, lazy: bool, global: bool } -> lib_handle
|
22 : |
|
|
|
23 : |
|
|
(* get the address handle of a symbol exported from a DL *)
|
24 : |
|
|
val lib_symbol : lib_handle -> string -> addr_handle
|
25 : |
|
|
|
26 : |
|
|
(* fetch the actual address from an address handle; the value obtained
|
27 : |
|
|
* is not valid across export{ML,Fn}/resume cycles *)
|
28 : |
|
|
val addr : addr_handle -> Word32.word
|
29 : |
|
|
|
30 : |
|
|
(* unlink previously linked DL; this immediately invalidates all
|
31 : |
|
|
* symbol addresses and handles associated with this library *)
|
32 : |
|
|
val close_lib : lib_handle -> unit
|
33 : |
|
|
end
|