[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Foreign Function Interface



We are trying to use the Foreign Function Interface (FFI), together with MPW
PASCAL, to simulate the [Not In ROM] system tools (e.g., the RAM Serial
Driver).  

This is the problem:
(1) The Inside MAC PASCAL calls require VAR argument calls to types other
than FLOAT or PSTRING.  For example, 
	SerGetBuf (refNum: INTEGER; VAR count: LONGINT) : OSErr
requires a VAR LONGINT type argument.  However, MACL doesn't support these
types with the :by-reference flag.  
(2) In fact, many types, such as RECORDs, ARRAYs, and the hundreds of
MACINTOSH defined PASCAL types, do not appear to be supported by the FFI
mechanism.  

Our questions are: 
(1) Short of rewriting every [Not In ROM] call to conform to the few supported
FFI types, how can we more easily achieve this functionality?
(2) In general, how can we use the FFI with both standard and user-defined
types?  

Thank you. - Mark