Renaming SWIGTYPE_p_void

View: New views
2 Messages — Rating Filter:   Alert me  

Renaming SWIGTYPE_p_void

by Solomon Gibbs-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm working on wrapping an set of methods that use void* for no reason except to keep the data type in question opaque to the user. These 12 methods all expect a pointer to a specific type, so I would like my wrappers to use a proxy class with a name that refers to that type rather than SWIGTYPE_p_void.

%rename (void) Reference;

doesn't seem to work.

Is there any way I can rename the proxy class with a directive? Or do I need a typemap for this?


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

Re: Renaming SWIGTYPE_p_void

by David Beazley-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

One approach is to hide the void with a typedef and to use the typedef  
name in declarations

%{
typedef void Foo;            // Not seen by Swig
%}

// Declarations you want to wrap
extern bar(Foo *obj, ...);
extern spam(Foo *obj, ...);

-Dave


On Oct 9, 2009, at 9:33 AM, Solomon Gibbs wrote:

> I'm working on wrapping an set of methods that use void* for no  
> reason except to keep the data type in question opaque to the user.  
> These 12 methods all expect a pointer to a specific type, so I would  
> like my wrappers to use a proxy class with a name that refers to  
> that type rather than SWIGTYPE_p_void.
>
> %rename (void) Reference;
>
> doesn't seem to work.
>
> Is there any way I can rename the proxy class with a directive? Or  
> do I need a typemap for this?
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference_______________________________________________
> Swig-user mailing list
> Swig-user@...
> https://lists.sourceforge.net/lists/listinfo/swig-user


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user