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

More FFI Questions



REGARDING                More FFI Questions
Folks,

I answered Professor Johnson's question about the MIDI Manager and the MACL FFI
(you must always remember that Pascal function names are compiled as
uppercase).  There is a followup, which I'm sending on because:

a) I don't know the answer offhand, and
b) I'm afraid that I don't really have time to research it right now.

I'm sure that any further help would be greatly appreciated.

Paul

-------------------------------Cut Here----------------------------
Thanks, Paul---changing the pascal function name to uppercase worked like
a charm.  If you have any control over the matter, this would be a great 
tidbit to include in the next version of the foreign function interface
chapter of the ACL documentation: I bet a lot of people might trip over that.

Can I exploit your expertise once more?  To manipulate the Midi Manager, 
I have to set up a bunch of pascal-style records to pass things back and
forth.  I read through the records chapter and looked at the records.lisp
code, and didn't find any mention/occurrence of the way to declare pascal-style
arrays.  Specifically, I need arrays of the following kinds:

packed array [0...128] of byte;
array [0...100] of ostype;
array [0...100] of MIDIIDREC; {MIDIIDREC is a kind of pascal record}

Now, a packed array of bytes is probably isomorphic to a string, and I 
could probably just inline 100 occurrences of ostype and midirec, but that
seems ridiculous!  However, neither normal arrays nor packed arrays are 
supplied as predefined types for the defrecord macro, and I didn't see
any examples of arrays in the records.lisp file, so I'm a bit stumped.
Surely there must be an elegant solution---we are talking about Lisp
here, after all!

Thanks very much, and I hope this doesn't put you out.

Philip