From: David P. <dpi...@me...> - 2011-03-07 16:31:39
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Understanding C# custom typemaps by looking at SWIG's output</TITLE> <style type='text/css'> /* By Qwertie: very useful */ .sidebox { border: 1px dotted rgb(127, 127, 127); padding: 4px 3px 4px 4px; min-width: 100px ! important; float: right ! important; font-size: small; margin-top: 1px; margin-bottom: 1px; margin-left: 4px; visibility: visible; max-width: 50%; width: 35%; } </style> </HEAD> <BODY LANG="en-US" DIR="LTR"> <H1>Understanding C# typemaps by looking at SWIG's output</H1> <P><I>Thanks to William Fulton for answering some of the questions I had while writing this.</I></P> <P>I found it hard to keep track the typemaps from the manual because there are so darn many of them. So, I've created this example to help understand them. In my experience, a number of typemaps are required for any nontrivial wrapper. Indeed, typemaps may be the most important feature for any "power user". </P> <P>Note that I am not discussing <EM>all</EM> the typemaps here, only the ones that are relevant to <EM>type conversion</EM> or <I>marshaling</I>. There are lots of others! (see the manual chapter 17, "SWIG and C#", and section 10.5, "Common typemap methods"). And I'm not covering the <B>varin</B> and <B>varout</B> typemaps, except to say that they are like <B>in</B> and <B>out</B> but apply to global variables (whereas the <B>in</B> and <B>out</B> typemaps apply to member variables.)</P> <P>When SWIG creates a wrapper for a function (or property), its C++ output is based on two things: (1) the typemaps <B>in</B>, <B>out</B>, <B>argout</B>, and <B>ctype</B>; and (2) logic hard-coded into SWIG. There's not much you can do about the latter, except that sometimes there are <B>%feature</B> directives that affect this hard-coded logic. For example <B>%feature("naturalvar")</B> has some kind of effect (see the manual section 6.6.7 for details). SWIG's C# output also comes from typemaps and hard-coded logic, and the relevant typemaps are <B>imtype</B>, <B>cstype</B>, <B>csin</B>, <B>csvarin</B>, <B>csout</B>, and <B>csvarout</B>.</P> <P>The following example sets <I>all</I> of the typemaps I mentioned above for two types, <B>Foo</B> and <B>Foo*</B>. Notice the comments such as <B>/* ctype */</B> and <B>/* in */</B>. I put those there so you can easily see how the typemaps affect the code that SWIG generates. Now, take a look at this nonsense:</P> <PRE STYLE="margin-left: 0.79in"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>module</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Test</B></FONT></FONT> // Typemaps for passing Foo by pointer <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>in</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* in* */ $1 = $input;"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>null</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* null* */ NULL"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* out* */ $result = $1;"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>argout</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* argout* */"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>cstype</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* cstype* out */ Foo"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* cstype* */ Foo"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>imtype</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* imtype* out */ Foo"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* imtype* */ Foo"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ctype</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* ctype* out */ Foo*"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* ctype* */ Foo*"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csin</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* csin* */ $csinput"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csvarin</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXCODE2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>*</B></FONT></FONT> %{ <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>set</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> { </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$imcall</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> } </B></FONT></FONT> %} <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csout</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXCODE</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT> { <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* csout* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$imcall</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$excode</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> } <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csvarout</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXCODE</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT> %{ <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>get</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> {</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* csvarout* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$imcall</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$excode</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> } %} // Note: SWIGEXCODE is a macro used by many csout typemaps. Definition: // %define SWIGEXCODE // "\n if ($modulePINVOKE.SWIGPendingException.Pending)" // "\n throw $modulePINVOKE.SWIGPendingException.Retrieve();" // Typemaps for passing Foo by value <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>in</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* in */ $1 = $input;"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>null</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* null */ Foo()"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* out */ $result = $1;"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>argout</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* argout */"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>cstype</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* cstype out */ Foo"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* cstype */ Foo"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>imtype</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* imtype out */ Foo"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* imtype */ Foo"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ctype</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>out</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* ctype out */ Foo"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* ctype */ Foo"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csin</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"/* csin */ $csinput"</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csvarin</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXCODE2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT> %{ <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>set</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> { </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$imcall</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> } </B></FONT></FONT> %} <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csout</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXCODE</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT> { <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* csout */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$imcall</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$excode</B></FONT></FONT> <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> } <FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>%</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>typemap</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>csvarout</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>excode</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>=</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXCODE</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT> %{ <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>get</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> {</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* csvarout */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$imcall</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>$excode</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ret</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> } %} <FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ByRefExample</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>& </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>foo3</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>foo4</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>const</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>foo5</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>);</B></FONT></FONT> <FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ByValExample</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>foo1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>const</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>& </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>foo2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>);</B></FONT></FONT> <FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>struct</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> StructWithFoo { Foo X; };</B></FONT></FONT> </PRE><P> By the way, there is no "real" C++ code here. There is not really a type called StructWithFoo, no type called Foo, and no function called ByRefExample or ByValExample. We're only giving SWIG this nonsense in order to find out what the generated code looks like.</P> <P>It's important that the typemaps appear above the function declarations, otherwise they have no effect on the functions' wrappers.</P> <P>SWIG really doesn't care that we haven't told it what <B>Foo</B> is. It just uses its default behavior for struct/class types, so if you add a declaration like <B>struct Foo { double a; };</B>, you'll find that SWIG creates a wrapper for Foo::a, new Foo() and delete Foo(), but other than that, SWIG's output remains identical. On the other hand, if you put <B>typedef int Foo;</B> at the top, substantial changes appear in the wrappers of ByRefExample and ByValExample. Apparently SWIG treats simple types quite differently than structures, but at least the typemaps remain intact. (By the way, <B>%naturalvar</B> has absolutely no effect on this example.)</P> <P>The result consists of three parts: (1) the C++ wrapper, (2) the C# PInvoke definition and (3) the C# wrapper. It is worth mentioning that SWIG's C++ typemaps and its C# typemaps are completely independent. Sometimes you need to customize both the C++ and the C#, but if the code on one side already happens to look the way you want it, then you only have to worry about changing the other side.</P> <P>Here is the C++ wrapper:</P> <PRE STYLE="margin-left: 0.79in"><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXPORT</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype* out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGSTDCALL</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>CSharp_ByRefExample</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>void</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> * </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg3</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) {</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype* out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>* </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *) </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg3</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *) </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *)</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>if</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(!</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) {</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIG_CSharpSetPendingExceptionArgument</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIG_CSharpArgumentNullException</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"Foo & type is null"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>);</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* null* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>NULL</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> } <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* in* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* in* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg3</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg3</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *)</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ByRefExample</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(*</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>,</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>,(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>const</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *)</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg3</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>);</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* out* */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* argout* */</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* argout* */</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> } <FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXPORT</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGSTDCALL</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>CSharp_ByValExample</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>void</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> * </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) {</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* in */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *)</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>if</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(!</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) {</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIG_CSharpSetPendingExceptionArgument</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIG_CSharpArgumentNullException</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#a43e00"><FONT SIZE=2 STYLE="font-size: 9pt"><B>"Foo const & type is null"</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>);</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* null */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>();</B></FONT></FONT> } <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>ByValExample</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>,(</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>const</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> &)*</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>);</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* argout */</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> } <FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXPORT</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>void</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGSTDCALL</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>CSharp_StructWithFoo_X_set</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>void</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> * </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>, </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) {</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>StructWithFoo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>StructWithFoo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *) </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>StructWithFoo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *)</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>; </B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* in */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>if</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>)-></B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>X</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg2</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* argout */</B></FONT></FONT> } <FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGEXPORT</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>SWIGSTDCALL</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>CSharp_StructWithFoo_X_get</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>(</B></FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>void</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> * </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>) {</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* ctype out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>StructWithFoo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>StructWithFoo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *) </B></FONT></FONT><FONT COLOR="#800049"><FONT SIZE=2 STYLE="font-size: 9pt"><B>0</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> ;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Foo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = (</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>StructWithFoo</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> *)</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jarg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>; </B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = ((</B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>arg1</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>)-></B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>X</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>);</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#008000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>/* out */</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> = </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>result</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2 STYLE="font-size: 9pt"><B>return</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B> </B></FONT></FONT><FONT COLOR="#020002"><FONT SIZE=2 STYLE="font-size: 9pt"><B>jresult</B></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2 STYLE="font-size: 9pt"><B>;</B></FONT></FONT> <FONT COLOR=... [truncated message content] |