[Top][All Lists]

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

Re: C structures

From: Mike Gran
Subject: Re: C structures
Date: Fri, 30 Dec 2005 07:58:30 -0800 (PST)


A "list" can hold any type of data, so it shouldn't be a problem to
unpack a struct into a list.

There really isn't a way to automatically convert a C struct into a
list.  You'd have to convert each element of the struct into a Guile
type, then assemble them into a list.  

Converting a C struct to a list is a good idea if you're giving the C
data to Guile, and you won't need the C struct to be valid afterwards.

If you want Guile to operate on the C struct directly because it needs
to remain relevant, then a different approach is used.

Which of the following are you trying to accomplish?

1.  You want to make C data available to Guile functions, and once that
data is passed to Guile, it never (or rarely) needs to be handed back
to C.

2.  You want the C code and the Guile code to be able to operate on the
same C structs at the same time.

Mike Gran

--- Leonardo Lopes Pereira <address@hidden> wrote:

> I would like to know if is there any way to convert C structs to any
> type of Guile data.

Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 

reply via email to

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