guile-user
[Top][All Lists]
Advanced

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

dynamic ffi and C struct


From: cong gu
Subject: dynamic ffi and C struct
Date: Sat, 19 May 2012 06:32:07 -0500

Hello,

Is it possible to use the current dynamic ffi to call a C function
whose parameter is a C struct (not a pointer to a C struct) ?

I cannot find much about it in the documentation.  After a brief look
at the source of foreign.c of guile, I found guile actually does some
parsing of nested argument list for `pointer->procedure' and generates
compound ffi types.  But I don't know the right data structure to give
when actually calling the foreign function.

For example, what should I do for the following function?

typedef struct {
  int dat[2];
} foo_t;

int func ( foo_t arg );

-- 
Cong Gu



reply via email to

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