Next Previous Up Top Contents Index

1.7 Functions

define C-address

Definition macro

Signature

Defines a Dylan constant binding that is a <C-pointer> to the location of a C global variable.

Signature

define C-address name :: pointer-designator-type 
  #key c-name import: boolean
end [C-address] [name]

Arguments

name
A Dylan variable name.

pointer-designator-type

c-name
A string constant.

import
#f or #t.

Library

c-ffi

Module

c-ffi

Description

Defines a Dylan constant binding, name, that is a <C-pointer> which points to the location of the C global variable c-name.

Pointer-designator-type must be the type of the constant to be defined, and a subtype of <C-pointer>.

The import: option indicates if the C address must be imported from another .dll or not. #t indicates it is in another .dll and must be imported, #f means that it is not to be imported. Whether the variable has to be imported from another .dll or not is determined by which Dylan project the C source files are part of. If they are in the same project as the C-address definition then the value of "import:" should be #f as the definition and variable will be linked into the same .dll. If the definition is in a different project from the C source files then they will be in separate .dlls and import: needs to be #t. The default value is #f.


C FFI and Win 32 Reference - 31 MAR 2000

Next Previous Up Top Contents Index