## linkage.api
## Author: Matthias Blume (blume@tti-c.org)
# Compiled by:
#
src/lib/c-glue-lib/ram/memory.lib# This module defines a high-level interface for dlopen.
# While addresses (those obtained by applying function "address" below
# or addresses derived from those) will not remain valid across
# { spawn
|fork}_to_disk/restart, handles *will* stay valid.
#
api Dynamic_Linkage {
exception DYNAMIC_LINK_ERROR String;
Lib_Handle; # Handle on dynamically linked library (DL)
Addr_Handle; # Handle on address obtained from a DL
main_lib: Lib_Handle; # The runtime system itself
# Link new library and return its handle
open_lib: { name: String, lazy: Bool, global: Bool } -> Lib_Handle;
open_lib': { name: String, lazy: Bool, global: Bool,
dependencies: List( Lib_Handle ) } -> Lib_Handle;
# Get the address handle of a symbol exported from a DL
lib_symbol: (Lib_Handle, String) -> Addr_Handle;
# Fetch the actual address from an address handle; the value obtained
# is not valid across (fork
|spawn)_to_disk/resume cycles
address: Addr_Handle -> one_word_unt::Unt;
# Unlink a previously linked DL; this immediately invalidates all
# symbol addresses and handles associated with this library
close_lib: Lib_Handle -> Void;
};
## Copyright (c) 2004 by The Fellowship of SML/NJ
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.