Re: Custom foreign types

Matt Wette <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <[email protected]>

On 6/19/24 5:11 PM, Matt Wette wrote:
> On 6/16/24 7:13 PM, Ryan Raymond wrote:
>> Hello, all.
>> I know we can create pointers to structs with make-c-struct, but I would
>> like to pass structs directly as arguments to foreign functions. I 
>> can do
>> that by using bytevector-uint-ref, and setting the size to that of the
>> struct, but when it is time to specify the type in 
>> pointer->procedure, I am
>> out of luck if the sizes don't match.
>>
>> Here is how I am binding Raylib using FFI currently.

>>
>> Is there a cleaner way to do this?
>> Ryan
>

I should also mention the nyacc FFI Helper tool I wrote.  You give it 
the header file and
it will generate the ffi code.   Look here: 
https://www.nongnu.org/nyacc/nyacc-fh-ug.html

Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.