typemap name changes:
inv => directorin outv => directorout argoutv => directorargout git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5137 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
20fabf7ff3
commit
7ee01311b2
24 changed files with 500 additions and 501 deletions
|
|
@ -99,7 +99,7 @@
|
||||||
<li><a href="#n66">What are directors?</a>
|
<li><a href="#n66">What are directors?</a>
|
||||||
<li><a href="#n67">Director-specific typemaps</a>
|
<li><a href="#n67">Director-specific typemaps</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#n68">%typemap(inv)</a>
|
<li><a href="#n68">%typemap(directorin)</a>
|
||||||
<li><a href="#n69">%typemap(javadirectorin)</a>
|
<li><a href="#n69">%typemap(javadirectorin)</a>
|
||||||
<li><a href="#n70">%typemap(javadirectorout)</a>
|
<li><a href="#n70">%typemap(javadirectorout)</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -4159,21 +4159,21 @@ public class director_derived extends director_example
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The Java directors feature requires the <a
|
The Java directors feature requires the <a
|
||||||
href="#java_directors_inv"><code>%typemap(inv)</code></a>, the <a
|
href="#java_directors_inv"><code>%typemap(directorin)</code></a>, the <a
|
||||||
href="#java_directors_din"><code>%typemap(javadirectorin)</code></a> and the <a
|
href="#java_directors_din"><code>%typemap(javadirectorin)</code></a> and the <a
|
||||||
href="#java_directors_dout"><code>%typemap(javadirectorout)</code></a> type maps in
|
href="#java_directors_dout"><code>%typemap(javadirectorout)</code></a> type maps in
|
||||||
order to work properly.
|
order to work properly.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a name="n68"></a><H4>15.9.2.1 %typemap(inv)</H4>
|
<a name="n68"></a><H4>15.9.2.1 %typemap(directorin)</H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The <code>%typemap(inv)</code> type map is used for converting arguments
|
The <code>%typemap(directorin)</code> type map is used for converting arguments
|
||||||
in the C++ director class to the appropriate JNI type before the upcall
|
in the C++ director class to the appropriate JNI type before the upcall
|
||||||
to Java. This typemap also specifies the JNI field descriptor for the
|
to Java. This typemap also specifies the JNI field descriptor for the
|
||||||
type. For example, integers are converted as follows:
|
type. For example, integers are converted as follows:
|
||||||
<pre>%typemap(inv,parse="I") int "$input = (jint) $1;"</pre>
|
<pre>%typemap(directorin,parse="I") int "$input = (jint) $1;"</pre>
|
||||||
<code>$input</code> is the SWIG name of the JNI temporary variable passed to
|
<code>$input</code> is the SWIG name of the JNI temporary variable passed to
|
||||||
Java in the upcall. The <code>parse="I"</code> will put an <code>I</code>
|
Java in the upcall. The <code>parse="I"</code> will put an <code>I</code>
|
||||||
into the JNI field descriptor that identifies the Java method that will be
|
into the JNI field descriptor that identifies the Java method that will be
|
||||||
|
|
@ -4183,7 +4183,7 @@ order to work properly.
|
||||||
<p>
|
<p>
|
||||||
A typemap for C character strings is:
|
A typemap for C character strings is:
|
||||||
<br>
|
<br>
|
||||||
<pre>%typemap(inv,parse="Ljava/lang/String;") char *
|
<pre>%typemap(directorin,parse="Ljava/lang/String;") char *
|
||||||
%{ $input = jenv->NewStringUTF($1); %}</pre>
|
%{ $input = jenv->NewStringUTF($1); %}</pre>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,10 @@
|
||||||
<li><a href="#n25">Overriding Methods in Ocaml</a>
|
<li><a href="#n25">Overriding Methods in Ocaml</a>
|
||||||
<li><a href="#n26">Director Usage Example</a>
|
<li><a href="#n26">Director Usage Example</a>
|
||||||
<li><a href="#n27">Creating director objects</a>
|
<li><a href="#n27">Creating director objects</a>
|
||||||
<li><a href="#n28">Typemaps for directors, <tt>inv, outv, argoutv</tt></a>
|
<li><a href="#n28">Typemaps for directors, <tt>directorin, directorout, directorargout</tt></a>
|
||||||
<li><a href="#n29"><tt>inv</tt> typemap</a>
|
<li><a href="#n29"><tt>directorin</tt> typemap</a>
|
||||||
<li><a href="#n30"><tt>outv</tt> typemap</a>
|
<li><a href="#n30"><tt>directorout</tt> typemap</a>
|
||||||
<li><a href="#n31"><tt>argoutv</tt> typemap</a>
|
<li><a href="#n31"><tt>directorargout</tt> typemap</a>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="#n32">Exceptions</a>
|
<li><a href="#n32">Exceptions</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -839,51 +839,51 @@ consequently trigger an exception when any method is called on the object
|
||||||
after that point (the actual raise is from an inner function used by
|
after that point (the actual raise is from an inner function used by
|
||||||
new_derived_object, and throws NotObject).
|
new_derived_object, and throws NotObject).
|
||||||
|
|
||||||
<a name="n28"></a><H4>16.2.5.5 Typemaps for directors, <tt>inv, outv, argoutv</tt></H4>
|
<a name="n28"></a><H4>16.2.5.5 Typemaps for directors, <tt>directorin, directorout, directorargout</tt></H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Special typemaps exist for use with directors, the <tt>inv, outv, argoutv</tt>
|
Special typemaps exist for use with directors, the <tt>directorin, directorout, directorargout</tt>
|
||||||
are used in place of <tt>in, out, argout</tt> typemaps, except that their
|
are used in place of <tt>in, out, argout</tt> typemaps, except that their
|
||||||
direction is reversed. They provide for you to provide argout values, as
|
direction is reversed. They provide for you to provide argout values, as
|
||||||
well as a function return value in the same way you provide function arguments,
|
well as a function return value in the same way you provide function arguments,
|
||||||
and to receive arguments the same way you normally receive function returns.
|
and to receive arguments the same way you normally receive function returns.
|
||||||
</P>
|
</P>
|
||||||
<a name="n29"></a><H4>16.2.5.6 <tt>inv</tt> typemap</H4>
|
<a name="n29"></a><H4>16.2.5.6 <tt>directorin</tt> typemap</H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The <tt>inv</tt> typemap is used when you will receive arguments from a call
|
The <tt>directorin</tt> typemap is used when you will receive arguments from a call
|
||||||
made by C++ code to you, therefore, values will be translated from C++ to
|
made by C++ code to you, therefore, values will be translated from C++ to
|
||||||
ocaml. You must provide some valid C_obj value. This is the value your ocaml
|
ocaml. You must provide some valid C_obj value. This is the value your ocaml
|
||||||
code receives when you are called. In general, a simple <tt>inv</tt> typemap
|
code receives when you are called. In general, a simple <tt>directorin</tt> typemap
|
||||||
can use the same body as a simple <tt>out</tt> typemap.
|
can use the same body as a simple <tt>out</tt> typemap.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a name="n30"></a><H4>16.2.5.7 <tt>outv</tt> typemap</H4>
|
<a name="n30"></a><H4>16.2.5.7 <tt>directorout</tt> typemap</H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The <tt>outv</tt> typemap is used when you will send an argument from your
|
The <tt>directorout</tt> typemap is used when you will send an argument from your
|
||||||
code back to the C++ caller. That is; outv specifies a function return
|
code back to the C++ caller. That is; directorout specifies a function return
|
||||||
conversion. You can usually use the same body as an <tt>in</tt> typemap
|
conversion. You can usually use the same body as an <tt>in</tt> typemap
|
||||||
for the same type, except when there are special requirements for object
|
for the same type, except when there are special requirements for object
|
||||||
ownership, etc.
|
ownership, etc.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a name="n31"></a><H4>16.2.5.8 <tt>argoutv</tt> typemap</H4>
|
<a name="n31"></a><H4>16.2.5.8 <tt>directorargout</tt> typemap</H4>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
C++ allows function arguments which are by pointer (*) and by reference (&)
|
C++ allows function arguments which are by pointer (*) and by reference (&)
|
||||||
to receive a value from the called function, as well as sending one there.
|
to receive a value from the called function, as well as sending one there.
|
||||||
Sometimes, this is the main purpose of the argument given. <tt>argoutv</tt>
|
Sometimes, this is the main purpose of the argument given. <tt>directorargout</tt>
|
||||||
typemaps allow your caml code to emulate this by specifying additional return
|
typemaps allow your caml code to emulate this by specifying additional return
|
||||||
values to be put into the output parameters. The SWIG ocaml module is a bit
|
values to be put into the output parameters. The SWIG ocaml module is a bit
|
||||||
loose in order to make code eaiser to write. In this case, your return to
|
loose in order to make code eaiser to write. In this case, your return to
|
||||||
the caller must be a list containing the normal function return first, followed
|
the caller must be a list containing the normal function return first, followed
|
||||||
by any argout values in order. These argout values will be taken from the
|
by any argout values in order. These argout values will be taken from the
|
||||||
list and assigned to the values to be returned to C++ through argoutv typemaps.
|
list and assigned to the values to be returned to C++ through directorargout typemaps.
|
||||||
In the event that you don't specify all of the necessary values, integral
|
In the event that you don't specify all of the necessary values, integral
|
||||||
values will read zero, and struct or object returns have undefined results.
|
values will read zero, and struct or object returns have undefined results.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -2223,7 +2223,7 @@ Python.
|
||||||
Typemaps for input and output of most of the basic types from director
|
Typemaps for input and output of most of the basic types from director
|
||||||
classes have been written. These are roughly the reverse of the usual
|
classes have been written. These are roughly the reverse of the usual
|
||||||
input and output typemaps used by the wrapper code. The typemap
|
input and output typemaps used by the wrapper code. The typemap
|
||||||
operation names are 'inv', 'outv', and 'argoutv'. The director code does
|
operation names are 'directorin', 'directorout', and 'directorargout'. The director code does
|
||||||
not use any of the other kinds of typemaps yet. It is not clear at this
|
not use any of the other kinds of typemaps yet. It is not clear at this
|
||||||
point which kinds are appropriate and need to be supported.
|
point which kinds are appropriate and need to be supported.
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ JAVA_ARRAYS_IMPL(double, jdouble, Double, Double) /* double[] */
|
||||||
if (!SWIG_JavaArrayIn##JFUNCNAME(jenv, &jarr, &$1, $input)) return $null; %}
|
if (!SWIG_JavaArrayIn##JFUNCNAME(jenv, &jarr, &$1, $input)) return $null; %}
|
||||||
%typemap(argout) CTYPE[ANY]
|
%typemap(argout) CTYPE[ANY]
|
||||||
%{ SWIG_JavaArrayArgout##JFUNCNAME(jenv, jarr$argnum, $1, $input); %}
|
%{ SWIG_JavaArrayArgout##JFUNCNAME(jenv, jarr$argnum, $1, $input); %}
|
||||||
%typemap(inv,parse=JNIDESC) CTYPE[ANY]
|
%typemap(directorin,parse=JNIDESC) CTYPE[ANY]
|
||||||
%{$input = SWIG_JavaArrayOut##JFUNCNAME(jenv, $1, $1_dim0); %}
|
%{$input = SWIG_JavaArrayOut##JFUNCNAME(jenv, $1, $1_dim0); %}
|
||||||
%typemap(out) CTYPE[ANY]
|
%typemap(out) CTYPE[ANY]
|
||||||
%{$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, $1, $1_dim0); %}
|
%{$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, $1, $1_dim0); %}
|
||||||
|
|
|
||||||
|
|
@ -179,20 +179,20 @@
|
||||||
enum SWIGTYPE
|
enum SWIGTYPE
|
||||||
%{ $1 = ($1_ltype)$input; %}
|
%{ $1 = ($1_ltype)$input; %}
|
||||||
|
|
||||||
%typemap(inv, parse="Z") bool "$input = (jboolean) $1;"
|
%typemap(directorin, parse="Z") bool "$input = (jboolean) $1;"
|
||||||
%typemap(inv, parse="C") char "$input = (jint) $1;"
|
%typemap(directorin, parse="C") char "$input = (jint) $1;"
|
||||||
%typemap(inv, parse="B") signed char "$input = (jbyte) $1;"
|
%typemap(directorin, parse="B") signed char "$input = (jbyte) $1;"
|
||||||
%typemap(inv, parse="S") unsigned char "$input = (jshort) $1;"
|
%typemap(directorin, parse="S") unsigned char "$input = (jshort) $1;"
|
||||||
%typemap(inv, parse="S") short "$input = (jshort) $1;"
|
%typemap(directorin, parse="S") short "$input = (jshort) $1;"
|
||||||
%typemap(inv, parse="I") unsigned short "$input = (jint) $1;"
|
%typemap(directorin, parse="I") unsigned short "$input = (jint) $1;"
|
||||||
%typemap(inv, parse="I") int "$input = (jint) $1;"
|
%typemap(directorin, parse="I") int "$input = (jint) $1;"
|
||||||
%typemap(inv, parse="J") unsigned int "$input = (jlong) $1;"
|
%typemap(directorin, parse="J") unsigned int "$input = (jlong) $1;"
|
||||||
%typemap(inv, parse="I") long "$input = (jint) $1;"
|
%typemap(directorin, parse="I") long "$input = (jint) $1;"
|
||||||
%typemap(inv, parse="J") unsigned long "$input = (jlong) $1;"
|
%typemap(directorin, parse="J") unsigned long "$input = (jlong) $1;"
|
||||||
%typemap(inv, parse="J") long long "$input = (jlong) $1;"
|
%typemap(directorin, parse="J") long long "$input = (jlong) $1;"
|
||||||
%typemap(inv, parse="F") float "$input = (jfloat) $1;"
|
%typemap(directorin, parse="F") float "$input = (jfloat) $1;"
|
||||||
%typemap(inv, parse="D") double "$input = (jdouble) $1;"
|
%typemap(directorin, parse="D") double "$input = (jdouble) $1;"
|
||||||
%typemap(inv, parse="I") enum SWIGTYPE "$input = (jint) $1;"
|
%typemap(directorin, parse="I") enum SWIGTYPE "$input = (jint) $1;"
|
||||||
|
|
||||||
%typemap(javadirectorin) char,
|
%typemap(javadirectorin) char,
|
||||||
signed char,
|
signed char,
|
||||||
|
|
@ -292,7 +292,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert to BigInteger (see out typemap) */
|
/* Convert to BigInteger (see out typemap) */
|
||||||
%typemap(inv, parse="Ljava/math/Biginteger;") unsigned long long, const unsigned long long & {
|
%typemap(directorin, parse="Ljava/math/Biginteger;") unsigned long long, const unsigned long long & {
|
||||||
jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
|
jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
|
||||||
jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
|
jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
|
||||||
jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
|
jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
|
||||||
|
|
@ -322,7 +322,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv, parse="Ljava/lang/String;") char * {
|
%typemap(directorin, parse="Ljava/lang/String;") char * {
|
||||||
$input = 0;
|
$input = 0;
|
||||||
if ($1) {
|
if ($1) {
|
||||||
$input = JCALL1(NewStringUTF, jenv, $1);
|
$input = JCALL1(NewStringUTF, jenv, $1);
|
||||||
|
|
@ -337,7 +337,7 @@
|
||||||
%typemap(out) void ""
|
%typemap(out) void ""
|
||||||
%typemap(javadirectorin) void "$jniinput"
|
%typemap(javadirectorin) void "$jniinput"
|
||||||
%typemap(javadirectorout) void "$javacall"
|
%typemap(javadirectorout) void "$javacall"
|
||||||
%typemap(inv, parse="V") void ""
|
%typemap(directorin, parse="V") void ""
|
||||||
|
|
||||||
/* primitive types by reference */
|
/* primitive types by reference */
|
||||||
%typemap(in) const bool & (bool temp)
|
%typemap(in) const bool & (bool temp)
|
||||||
|
|
@ -362,19 +362,19 @@
|
||||||
%{ temp = ($*1_ltype)$input;
|
%{ temp = ($*1_ltype)$input;
|
||||||
$1 = &temp; %}
|
$1 = &temp; %}
|
||||||
|
|
||||||
%typemap(inv, parse="Z") const bool & "$input = (jboolean)$1_name;"
|
%typemap(directorin, parse="Z") const bool & "$input = (jboolean)$1_name;"
|
||||||
%typemap(inv, parse="C") const char & "$input = (jchar)$1_name;"
|
%typemap(directorin, parse="C") const char & "$input = (jchar)$1_name;"
|
||||||
%typemap(inv, parse="B") const signed char & "$input = (jbyte)$1_name;"
|
%typemap(directorin, parse="B") const signed char & "$input = (jbyte)$1_name;"
|
||||||
%typemap(inv, parse="S") const unsigned char & "$input = (jshort)$1_name;"
|
%typemap(directorin, parse="S") const unsigned char & "$input = (jshort)$1_name;"
|
||||||
%typemap(inv, parse="S") const short & "$input = (jshort)$1_name;"
|
%typemap(directorin, parse="S") const short & "$input = (jshort)$1_name;"
|
||||||
%typemap(inv, parse="I") const unsigned short & "$input = (jint)$1_name;"
|
%typemap(directorin, parse="I") const unsigned short & "$input = (jint)$1_name;"
|
||||||
%typemap(inv, parse="I") const int & "$input = (jint)$1_name;"
|
%typemap(directorin, parse="I") const int & "$input = (jint)$1_name;"
|
||||||
%typemap(inv, parse="J") const unsigned int & "$input = (jlong)$1_name;"
|
%typemap(directorin, parse="J") const unsigned int & "$input = (jlong)$1_name;"
|
||||||
%typemap(inv, parse="I") const long & "$input = (jint)$1_name;"
|
%typemap(directorin, parse="I") const long & "$input = (jint)$1_name;"
|
||||||
%typemap(inv, parse="J") const unsigned long & "$input = (jlong)$1_name;"
|
%typemap(directorin, parse="J") const unsigned long & "$input = (jlong)$1_name;"
|
||||||
%typemap(inv, parse="J") const long long & "$input = (jlong)$1_name;"
|
%typemap(directorin, parse="J") const long long & "$input = (jlong)$1_name;"
|
||||||
%typemap(inv, parse="F") const float & "$input = (jfloat)$1_name;"
|
%typemap(directorin, parse="F") const float & "$input = (jfloat)$1_name;"
|
||||||
%typemap(inv, parse="D") const double & "$input = (jdouble)$1_name;"
|
%typemap(directorin, parse="D") const double & "$input = (jdouble)$1_name;"
|
||||||
|
|
||||||
%typemap(javadirectorin) const char & (char temp),
|
%typemap(javadirectorin) const char & (char temp),
|
||||||
const signed char & (signed char temp),
|
const signed char & (signed char temp),
|
||||||
|
|
@ -494,7 +494,7 @@
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
%typemap(inv,parse="L$packagepath/$javaclassname;") SWIGTYPE "*(($&1_type)&$input) = &$1;"
|
%typemap(directorin,parse="L$packagepath/$javaclassname;") SWIGTYPE "*(($&1_type)&$input) = &$1;"
|
||||||
%typemap(javadirectorin) SWIGTYPE "new $javaclassname($jniinput, false)"
|
%typemap(javadirectorin) SWIGTYPE "new $javaclassname($jniinput, false)"
|
||||||
%typemap(javadirectorout) SWIGTYPE "$javaclassname.getCPtr($javacall)"
|
%typemap(javadirectorout) SWIGTYPE "$javaclassname.getCPtr($javacall)"
|
||||||
|
|
||||||
|
|
@ -510,10 +510,10 @@
|
||||||
%typemap(out) SWIGTYPE &
|
%typemap(out) SWIGTYPE &
|
||||||
%{ *($&1_ltype)&$result = $1; %}
|
%{ *($&1_ltype)&$result = $1; %}
|
||||||
|
|
||||||
%typemap(inv,parse="L$packagepath/$javaclassname;") SWIGTYPE *, SWIGTYPE (CLASS::*)
|
%typemap(directorin,parse="L$packagepath/$javaclassname;") SWIGTYPE *, SWIGTYPE (CLASS::*)
|
||||||
%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %}
|
%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %}
|
||||||
|
|
||||||
%typemap(inv,parse="L$packagepath/$javaclassname;") SWIGTYPE &
|
%typemap(directorin,parse="L$packagepath/$javaclassname;") SWIGTYPE &
|
||||||
%{ *($&1_ltype)&$input = ($1_ltype) &$1; %}
|
%{ *($&1_ltype)&$input = ($1_ltype) &$1; %}
|
||||||
|
|
||||||
%typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, const SWIGTYPE & "new $javaclassname($jniinput, false)"
|
%typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, const SWIGTYPE & "new $javaclassname($jniinput, false)"
|
||||||
|
|
@ -532,7 +532,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv,parse="Ljava/lang/String;") char[ANY] "$input = JCALL1(NewStringUTF, jenv, $1_name);"
|
%typemap(directorin,parse="Ljava/lang/String;") char[ANY] "$input = JCALL1(NewStringUTF, jenv, $1_name);"
|
||||||
|
|
||||||
%typemap(argout) char[ANY] ""
|
%typemap(argout) char[ANY] ""
|
||||||
%typemap(freearg) char[ANY] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, $1); }
|
%typemap(freearg) char[ANY] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, $1); }
|
||||||
|
|
@ -583,25 +583,25 @@
|
||||||
jobjectArray
|
jobjectArray
|
||||||
%{ $result = $1; %}
|
%{ $result = $1; %}
|
||||||
|
|
||||||
%typemap(inv,parse="Z") jboolean "$input = $1;"
|
%typemap(directorin,parse="Z") jboolean "$input = $1;"
|
||||||
%typemap(inv,parse="C") jchar "$input = $1;"
|
%typemap(directorin,parse="C") jchar "$input = $1;"
|
||||||
%typemap(inv,parse="B") jbyte "$input = $1;"
|
%typemap(directorin,parse="B") jbyte "$input = $1;"
|
||||||
%typemap(inv,parse="S") jshort "$input = $1;"
|
%typemap(directorin,parse="S") jshort "$input = $1;"
|
||||||
%typemap(inv,parse="I") jint "$input = $1;"
|
%typemap(directorin,parse="I") jint "$input = $1;"
|
||||||
%typemap(inv,parse="J") jlong "$input = $1;"
|
%typemap(directorin,parse="J") jlong "$input = $1;"
|
||||||
%typemap(inv,parse="F") jfloat "$input = $1;"
|
%typemap(directorin,parse="F") jfloat "$input = $1;"
|
||||||
%typemap(inv,parse="D") jdouble "$input = $1;"
|
%typemap(directorin,parse="D") jdouble "$input = $1;"
|
||||||
%typemap(inv,parse="Ljava/lang/String;") jstring "$input = $1;"
|
%typemap(directorin,parse="Ljava/lang/String;") jstring "$input = $1;"
|
||||||
%typemap(inv,parse="Ljava/lang/Object;") jobject "$input = $1;"
|
%typemap(directorin,parse="Ljava/lang/Object;") jobject "$input = $1;"
|
||||||
%typemap(inv,parse="[Z") jbooleanArray "$input = $1;"
|
%typemap(directorin,parse="[Z") jbooleanArray "$input = $1;"
|
||||||
%typemap(inv,parse="[C") jcharArray "$input = $1;"
|
%typemap(directorin,parse="[C") jcharArray "$input = $1;"
|
||||||
%typemap(inv,parse="[B") jbyteArray "$input = $1;"
|
%typemap(directorin,parse="[B") jbyteArray "$input = $1;"
|
||||||
%typemap(inv,parse="[S") jshortArray "$input = $1;"
|
%typemap(directorin,parse="[S") jshortArray "$input = $1;"
|
||||||
%typemap(inv,parse="[I") jintArray "$input = $1;"
|
%typemap(directorin,parse="[I") jintArray "$input = $1;"
|
||||||
%typemap(inv,parse="[J") jlongArray "$input = $1;"
|
%typemap(directorin,parse="[J") jlongArray "$input = $1;"
|
||||||
%typemap(inv,parse="[F") jfloatArray "$input = $1;"
|
%typemap(directorin,parse="[F") jfloatArray "$input = $1;"
|
||||||
%typemap(inv,parse="[D") jdoubleArray "$input = $1;"
|
%typemap(directorin,parse="[D") jdoubleArray "$input = $1;"
|
||||||
%typemap(inv,parse="[Ljava/lang/Object;") jobjectArray "$input = $1;"
|
%typemap(directorin,parse="[Ljava/lang/Object;") jobjectArray "$input = $1;"
|
||||||
|
|
||||||
%typemap(javadirectorin) jboolean,
|
%typemap(javadirectorin) jboolean,
|
||||||
jchar,
|
jchar,
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class string;
|
||||||
return $null;
|
return $null;
|
||||||
} %}
|
} %}
|
||||||
|
|
||||||
%typemap(inv,parse="Ljava/lang/String;") string
|
%typemap(directorin,parse="Ljava/lang/String;") string
|
||||||
%{ $input = jenv->NewStringUTF($1.c_str()); %}
|
%{ $input = jenv->NewStringUTF($1.c_str()); %}
|
||||||
|
|
||||||
%typemap(out) string
|
%typemap(out) string
|
||||||
|
|
@ -80,7 +80,7 @@ class string;
|
||||||
%typemap(freearg) const string &
|
%typemap(freearg) const string &
|
||||||
%{ delete $1; %}
|
%{ delete $1; %}
|
||||||
|
|
||||||
%typemap(inv,parse="Ljava/lang/String;") const string &
|
%typemap(directorin,parse="Ljava/lang/String;") const string &
|
||||||
%{ $input = jenv->NewStringUTF($1.c_str()); %}
|
%{ $input = jenv->NewStringUTF($1.c_str()); %}
|
||||||
|
|
||||||
%typemap(out) const string &
|
%typemap(out) const string &
|
||||||
|
|
@ -142,7 +142,7 @@ class wstring;
|
||||||
return $null;
|
return $null;
|
||||||
} %}
|
} %}
|
||||||
|
|
||||||
%typemap(inv,parse="Ljava/lang/String;") wstring
|
%typemap(directorin,parse="Ljava/lang/String;") wstring
|
||||||
%{jsize len = $1.length();
|
%{jsize len = $1.length();
|
||||||
jchar *conv_buf = new jchar[len];
|
jchar *conv_buf = new jchar[len];
|
||||||
for (jsize i = 0; i < len; ++i) {
|
for (jsize i = 0; i < len; ++i) {
|
||||||
|
|
@ -194,7 +194,7 @@ class wstring;
|
||||||
return $null;
|
return $null;
|
||||||
} %}
|
} %}
|
||||||
|
|
||||||
%typemap(inv,parse="Ljava/lang/String;") const wstring &
|
%typemap(directorin,parse="Ljava/lang/String;") const wstring &
|
||||||
%{jsize len = $1->length();
|
%{jsize len = $1->length();
|
||||||
jchar *conv_buf = new jchar[len];
|
jchar *conv_buf = new jchar[len];
|
||||||
for (jsize i = 0; i < len; ++i) {
|
for (jsize i = 0; i < len; ++i) {
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,10 @@ In Java you could then use it like this:
|
||||||
%typemap(in) CTYPE *INPUT, CTYPE &INPUT
|
%typemap(in) CTYPE *INPUT, CTYPE &INPUT
|
||||||
%{ $1 = ($1_ltype)&$input; %}
|
%{ $1 = ($1_ltype)&$input; %}
|
||||||
|
|
||||||
%typemap(inv,parse=JNIDESC) CYTPE &INPUT
|
%typemap(directorin,parse=JNIDESC) CYTPE &INPUT
|
||||||
%{ *(($&1_ltype) $input) = (JNITYPE *) &$1; %}
|
%{ *(($&1_ltype) $input) = (JNITYPE *) &$1; %}
|
||||||
|
|
||||||
%typemap(inv,parse=JNIDESC) CTYPE *INPUT
|
%typemap(directorin,parse=JNIDESC) CTYPE *INPUT
|
||||||
%{ *(($&1_ltype) $input) = (JNITYPE *) $1; %}
|
%{ *(($&1_ltype) $input) = (JNITYPE *) $1; %}
|
||||||
|
|
||||||
%typemap(typecheck) CTYPE *INPUT = CTYPE;
|
%typemap(typecheck) CTYPE *INPUT = CTYPE;
|
||||||
|
|
@ -220,12 +220,12 @@ value in the single element array. In Java you would use it like this:
|
||||||
$1 = &temp;
|
$1 = &temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv,parse=JNIDESC) CTYPE &OUTPUT
|
%typemap(directorin,parse=JNIDESC) CTYPE &OUTPUT
|
||||||
%{ *(($&1_ltype) $input = &$1; %}
|
%{ *(($&1_ltype) $input = &$1; %}
|
||||||
|
|
||||||
%typemap(inv,parse=JNIDESC) CTYPE *OUTPUT
|
%typemap(directorin,parse=JNIDESC) CTYPE *OUTPUT
|
||||||
%{
|
%{
|
||||||
#error "Need to provide OUT inv typemap, CTYPE array length is unknown"
|
#error "Need to provide OUT directorin typemap, CTYPE array length is unknown"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%typemap(argout) CTYPE *OUTPUT, CTYPE &OUTPUT
|
%typemap(argout) CTYPE *OUTPUT, CTYPE &OUTPUT
|
||||||
|
|
@ -354,12 +354,12 @@ of the function return value. This difference is due to Java being a typed langu
|
||||||
$1 = ($1_ltype) JCALL2(Get##JAVATYPE##ArrayElements, jenv, $input, 0);
|
$1 = ($1_ltype) JCALL2(Get##JAVATYPE##ArrayElements, jenv, $input, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv,parse=JNIDESC) CTYPE &INOUT
|
%typemap(directorin,parse=JNIDESC) CTYPE &INOUT
|
||||||
%{ *(($&1_ltype)&$input) = &$1; %}
|
%{ *(($&1_ltype)&$input) = &$1; %}
|
||||||
|
|
||||||
%typemap(inv,parse=JNIDESC) CTYPE *INOUT, CTYPE &INOUT
|
%typemap(directorin,parse=JNIDESC) CTYPE *INOUT, CTYPE &INOUT
|
||||||
{
|
{
|
||||||
#error "Need to provide INOUT inv typemap, CTYPE array length is unknown"
|
#error "Need to provide INOUT directorin typemap, CTYPE array length is unknown"
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(argout) CTYPE *INOUT, CTYPE &INOUT
|
%typemap(argout) CTYPE *INOUT, CTYPE &INOUT
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
%typemap(freearg) char **STRING_IN
|
%typemap(freearg) char **STRING_IN
|
||||||
%{ free($1); %}
|
%{ free($1); %}
|
||||||
|
|
||||||
%typemap(inv, parse="Ljava/lang/String;") char **STRING_IN
|
%typemap(directorin, parse="Ljava/lang/String;") char **STRING_IN
|
||||||
%{ $input = JCALL1(NewStringUTF, jenv, *$1); %}
|
%{ $input = JCALL1(NewStringUTF, jenv, *$1); %}
|
||||||
|
|
||||||
/* char **STRING_OUT - result must be a null terminated string */
|
/* char **STRING_OUT - result must be a null terminated string */
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv,parse="Ljava/lang/String;") char **STRING_OUT
|
%typemap(directorin,parse="Ljava/lang/String;") char **STRING_OUT
|
||||||
%{ $input = JCALL1(NewStringUTF, jenv, *$1); %}
|
%{ $input = JCALL1(NewStringUTF, jenv, *$1); %}
|
||||||
|
|
||||||
/* char **STRING_RET - a NULL terminated array of char* */
|
/* char **STRING_RET - a NULL terminated array of char* */
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv,parse="Ljava/lang/String;") char **STRING_RET
|
%typemap(directorin,parse="Ljava/lang/String;") char **STRING_RET
|
||||||
%{ $input = JCALL1(NewStringUTF, jenv, *$1; %}
|
%{ $input = JCALL1(NewStringUTF, jenv, *$1; %}
|
||||||
|
|
||||||
/* float *FLOAT_ARRAY_RETURN */
|
/* float *FLOAT_ARRAY_RETURN */
|
||||||
|
|
@ -106,9 +106,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv,parse="[F") float *FLOATARRAYRETURN
|
%typemap(directorin,parse="[F") float *FLOATARRAYRETURN
|
||||||
%{
|
%{
|
||||||
#error "Need inv typemape for FLOATARRAYRETURN, array input size is unknown."
|
#error "Need directorin typemape for FLOATARRAYRETURN, array input size is unknown."
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* char *BYTE */
|
/* char *BYTE */
|
||||||
|
|
@ -125,9 +125,9 @@
|
||||||
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *) $1, 0);
|
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *) $1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv,parse="[B") char *BYTE
|
%typemap(directorin,parse="[B") char *BYTE
|
||||||
%{
|
%{
|
||||||
#error "Need inv typemape for BYTE, array input size is unknown."
|
#error "Need directorin typemape for BYTE, array input size is unknown."
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* Prevent default freearg typemap from being used */
|
/* Prevent default freearg typemap from being used */
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@ type _value = c_obj
|
||||||
%define %make_simple_array_typemap(type,out_f,in_f)
|
%define %make_simple_array_typemap(type,out_f,in_f)
|
||||||
%array_tmap_out(out,type,out_f);
|
%array_tmap_out(out,type,out_f);
|
||||||
%array_tmap_out(varout,type,out_f);
|
%array_tmap_out(varout,type,out_f);
|
||||||
%array_tmap_out(inv,type,out_f);
|
%array_tmap_out(directorin,type,out_f);
|
||||||
|
|
||||||
%array_tmap_in(in,type,in_f);
|
%array_tmap_in(in,type,in_f);
|
||||||
%array_tmap_in(varin,type,in_f);
|
%array_tmap_in(varin,type,in_f);
|
||||||
%array_tmap_in(outv,type,in_f);
|
%array_tmap_in(directorout,type,in_f);
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
%make_simple_array_typemap(bool,caml_val_bool,caml_long_val);
|
%make_simple_array_typemap(bool,caml_val_bool,caml_long_val);
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
%typemap(varin) C_NAME & {
|
%typemap(varin) C_NAME & {
|
||||||
$1 = MZ_TO_C($input);
|
$1 = MZ_TO_C($input);
|
||||||
}
|
}
|
||||||
%typemap(outv) C_NAME {
|
%typemap(directorout) C_NAME {
|
||||||
$1 = MZ_TO_C($input);
|
$1 = MZ_TO_C($input);
|
||||||
}
|
}
|
||||||
%typemap(in) C_NAME *INPUT ($*1_ltype temp) {
|
%typemap(in) C_NAME *INPUT ($*1_ltype temp) {
|
||||||
|
|
@ -157,7 +157,7 @@
|
||||||
%typemap(argout) C_NAME & {
|
%typemap(argout) C_NAME & {
|
||||||
swig_result = caml_list_append(swig_result,C_TO_MZ((long)*$1));
|
swig_result = caml_list_append(swig_result,C_TO_MZ((long)*$1));
|
||||||
}
|
}
|
||||||
%typemap(inv) C_NAME {
|
%typemap(directorin) C_NAME {
|
||||||
args = caml_list_append(args,C_TO_MZ($1_name));
|
args = caml_list_append(args,C_TO_MZ($1_name));
|
||||||
}
|
}
|
||||||
%enddef
|
%enddef
|
||||||
|
|
@ -225,7 +225,7 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
|
||||||
|
|
||||||
%char_ptr_in(in);
|
%char_ptr_in(in);
|
||||||
%char_ptr_in(varin);
|
%char_ptr_in(varin);
|
||||||
%char_ptr_in(outv);
|
%char_ptr_in(directorout);
|
||||||
|
|
||||||
%define %char_ptr_out(how)
|
%define %char_ptr_out(how)
|
||||||
%typemap(how)
|
%typemap(how)
|
||||||
|
|
@ -242,7 +242,7 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
|
||||||
|
|
||||||
%char_ptr_out(out);
|
%char_ptr_out(out);
|
||||||
%char_ptr_out(varout);
|
%char_ptr_out(varout);
|
||||||
%char_ptr_out(invv);
|
%char_ptr_out(directorin);
|
||||||
|
|
||||||
%define %swigtype_ptr_in(how)
|
%define %swigtype_ptr_in(how)
|
||||||
%typemap(how) SWIGTYPE * {
|
%typemap(how) SWIGTYPE * {
|
||||||
|
|
@ -276,10 +276,10 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
|
||||||
|
|
||||||
%swigtype_ptr_in(in);
|
%swigtype_ptr_in(in);
|
||||||
%swigtype_ptr_in(varin);
|
%swigtype_ptr_in(varin);
|
||||||
%swigtype_ptr_in(outv);
|
%swigtype_ptr_in(directorout);
|
||||||
%swigtype_ptr_out(out);
|
%swigtype_ptr_out(out);
|
||||||
%swigtype_ptr_out(varout);
|
%swigtype_ptr_out(varout);
|
||||||
%swigtype_ptr_out(inv);
|
%swigtype_ptr_out(directorin);
|
||||||
|
|
||||||
/* C++ References */
|
/* C++ References */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,18 +35,18 @@ namespace std {
|
||||||
|
|
||||||
%typemap(out, pikedesc="tStr") const string & "push_text($1->c_str());";
|
%typemap(out, pikedesc="tStr") const string & "push_text($1->c_str());";
|
||||||
|
|
||||||
%typemap(inv) string, const string &, string & "$1_name.c_str()";
|
%typemap(directorin) string, const string &, string & "$1_name.c_str()";
|
||||||
|
|
||||||
%typemap(inv) string *, const string * "$1_name->c_str()";
|
%typemap(directorin) string *, const string * "$1_name->c_str()";
|
||||||
|
|
||||||
%typemap(outv) string {
|
%typemap(directorout) string {
|
||||||
if ($input.type == T_STRING)
|
if ($input.type == T_STRING)
|
||||||
$result = std::string(STR0($input.u.string));
|
$result = std::string(STR0($input.u.string));
|
||||||
else
|
else
|
||||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(outv) const string & (std::string temp) {
|
%typemap(directorout) const string & (std::string temp) {
|
||||||
if ($input.type == T_STRING) {
|
if ($input.type == T_STRING) {
|
||||||
temp = std::string(STR0($input.u.string));
|
temp = std::string(STR0($input.u.string));
|
||||||
$result = &temp;
|
$result = &temp;
|
||||||
|
|
|
||||||
|
|
@ -143,8 +143,7 @@ SWIG_newvarlink(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGRUNTIME(void)
|
SWIGRUNTIME(void)
|
||||||
SWIG_addvarlink(PyObject *p, char *name,
|
SWIG_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
|
||||||
PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
|
|
||||||
swig_varlinkobject *v;
|
swig_varlinkobject *v;
|
||||||
swig_globalvar *gv;
|
swig_globalvar *gv;
|
||||||
v= (swig_varlinkobject *) p;
|
v= (swig_varlinkobject *) p;
|
||||||
|
|
|
||||||
|
|
@ -423,41 +423,41 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/* --- Inverse arguments --- */
|
/* directorin typemaps */
|
||||||
|
|
||||||
/* Primitive datatypes. These only supply a parse code to PyObject_CallMethod */
|
/* Primitive datatypes. These only supply a parse code to PyObject_CallMethod */
|
||||||
|
|
||||||
%typemap(inv,parse="i") int "";
|
%typemap(directorin,parse="i") int "";
|
||||||
%typemap(inv,parse="h") short "";
|
%typemap(directorin,parse="h") short "";
|
||||||
%typemap(inv,parse="l") long "";
|
%typemap(directorin,parse="l") long "";
|
||||||
%typemap(inv,parse="b") signed char "";
|
%typemap(directorin,parse="b") signed char "";
|
||||||
%typemap(inv,parse="f") float "";
|
%typemap(directorin,parse="f") float "";
|
||||||
%typemap(inv,parse="d") double "";
|
%typemap(directorin,parse="d") double "";
|
||||||
%typemap(inv,parse="s") char* "";
|
%typemap(directorin,parse="s") char* "";
|
||||||
%typemap(inv,parse="i") bool "";
|
%typemap(directorin,parse="i") bool "";
|
||||||
%typemap(inv,parse="i") enum SWIGTYPE "";
|
%typemap(directorin,parse="i") enum SWIGTYPE "";
|
||||||
|
|
||||||
%typemap(inv,parse="l") unsigned int, unsigned short, unsigned long, unsigned char "(long) $1_name";
|
%typemap(directorin,parse="l") unsigned int, unsigned short, unsigned long, unsigned char "(long) $1_name";
|
||||||
|
|
||||||
%typemap(inv) long long
|
%typemap(directorin) long long
|
||||||
"$input = PyLong_FromLongLong($1_name);";
|
"$input = PyLong_FromLongLong($1_name);";
|
||||||
%typemap(inv) unsigned long long
|
%typemap(directorin) unsigned long long
|
||||||
"$input = PyLong_FromUnsignedLongLong($1_name);";
|
"$input = PyLong_FromUnsignedLongLong($1_name);";
|
||||||
|
|
||||||
%typemap(inv, parse="l") int *INV, long* INV,
|
%typemap(directorin, parse="l") int *DIRECTORIN, long* DIRECTORIN,
|
||||||
unsigned int *INV, unsigned long *INV,
|
unsigned int *DIRECTORIN, unsigned long *DIRECTORIN,
|
||||||
short *INV, unsigned short *INV,
|
short *DIRECTORIN, unsigned short *DIRECTORIN,
|
||||||
char *INV, unsigned char *INV
|
char *DIRECTORIN, unsigned char *DIRECTORIN
|
||||||
"(long) *$1_name";
|
"(long) *$1_name";
|
||||||
%typemap(inv, parse="f") float *INV "*$1_name";
|
%typemap(directorin, parse="f") float *DIRECTORIN "*$1_name";
|
||||||
%typemap(inv, parse="d") double *INV "*$1_name";
|
%typemap(directorin, parse="d") double *DIRECTORIN "*$1_name";
|
||||||
|
|
||||||
%typemap(inv, parse="O") PyObject* "";
|
%typemap(directorin, parse="O") PyObject* "";
|
||||||
|
|
||||||
%typemap(inv, parse="l") std::size_t "(long) $input";
|
%typemap(directorin, parse="l") std::size_t "(long) $input";
|
||||||
|
|
||||||
/* // this is rather dangerous
|
/* // this is rather dangerous
|
||||||
%typemap(inv) SWIGTYPE {
|
%typemap(directorin) SWIGTYPE {
|
||||||
{
|
{
|
||||||
$input = SWIG_NewPointerObj((void *) &$1_name, $&1_descriptor, $owner);
|
$input = SWIG_NewPointerObj((void *) &$1_name, $&1_descriptor, $owner);
|
||||||
}
|
}
|
||||||
|
|
@ -465,7 +465,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* no can do... see python.cxx
|
/* no can do... see python.cxx
|
||||||
%typemap(inv) DIRECTORTYPE * {
|
%typemap(directorin) DIRECTORTYPE * {
|
||||||
{
|
{
|
||||||
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
|
|
@ -475,58 +475,58 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(inv) SWIGTYPE * {
|
%typemap(directorin) SWIGTYPE * {
|
||||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* // not currently needed, see python.cxx
|
/* // not currently needed, see python.cxx
|
||||||
%typemap(inv) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
%typemap(directorin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
||||||
}
|
}
|
||||||
%typemap(inv, parse="s") void "0";
|
%typemap(directorin, parse="s") void "0";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* --- Outverse arguments --- */
|
/* --- directorout typemaps --- */
|
||||||
|
|
||||||
%define OUTV_TYPEMAP(type, converter)
|
%define DIRECTOROUT_TYPEMAP(type, converter)
|
||||||
%typemap(argoutv) type *OUTV
|
%typemap(directorargout) type *DIRECTOROUT
|
||||||
"*$result = (type) converter($input);
|
"*$result = (type) converter($input);
|
||||||
if (PyErr_Occurred()) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Error converting Python object using converter\");";
|
if (PyErr_Occurred()) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Error converting Python object using converter\");";
|
||||||
%typemap(outv) type
|
%typemap(directorout) type
|
||||||
"$result = (type) converter($input);
|
"$result = (type) converter($input);
|
||||||
if (PyErr_Occurred()) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Error converting Python object using converter\");";
|
if (PyErr_Occurred()) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Error converting Python object using converter\");";
|
||||||
%typemap(outv) type &OUTV = type
|
%typemap(directorout) type &DIRECTOROUT = type
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
OUTV_TYPEMAP(char, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(char, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(unsigned char, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(unsigned char, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(short, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(short, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(unsigned short, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(unsigned short, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(int, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(int, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(unsigned int, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(unsigned int, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(long, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(long, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(unsigned long, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(unsigned long, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(long long, PyLong_AsLongLong);
|
DIRECTOROUT_TYPEMAP(long long, PyLong_AsLongLong);
|
||||||
OUTV_TYPEMAP(unsigned long long, PyLong_AsUnsignedLongLong);
|
DIRECTOROUT_TYPEMAP(unsigned long long, PyLong_AsUnsignedLongLong);
|
||||||
OUTV_TYPEMAP(float, PyFloat_AsDouble);
|
DIRECTOROUT_TYPEMAP(float, PyFloat_AsDouble);
|
||||||
OUTV_TYPEMAP(double, PyFloat_AsDouble);
|
DIRECTOROUT_TYPEMAP(double, PyFloat_AsDouble);
|
||||||
OUTV_TYPEMAP(bool, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(bool, PyInt_AsLong);
|
||||||
OUTV_TYPEMAP(PyObject *, );
|
DIRECTOROUT_TYPEMAP(PyObject *, );
|
||||||
OUTV_TYPEMAP(char *, PyString_AsString);
|
DIRECTOROUT_TYPEMAP(char *, PyString_AsString);
|
||||||
OUTV_TYPEMAP(std::size_t, PyInt_AsLong);
|
DIRECTOROUT_TYPEMAP(std::size_t, PyInt_AsLong);
|
||||||
|
|
||||||
/* Object returned by value. Convert from a pointer */
|
/* Object returned by value. Convert from a pointer */
|
||||||
%typemap(outv) SWIGTYPE ($<ype argp)
|
%typemap(directorout) SWIGTYPE ($<ype argp)
|
||||||
"if ((SWIG_ConvertPtr($input,(void **) &argp, $&descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\"); $result = *argp;";
|
"if ((SWIG_ConvertPtr($input,(void **) &argp, $&descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\"); $result = *argp;";
|
||||||
|
|
||||||
%typemap(outv) SWIGTYPE *,
|
%typemap(directorout) SWIGTYPE *,
|
||||||
SWIGTYPE &,
|
SWIGTYPE &,
|
||||||
SWIGTYPE []
|
SWIGTYPE []
|
||||||
"if ((SWIG_ConvertPtr($input,(void **) &$result, $descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
"if ((SWIG_ConvertPtr($input,(void **) &$result, $descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
||||||
|
|
||||||
%typemap(outv) void * "if ((SWIG_ConvertPtr($input,(void **) &$result, 0, SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
%typemap(directorout) void * "if ((SWIG_ConvertPtr($input,(void **) &$result, 0, SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,22 +67,22 @@ SwigComplex_AsComplexDouble(PyObject *o)
|
||||||
|
|
||||||
// C++ proxy class typemaps
|
// C++ proxy class typemaps
|
||||||
|
|
||||||
%typemap(inv) Complex {
|
%typemap(directorin) Complex {
|
||||||
$input = PyComplex_FromDoubles($1_name.real(), $1_name.imag());
|
$input = PyComplex_FromDoubles($1_name.real(), $1_name.imag());
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv) const Complex & {
|
%typemap(directorin) const Complex & {
|
||||||
$input = PyComplex_FromDoubles($1_name.real(), $1_name.imag());
|
$input = PyComplex_FromDoubles($1_name.real(), $1_name.imag());
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(outv) Complex {
|
%typemap(directorout) Complex {
|
||||||
$result = SwigComplex_As< Complex >($input);
|
$result = SwigComplex_As< Complex >($input);
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("Expecting a complex or compatible type");
|
throw SWIG_DIRECTOR_TYPE_MISMATCH("Expecting a complex or compatible type");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(outv) const complex<T>& (Complex temp) {
|
%typemap(directorout) const complex<T>& (Complex temp) {
|
||||||
temp = SwigComplex_As< Complex >($input);
|
temp = SwigComplex_As< Complex >($input);
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("Expecting a complex or compatible type");
|
throw SWIG_DIRECTOR_TYPE_MISMATCH("Expecting a complex or compatible type");
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,11 @@ namespace std {
|
||||||
$result = PyString_FromStringAndSize($1->data(),$1->size());
|
$result = PyString_FromStringAndSize($1->data(),$1->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv, parse="s") string, const string &, string & "$1_name.c_str()";
|
%typemap(directorin, parse="s") string, const string &, string & "$1_name.c_str()";
|
||||||
|
|
||||||
%typemap(inv, parse="s") string *, const string * "$1_name->c_str()";
|
%typemap(directorin, parse="s") string *, const string * "$1_name->c_str()";
|
||||||
|
|
||||||
%typemap(outv) string {
|
%typemap(directorout) string {
|
||||||
if (PyString_Check($input))
|
if (PyString_Check($input))
|
||||||
$result = std::string(PyString_AsString($input),
|
$result = std::string(PyString_AsString($input),
|
||||||
PyString_Size($input));
|
PyString_Size($input));
|
||||||
|
|
@ -65,7 +65,7 @@ namespace std {
|
||||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(outv) const string & (std::string temp) {
|
%typemap(directorout) const string & (std::string temp) {
|
||||||
if (PyString_Check($input)) {
|
if (PyString_Check($input)) {
|
||||||
temp = std::string(PyString_AsString($input),
|
temp = std::string(PyString_AsString($input),
|
||||||
PyString_Size($input));
|
PyString_Size($input));
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ namespace std {
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(outv) vector<T> (std::vector<T>* v) {
|
%typemap(directorout) vector<T> (std::vector<T>* v) {
|
||||||
if (PyTuple_Check($input) || PyList_Check($input)) {
|
if (PyTuple_Check($input) || PyList_Check($input)) {
|
||||||
unsigned int size = (PyTuple_Check($input) ?
|
unsigned int size = (PyTuple_Check($input) ?
|
||||||
PyTuple_Size($input) :
|
PyTuple_Size($input) :
|
||||||
|
|
@ -164,7 +164,7 @@ namespace std {
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(outv) const vector<T>& (std::vector<T> temp,
|
%typemap(directorout) const vector<T>& (std::vector<T> temp,
|
||||||
std::vector<T>* v),
|
std::vector<T>* v),
|
||||||
const vector<T>* (std::vector<T> temp,
|
const vector<T>* (std::vector<T> temp,
|
||||||
std::vector<T>* v) {
|
std::vector<T>* v) {
|
||||||
|
|
@ -202,7 +202,7 @@ namespace std {
|
||||||
$descriptor(T *), 1));
|
$descriptor(T *), 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(inv) vector<T> {
|
%typemap(directorin) vector<T> {
|
||||||
$input = PyTuple_New($1_name.size());
|
$input = PyTuple_New($1_name.size());
|
||||||
for (unsigned int i=0; i<$1_name.size(); i++) {
|
for (unsigned int i=0; i<$1_name.size(); i++) {
|
||||||
T* ptr = new T((($1_type &)$1_name)[i]);
|
T* ptr = new T((($1_type &)$1_name)[i]);
|
||||||
|
|
@ -388,7 +388,7 @@ namespace std {
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(outv) vector<T*> (std::vector<T*>* v) {
|
%typemap(directorout) vector<T*> (std::vector<T*>* v) {
|
||||||
if (PyTuple_Check($input) || PyList_Check($input)) {
|
if (PyTuple_Check($input) || PyList_Check($input)) {
|
||||||
unsigned int size = (PyTuple_Check($input) ?
|
unsigned int size = (PyTuple_Check($input) ?
|
||||||
PyTuple_Size($input) :
|
PyTuple_Size($input) :
|
||||||
|
|
@ -445,7 +445,7 @@ namespace std {
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(outv) const vector<T *>& (std::vector<T *> temp,
|
%typemap(directorout) const vector<T *>& (std::vector<T *> temp,
|
||||||
std::vector<T *>* v),
|
std::vector<T *>* v),
|
||||||
const vector<T *>* (std::vector<T *> temp,
|
const vector<T *>* (std::vector<T *> temp,
|
||||||
std::vector<T *>* v) {
|
std::vector<T *>* v) {
|
||||||
|
|
@ -483,7 +483,7 @@ namespace std {
|
||||||
$descriptor(T*), 0));
|
$descriptor(T*), 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(inv) vector<T*> {
|
%typemap(directorin) vector<T*> {
|
||||||
$input = PyTuple_New($1_name.size());
|
$input = PyTuple_New($1_name.size());
|
||||||
for (unsigned int i=0; i<$1_name.size(); i++) {
|
for (unsigned int i=0; i<$1_name.size(); i++) {
|
||||||
T *ptr = (($1_type &)$1_name)[i];
|
T *ptr = (($1_type &)$1_name)[i];
|
||||||
|
|
@ -665,7 +665,7 @@ namespace std {
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(outv) vector<T> (std::vector<T>* v) {
|
%typemap(directorout) vector<T> (std::vector<T>* v) {
|
||||||
if (PyTuple_Check($input) || PyList_Check($input)) {
|
if (PyTuple_Check($input) || PyList_Check($input)) {
|
||||||
unsigned int size = (PyTuple_Check($input) ?
|
unsigned int size = (PyTuple_Check($input) ?
|
||||||
PyTuple_Size($input) :
|
PyTuple_Size($input) :
|
||||||
|
|
@ -718,7 +718,7 @@ namespace std {
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(outv) const vector<T>& (std::vector<T> temp,
|
%typemap(directorout) const vector<T>& (std::vector<T> temp,
|
||||||
std::vector<T>* v),
|
std::vector<T>* v),
|
||||||
const vector<T>* (std::vector<T> temp,
|
const vector<T>* (std::vector<T> temp,
|
||||||
std::vector<T>* v) {
|
std::vector<T>* v) {
|
||||||
|
|
@ -751,7 +751,7 @@ namespace std {
|
||||||
PyTuple_SetItem($result,i,
|
PyTuple_SetItem($result,i,
|
||||||
CONVERT_TO((($1_type &)$1)[i]));
|
CONVERT_TO((($1_type &)$1)[i]));
|
||||||
}
|
}
|
||||||
%typemap(inv) vector<T> {
|
%typemap(directorin) vector<T> {
|
||||||
$input = PyTuple_New($1_name.size());
|
$input = PyTuple_New($1_name.size());
|
||||||
for (unsigned int i=0; i<$1_name.size(); i++)
|
for (unsigned int i=0; i<$1_name.size(); i++)
|
||||||
PyTuple_SetItem($input,i,
|
PyTuple_SetItem($input,i,
|
||||||
|
|
|
||||||
|
|
@ -392,28 +392,28 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/* --- Inverse arguments --- */
|
/* directorin typemaps */
|
||||||
|
|
||||||
/* Primitive datatypes */
|
/* Primitive datatypes */
|
||||||
|
|
||||||
%typemap(inv) int "$input = INT2NUM($1);";
|
%typemap(directorin) int "$input = INT2NUM($1);";
|
||||||
%typemap(inv) short "$input = INT2NUM($1);";
|
%typemap(directorin) short "$input = INT2NUM($1);";
|
||||||
%typemap(inv) long "$input = LONG2NUM($1);";
|
%typemap(directorin) long "$input = LONG2NUM($1);";
|
||||||
%typemap(inv) signed char "$input = INT2NUM($1);";
|
%typemap(directorin) signed char "$input = INT2NUM($1);";
|
||||||
%typemap(inv) float "$input = rb_float_new($1);";
|
%typemap(directorin) float "$input = rb_float_new($1);";
|
||||||
%typemap(inv) double "$input = rb_float_new($1);";
|
%typemap(directorin) double "$input = rb_float_new($1);";
|
||||||
%typemap(inv) char* "$input = rb_str_new2($1);";
|
%typemap(directorin) char* "$input = rb_str_new2($1);";
|
||||||
%typemap(inv) bool "$input = $1 ? Qtrue : Qfalse;";
|
%typemap(directorin) bool "$input = $1 ? Qtrue : Qfalse;";
|
||||||
|
|
||||||
%typemap(inv) unsigned int "$input = UINT2NUM($1);";
|
%typemap(directorin) unsigned int "$input = UINT2NUM($1);";
|
||||||
%typemap(inv) unsigned short "$input = UINT2NUM($1);";
|
%typemap(directorin) unsigned short "$input = UINT2NUM($1);";
|
||||||
%typemap(inv) unsigned long "$input = ULONG2NUM($1);";
|
%typemap(directorin) unsigned long "$input = ULONG2NUM($1);";
|
||||||
%typemap(inv) unsigned char "$input = UINT2NUM($1);";
|
%typemap(directorin) unsigned char "$input = UINT2NUM($1);";
|
||||||
|
|
||||||
%typemap(inv) VALUE "$input = $1;";
|
%typemap(directorin) VALUE "$input = $1;";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
%typemap(inv, parse="s") SWIGTYPE {
|
%typemap(directorin, parse="s") SWIGTYPE {
|
||||||
{
|
{
|
||||||
$&1_ltype resultptr;
|
$&1_ltype resultptr;
|
||||||
resultptr = new $1_ltype(($1_ltype &) $1);
|
resultptr = new $1_ltype(($1_ltype &) $1);
|
||||||
|
|
@ -423,7 +423,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* no can do... see python.cxx
|
/* no can do... see python.cxx
|
||||||
%typemap(inv) DIRECTORTYPE * {
|
%typemap(directorin) DIRECTORTYPE * {
|
||||||
{
|
{
|
||||||
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
|
|
@ -433,50 +433,50 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(inv) SWIGTYPE * {
|
%typemap(directorin) SWIGTYPE * {
|
||||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
%typemap(inv, parse="s") void "0";
|
%typemap(directorin, parse="s") void "0";
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
%typemap(inv) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
%typemap(directorin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* --- Outverse arguments --- */
|
/* --- directorout typemaps --- */
|
||||||
|
|
||||||
%define OUTV_TYPEMAP(type, converter)
|
%define DIRECTOROUT_TYPEMAP(type, converter)
|
||||||
%typemap(argoutv) type *OUTV "*$result = (type) converter($input);";
|
%typemap(directorargout) type *DIRECTOROUT "*$result = (type) converter($input);";
|
||||||
%typemap(outv) type "$result = (type) converter($input);";
|
%typemap(directorout) type "$result = (type) converter($input);";
|
||||||
%typemap(outv) type &OUTV = type
|
%typemap(directorout) type &DIRECTOROUT = type
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
OUTV_TYPEMAP(char, NUM2INT);
|
DIRECTOROUT_TYPEMAP(char, NUM2INT);
|
||||||
OUTV_TYPEMAP(unsigned char, NUM2UINT);
|
DIRECTOROUT_TYPEMAP(unsigned char, NUM2UINT);
|
||||||
OUTV_TYPEMAP(short, NUM2INT);
|
DIRECTOROUT_TYPEMAP(short, NUM2INT);
|
||||||
OUTV_TYPEMAP(unsigned short, NUM2INT);
|
DIRECTOROUT_TYPEMAP(unsigned short, NUM2INT);
|
||||||
OUTV_TYPEMAP(int, NUM2INT);
|
DIRECTOROUT_TYPEMAP(int, NUM2INT);
|
||||||
OUTV_TYPEMAP(unsigned int, NUM2INT);
|
DIRECTOROUT_TYPEMAP(unsigned int, NUM2INT);
|
||||||
OUTV_TYPEMAP(long, NUM2INT);
|
DIRECTOROUT_TYPEMAP(long, NUM2INT);
|
||||||
OUTV_TYPEMAP(unsigned long, NUM2INT);
|
DIRECTOROUT_TYPEMAP(unsigned long, NUM2INT);
|
||||||
OUTV_TYPEMAP(long long, NUM2INT);
|
DIRECTOROUT_TYPEMAP(long long, NUM2INT);
|
||||||
OUTV_TYPEMAP(unsigned long long, NUM2INT);
|
DIRECTOROUT_TYPEMAP(unsigned long long, NUM2INT);
|
||||||
OUTV_TYPEMAP(float, NUM2DBL);
|
DIRECTOROUT_TYPEMAP(float, NUM2DBL);
|
||||||
OUTV_TYPEMAP(double, NUM2DBL);
|
DIRECTOROUT_TYPEMAP(double, NUM2DBL);
|
||||||
OUTV_TYPEMAP(bool, RTEST);
|
DIRECTOROUT_TYPEMAP(bool, RTEST);
|
||||||
|
|
||||||
|
|
||||||
%typemap(outv) SWIGTYPE *,
|
%typemap(directorout) SWIGTYPE *,
|
||||||
SWIGTYPE &,
|
SWIGTYPE &,
|
||||||
SWIGTYPE []
|
SWIGTYPE []
|
||||||
"if ((SWIG_ConvertPtr($input,(void **) &$result, $descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
"if ((SWIG_ConvertPtr($input,(void **) &$result, $descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
||||||
|
|
||||||
%typemap(outv) void * "if ((SWIG_ConvertPtr($input,(void **) &$result, 0, SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
%typemap(directorout) void * "if ((SWIG_ConvertPtr($input,(void **) &$result, 0, SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\");";
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------
|
/* ---------------------------------------------------------------------
|
||||||
* typedef & typemaps for VALUE (passed through unmodified and unchecked)
|
* typedef & typemaps for VALUE (passed through unmodified and unchecked)
|
||||||
|
|
|
||||||
|
|
@ -54,18 +54,18 @@ namespace std {
|
||||||
$result = rb_str_new2($1->c_str());
|
$result = rb_str_new2($1->c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(inv) string, const string &, string & "$1_name.c_str()";
|
%typemap(directorin) string, const string &, string & "$1_name.c_str()";
|
||||||
|
|
||||||
%typemap(inv) string *, const string * "$1_name->c_str()";
|
%typemap(directorin) string *, const string * "$1_name->c_str()";
|
||||||
|
|
||||||
%typemap(outv) string {
|
%typemap(directorout) string {
|
||||||
if (TYPE($input) == T_STRING)
|
if (TYPE($input) == T_STRING)
|
||||||
$result = std::string(StringValuePtr($input));
|
$result = std::string(StringValuePtr($input));
|
||||||
else
|
else
|
||||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(outv) const string & (std::string temp) {
|
%typemap(directorout) const string & (std::string temp) {
|
||||||
if (TYPE($input) == T_STRING) {
|
if (TYPE($input) == T_STRING) {
|
||||||
temp = std::string(StringValuePtr($input));
|
temp = std::string(StringValuePtr($input));
|
||||||
$result = &temp;
|
$result = &temp;
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
#define WARN_TYPEMAP_VAR_UNDEF 466
|
#define WARN_TYPEMAP_VAR_UNDEF 466
|
||||||
#define WARN_TYPEMAP_TYPECHECK 467
|
#define WARN_TYPEMAP_TYPECHECK 467
|
||||||
#define WARN_TYPEMAP_THROW 468
|
#define WARN_TYPEMAP_THROW 468
|
||||||
#define WARN_TYPEMAP_INV_UNDEF 469
|
#define WARN_TYPEMAP_DIRECTORIN_UNDEF 469
|
||||||
|
|
||||||
/* -- General code generation -- */
|
/* -- General code generation -- */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -781,7 +781,7 @@ class JAVA : public Language {
|
||||||
Swig_typemap_attach_parms("jni", l, f);
|
Swig_typemap_attach_parms("jni", l, f);
|
||||||
Swig_typemap_attach_parms("jtype", l, f);
|
Swig_typemap_attach_parms("jtype", l, f);
|
||||||
if (director_method) {
|
if (director_method) {
|
||||||
Setattr(n, "tmap:inv", Swig_typemap_lookup_new("inv", n, "", 0));
|
Setattr(n, "tmap:directorin", Swig_typemap_lookup_new("directorin", n, "", 0));
|
||||||
Swig_typemap_attach_parms("javadirectorin", l, 0);
|
Swig_typemap_attach_parms("javadirectorin", l, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1037,7 +1037,7 @@ class JAVA : public Language {
|
||||||
|
|
||||||
Printf(f->code, "} else {\n");
|
Printf(f->code, "} else {\n");
|
||||||
|
|
||||||
if ((tm= Getattr(n, "tmap:inv")) != NULL && (jdescrip = Getattr(n, "tmap:inv:parse")) != NULL) {
|
if ((tm= Getattr(n, "tmap:directorin")) != NULL && (jdescrip = Getattr(n, "tmap:directorin:parse")) != NULL) {
|
||||||
String *jni_canon = canonicalJNIFDesc(jdescrip, n, proxy_class_name);
|
String *jni_canon = canonicalJNIFDesc(jdescrip, n, proxy_class_name);
|
||||||
|
|
||||||
Delete(jdescrip);
|
Delete(jdescrip);
|
||||||
|
|
@ -1087,8 +1087,8 @@ class JAVA : public Language {
|
||||||
|
|
||||||
Delete(jdescrip);
|
Delete(jdescrip);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"No or improper inv typemap defined for %s\n", c_return_type);
|
"No or improper directorin typemap defined for %s\n", c_return_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
Printf(f->code, " }\n");
|
Printf(f->code, " }\n");
|
||||||
|
|
@ -2690,7 +2690,7 @@ class JAVA : public Language {
|
||||||
Swig_typemap_attach_parms("out", l, w);
|
Swig_typemap_attach_parms("out", l, w);
|
||||||
Swig_typemap_attach_parms("jni", l, w);
|
Swig_typemap_attach_parms("jni", l, w);
|
||||||
Swig_typemap_attach_parms("jtype", l, w);
|
Swig_typemap_attach_parms("jtype", l, w);
|
||||||
Swig_typemap_attach_parms("inv", l, 0);
|
Swig_typemap_attach_parms("directorin", l, 0);
|
||||||
Swig_typemap_attach_parms("javadirectorin", l, 0);
|
Swig_typemap_attach_parms("javadirectorin", l, 0);
|
||||||
|
|
||||||
/* Get the JNI field descriptor for this return type */
|
/* Get the JNI field descriptor for this return type */
|
||||||
|
|
@ -2706,16 +2706,16 @@ class JAVA : public Language {
|
||||||
Delete(jretval_decl);
|
Delete(jretval_decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tm = Swig_typemap_lookup_new("inv", tp, "", 0)) != NULL
|
if ((tm = Swig_typemap_lookup_new("directorin", tp, "", 0)) != NULL
|
||||||
&& (jdesc = Getattr(tp, "tmap:inv:parse")) != NULL) {
|
&& (jdesc = Getattr(tp, "tmap:directorin:parse")) != NULL) {
|
||||||
String *jnidesc_canon;
|
String *jnidesc_canon;
|
||||||
|
|
||||||
jnidesc_canon = canonicalJNIFDesc(jdesc, n, jniret_type);
|
jnidesc_canon = canonicalJNIFDesc(jdesc, n, jniret_type);
|
||||||
Append(jniret_desc, jnidesc_canon);
|
Append(jniret_desc, jnidesc_canon);
|
||||||
Delete(jnidesc_canon);
|
Delete(jnidesc_canon);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"No or improper inv typemap defined for %s\n", SwigType_str(jniret_type,0));
|
"No or improper directorin typemap defined for %s\n", SwigType_str(jniret_type,0));
|
||||||
output_director = false;
|
output_director = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2729,16 +2729,16 @@ class JAVA : public Language {
|
||||||
{
|
{
|
||||||
String *jdesc;
|
String *jdesc;
|
||||||
|
|
||||||
if ((tm = Swig_typemap_lookup_new("inv", retpm, "", 0)) != NULL
|
if ((tm = Swig_typemap_lookup_new("directorin", retpm, "", 0)) != NULL
|
||||||
&& (jdesc = Getattr(retpm, "tmap:inv:parse")) != NULL) {
|
&& (jdesc = Getattr(retpm, "tmap:directorin:parse")) != NULL) {
|
||||||
String *jnidesc_canon;
|
String *jnidesc_canon;
|
||||||
|
|
||||||
jnidesc_canon = canonicalJNIFDesc(jdesc, n, return_type);
|
jnidesc_canon = canonicalJNIFDesc(jdesc, n, return_type);
|
||||||
Append(classret_desc, jnidesc_canon);
|
Append(classret_desc, jnidesc_canon);
|
||||||
Delete(jnidesc_canon);
|
Delete(jnidesc_canon);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"No or improper inv typemap defined for %s\n", SwigType_str(jniret_type,0));
|
"No or improper directorin typemap defined for %s\n", SwigType_str(jniret_type,0));
|
||||||
output_director = false;
|
output_director = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2805,8 +2805,8 @@ class JAVA : public Language {
|
||||||
Parm *tp = NewParm(classname, empty_str);
|
Parm *tp = NewParm(classname, empty_str);
|
||||||
String *jdesc;
|
String *jdesc;
|
||||||
|
|
||||||
if ((tm = Swig_typemap_lookup_new("inv", tp, "", 0)) != NULL
|
if ((tm = Swig_typemap_lookup_new("directorin", tp, "", 0)) != NULL
|
||||||
&& (jdesc = Getattr(tp, "tmap:inv:parse")) != NULL) {
|
&& (jdesc = Getattr(tp, "tmap:directorin:parse")) != NULL) {
|
||||||
String *jni_canon;
|
String *jni_canon;
|
||||||
|
|
||||||
jni_canon = canonicalJNIFDesc(jdesc, n, classname);
|
jni_canon = canonicalJNIFDesc(jdesc, n, classname);
|
||||||
|
|
@ -2814,8 +2814,8 @@ class JAVA : public Language {
|
||||||
Delete(jni_canon);
|
Delete(jni_canon);
|
||||||
Delete(tm);
|
Delete(tm);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"No or improper inv typemap defined for %s\n", SwigType_str(classname, 0));
|
"No or improper directorin typemap defined for %s\n", SwigType_str(classname, 0));
|
||||||
output_director = false;
|
output_director = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2865,10 +2865,10 @@ class JAVA : public Language {
|
||||||
Wrapper_add_local(w, arg, c_decl);
|
Wrapper_add_local(w, arg, c_decl);
|
||||||
|
|
||||||
/* Add input marshalling code and update JNI field descriptor */
|
/* Add input marshalling code and update JNI field descriptor */
|
||||||
if ((desc_tm = Swig_typemap_lookup_new("inv", tp, "", 0)) != NULL
|
if ((desc_tm = Swig_typemap_lookup_new("directorin", tp, "", 0)) != NULL
|
||||||
&& (jdesc = Getattr(tp, "tmap:inv:parse")) != NULL) {
|
&& (jdesc = Getattr(tp, "tmap:directorin:parse")) != NULL) {
|
||||||
if ((tm = Getattr(p, "tmap:inv")) != NULL
|
if ((tm = Getattr(p, "tmap:directorin")) != NULL
|
||||||
&& (cdesc = Getattr(p, "tmap:inv:parse")) != NULL) {
|
&& (cdesc = Getattr(p, "tmap:directorin:parse")) != NULL) {
|
||||||
String *jni_canon;
|
String *jni_canon;
|
||||||
|
|
||||||
jni_canon = canonicalJNIFDesc(jdesc, n, c_param_type);
|
jni_canon = canonicalJNIFDesc(jdesc, n, c_param_type);
|
||||||
|
|
@ -2927,16 +2927,16 @@ class JAVA : public Language {
|
||||||
|
|
||||||
p = Getattr(p, "tmap:in:next");
|
p = Getattr(p, "tmap:in:next");
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"No or improper inv typemap defined for %s\n", SwigType_str(pt, 0));
|
"No or improper directorin typemap defined for %s\n", SwigType_str(pt, 0));
|
||||||
output_director = false;
|
output_director = false;
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
Delete(desc_tm);
|
Delete(desc_tm);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"No or improper inv typemap defined for %s\n", SwigType_str(c_param_type, 0));
|
"No or improper directorin typemap defined for %s\n", SwigType_str(c_param_type, 0));
|
||||||
output_director = false;
|
output_director = false;
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1555,9 +1555,9 @@ public:
|
||||||
String *arglist = NewString("");
|
String *arglist = NewString("");
|
||||||
|
|
||||||
Swig_typemap_attach_parms("in", l, w);
|
Swig_typemap_attach_parms("in", l, w);
|
||||||
Swig_typemap_attach_parms("inv", l, w);
|
Swig_typemap_attach_parms("directorin", l, w);
|
||||||
Swig_typemap_attach_parms("outv", l, w);
|
Swig_typemap_attach_parms("directorout", l, w);
|
||||||
Swig_typemap_attach_parms("argoutv", l, w);
|
Swig_typemap_attach_parms("directorargout", l, w);
|
||||||
|
|
||||||
Parm* p;
|
Parm* p;
|
||||||
int num_arguments = emit_num_arguments(l);
|
int num_arguments = emit_num_arguments(l);
|
||||||
|
|
@ -1575,18 +1575,18 @@ public:
|
||||||
p = Getattr(p, "tmap:ignore:next");
|
p = Getattr(p, "tmap:ignore:next");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Getattr(p, "tmap:argoutv") != 0) outputs++;
|
if (Getattr(p, "tmap:directorargout") != 0) outputs++;
|
||||||
|
|
||||||
String* pname = Getattr(p, "name");
|
String* pname = Getattr(p, "name");
|
||||||
String* ptype = Getattr(p, "type");
|
String* ptype = Getattr(p, "type");
|
||||||
|
|
||||||
Putc(',',arglist);
|
Putc(',',arglist);
|
||||||
if ((tm = Getattr(p, "tmap:inv")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||||
Replaceall(tm, "$input", pname);
|
Replaceall(tm, "$input", pname);
|
||||||
Replaceall(tm, "$owner", "0");
|
Replaceall(tm, "$owner", "0");
|
||||||
if (Len(tm) == 0) Append(tm, pname);
|
if (Len(tm) == 0) Append(tm, pname);
|
||||||
Printv(wrap_args, tm, "\n", NIL);
|
Printv(wrap_args, tm, "\n", NIL);
|
||||||
p = Getattr(p, "tmap:inv:next");
|
p = Getattr(p, "tmap:directorin:next");
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
if (Cmp(ptype, "void")) {
|
if (Cmp(ptype, "void")) {
|
||||||
|
|
@ -1648,7 +1648,7 @@ public:
|
||||||
Delete(mangle);
|
Delete(mangle);
|
||||||
Delete(nonconst);
|
Delete(nonconst);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(ptype, 0), classname, name);
|
"Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(ptype, 0), classname, name);
|
||||||
status = SWIG_NOWRAP;
|
status = SWIG_NOWRAP;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1725,11 +1725,11 @@ public:
|
||||||
* occurs in Language::cDeclaration().
|
* occurs in Language::cDeclaration().
|
||||||
*/
|
*/
|
||||||
Setattr(n, "type", return_type);
|
Setattr(n, "type", return_type);
|
||||||
tm = Swig_typemap_lookup_new("outv", n, "c_result", w);
|
tm = Swig_typemap_lookup_new("directorout", n, "c_result", w);
|
||||||
Setattr(n, "type", type);
|
Setattr(n, "type", type);
|
||||||
if (tm == 0) {
|
if (tm == 0) {
|
||||||
String *name = NewString("c_result");
|
String *name = NewString("c_result");
|
||||||
tm = Swig_typemap_search("outv", return_type, name, NULL);
|
tm = Swig_typemap_search("directorout", return_type, name, NULL);
|
||||||
Delete(name);
|
Delete(name);
|
||||||
}
|
}
|
||||||
if (tm != 0) {
|
if (tm != 0) {
|
||||||
|
|
@ -1751,11 +1751,11 @@ public:
|
||||||
|
|
||||||
/* marshal outputs */
|
/* marshal outputs */
|
||||||
for (p = l; p; ) {
|
for (p = l; p; ) {
|
||||||
if ((tm = Getattr(p, "tmap:argoutv")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorargout")) != 0) {
|
||||||
Replaceall(tm, "$input", "swig_result");
|
Replaceall(tm, "$input", "swig_result");
|
||||||
Replaceall(tm, "$result", Getattr(p, "name"));
|
Replaceall(tm, "$result", Getattr(p, "name"));
|
||||||
Printv(w->code, tm, "\n", NIL);
|
Printv(w->code, tm, "\n", NIL);
|
||||||
p = Getattr(p, "tmap:argoutv:next");
|
p = Getattr(p, "tmap:directorargout:next");
|
||||||
} else {
|
} else {
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1320,9 +1320,9 @@ public:
|
||||||
String* parse_args = NewString("");
|
String* parse_args = NewString("");
|
||||||
|
|
||||||
Swig_typemap_attach_parms("in", l, w);
|
Swig_typemap_attach_parms("in", l, w);
|
||||||
Swig_typemap_attach_parms("inv", l, w);
|
Swig_typemap_attach_parms("directorin", l, w);
|
||||||
Swig_typemap_attach_parms("outv", l, w);
|
Swig_typemap_attach_parms("directorout", l, w);
|
||||||
Swig_typemap_attach_parms("argoutv", l, w);
|
Swig_typemap_attach_parms("directorargout", l, w);
|
||||||
|
|
||||||
Parm* p;
|
Parm* p;
|
||||||
int num_arguments = emit_num_arguments(l);
|
int num_arguments = emit_num_arguments(l);
|
||||||
|
|
@ -1349,14 +1349,14 @@ public:
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (Getattr(p, "tmap:argoutv") != 0) outputs++;
|
if (Getattr(p, "tmap:directorargout") != 0) outputs++;
|
||||||
|
|
||||||
String* pname = Getattr(p, "name");
|
String* pname = Getattr(p, "name");
|
||||||
String* ptype = Getattr(p, "type");
|
String* ptype = Getattr(p, "type");
|
||||||
|
|
||||||
Putc(',',arglist);
|
Putc(',',arglist);
|
||||||
if ((tm = Getattr(p, "tmap:inv")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||||
String* parse = Getattr(p, "tmap:inv:parse");
|
String* parse = Getattr(p, "tmap:directorin:parse");
|
||||||
if (!parse) {
|
if (!parse) {
|
||||||
sprintf(source, "obj%d", idx++);
|
sprintf(source, "obj%d", idx++);
|
||||||
Replaceall(tm, "$input", source);
|
Replaceall(tm, "$input", source);
|
||||||
|
|
@ -1372,7 +1372,7 @@ public:
|
||||||
if (Len(tm) == 0) Append(tm, pname);
|
if (Len(tm) == 0) Append(tm, pname);
|
||||||
Printf(arglist, "%s", tm);
|
Printf(arglist, "%s", tm);
|
||||||
}
|
}
|
||||||
p = Getattr(p, "tmap:inv:next");
|
p = Getattr(p, "tmap:directorin:next");
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
if (Cmp(ptype, "void")) {
|
if (Cmp(ptype, "void")) {
|
||||||
|
|
@ -1436,7 +1436,7 @@ public:
|
||||||
Delete(mangle);
|
Delete(mangle);
|
||||||
Delete(nonconst);
|
Delete(nonconst);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(ptype, 0), classname, name);
|
"Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(ptype, 0), classname, name);
|
||||||
status = SWIG_NOWRAP;
|
status = SWIG_NOWRAP;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1523,11 +1523,11 @@ public:
|
||||||
* it's not just me, similar silliness also occurs in Language::cDeclaration().
|
* it's not just me, similar silliness also occurs in Language::cDeclaration().
|
||||||
*/
|
*/
|
||||||
Setattr(n, "type", return_type);
|
Setattr(n, "type", return_type);
|
||||||
tm = Swig_typemap_lookup_new("outv", n, "result", w);
|
tm = Swig_typemap_lookup_new("directorout", n, "result", w);
|
||||||
Setattr(n, "type", type);
|
Setattr(n, "type", type);
|
||||||
if (tm == 0) {
|
if (tm == 0) {
|
||||||
String *name = NewString("result");
|
String *name = NewString("result");
|
||||||
tm = Swig_typemap_search("outv", return_type, name, NULL);
|
tm = Swig_typemap_search("directorout", return_type, name, NULL);
|
||||||
Delete(name);
|
Delete(name);
|
||||||
}
|
}
|
||||||
if (tm != 0) {
|
if (tm != 0) {
|
||||||
|
|
@ -1554,7 +1554,7 @@ public:
|
||||||
|
|
||||||
/* marshal outputs */
|
/* marshal outputs */
|
||||||
for (p = l; p; ) {
|
for (p = l; p; ) {
|
||||||
if ((tm = Getattr(p, "tmap:argoutv")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorargout")) != 0) {
|
||||||
if (outputs > 1) {
|
if (outputs > 1) {
|
||||||
Printf(w->code, "output = PyTuple_GetItem(result, %d);\n", idx++);
|
Printf(w->code, "output = PyTuple_GetItem(result, %d);\n", idx++);
|
||||||
Replaceall(tm, "$input", "output");
|
Replaceall(tm, "$input", "output");
|
||||||
|
|
@ -1563,7 +1563,7 @@ public:
|
||||||
}
|
}
|
||||||
Replaceall(tm, "$result", Getattr(p, "name"));
|
Replaceall(tm, "$result", Getattr(p, "name"));
|
||||||
Printv(w->code, tm, "\n", NIL);
|
Printv(w->code, tm, "\n", NIL);
|
||||||
p = Getattr(p, "tmap:argoutv:next");
|
p = Getattr(p, "tmap:directorargout:next");
|
||||||
} else {
|
} else {
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2295,15 +2295,15 @@ public:
|
||||||
/**
|
/**
|
||||||
* For each parameter to the C++ member function, copy the parameter name
|
* For each parameter to the C++ member function, copy the parameter name
|
||||||
* to its "lname"; this ensures that Swig_typemap_attach_parms() will do
|
* to its "lname"; this ensures that Swig_typemap_attach_parms() will do
|
||||||
* the right thing when it sees strings like "$1" in your "inv" typemaps.
|
* the right thing when it sees strings like "$1" in your "directorin" typemaps.
|
||||||
* Not sure if it's OK to leave it like this, but seems OK so far.
|
* Not sure if it's OK to leave it like this, but seems OK so far.
|
||||||
*/
|
*/
|
||||||
Swig_typemap_copy_pname_to_lname(l);
|
Swig_typemap_copy_pname_to_lname(l);
|
||||||
|
|
||||||
Swig_typemap_attach_parms("in", l, w);
|
Swig_typemap_attach_parms("in", l, w);
|
||||||
Swig_typemap_attach_parms("inv", l, w);
|
Swig_typemap_attach_parms("directorin", l, w);
|
||||||
Swig_typemap_attach_parms("outv", l, w);
|
Swig_typemap_attach_parms("directorout", l, w);
|
||||||
Swig_typemap_attach_parms("argoutv", l, w);
|
Swig_typemap_attach_parms("directorargout", l, w);
|
||||||
|
|
||||||
int num_arguments = emit_num_arguments(l);
|
int num_arguments = emit_num_arguments(l);
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -2320,20 +2320,20 @@ public:
|
||||||
p = Getattr(p, "tmap:ignore:next");
|
p = Getattr(p, "tmap:ignore:next");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Getattr(p, "tmap:argoutv") != 0) outputs++;
|
if (Getattr(p, "tmap:directorargout") != 0) outputs++;
|
||||||
|
|
||||||
String* parameterName = Getattr(p, "name");
|
String* parameterName = Getattr(p, "name");
|
||||||
String* parameterType = Getattr(p, "type");
|
String* parameterType = Getattr(p, "type");
|
||||||
|
|
||||||
Putc(',',arglist);
|
Putc(',',arglist);
|
||||||
if ((tm = Getattr(p, "tmap:inv")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||||
sprintf(source, "obj%d", idx++);
|
sprintf(source, "obj%d", idx++);
|
||||||
Replaceall(tm, "$input", source);
|
Replaceall(tm, "$input", source);
|
||||||
Replaceall(tm, "$owner", "0");
|
Replaceall(tm, "$owner", "0");
|
||||||
Printv(wrap_args, tm, "\n", NIL);
|
Printv(wrap_args, tm, "\n", NIL);
|
||||||
Wrapper_add_localv(w, source, "VALUE", source, "= Qnil", NIL);
|
Wrapper_add_localv(w, source, "VALUE", source, "= Qnil", NIL);
|
||||||
Printv(arglist, source, NIL);
|
Printv(arglist, source, NIL);
|
||||||
p = Getattr(p, "tmap:inv:next");
|
p = Getattr(p, "tmap:directorin:next");
|
||||||
continue;
|
continue;
|
||||||
} else if (Cmp(parameterType, "void")) {
|
} else if (Cmp(parameterType, "void")) {
|
||||||
/**
|
/**
|
||||||
|
|
@ -2395,7 +2395,7 @@ public:
|
||||||
Delete(mangle);
|
Delete(mangle);
|
||||||
Delete(nonconst);
|
Delete(nonconst);
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||||
"Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(parameterType, 0), classname, name);
|
"Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(parameterType, 0), classname, name);
|
||||||
status = SWIG_NOWRAP;
|
status = SWIG_NOWRAP;
|
||||||
break;
|
break;
|
||||||
|
|
@ -2462,11 +2462,11 @@ public:
|
||||||
* It's not just me, similar silliness also occurs in Language::cDeclaration().
|
* It's not just me, similar silliness also occurs in Language::cDeclaration().
|
||||||
*/
|
*/
|
||||||
Setattr(n, "type", return_type);
|
Setattr(n, "type", return_type);
|
||||||
tm = Swig_typemap_lookup_new("outv", n, "result", w);
|
tm = Swig_typemap_lookup_new("directorout", n, "result", w);
|
||||||
Setattr(n, "type", type);
|
Setattr(n, "type", type);
|
||||||
if (tm == 0) {
|
if (tm == 0) {
|
||||||
String *name = NewString("result");
|
String *name = NewString("result");
|
||||||
tm = Swig_typemap_search("outv", return_type, name, NULL);
|
tm = Swig_typemap_search("directorout", return_type, name, NULL);
|
||||||
Delete(name);
|
Delete(name);
|
||||||
}
|
}
|
||||||
if (tm != 0) {
|
if (tm != 0) {
|
||||||
|
|
@ -2493,7 +2493,7 @@ public:
|
||||||
|
|
||||||
/* Marshal outputs */
|
/* Marshal outputs */
|
||||||
for (p = l; p; ) {
|
for (p = l; p; ) {
|
||||||
if ((tm = Getattr(p, "tmap:argoutv")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorargout")) != 0) {
|
||||||
if (outputs > 1) {
|
if (outputs > 1) {
|
||||||
Printf(w->code, "output = rb_ary_entry(result, %d);\n", idx++);
|
Printf(w->code, "output = rb_ary_entry(result, %d);\n", idx++);
|
||||||
Replaceall(tm, "$input", "output");
|
Replaceall(tm, "$input", "output");
|
||||||
|
|
@ -2502,7 +2502,7 @@ public:
|
||||||
}
|
}
|
||||||
Replaceall(tm, "$result", Getattr(p, "name"));
|
Replaceall(tm, "$result", Getattr(p, "name"));
|
||||||
Printv(w->code, tm, "\n", NIL);
|
Printv(w->code, tm, "\n", NIL);
|
||||||
p = Getattr(p, "tmap:argoutv:next");
|
p = Getattr(p, "tmap:directorargout:next");
|
||||||
} else {
|
} else {
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue