Next Previous Up Top Contents Index

7 The MLWorks Foreign Interface Library

7.8 The LibML structure

This structure provides the ML side of a C programmers' interface for accessing ML values and calling ML functions from C. This facility is provided only for C code that has already been called from ML. An application of this is to provide windowing callback functions as ML functions. To make use of this, ML values have first to be registered by ML for access from C. The following functions provide facilities for this registration. Values so registered are called external values:

registerExternalValue

Function

Signature:

val registerExternalValue : string * 'a -> unit

Description:

Associates a given value with a string. This string is then used from C as a handle for the C version of the object.
If a value is already associated then an exception is raised.
deleteExternalValue

Function

Signature:

val deleteExternalValue : string -> unit

Description:

Provides means for deleting a specific external value entry.
externalValues

Function

Signature:

val externalValues : unit -> string list

Description:

Provides a list of all strings used to name the external values.
clearExternalValues

Function

Signature:

val clearExternalValues : unit -> unit

Description:

Provides an efficient way to clear all the external value entries in a single operation.

MLWorks Reference Manual version 2.0 - 29 Jul 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker