chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] How to FFI?


From: felix winkelmann
Subject: Re: [Chicken-users] How to FFI?
Date: Thu, 5 Jul 2007 09:35:26 +0200

On 7/4/07, Robin Lee Powell <address@hidden> wrote:

What's SWIG?

A heavy duty version of easyffi: http://www.swig.org


I'm actually doing both CDK and libxmmsclient, and I don't need a
compelet wrapper for either of them; I just want things to work, and
I don't mind adding bits of CDK in as I need them.

So I'd recommend easyffi, or using normal FFI macros.


As a related question, something I ran across in libxmmsclient that
seems particularily tricky: a function with an int return value, but
an int32_t *foo argument where the *actual* data is returned.

In whichever method(s) you reccomend, how would I set up the 32-bit
integer pointer, and then read data out of it after the call?

; manually:

(define foo (foreign-lambda int "foo" (c-pointer int)))

(let-location ((n int 0)) (my-function n) n)

or:

; easyffi:

#>?
int foo(___in int *x);
<#

(foo 123)


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]