More C interfacing issues

Alastair Reid reid at reid-consulting-uk.ltd.uk
Wed Jul 3 09:19:21 EDT 2002


> Curious: how does green card know that getxy is a macro and that x
> and y are out parameters... do you have to tell it?

More or less.  GreenCard definitions are of the form of the form:

  %fun foo :: <type>
  ...
  %call <arbitrary C code to invoke foo>
  ...
  
GreenCard fills in the obvious code (i.e., result = foo(args)) if you
omit the %call line.

Roughly speaking, you use %call lines in the same places that you'd
introduce a wrapper in greencard.

So you don't tell it that it's a macro but you do write a %call line
and the code in the %call line will reflect the fact that you know it
is a macro.

-- 
Alastair Reid   
alastair at reid-consulting-uk.ltd.uk  
http://www.reid-consulting-uk.ltd.uk/alastair/





More information about the FFI mailing list