Calling C libs from Prothon

"Mark Hahn" <[email protected]> Sat, 3 Jul 2004 11:05:09 -0700
Newsgroups gmane.comp.lang.prothon.devel
Message-ID <001101c46128$47551180$0b01a8c0@mark>
> From: Ben Collins

>>> The only thing is that you will have
>>> to figure out some logic on how 
>>> to pass the args correctly to the function.
>> 
>> That is what I have been trying to ask how to do.
>> I just couldn't spit the words out.  I need to know
>> how to pass the args and get the return value back.  
>> I guess the worst-case scenario is assembly 
>> language to manipulate the stack.
>> 
>> Have you ever heard of someone calling dll's directly from an 
>> interpreter?
> 
> You'll have to boil everything down to an internal type. You 
> can't use stack manipulation, else you immediately lose all 
> portability.

This could be an optional feature that only works on x86 in the
beginning.

> The real problem is parsing the headers and figuring out the 
> length of the types. For normal C types, that's easy, you can 
> use direct casts (cast pointers to unsigned long and use u32, 
> u16, u8 and u64 for everything else). But if they use some 
> sort of typedef, then you are screwed.

Greg: You have to parse headers in Pyrex. Is it a giant problem?