Re: one more C question ( mixedlib.e )

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Thu, 31 Aug 2000, Robert Craig wrote:
> cense writes:
> > If i wanted to pass a C struct to a function, would
> > i pass the *pointer* to this struct created by mixedlib.e
> > even though the function wants the "value" not
> > the "reference"? like this:
>
> Euphoria supports passing *pointers* to structures,
> not structures by value.
>
> If you can create an intermediate C routine that
> expects a pointer to a structure and then
> passes the structure by value, that would work.
>
> Alternatively, you can go way out on the bleeding edge,
> and try passing the members of the structure as
> individual arguments. i.e. tell Euphoria that the
> C routine takes (say) 4 integer arguments
> instead of one structure, and then pass
> the structure members as 4 arguments: (a,b,c,d).
> They will be pushed onto the call stack, hopefully in
> the same way that C expects a structure to be pushed
> when passed by value. Maybe you'll need the opposite order:
> (d,c,b,a). You'd have to look at the assembly code produced
> by a C compiler to learn if this is the right way to pass
> a structure. I might look into this eventually, but I'm pretty busy
> right now. Good Luck!  smile
>
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    http://www.RapidEuphoria.com

sounds like alot of work! i dont do alot of memory/pointer work and thus im
confused on the subject every once in a while. I will see what alternatives are
possible before i takle such a seemingly long task. ( i have school to attend
now #one more year# too so that dont help me out time wise )

--
cense
a member of the
ak-software development team
http://ak-software.virtualave.net/

contract work for
Web Velocity IT inc.
http://www.webvelocity.ca/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu