Hello chickeners,
I am trying to wrap a function that accepts a function pointer with an
argument to a struct passed by value.
I don't know how to do this (and fear it is not possible) but maybe
somebody else has a solution.
A little example of what I mean:
----
#>
typedef struct { int x, y; } Point;
typedef void (*SomeCallbackFuncType)(Point point);
void someFunc(SomeCallbackFuncType callback)
{
Point p = {1, 1};
callback(p);
}
<#
(define-external (callbackFunction (??? point))
void
(print "Hello from callback!"))
((foreign-lambda void "someFunc" c-pointer) #$callbackFunction)
----
I don't actually need the the value of the object in my callback.
Maybe that helps.
Thank you in advance,
Pluijzer
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users