Next Previous Up Top Contents Index

7.10 The C structure

7.10.5 The C.Function structure

c_structure

Type abbreviation

Specification:

type c_structure

Description:

Equivalent to Structure.c_structure.
c_signature

Type abbreviation

Specification:

type c_signature

Description:

Equivalent to Signature.c_signature.

c_type

Type abbreviation

Specification:

type c_type

Description:

Equivalent to Type.c_type.

c_object

Type abbreviation

Specification:

type c_object

Description:

Equivalent to Value.c_object.

c_function

Type abbreviation

Specification:

type c_function

Description:

This is an encapsulated abstract type used for representing foreign function data. It supports sufficient information to enable these functions to be called with appropriate arguments and for its results to be interpreted.
defineForeignFun

Function

Signature:

val defineForeignFun : (c_structure * c_signature) -> (name -> c_function)

Description:

This is the main function in which all the key elements of the C interface are combined. This function is used to extract named foreign code from a c_structure and then combined with the type information associated with the c_signature for that name. The result is a c_function object which can then be supplied with arguments and called.
call

Function

Signature:

val call : c_function -> (c_object list * c_object) -> unit

Description:

This function takes a c_function object and a list of objects representing the arguments, calls the associated foreign function and returns the result to the other given object. Of course, all the type information for c_function, argument objects and result object must match accordingly.

MLWorks Reference Manual version 2.0 - 29 Jul 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker