Pointer modifying functions?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pointer modifying functions?

Pascal Bamford
Version 1.1 user manual describes pointer.i functions for adding offsets etc. to pointers. Do these still exist  as they obviously aren't in cpointer.i?

I can get around this by instantiating a new pointer class based on the original C pointer, but the helper functions that used to exist in 1.1 (e.g. ptradd etc.) would have made the scripting code much cleaner...

I just wrapped the entire Intel Performance Primitives (IPP) library for use in Java in a few key strokes - incredible! I wish I had found SWIG sooner. IPP requires the use of extensive pointer arithmetic, particularly in the image analysis functions to allow for border effects etc. Those helper functions sure would be handy...

Thanks for SWIG.
Reply | Threaded
Open this post in threaded view
|

Re: Pointer modifying functions?

William S Fulton
Pascal Bamford wrote:

> Version 1.1 user manual describes pointer.i functions for adding offsets
> etc. to pointers. Do these still exist  as they obviously aren't in
> cpointer.i?
>
> I can get around this by instantiating a new pointer class based on the
> original C pointer, but the helper functions that used to exist in 1.1
> (e.g. ptradd etc.) would have made the scripting code much cleaner...
>
> I just wrapped the entire Intel Performance Primitives (IPP) library for
> use in Java in a few key strokes - incredible! I wish I had found SWIG
> sooner. IPP requires the use of extensive pointer arithmetic,
> particularly in the image analysis functions to allow for border effects
> etc. Those helper functions sure would be handy...
>

Just add in a method to do this, something like:

%inline %{
int* ptr_add_int(int *p, int offset) { return p+offset; }
%}

William


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user