Re: [C#] - Member array typemaps

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [C#] - Member array typemaps

William S Fulton


On 23 May 2017 at 13:39, schullq <[hidden email]> wrote:
Hello,

I have multiple arrays of unsigned char in mutliple structures and classes,
like this:

struct Test {
  unsigned char myArray[5];
};

I wrote a macro of multiple typemaps to handle them array in C#. Here are my
typemaps:

%define CSHARP_MEMBER_ARRAYS( CTYPE, CSTYPE )

%typemap(ctype)         CTYPE MBINOUT[] "CTYPE*"
%typemap(cstype)        CTYPE MBINOUT[] "CSTYPE[]"
%typemap(imtype, out="System.IntPtr")
                                        CTYPE MBINOUT[] "CSTYPE[]"
%typemap(csin)          CTYPE "$csinput"
The above line should be:
 %typemap(csin)          CTYPE MBINOUT[] "$csinput"

William


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user