[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C structures
From: |
Leonardo Lopes Pereira |
Subject: |
Re: C structures |
Date: |
Fri, 30 Dec 2005 13:19:52 -0300 |
Em Fri, 30 Dec 2005 07:58:30 -0800 (PST)
Mike Gran <address@hidden> escreveu:
> Leonardo-
>
> 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.
This is what I want to do.
>
> 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.
No.
>
> 2. You want the C code and the Guile code to be able to operate on
> the same C structs at the same time.
Yes.
To be more clear. I want to be able to call a C function from guile.
The problem is that this function has a struct as an arg and this
struct has variable members. So, I need to create a list on
scheme/guile and convert it to a C struct that will be used as an arg
to that function.
>
> --
> 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.
> dsl.yahoo.com
>