1. Re: Wrappers
- Posted by Mark Brown <mabrown at SENET.COM.AU>
Mar 18, 2000
-
Last edited Mar 19, 2000
Oh...and regarding type conversion, it isn't a problem when the item in
question is a simple double or whatever but it gets complicated on double
arrays (like double p1[3])
when you peek the location(s) to get the elements of the double array you
also have to convert from double to atom
eg
atom force
force = allocate(3*8)
global function Morfit_group_get_physics_force(atom group_handle)
--void Morfit_group_get_physics_force(DWORD group_handle, double
force[3]);
c_proc(xMorfit_group_get_physics_rotation,{group_handle, force})
return { float64_to_atom(peek({force,8})),
float64_to_atom(peek({force+8,8})),
float64_to_atom(peek({force+16,8})) }
end function
----- Original Message -----
From: David Cuny <dcuny at LANSET.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, March 18, 2000 5:56
Subject: Re: Wrappers
> I've started (but not completed) a program to generate wrappers from a C
> include file. It's a two-step process. The first pass runs the
pre-processor
> directives and creates a 'plain' C file. The second pass converts
structures
> and declarations to Euphoria equivalents.
>
> Anyone interested in taking this project on? There are a *lot* of subtle
> problems to be solved, especially with type conversions.
>
> -- David Cuny