I'm hoping I'm just missing something, but here is the problem I'm
having with symbols appearing in compiled extensions not being usable in
other compiled extensions.
This involves the Cairo binding, which allows drawing on a variety of
surfaces, including an SDL_Surface as bound in the _sdl extentions.
In _sdl.crk, an SDL_Surface class is created as an opaque class with no
methods:
class SDL_Surface;
In _cairosdl.crk, a C function is wrapped with the signature
import crack.ext._sdl SDL_Surface;
import crack.ext._cairo cairo_surface_t;
..
cairo_surface_t
cairosdl_surface_create (SDL_Surface sdl_surface);
ParseError: opt/_cairosdl.crk:69: Unknown type cairo_surface_t
I.e. there needs to be a way in the extensions to declare a type as
defined in an external module.
Hope this makes sense :-)
Conrad
So am I correct in assuming that _cairosdl.crk is also an extension generator?
If so, this won't work because the extension generator doesn't know anything
about crack language imports. The extension generator has its own type
system.
>
> I.e. there needs to be a way in the extensions to declare a type as
> defined in an external module.
In order to make this happen, you need:
1) Support in the extension API for importing a module (probably in the form
of a method that returns a Module pointer). The getType() method (possibly
with some modifications) should allow you to extract the foreign type from
the module.
2) Support in the extension generator for a syntax that allows you to specify
the import of a type and bind it to a C++ type. Use of this syntax should
generate the import and type extraction.
Would you like to take a stab at this for 0.5?
>
> Hope this makes sense :-)
> Conrad
>
>
=============================================================================
michaelMuller = mmu...@enduden.com | http://www.mindhog.net/~mmuller
-----------------------------------------------------------------------------
The world is full of security systems. Hack one of them. - Bruce Schneier
=============================================================================
On Wed, 2011-04-27 at 17:33 -0400, Michael Muller wrote:
>
> In order to make this happen, you need:
>
> 1) Support in the extension API for importing a module (probably in the form
> of a method that returns a Module pointer). The getType() method (possibly
> with some modifications) should allow you to extract the foreign type from
> the module.
> 2) Support in the extension generator for a syntax that allows you to specify
> the import of a type and bind it to a C++ type. Use of this syntax should
> generate the import and type extraction.
>
> Would you like to take a stab at this for 0.5?
Sure, I'd love to get it done.
I'll ask for some pointers on how to import modules when the time comes.
Cheers,
Conrad
Cool!
>
> I'll ask for some pointers on how to import modules when the time comes.
>
You know where to find me :-)
> Cheers,
> Conrad
>
>
>