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="#n67">Director-specific typemaps</a>
|
||||
<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="#n70">%typemap(javadirectorout)</a>
|
||||
</ul>
|
||||
|
|
@ -4159,21 +4159,21 @@ public class director_derived extends director_example
|
|||
|
||||
<p>
|
||||
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_dout"><code>%typemap(javadirectorout)</code></a> type maps in
|
||||
order to work properly.
|
||||
</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>
|
||||
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
|
||||
to Java. This typemap also specifies the JNI field descriptor for the
|
||||
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
|
||||
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
|
||||
|
|
@ -4183,7 +4183,7 @@ order to work properly.
|
|||
<p>
|
||||
A typemap for C character strings is:
|
||||
<br>
|
||||
<pre>%typemap(inv,parse="Ljava/lang/String;") char *
|
||||
<pre>%typemap(directorin,parse="Ljava/lang/String;") char *
|
||||
%{ $input = jenv->NewStringUTF($1); %}</pre>
|
||||
</p>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@
|
|||
<li><a href="#n25">Overriding Methods in Ocaml</a>
|
||||
<li><a href="#n26">Director Usage Example</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="#n29"><tt>inv</tt> typemap</a>
|
||||
<li><a href="#n30"><tt>outv</tt> typemap</a>
|
||||
<li><a href="#n31"><tt>argoutv</tt> typemap</a>
|
||||
<li><a href="#n28">Typemaps for directors, <tt>directorin, directorout, directorargout</tt></a>
|
||||
<li><a href="#n29"><tt>directorin</tt> typemap</a>
|
||||
<li><a href="#n30"><tt>directorout</tt> typemap</a>
|
||||
<li><a href="#n31"><tt>directorargout</tt> typemap</a>
|
||||
</ul>
|
||||
<li><a href="#n32">Exceptions</a>
|
||||
</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
|
||||
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>
|
||||
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
|
||||
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,
|
||||
and to receive arguments the same way you normally receive function returns.
|
||||
</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>
|
||||
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
|
||||
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.
|
||||
</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>
|
||||
The <tt>outv</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
|
||||
The <tt>directorout</tt> typemap is used when you will send an argument from your
|
||||
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
|
||||
for the same type, except when there are special requirements for object
|
||||
ownership, etc.
|
||||
</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>
|
||||
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.
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
values will read zero, and struct or object returns have undefined results.
|
||||
</p>
|
||||
|
|
@ -895,4 +895,4 @@ Catching exceptions is now supported using SWIG's %exception feature. A simple
|
|||
but not too useful example is provided by the throw_exception testcase in
|
||||
Examples/test-suite. You can provide your own exceptions, too.
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -2223,7 +2223,7 @@ Python.
|
|||
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
|
||||
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
|
||||
point which kinds are appropriate and need to be supported.
|
||||
<p>
|
||||
|
|
@ -3645,4 +3645,4 @@ class object (if applicable).
|
|||
|
||||
<address>SWIG 1.3 - Last Modified : August 7, 2002</address>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ JAVA_ARRAYS_IMPL(double, jdouble, Double, Double) /* double[] */
|
|||
if (!SWIG_JavaArrayIn##JFUNCNAME(jenv, &jarr, &$1, $input)) return $null; %}
|
||||
%typemap(argout) CTYPE[ANY]
|
||||
%{ 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); %}
|
||||
%typemap(out) CTYPE[ANY]
|
||||
%{$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, $1, $1_dim0); %}
|
||||
|
|
|
|||
|
|
@ -179,49 +179,49 @@
|
|||
enum SWIGTYPE
|
||||
%{ $1 = ($1_ltype)$input; %}
|
||||
|
||||
%typemap(inv, parse="Z") bool "$input = (jboolean) $1;"
|
||||
%typemap(inv, parse="C") char "$input = (jint) $1;"
|
||||
%typemap(inv, parse="B") signed char "$input = (jbyte) $1;"
|
||||
%typemap(inv, parse="S") unsigned char "$input = (jshort) $1;"
|
||||
%typemap(inv, parse="S") short "$input = (jshort) $1;"
|
||||
%typemap(inv, parse="I") unsigned short "$input = (jint) $1;"
|
||||
%typemap(inv, parse="I") int "$input = (jint) $1;"
|
||||
%typemap(inv, parse="J") unsigned int "$input = (jlong) $1;"
|
||||
%typemap(inv, parse="I") long "$input = (jint) $1;"
|
||||
%typemap(inv, parse="J") unsigned long "$input = (jlong) $1;"
|
||||
%typemap(inv, parse="J") long long "$input = (jlong) $1;"
|
||||
%typemap(inv, parse="F") float "$input = (jfloat) $1;"
|
||||
%typemap(inv, parse="D") double "$input = (jdouble) $1;"
|
||||
%typemap(inv, parse="I") enum SWIGTYPE "$input = (jint) $1;"
|
||||
%typemap(directorin, parse="Z") bool "$input = (jboolean) $1;"
|
||||
%typemap(directorin, parse="C") char "$input = (jint) $1;"
|
||||
%typemap(directorin, parse="B") signed char "$input = (jbyte) $1;"
|
||||
%typemap(directorin, parse="S") unsigned char "$input = (jshort) $1;"
|
||||
%typemap(directorin, parse="S") short "$input = (jshort) $1;"
|
||||
%typemap(directorin, parse="I") unsigned short "$input = (jint) $1;"
|
||||
%typemap(directorin, parse="I") int "$input = (jint) $1;"
|
||||
%typemap(directorin, parse="J") unsigned int "$input = (jlong) $1;"
|
||||
%typemap(directorin, parse="I") long "$input = (jint) $1;"
|
||||
%typemap(directorin, parse="J") unsigned long "$input = (jlong) $1;"
|
||||
%typemap(directorin, parse="J") long long "$input = (jlong) $1;"
|
||||
%typemap(directorin, parse="F") float "$input = (jfloat) $1;"
|
||||
%typemap(directorin, parse="D") double "$input = (jdouble) $1;"
|
||||
%typemap(directorin, parse="I") enum SWIGTYPE "$input = (jint) $1;"
|
||||
|
||||
%typemap(javadirectorin) char,
|
||||
signed char,
|
||||
unsigned char,
|
||||
short,
|
||||
unsigned short,
|
||||
int,
|
||||
unsigned int,
|
||||
long,
|
||||
unsigned long,
|
||||
long long,
|
||||
float,
|
||||
double,
|
||||
enum SWIGTYPE
|
||||
signed char,
|
||||
unsigned char,
|
||||
short,
|
||||
unsigned short,
|
||||
int,
|
||||
unsigned int,
|
||||
long,
|
||||
unsigned long,
|
||||
long long,
|
||||
float,
|
||||
double,
|
||||
enum SWIGTYPE
|
||||
"$jniinput"
|
||||
|
||||
%typemap(javadirectorout) char,
|
||||
signed char,
|
||||
unsigned char,
|
||||
short,
|
||||
unsigned short,
|
||||
int,
|
||||
unsigned int,
|
||||
long,
|
||||
unsigned long,
|
||||
long long,
|
||||
float,
|
||||
double,
|
||||
enum SWIGTYPE
|
||||
signed char,
|
||||
unsigned char,
|
||||
short,
|
||||
unsigned short,
|
||||
int,
|
||||
unsigned int,
|
||||
long,
|
||||
unsigned long,
|
||||
long long,
|
||||
float,
|
||||
double,
|
||||
enum SWIGTYPE
|
||||
"$javacall"
|
||||
|
||||
%typemap(out) bool %{ $result = (jboolean)$1; %}
|
||||
|
|
@ -292,7 +292,7 @@
|
|||
}
|
||||
|
||||
/* 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);
|
||||
jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
|
||||
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;
|
||||
if ($1) {
|
||||
$input = JCALL1(NewStringUTF, jenv, $1);
|
||||
|
|
@ -337,7 +337,7 @@
|
|||
%typemap(out) void ""
|
||||
%typemap(javadirectorin) void "$jniinput"
|
||||
%typemap(javadirectorout) void "$javacall"
|
||||
%typemap(inv, parse="V") void ""
|
||||
%typemap(directorin, parse="V") void ""
|
||||
|
||||
/* primitive types by reference */
|
||||
%typemap(in) const bool & (bool temp)
|
||||
|
|
@ -362,46 +362,46 @@
|
|||
%{ temp = ($*1_ltype)$input;
|
||||
$1 = &temp; %}
|
||||
|
||||
%typemap(inv, parse="Z") const bool & "$input = (jboolean)$1_name;"
|
||||
%typemap(inv, parse="C") const char & "$input = (jchar)$1_name;"
|
||||
%typemap(inv, parse="B") const signed char & "$input = (jbyte)$1_name;"
|
||||
%typemap(inv, parse="S") const unsigned char & "$input = (jshort)$1_name;"
|
||||
%typemap(inv, parse="S") const short & "$input = (jshort)$1_name;"
|
||||
%typemap(inv, parse="I") const unsigned short & "$input = (jint)$1_name;"
|
||||
%typemap(inv, parse="I") const int & "$input = (jint)$1_name;"
|
||||
%typemap(inv, parse="J") const unsigned int & "$input = (jlong)$1_name;"
|
||||
%typemap(inv, parse="I") const long & "$input = (jint)$1_name;"
|
||||
%typemap(inv, parse="J") const unsigned long & "$input = (jlong)$1_name;"
|
||||
%typemap(inv, parse="J") const long long & "$input = (jlong)$1_name;"
|
||||
%typemap(inv, parse="F") const float & "$input = (jfloat)$1_name;"
|
||||
%typemap(inv, parse="D") const double & "$input = (jdouble)$1_name;"
|
||||
%typemap(directorin, parse="Z") const bool & "$input = (jboolean)$1_name;"
|
||||
%typemap(directorin, parse="C") const char & "$input = (jchar)$1_name;"
|
||||
%typemap(directorin, parse="B") const signed char & "$input = (jbyte)$1_name;"
|
||||
%typemap(directorin, parse="S") const unsigned char & "$input = (jshort)$1_name;"
|
||||
%typemap(directorin, parse="S") const short & "$input = (jshort)$1_name;"
|
||||
%typemap(directorin, parse="I") const unsigned short & "$input = (jint)$1_name;"
|
||||
%typemap(directorin, parse="I") const int & "$input = (jint)$1_name;"
|
||||
%typemap(directorin, parse="J") const unsigned int & "$input = (jlong)$1_name;"
|
||||
%typemap(directorin, parse="I") const long & "$input = (jint)$1_name;"
|
||||
%typemap(directorin, parse="J") const unsigned long & "$input = (jlong)$1_name;"
|
||||
%typemap(directorin, parse="J") const long long & "$input = (jlong)$1_name;"
|
||||
%typemap(directorin, parse="F") const float & "$input = (jfloat)$1_name;"
|
||||
%typemap(directorin, parse="D") const double & "$input = (jdouble)$1_name;"
|
||||
|
||||
%typemap(javadirectorin) const char & (char temp),
|
||||
const signed char & (signed char temp),
|
||||
const unsigned char & (unsigned char temp),
|
||||
const short & (short temp),
|
||||
const unsigned short & (unsigned short temp),
|
||||
const int & (int temp),
|
||||
const unsigned int & (unsigned int temp),
|
||||
const long & (long temp),
|
||||
const unsigned long & (unsigned long temp),
|
||||
const long long & ($*1_ltype temp),
|
||||
const float & (float temp),
|
||||
const double & (double temp)
|
||||
const signed char & (signed char temp),
|
||||
const unsigned char & (unsigned char temp),
|
||||
const short & (short temp),
|
||||
const unsigned short & (unsigned short temp),
|
||||
const int & (int temp),
|
||||
const unsigned int & (unsigned int temp),
|
||||
const long & (long temp),
|
||||
const unsigned long & (unsigned long temp),
|
||||
const long long & ($*1_ltype temp),
|
||||
const float & (float temp),
|
||||
const double & (double temp)
|
||||
"$jniinput"
|
||||
|
||||
%typemap(javadirectorout) const char & (char temp),
|
||||
const signed char & (signed char temp),
|
||||
const unsigned char & (unsigned char temp),
|
||||
const short & (short temp),
|
||||
const unsigned short & (unsigned short temp),
|
||||
const int & (int temp),
|
||||
const unsigned int & (unsigned int temp),
|
||||
const long & (long temp),
|
||||
const unsigned long & (unsigned long temp),
|
||||
const long long & ($*1_ltype temp),
|
||||
const float & (float temp),
|
||||
const double & (double temp)
|
||||
const signed char & (signed char temp),
|
||||
const unsigned char & (unsigned char temp),
|
||||
const short & (short temp),
|
||||
const unsigned short & (unsigned short temp),
|
||||
const int & (int temp),
|
||||
const unsigned int & (unsigned int temp),
|
||||
const long & (long temp),
|
||||
const unsigned long & (unsigned long temp),
|
||||
const long long & ($*1_ltype temp),
|
||||
const float & (float temp),
|
||||
const double & (double temp)
|
||||
"$javacall"
|
||||
|
||||
|
||||
|
|
@ -494,7 +494,7 @@
|
|||
}
|
||||
#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(javadirectorout) SWIGTYPE "$javaclassname.getCPtr($javacall)"
|
||||
|
||||
|
|
@ -510,10 +510,10 @@
|
|||
%typemap(out) SWIGTYPE &
|
||||
%{ *($&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; %}
|
||||
|
||||
%typemap(inv,parse="L$packagepath/$javaclassname;") SWIGTYPE &
|
||||
%typemap(directorin,parse="L$packagepath/$javaclassname;") SWIGTYPE &
|
||||
%{ *($&1_ltype)&$input = ($1_ltype) &$1; %}
|
||||
|
||||
%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(freearg) char[ANY] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, $1); }
|
||||
|
|
@ -583,66 +583,66 @@
|
|||
jobjectArray
|
||||
%{ $result = $1; %}
|
||||
|
||||
%typemap(inv,parse="Z") jboolean "$input = $1;"
|
||||
%typemap(inv,parse="C") jchar "$input = $1;"
|
||||
%typemap(inv,parse="B") jbyte "$input = $1;"
|
||||
%typemap(inv,parse="S") jshort "$input = $1;"
|
||||
%typemap(inv,parse="I") jint "$input = $1;"
|
||||
%typemap(inv,parse="J") jlong "$input = $1;"
|
||||
%typemap(inv,parse="F") jfloat "$input = $1;"
|
||||
%typemap(inv,parse="D") jdouble "$input = $1;"
|
||||
%typemap(inv,parse="Ljava/lang/String;") jstring "$input = $1;"
|
||||
%typemap(inv,parse="Ljava/lang/Object;") jobject "$input = $1;"
|
||||
%typemap(inv,parse="[Z") jbooleanArray "$input = $1;"
|
||||
%typemap(inv,parse="[C") jcharArray "$input = $1;"
|
||||
%typemap(inv,parse="[B") jbyteArray "$input = $1;"
|
||||
%typemap(inv,parse="[S") jshortArray "$input = $1;"
|
||||
%typemap(inv,parse="[I") jintArray "$input = $1;"
|
||||
%typemap(inv,parse="[J") jlongArray "$input = $1;"
|
||||
%typemap(inv,parse="[F") jfloatArray "$input = $1;"
|
||||
%typemap(inv,parse="[D") jdoubleArray "$input = $1;"
|
||||
%typemap(inv,parse="[Ljava/lang/Object;") jobjectArray "$input = $1;"
|
||||
%typemap(directorin,parse="Z") jboolean "$input = $1;"
|
||||
%typemap(directorin,parse="C") jchar "$input = $1;"
|
||||
%typemap(directorin,parse="B") jbyte "$input = $1;"
|
||||
%typemap(directorin,parse="S") jshort "$input = $1;"
|
||||
%typemap(directorin,parse="I") jint "$input = $1;"
|
||||
%typemap(directorin,parse="J") jlong "$input = $1;"
|
||||
%typemap(directorin,parse="F") jfloat "$input = $1;"
|
||||
%typemap(directorin,parse="D") jdouble "$input = $1;"
|
||||
%typemap(directorin,parse="Ljava/lang/String;") jstring "$input = $1;"
|
||||
%typemap(directorin,parse="Ljava/lang/Object;") jobject "$input = $1;"
|
||||
%typemap(directorin,parse="[Z") jbooleanArray "$input = $1;"
|
||||
%typemap(directorin,parse="[C") jcharArray "$input = $1;"
|
||||
%typemap(directorin,parse="[B") jbyteArray "$input = $1;"
|
||||
%typemap(directorin,parse="[S") jshortArray "$input = $1;"
|
||||
%typemap(directorin,parse="[I") jintArray "$input = $1;"
|
||||
%typemap(directorin,parse="[J") jlongArray "$input = $1;"
|
||||
%typemap(directorin,parse="[F") jfloatArray "$input = $1;"
|
||||
%typemap(directorin,parse="[D") jdoubleArray "$input = $1;"
|
||||
%typemap(directorin,parse="[Ljava/lang/Object;") jobjectArray "$input = $1;"
|
||||
|
||||
%typemap(javadirectorin) jboolean,
|
||||
jchar,
|
||||
jbyte,
|
||||
jshort,
|
||||
jint,
|
||||
jlong,
|
||||
jfloat,
|
||||
jdouble,
|
||||
jstring,
|
||||
jobject,
|
||||
jbooleanArray,
|
||||
jcharArray,
|
||||
jbyteArray,
|
||||
jshortArray,
|
||||
jintArray,
|
||||
jlongArray,
|
||||
jfloatArray,
|
||||
jdoubleArray,
|
||||
jobjectArray
|
||||
jchar,
|
||||
jbyte,
|
||||
jshort,
|
||||
jint,
|
||||
jlong,
|
||||
jfloat,
|
||||
jdouble,
|
||||
jstring,
|
||||
jobject,
|
||||
jbooleanArray,
|
||||
jcharArray,
|
||||
jbyteArray,
|
||||
jshortArray,
|
||||
jintArray,
|
||||
jlongArray,
|
||||
jfloatArray,
|
||||
jdoubleArray,
|
||||
jobjectArray
|
||||
"$jniinput"
|
||||
|
||||
%typemap(javadirectorout) jboolean,
|
||||
jchar,
|
||||
jbyte,
|
||||
jshort,
|
||||
jint,
|
||||
jlong,
|
||||
jfloat,
|
||||
jdouble,
|
||||
jstring,
|
||||
jobject,
|
||||
jbooleanArray,
|
||||
jcharArray,
|
||||
jbyteArray,
|
||||
jshortArray,
|
||||
jintArray,
|
||||
jlongArray,
|
||||
jfloatArray,
|
||||
jdoubleArray,
|
||||
jobjectArray
|
||||
jchar,
|
||||
jbyte,
|
||||
jshort,
|
||||
jint,
|
||||
jlong,
|
||||
jfloat,
|
||||
jdouble,
|
||||
jstring,
|
||||
jobject,
|
||||
jbooleanArray,
|
||||
jcharArray,
|
||||
jbyteArray,
|
||||
jshortArray,
|
||||
jintArray,
|
||||
jlongArray,
|
||||
jfloatArray,
|
||||
jdoubleArray,
|
||||
jobjectArray
|
||||
"$javacall"
|
||||
|
||||
/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class string;
|
|||
return $null;
|
||||
} %}
|
||||
|
||||
%typemap(inv,parse="Ljava/lang/String;") string
|
||||
%typemap(directorin,parse="Ljava/lang/String;") string
|
||||
%{ $input = jenv->NewStringUTF($1.c_str()); %}
|
||||
|
||||
%typemap(out) string
|
||||
|
|
@ -80,7 +80,7 @@ class string;
|
|||
%typemap(freearg) const string &
|
||||
%{ delete $1; %}
|
||||
|
||||
%typemap(inv,parse="Ljava/lang/String;") const string &
|
||||
%typemap(directorin,parse="Ljava/lang/String;") const string &
|
||||
%{ $input = jenv->NewStringUTF($1.c_str()); %}
|
||||
|
||||
%typemap(out) const string &
|
||||
|
|
@ -142,7 +142,7 @@ class wstring;
|
|||
return $null;
|
||||
} %}
|
||||
|
||||
%typemap(inv,parse="Ljava/lang/String;") wstring
|
||||
%typemap(directorin,parse="Ljava/lang/String;") wstring
|
||||
%{jsize len = $1.length();
|
||||
jchar *conv_buf = new jchar[len];
|
||||
for (jsize i = 0; i < len; ++i) {
|
||||
|
|
@ -194,7 +194,7 @@ class wstring;
|
|||
return $null;
|
||||
} %}
|
||||
|
||||
%typemap(inv,parse="Ljava/lang/String;") const wstring &
|
||||
%typemap(directorin,parse="Ljava/lang/String;") const wstring &
|
||||
%{jsize len = $1->length();
|
||||
jchar *conv_buf = new jchar[len];
|
||||
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
|
||||
%{ $1 = ($1_ltype)&$input; %}
|
||||
|
||||
%typemap(inv,parse=JNIDESC) CYTPE &INPUT
|
||||
%typemap(directorin,parse=JNIDESC) CYTPE &INPUT
|
||||
%{ *(($&1_ltype) $input) = (JNITYPE *) &$1; %}
|
||||
|
||||
%typemap(inv,parse=JNIDESC) CTYPE *INPUT
|
||||
%typemap(directorin,parse=JNIDESC) CTYPE *INPUT
|
||||
%{ *(($&1_ltype) $input) = (JNITYPE *) $1; %}
|
||||
|
||||
%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;
|
||||
}
|
||||
|
||||
%typemap(inv,parse=JNIDESC) CTYPE &OUTPUT
|
||||
%typemap(directorin,parse=JNIDESC) CTYPE &OUTPUT
|
||||
%{ *(($&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
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
%typemap(inv,parse=JNIDESC) CTYPE &INOUT
|
||||
%typemap(directorin,parse=JNIDESC) CTYPE &INOUT
|
||||
%{ *(($&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
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
%typemap(freearg) char **STRING_IN
|
||||
%{ 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); %}
|
||||
|
||||
/* 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); %}
|
||||
|
||||
/* 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; %}
|
||||
|
||||
/* 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 */
|
||||
|
|
@ -125,9 +125,9 @@
|
|||
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 */
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ type _value = c_obj
|
|||
%define %make_simple_array_typemap(type,out_f,in_f)
|
||||
%array_tmap_out(out,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(varin,type,in_f);
|
||||
%array_tmap_in(outv,type,in_f);
|
||||
%array_tmap_in(directorout,type,in_f);
|
||||
%enddef
|
||||
|
||||
%make_simple_array_typemap(bool,caml_val_bool,caml_long_val);
|
||||
|
|
|
|||
|
|
@ -49,33 +49,33 @@ private:
|
|||
/* reset the _up flag once the routing direction has been determined */
|
||||
#ifdef __PTHREAD__
|
||||
void __clear_up() const {
|
||||
__DIRECTOR__::_up = 0;
|
||||
__DIRECTOR__::_mutex_active = 0;
|
||||
pthread_mutex_unlock(&_mutex_up);
|
||||
__DIRECTOR__::_up = 0;
|
||||
__DIRECTOR__::_mutex_active = 0;
|
||||
pthread_mutex_unlock(&_mutex_up);
|
||||
}
|
||||
#else
|
||||
void __clear_up() const {
|
||||
__DIRECTOR__::_up = 0;
|
||||
__DIRECTOR__::_up = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
/* wrap a ocaml object, optionally taking ownership */
|
||||
__DIRECTOR__(CAML_VALUE self, int disown): _self(self), _disown(disown) {
|
||||
register_global_root(&_self);
|
||||
register_global_root(&_self);
|
||||
}
|
||||
|
||||
/* discard our reference at destruction */
|
||||
virtual ~__DIRECTOR__() {
|
||||
remove_global_root(&_self);
|
||||
__disown();
|
||||
remove_global_root(&_self);
|
||||
__disown();
|
||||
// Disown is safe here because we're just divorcing a reference that
|
||||
// points to us.
|
||||
// points to us.
|
||||
}
|
||||
|
||||
/* return a pointer to the wrapped ocaml object */
|
||||
CAML_VALUE __get_self() const {
|
||||
return callback(*caml_named_value("caml_director_get_self"),_self);
|
||||
return callback(*caml_named_value("caml_director_get_self"),_self);
|
||||
}
|
||||
|
||||
/* get the _up flag to determine if the method call should be routed
|
||||
|
|
@ -83,20 +83,20 @@ public:
|
|||
*/
|
||||
#ifdef __PTHREAD__
|
||||
int __get_up() const {
|
||||
if (__DIRECTOR__::_mutex_active) {
|
||||
if (pthread_equal(__DIRECTOR__::_mutex_thread, pthread_self())) {
|
||||
int up = _up;
|
||||
__clear_up();
|
||||
return up;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
if (__DIRECTOR__::_mutex_active) {
|
||||
if (pthread_equal(__DIRECTOR__::_mutex_thread, pthread_self())) {
|
||||
int up = _up;
|
||||
__clear_up();
|
||||
return up;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int __get_up() const {
|
||||
int up = _up;
|
||||
_up = 0;
|
||||
return up;
|
||||
int up = _up;
|
||||
_up = 0;
|
||||
return up;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -105,24 +105,24 @@ public:
|
|||
*/
|
||||
#ifdef __PTHREAD__
|
||||
void __set_up() const {
|
||||
pthread_mutex_lock(&__DIRECTOR__::_mutex_up);
|
||||
__DIRECTOR__::_mutex_thread = pthread_self();
|
||||
__DIRECTOR__::_mutex_active = 1;
|
||||
__DIRECTOR__::_up = 1;
|
||||
pthread_mutex_lock(&__DIRECTOR__::_mutex_up);
|
||||
__DIRECTOR__::_mutex_thread = pthread_self();
|
||||
__DIRECTOR__::_mutex_active = 1;
|
||||
__DIRECTOR__::_up = 1;
|
||||
}
|
||||
#else
|
||||
void __set_up() const {
|
||||
__DIRECTOR__::_up = 1;
|
||||
__DIRECTOR__::_up = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* acquire ownership of the wrapped ocaml object (the sense of "disown"
|
||||
* is from ocaml) */
|
||||
void __disown() const {
|
||||
if (!_disown) {
|
||||
_disown=1;
|
||||
callback(*caml_named_value("caml_obj_disown"),_self);
|
||||
}
|
||||
if (!_disown) {
|
||||
_disown=1;
|
||||
callback(*caml_named_value("caml_obj_disown"),_self);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -140,9 +140,9 @@ int __DIRECTOR__::_mutex_active = 0;
|
|||
|
||||
%insert(mli) %{
|
||||
val new_derived_object:
|
||||
(c_obj -> c_obj) ->
|
||||
(c_obj -> string -> c_obj -> c_obj) ->
|
||||
c_obj -> c_obj
|
||||
(c_obj -> c_obj) ->
|
||||
(c_obj -> string -> c_obj -> c_obj) ->
|
||||
c_obj -> c_obj
|
||||
%}
|
||||
|
||||
%insert(ml) %{
|
||||
|
|
@ -160,9 +160,9 @@ let new_derived_object cfun x_class args =
|
|||
let obj =
|
||||
cfun (match args with
|
||||
C_list argl ->
|
||||
(C_list ((C_director_core (C_obj new_class,ob_ref)) :: argl))
|
||||
| a -> (C_list [ C_director_core
|
||||
(C_obj new_class,ob_ref) ; a ])) in
|
||||
(C_list ((C_director_core (C_obj new_class,ob_ref)) :: argl))
|
||||
| a -> (C_list [ C_director_core
|
||||
(C_obj new_class,ob_ref) ; a ])) in
|
||||
ob_ref := Some obj ;
|
||||
obj
|
||||
end
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@
|
|||
%typemap(varin) C_NAME & {
|
||||
$1 = MZ_TO_C($input);
|
||||
}
|
||||
%typemap(outv) C_NAME {
|
||||
%typemap(directorout) C_NAME {
|
||||
$1 = MZ_TO_C($input);
|
||||
}
|
||||
%typemap(in) C_NAME *INPUT ($*1_ltype temp) {
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
%typemap(argout) C_NAME & {
|
||||
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));
|
||||
}
|
||||
%enddef
|
||||
|
|
@ -225,7 +225,7 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
|
|||
|
||||
%char_ptr_in(in);
|
||||
%char_ptr_in(varin);
|
||||
%char_ptr_in(outv);
|
||||
%char_ptr_in(directorout);
|
||||
|
||||
%define %char_ptr_out(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(varout);
|
||||
%char_ptr_out(invv);
|
||||
%char_ptr_out(directorin);
|
||||
|
||||
%define %swigtype_ptr_in(how)
|
||||
%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(varin);
|
||||
%swigtype_ptr_in(outv);
|
||||
%swigtype_ptr_in(directorout);
|
||||
%swigtype_ptr_out(out);
|
||||
%swigtype_ptr_out(varout);
|
||||
%swigtype_ptr_out(inv);
|
||||
%swigtype_ptr_out(directorin);
|
||||
|
||||
/* C++ References */
|
||||
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@ namespace std {
|
|||
|
||||
%typemap(in, pikedesc="tStr") string {
|
||||
if ($input.type != T_STRING)
|
||||
Pike_error("Bad argument: Expected a string.\n");
|
||||
Pike_error("Bad argument: Expected a string.\n");
|
||||
$1 = std::string(STR0($input.u.string));
|
||||
}
|
||||
|
||||
%typemap(in, pikedesc="tStr") const string & (std::string temp) {
|
||||
if ($input.type != T_STRING)
|
||||
Pike_error("Bad argument: Expected a string.\n");
|
||||
Pike_error("Bad argument: Expected a string.\n");
|
||||
temp = std::string(STR0($input.u.string));
|
||||
$1 = &temp;
|
||||
}
|
||||
|
|
@ -35,23 +35,23 @@ namespace std {
|
|||
|
||||
%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)
|
||||
$result = std::string(STR0($input.u.string));
|
||||
$result = std::string(STR0($input.u.string));
|
||||
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) {
|
||||
temp = std::string(STR0($input.u.string));
|
||||
$result = &temp;
|
||||
temp = std::string(STR0($input.u.string));
|
||||
$result = &temp;
|
||||
} else {
|
||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("string expected");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
|
|||
statichere PyTypeObject varlinktype = {
|
||||
PyObject_HEAD_INIT(0)
|
||||
0,
|
||||
(char *)"swigvarlink", /* Type name */
|
||||
(char *)"swigvarlink", /* Type name */
|
||||
sizeof(swig_varlinkobject), /* Basic size */
|
||||
0, /* Itemsize */
|
||||
0, /* Deallocator */
|
||||
|
|
@ -143,8 +143,7 @@ SWIG_newvarlink(void) {
|
|||
}
|
||||
|
||||
SWIGRUNTIME(void)
|
||||
SWIG_addvarlink(PyObject *p, char *name,
|
||||
PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
|
||||
SWIG_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
|
||||
swig_varlinkobject *v;
|
||||
swig_globalvar *gv;
|
||||
v= (swig_varlinkobject *) p;
|
||||
|
|
@ -277,7 +276,7 @@ type_error:
|
|||
if (flags & SWIG_POINTER_EXCEPTION) {
|
||||
if (ty && c) {
|
||||
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
||||
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
||||
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
||||
PyErr_SetString(PyExc_TypeError, temp);
|
||||
free((char *) temp);
|
||||
} else {
|
||||
|
|
@ -310,7 +309,7 @@ type_error:
|
|||
if (flags) {
|
||||
if (ty && c) {
|
||||
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
|
||||
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
||||
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
|
||||
PyErr_SetString(PyExc_TypeError, temp);
|
||||
free((char *) temp);
|
||||
} else {
|
||||
|
|
@ -349,9 +348,9 @@ SWIG_NewPointerObj(void *ptr, swig_type_info *type, int own) {
|
|||
Py_DECREF(args);
|
||||
if (inst) {
|
||||
if (own) {
|
||||
PyObject *n = PyInt_FromLong(1);
|
||||
PyObject_SetAttrString(inst,(char*)"thisown",n);
|
||||
Py_DECREF(n);
|
||||
PyObject *n = PyInt_FromLong(1);
|
||||
PyObject_SetAttrString(inst,(char*)"thisown",n);
|
||||
Py_DECREF(n);
|
||||
}
|
||||
robj = inst;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
%typemap(in,parse="b") signed char "";
|
||||
|
||||
%typemap(in) unsigned int, unsigned short, unsigned long, unsigned char
|
||||
"$1 = ($1_ltype) PyInt_AsLong($input);
|
||||
"$1 = ($1_ltype) PyInt_AsLong($input);
|
||||
if (PyErr_Occurred()) SWIG_fail;";
|
||||
|
||||
%typemap(in) long long
|
||||
|
|
@ -82,25 +82,25 @@
|
|||
/* Const primitive references. Passed by value */
|
||||
|
||||
%typemap(in) const int & (int temp),
|
||||
const short & (short temp),
|
||||
const short & (short temp),
|
||||
const long & (long temp),
|
||||
const unsigned int & (unsigned int temp),
|
||||
const unsigned short & (unsigned short temp),
|
||||
const unsigned long & (unsigned long temp),
|
||||
const signed char & (signed char temp),
|
||||
const unsigned char & (unsigned char temp)
|
||||
"temp = ($*1_ltype) PyInt_AsLong($input);
|
||||
"temp = ($*1_ltype) PyInt_AsLong($input);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const bool & (bool temp)
|
||||
"temp = PyInt_AsLong($input) ? true : false;
|
||||
"temp = PyInt_AsLong($input) ? true : false;
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const float & (float temp),
|
||||
const double & (double temp)
|
||||
"temp = ($*1_ltype) PyFloat_AsDouble($input);
|
||||
const double & (double temp)
|
||||
"temp = ($*1_ltype) PyFloat_AsDouble($input);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
$1 = &temp;";
|
||||
|
||||
|
|
@ -423,41 +423,41 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/* --- Inverse arguments --- */
|
||||
/* directorin typemaps */
|
||||
|
||||
/* Primitive datatypes. These only supply a parse code to PyObject_CallMethod */
|
||||
|
||||
%typemap(inv,parse="i") int "";
|
||||
%typemap(inv,parse="h") short "";
|
||||
%typemap(inv,parse="l") long "";
|
||||
%typemap(inv,parse="b") signed char "";
|
||||
%typemap(inv,parse="f") float "";
|
||||
%typemap(inv,parse="d") double "";
|
||||
%typemap(inv,parse="s") char* "";
|
||||
%typemap(inv,parse="i") bool "";
|
||||
%typemap(inv,parse="i") enum SWIGTYPE "";
|
||||
%typemap(directorin,parse="i") int "";
|
||||
%typemap(directorin,parse="h") short "";
|
||||
%typemap(directorin,parse="l") long "";
|
||||
%typemap(directorin,parse="b") signed char "";
|
||||
%typemap(directorin,parse="f") float "";
|
||||
%typemap(directorin,parse="d") double "";
|
||||
%typemap(directorin,parse="s") char* "";
|
||||
%typemap(directorin,parse="i") bool "";
|
||||
%typemap(directorin,parse="i") enum SWIGTYPE "";
|
||||
|
||||
%typemap(inv,parse="l") unsigned int, unsigned short, unsigned long, unsigned char "(long) $1_name";
|
||||
|
||||
%typemap(inv) long long
|
||||
"$input = PyLong_FromLongLong($1_name);";
|
||||
%typemap(inv) unsigned long long
|
||||
"$input = PyLong_FromUnsignedLongLong($1_name);";
|
||||
%typemap(directorin,parse="l") unsigned int, unsigned short, unsigned long, unsigned char "(long) $1_name";
|
||||
|
||||
%typemap(directorin) long long
|
||||
"$input = PyLong_FromLongLong($1_name);";
|
||||
%typemap(directorin) unsigned long long
|
||||
"$input = PyLong_FromUnsignedLongLong($1_name);";
|
||||
|
||||
%typemap(inv, parse="l") int *INV, long* INV,
|
||||
unsigned int *INV, unsigned long *INV,
|
||||
short *INV, unsigned short *INV,
|
||||
char *INV, unsigned char *INV
|
||||
"(long) *$1_name";
|
||||
%typemap(inv, parse="f") float *INV "*$1_name";
|
||||
%typemap(inv, parse="d") double *INV "*$1_name";
|
||||
%typemap(directorin, parse="l") int *DIRECTORIN, long* DIRECTORIN,
|
||||
unsigned int *DIRECTORIN, unsigned long *DIRECTORIN,
|
||||
short *DIRECTORIN, unsigned short *DIRECTORIN,
|
||||
char *DIRECTORIN, unsigned char *DIRECTORIN
|
||||
"(long) *$1_name";
|
||||
%typemap(directorin, parse="f") float *DIRECTORIN "*$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
|
||||
%typemap(inv) SWIGTYPE {
|
||||
%typemap(directorin) SWIGTYPE {
|
||||
{
|
||||
$input = SWIG_NewPointerObj((void *) &$1_name, $&1_descriptor, $owner);
|
||||
}
|
||||
|
|
@ -465,68 +465,68 @@
|
|||
*/
|
||||
|
||||
/* no can do... see python.cxx
|
||||
%typemap(inv) DIRECTORTYPE * {
|
||||
{
|
||||
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
||||
if (!proxy) {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||
} else {
|
||||
$input = proxy->__get_self();
|
||||
}
|
||||
}
|
||||
%typemap(directorin) DIRECTORTYPE * {
|
||||
{
|
||||
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
||||
if (!proxy) {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||
} else {
|
||||
$input = proxy->__get_self();
|
||||
}
|
||||
}
|
||||
}
|
||||
%typemap(inv) SWIGTYPE * {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||
%typemap(directorin) SWIGTYPE * {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
/* // not currently needed, see python.cxx
|
||||
%typemap(inv) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
||||
%typemap(directorin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||
$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)
|
||||
%typemap(argoutv) type *OUTV
|
||||
%define DIRECTOROUT_TYPEMAP(type, converter)
|
||||
%typemap(directorargout) type *DIRECTOROUT
|
||||
"*$result = (type) converter($input);
|
||||
if (PyErr_Occurred()) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Error converting Python object using converter\");";
|
||||
%typemap(outv) type
|
||||
%typemap(directorout) type
|
||||
"$result = (type) converter($input);
|
||||
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
|
||||
|
||||
OUTV_TYPEMAP(char, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(unsigned char, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(short, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(unsigned short, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(int, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(unsigned int, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(long, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(unsigned long, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(long long, PyLong_AsLongLong);
|
||||
OUTV_TYPEMAP(unsigned long long, PyLong_AsUnsignedLongLong);
|
||||
OUTV_TYPEMAP(float, PyFloat_AsDouble);
|
||||
OUTV_TYPEMAP(double, PyFloat_AsDouble);
|
||||
OUTV_TYPEMAP(bool, PyInt_AsLong);
|
||||
OUTV_TYPEMAP(PyObject *, );
|
||||
OUTV_TYPEMAP(char *, PyString_AsString);
|
||||
OUTV_TYPEMAP(std::size_t, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(char, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(unsigned char, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(short, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(unsigned short, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(int, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(unsigned int, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(long, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(unsigned long, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(long long, PyLong_AsLongLong);
|
||||
DIRECTOROUT_TYPEMAP(unsigned long long, PyLong_AsUnsignedLongLong);
|
||||
DIRECTOROUT_TYPEMAP(float, PyFloat_AsDouble);
|
||||
DIRECTOROUT_TYPEMAP(double, PyFloat_AsDouble);
|
||||
DIRECTOROUT_TYPEMAP(bool, PyInt_AsLong);
|
||||
DIRECTOROUT_TYPEMAP(PyObject *, );
|
||||
DIRECTOROUT_TYPEMAP(char *, PyString_AsString);
|
||||
DIRECTOROUT_TYPEMAP(std::size_t, PyInt_AsLong);
|
||||
|
||||
/* 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;";
|
||||
|
||||
%typemap(outv) SWIGTYPE *,
|
||||
SWIGTYPE &,
|
||||
SWIGTYPE []
|
||||
%typemap(directorout) SWIGTYPE *,
|
||||
SWIGTYPE &,
|
||||
SWIGTYPE []
|
||||
"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.\");";
|
||||
|
||||
|
||||
|
||||
|
|
@ -569,22 +569,22 @@ OUTV_TYPEMAP(std::size_t, PyInt_AsLong);
|
|||
* ------------------------------------------------------------ */
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_INTEGER)
|
||||
int, short, long,
|
||||
unsigned int, unsigned short, unsigned long,
|
||||
signed char, unsigned char,
|
||||
long long, unsigned long long,
|
||||
const int &, const short &, const long &,
|
||||
const unsigned int &, const unsigned short &, const unsigned long &,
|
||||
const long long &, const unsigned long long &,
|
||||
enum SWIGTYPE,
|
||||
int, short, long,
|
||||
unsigned int, unsigned short, unsigned long,
|
||||
signed char, unsigned char,
|
||||
long long, unsigned long long,
|
||||
const int &, const short &, const long &,
|
||||
const unsigned int &, const unsigned short &, const unsigned long &,
|
||||
const long long &, const unsigned long long &,
|
||||
enum SWIGTYPE,
|
||||
bool, const bool &
|
||||
{
|
||||
$1 = (PyInt_Check($input) || PyLong_Check($input)) ? 1 : 0;
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_DOUBLE)
|
||||
float, double,
|
||||
const float &, const double &
|
||||
float, double,
|
||||
const float &, const double &
|
||||
{
|
||||
$1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input)) ? 1 : 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,22 +67,22 @@ SwigComplex_AsComplexDouble(PyObject *o)
|
|||
|
||||
// C++ proxy class typemaps
|
||||
|
||||
%typemap(inv) Complex {
|
||||
%typemap(directorin) Complex {
|
||||
$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());
|
||||
}
|
||||
|
||||
%typemap(outv) Complex {
|
||||
%typemap(directorout) Complex {
|
||||
$result = SwigComplex_As< Complex >($input);
|
||||
if (PyErr_Occurred()) {
|
||||
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);
|
||||
if (PyErr_Occurred()) {
|
||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("Expecting a complex or compatible type");
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@ namespace std {
|
|||
$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))
|
||||
$result = std::string(PyString_AsString($input),
|
||||
PyString_Size($input));
|
||||
|
|
@ -65,7 +65,7 @@ namespace std {
|
|||
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)) {
|
||||
temp = std::string(PyString_AsString($input),
|
||||
PyString_Size($input));
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ namespace std {
|
|||
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)) {
|
||||
unsigned int size = (PyTuple_Check($input) ?
|
||||
PyTuple_Size($input) :
|
||||
|
|
@ -164,7 +164,7 @@ namespace std {
|
|||
SWIG_fail;
|
||||
}
|
||||
}
|
||||
%typemap(outv) const vector<T>& (std::vector<T> temp,
|
||||
%typemap(directorout) const vector<T>& (std::vector<T> temp,
|
||||
std::vector<T>* v),
|
||||
const vector<T>* (std::vector<T> temp,
|
||||
std::vector<T>* v) {
|
||||
|
|
@ -183,7 +183,7 @@ namespace std {
|
|||
Py_DECREF(o);
|
||||
} else {
|
||||
Py_DECREF(o);
|
||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("vector<" #T "> expected");
|
||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("vector<" #T "> expected");
|
||||
}
|
||||
}
|
||||
} else if (SWIG_ConvertPtr($input,(void **) &v,
|
||||
|
|
@ -202,7 +202,7 @@ namespace std {
|
|||
$descriptor(T *), 1));
|
||||
}
|
||||
}
|
||||
%typemap(inv) vector<T> {
|
||||
%typemap(directorin) vector<T> {
|
||||
$input = PyTuple_New($1_name.size());
|
||||
for (unsigned int i=0; i<$1_name.size(); i++) {
|
||||
T* ptr = new T((($1_type &)$1_name)[i]);
|
||||
|
|
@ -334,7 +334,7 @@ namespace std {
|
|||
self->insert(self->begin()+i,v.begin(),v.end());
|
||||
} else {
|
||||
self->insert(self->end(),v.begin(),v.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void __delitem__(int i) {
|
||||
|
|
@ -388,7 +388,7 @@ namespace std {
|
|||
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)) {
|
||||
unsigned int size = (PyTuple_Check($input) ?
|
||||
PyTuple_Size($input) :
|
||||
|
|
@ -445,7 +445,7 @@ namespace std {
|
|||
SWIG_fail;
|
||||
}
|
||||
}
|
||||
%typemap(outv) const vector<T *>& (std::vector<T *> temp,
|
||||
%typemap(directorout) const vector<T *>& (std::vector<T *> temp,
|
||||
std::vector<T *>* v),
|
||||
const vector<T *>* (std::vector<T *> temp,
|
||||
std::vector<T *>* v) {
|
||||
|
|
@ -483,7 +483,7 @@ namespace std {
|
|||
$descriptor(T*), 0));
|
||||
}
|
||||
}
|
||||
%typemap(inv) vector<T*> {
|
||||
%typemap(directorin) vector<T*> {
|
||||
$input = PyTuple_New($1_name.size());
|
||||
for (unsigned int i=0; i<$1_name.size(); i++) {
|
||||
T *ptr = (($1_type &)$1_name)[i];
|
||||
|
|
@ -665,7 +665,7 @@ namespace std {
|
|||
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)) {
|
||||
unsigned int size = (PyTuple_Check($input) ?
|
||||
PyTuple_Size($input) :
|
||||
|
|
@ -718,7 +718,7 @@ namespace std {
|
|||
SWIG_fail;
|
||||
}
|
||||
}
|
||||
%typemap(outv) const vector<T>& (std::vector<T> temp,
|
||||
%typemap(directorout) const vector<T>& (std::vector<T> temp,
|
||||
std::vector<T>* v),
|
||||
const vector<T>* (std::vector<T> temp,
|
||||
std::vector<T>* v) {
|
||||
|
|
@ -735,7 +735,7 @@ namespace std {
|
|||
Py_DECREF(o);
|
||||
} else {
|
||||
Py_DECREF(o);
|
||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("vector<" #T "> expected");
|
||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("vector<" #T "> expected");
|
||||
}
|
||||
}
|
||||
} else if (SWIG_ConvertPtr($input,(void **) &v,
|
||||
|
|
@ -751,7 +751,7 @@ namespace std {
|
|||
PyTuple_SetItem($result,i,
|
||||
CONVERT_TO((($1_type &)$1)[i]));
|
||||
}
|
||||
%typemap(inv) vector<T> {
|
||||
%typemap(directorin) vector<T> {
|
||||
$input = PyTuple_New($1_name.size());
|
||||
for (unsigned int i=0; i<$1_name.size(); i++)
|
||||
PyTuple_SetItem($input,i,
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@
|
|||
|
||||
%typemap(in) SWIGTYPE *,
|
||||
SWIGTYPE []
|
||||
"SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);"
|
||||
"SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);"
|
||||
|
||||
/* Additional check for null references */
|
||||
%typemap(in) SWIGTYPE &
|
||||
"SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1); if ($1 == NULL) rb_raise(rb_eTypeError, \"null reference\");"
|
||||
"SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1); if ($1 == NULL) rb_raise(rb_eTypeError, \"null reference\");"
|
||||
|
||||
/* Void pointer. Accepts any kind of pointer */
|
||||
%typemap(in) void *
|
||||
|
|
@ -75,36 +75,36 @@
|
|||
%typemap(in) const int & (int temp),
|
||||
const signed char & (signed char temp),
|
||||
const unsigned char & (unsigned char temp)
|
||||
"temp = ($*1_ltype) NUM2INT($input);
|
||||
"temp = ($*1_ltype) NUM2INT($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const short & (short temp)
|
||||
"temp = ($*1_ltype) NUM2SHRT($input);
|
||||
"temp = ($*1_ltype) NUM2SHRT($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const long & (long temp)
|
||||
"temp = ($*1_ltype) NUM2LONG($input);
|
||||
"temp = ($*1_ltype) NUM2LONG($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const unsigned int & (unsigned int temp)
|
||||
"temp = ($*1_ltype) NUM2UINT($input);
|
||||
"temp = ($*1_ltype) NUM2UINT($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const unsigned short & (unsigned short temp)
|
||||
"temp = ($*1_ltype) NUM2USHRT($input);
|
||||
"temp = ($*1_ltype) NUM2USHRT($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const unsigned long & (unsigned long temp)
|
||||
"temp = ($*1_ltype) NUM2ULONG($input);
|
||||
"temp = ($*1_ltype) NUM2ULONG($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const bool & (bool temp)
|
||||
"temp = ($*1_ltype) RTEST($input);
|
||||
"temp = ($*1_ltype) RTEST($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const float & (float temp),
|
||||
const double & (double temp)
|
||||
"temp = ($*1_ltype) NUM2DBL($input);
|
||||
const double & (double temp)
|
||||
"temp = ($*1_ltype) NUM2DBL($input);
|
||||
$1 = &temp;";
|
||||
|
||||
%typemap(in) const long long & ($*1_ltype temp)
|
||||
|
|
@ -124,10 +124,10 @@
|
|||
/* --- Output typemaps --- */
|
||||
|
||||
%typemap(out) int, short, long, signed char, enum SWIGTYPE
|
||||
"$result = INT2NUM($1);";
|
||||
"$result = INT2NUM($1);";
|
||||
|
||||
%typemap(out) unsigned int, unsigned short, unsigned long, unsigned char
|
||||
"$result = UINT2NUM($1);";
|
||||
"$result = UINT2NUM($1);";
|
||||
|
||||
|
||||
/* Long long */
|
||||
|
|
@ -137,19 +137,19 @@
|
|||
|
||||
/* Floating point output values */
|
||||
%typemap(out) double, float
|
||||
"$result = rb_float_new($1);";
|
||||
"$result = rb_float_new($1);";
|
||||
|
||||
/* Character */
|
||||
%typemap(out) char
|
||||
"$result = rb_str_new(&$1,1);";
|
||||
"$result = rb_str_new(&$1,1);";
|
||||
|
||||
/* Boolean */
|
||||
%typemap(out) bool
|
||||
"$result = $1 ? Qtrue : Qfalse;";
|
||||
"$result = $1 ? Qtrue : Qfalse;";
|
||||
|
||||
/* C string */
|
||||
%typemap(out) char *
|
||||
"$result = rb_str_new2($1);";
|
||||
"$result = rb_str_new2($1);";
|
||||
|
||||
/* Pointers, references, and arrays */
|
||||
%typemap(out) SWIGTYPE*, SWIGTYPE &, SWIGTYPE []
|
||||
|
|
@ -309,29 +309,29 @@
|
|||
/* --- Output typemaps --- */
|
||||
|
||||
%typemap(varout) int, short, long, signed char, enum SWIGTYPE
|
||||
"$result = INT2NUM($1);";
|
||||
"$result = INT2NUM($1);";
|
||||
|
||||
%typemap(varout) unsigned int, unsigned short, unsigned long, unsigned char
|
||||
"$result = UINT2NUM($1);";
|
||||
"$result = UINT2NUM($1);";
|
||||
|
||||
%typemap(varout) long long "$result = LL2NUM($1);";
|
||||
%typemap(varout) unsigned long long "$result = ULL2NUM($1);";
|
||||
|
||||
/* Floats and doubles */
|
||||
%typemap(varout) double, float
|
||||
"$result = rb_float_new($1);";
|
||||
"$result = rb_float_new($1);";
|
||||
|
||||
/* Character */
|
||||
%typemap(varout) char
|
||||
"$result = rb_str_new(&$1,1);";
|
||||
"$result = rb_str_new(&$1,1);";
|
||||
|
||||
/* Boolean */
|
||||
%typemap(varout) bool
|
||||
"$result = $1 ? Qtrue : Qfalse;";
|
||||
"$result = $1 ? Qtrue : Qfalse;";
|
||||
|
||||
/* C string */
|
||||
%typemap(varout) char *
|
||||
"$result = rb_str_new2($1);";
|
||||
"$result = rb_str_new2($1);";
|
||||
|
||||
/* Pointers, references, and arrays */
|
||||
%typemap(varout) SWIGTYPE*, SWIGTYPE []
|
||||
|
|
@ -355,28 +355,28 @@
|
|||
/* --- Constants --- */
|
||||
|
||||
%typemap(constant) int, short, long, signed char, enum SWIGTYPE
|
||||
"rb_define_const($module,\"$symname\", INT2NUM($1));";
|
||||
"rb_define_const($module,\"$symname\", INT2NUM($1));";
|
||||
|
||||
%typemap(constant) unsigned int, unsigned short, unsigned long, unsigned char
|
||||
"rb_define_const($module,\"$symname\", UINT2NUM($1));";
|
||||
"rb_define_const($module,\"$symname\", UINT2NUM($1));";
|
||||
|
||||
%typemap(constant) long long
|
||||
"rb_define_const($module,\"$symname\", LL2NUM($1));";
|
||||
"rb_define_const($module,\"$symname\", LL2NUM($1));";
|
||||
|
||||
%typemap(constant) unsigned long long
|
||||
"rb_define_const($module,\"$symname\", ULL2NUM($1));";
|
||||
"rb_define_const($module,\"$symname\", ULL2NUM($1));";
|
||||
|
||||
%typemap(constant) double, float
|
||||
"rb_define_const($module,\"$symname\", rb_float_new($1));";
|
||||
"rb_define_const($module,\"$symname\", rb_float_new($1));";
|
||||
|
||||
%typemap(constant) char
|
||||
"rb_define_const($module,\"$symname\", rb_str_new(\"$1\",1));";
|
||||
"rb_define_const($module,\"$symname\", rb_str_new(\"$1\",1));";
|
||||
|
||||
%typemap(constant) bool
|
||||
"rb_define_const($module,\"$symname\", ($1 ? Qtrue : Qfalse));";
|
||||
"rb_define_const($module,\"$symname\", ($1 ? Qtrue : Qfalse));";
|
||||
|
||||
%typemap(constant) char *
|
||||
"rb_define_const($module,\"$symname\", rb_str_new2(\"$1\"));";
|
||||
"rb_define_const($module,\"$symname\", rb_str_new2(\"$1\"));";
|
||||
|
||||
%typemap(constant) SWIGTYPE*, SWIGTYPE &, SWIGTYPE []
|
||||
"rb_define_const($module,\"$symname\", SWIG_NewPointerObj((void *) $1, $1_descriptor,0));";
|
||||
|
|
@ -392,28 +392,28 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/* --- Inverse arguments --- */
|
||||
/* directorin typemaps */
|
||||
|
||||
/* Primitive datatypes */
|
||||
|
||||
%typemap(inv) int "$input = INT2NUM($1);";
|
||||
%typemap(inv) short "$input = INT2NUM($1);";
|
||||
%typemap(inv) long "$input = LONG2NUM($1);";
|
||||
%typemap(inv) signed char "$input = INT2NUM($1);";
|
||||
%typemap(inv) float "$input = rb_float_new($1);";
|
||||
%typemap(inv) double "$input = rb_float_new($1);";
|
||||
%typemap(inv) char* "$input = rb_str_new2($1);";
|
||||
%typemap(inv) bool "$input = $1 ? Qtrue : Qfalse;";
|
||||
%typemap(directorin) int "$input = INT2NUM($1);";
|
||||
%typemap(directorin) short "$input = INT2NUM($1);";
|
||||
%typemap(directorin) long "$input = LONG2NUM($1);";
|
||||
%typemap(directorin) signed char "$input = INT2NUM($1);";
|
||||
%typemap(directorin) float "$input = rb_float_new($1);";
|
||||
%typemap(directorin) double "$input = rb_float_new($1);";
|
||||
%typemap(directorin) char* "$input = rb_str_new2($1);";
|
||||
%typemap(directorin) bool "$input = $1 ? Qtrue : Qfalse;";
|
||||
|
||||
%typemap(inv) unsigned int "$input = UINT2NUM($1);";
|
||||
%typemap(inv) unsigned short "$input = UINT2NUM($1);";
|
||||
%typemap(inv) unsigned long "$input = ULONG2NUM($1);";
|
||||
%typemap(inv) unsigned char "$input = UINT2NUM($1);";
|
||||
|
||||
%typemap(inv) VALUE "$input = $1;";
|
||||
%typemap(directorin) unsigned int "$input = UINT2NUM($1);";
|
||||
%typemap(directorin) unsigned short "$input = UINT2NUM($1);";
|
||||
%typemap(directorin) unsigned long "$input = ULONG2NUM($1);";
|
||||
%typemap(directorin) unsigned char "$input = UINT2NUM($1);";
|
||||
|
||||
%typemap(directorin) VALUE "$input = $1;";
|
||||
|
||||
/*
|
||||
%typemap(inv, parse="s") SWIGTYPE {
|
||||
%typemap(directorin, parse="s") SWIGTYPE {
|
||||
{
|
||||
$&1_ltype resultptr;
|
||||
resultptr = new $1_ltype(($1_ltype &) $1);
|
||||
|
|
@ -423,60 +423,60 @@
|
|||
*/
|
||||
|
||||
/* no can do... see python.cxx
|
||||
%typemap(inv) DIRECTORTYPE * {
|
||||
{
|
||||
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
||||
if (!proxy) {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||
} else {
|
||||
$input = proxy->__get_self();
|
||||
}
|
||||
}
|
||||
%typemap(directorin) DIRECTORTYPE * {
|
||||
{
|
||||
__DIRECTOR__$1_ltype proxy = dynamic_cast<__DIRECTOR__$1_ltype>($1_name);
|
||||
if (!proxy) {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||
} else {
|
||||
$input = proxy->__get_self();
|
||||
}
|
||||
}
|
||||
}
|
||||
%typemap(inv) SWIGTYPE * {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, 0);
|
||||
%typemap(directorin) SWIGTYPE * {
|
||||
$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 [] {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
||||
%typemap(directorin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* --- Outverse arguments --- */
|
||||
/* --- directorout typemaps --- */
|
||||
|
||||
%define OUTV_TYPEMAP(type, converter)
|
||||
%typemap(argoutv) type *OUTV "*$result = (type) converter($input);";
|
||||
%typemap(outv) type "$result = (type) converter($input);";
|
||||
%typemap(outv) type &OUTV = type
|
||||
%define DIRECTOROUT_TYPEMAP(type, converter)
|
||||
%typemap(directorargout) type *DIRECTOROUT "*$result = (type) converter($input);";
|
||||
%typemap(directorout) type "$result = (type) converter($input);";
|
||||
%typemap(directorout) type &DIRECTOROUT = type
|
||||
%enddef
|
||||
|
||||
OUTV_TYPEMAP(char, NUM2INT);
|
||||
OUTV_TYPEMAP(unsigned char, NUM2UINT);
|
||||
OUTV_TYPEMAP(short, NUM2INT);
|
||||
OUTV_TYPEMAP(unsigned short, NUM2INT);
|
||||
OUTV_TYPEMAP(int, NUM2INT);
|
||||
OUTV_TYPEMAP(unsigned int, NUM2INT);
|
||||
OUTV_TYPEMAP(long, NUM2INT);
|
||||
OUTV_TYPEMAP(unsigned long, NUM2INT);
|
||||
OUTV_TYPEMAP(long long, NUM2INT);
|
||||
OUTV_TYPEMAP(unsigned long long, NUM2INT);
|
||||
OUTV_TYPEMAP(float, NUM2DBL);
|
||||
OUTV_TYPEMAP(double, NUM2DBL);
|
||||
OUTV_TYPEMAP(bool, RTEST);
|
||||
DIRECTOROUT_TYPEMAP(char, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(unsigned char, NUM2UINT);
|
||||
DIRECTOROUT_TYPEMAP(short, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(unsigned short, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(int, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(unsigned int, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(long, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(unsigned long, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(long long, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(unsigned long long, NUM2INT);
|
||||
DIRECTOROUT_TYPEMAP(float, NUM2DBL);
|
||||
DIRECTOROUT_TYPEMAP(double, NUM2DBL);
|
||||
DIRECTOROUT_TYPEMAP(bool, RTEST);
|
||||
|
||||
|
||||
%typemap(outv) SWIGTYPE *,
|
||||
SWIGTYPE &,
|
||||
SWIGTYPE []
|
||||
%typemap(directorout) SWIGTYPE *,
|
||||
SWIGTYPE &,
|
||||
SWIGTYPE []
|
||||
"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)
|
||||
|
|
@ -525,21 +525,21 @@ typedef unsigned long VALUE;
|
|||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_INTEGER)
|
||||
int, short, long,
|
||||
unsigned int, unsigned short, unsigned long,
|
||||
signed char, unsigned char,
|
||||
long long, unsigned long long,
|
||||
const int &, const short &, const long &,
|
||||
const unsigned int &, const unsigned short &, const unsigned long &,
|
||||
const long long &, const unsigned long long &,
|
||||
enum SWIGTYPE
|
||||
int, short, long,
|
||||
unsigned int, unsigned short, unsigned long,
|
||||
signed char, unsigned char,
|
||||
long long, unsigned long long,
|
||||
const int &, const short &, const long &,
|
||||
const unsigned int &, const unsigned short &, const unsigned long &,
|
||||
const long long &, const unsigned long long &,
|
||||
enum SWIGTYPE
|
||||
{
|
||||
$1 = ((TYPE($input) == T_FIXNUM) || (TYPE($input) == T_BIGNUM)) ? 1 : 0;
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_DOUBLE)
|
||||
float, double,
|
||||
const float &, const double &
|
||||
float, double,
|
||||
const float &, const double &
|
||||
{
|
||||
$1 = ((TYPE($input) == T_FLOAT) || (TYPE($input) == T_FIXNUM) || (TYPE($input) == T_BIGNUM)) ? 1 : 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,18 +54,18 @@ namespace std {
|
|||
$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)
|
||||
$result = std::string(StringValuePtr($input));
|
||||
else
|
||||
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) {
|
||||
temp = std::string(StringValuePtr($input));
|
||||
$result = &temp;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
#define WARN_TYPEMAP_VAR_UNDEF 466
|
||||
#define WARN_TYPEMAP_TYPECHECK 467
|
||||
#define WARN_TYPEMAP_THROW 468
|
||||
#define WARN_TYPEMAP_INV_UNDEF 469
|
||||
#define WARN_TYPEMAP_DIRECTORIN_UNDEF 469
|
||||
|
||||
/* -- General code generation -- */
|
||||
|
||||
|
|
|
|||
|
|
@ -781,7 +781,7 @@ class JAVA : public Language {
|
|||
Swig_typemap_attach_parms("jni", l, f);
|
||||
Swig_typemap_attach_parms("jtype", l, f);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -1037,7 +1037,7 @@ class JAVA : public Language {
|
|||
|
||||
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);
|
||||
|
||||
Delete(jdescrip);
|
||||
|
|
@ -1087,8 +1087,8 @@ class JAVA : public Language {
|
|||
|
||||
Delete(jdescrip);
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
||||
"No or improper inv typemap defined for %s\n", c_return_type);
|
||||
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||
"No or improper directorin typemap defined for %s\n", c_return_type);
|
||||
}
|
||||
|
||||
Printf(f->code, " }\n");
|
||||
|
|
@ -2690,7 +2690,7 @@ class JAVA : public Language {
|
|||
Swig_typemap_attach_parms("out", l, w);
|
||||
Swig_typemap_attach_parms("jni", 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);
|
||||
|
||||
/* Get the JNI field descriptor for this return type */
|
||||
|
|
@ -2706,16 +2706,16 @@ class JAVA : public Language {
|
|||
Delete(jretval_decl);
|
||||
}
|
||||
|
||||
if ((tm = Swig_typemap_lookup_new("inv", tp, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(tp, "tmap:inv:parse")) != NULL) {
|
||||
if ((tm = Swig_typemap_lookup_new("directorin", tp, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(tp, "tmap:directorin:parse")) != NULL) {
|
||||
String *jnidesc_canon;
|
||||
|
||||
jnidesc_canon = canonicalJNIFDesc(jdesc, n, jniret_type);
|
||||
Append(jniret_desc, jnidesc_canon);
|
||||
Delete(jnidesc_canon);
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
||||
"No or improper inv typemap defined for %s\n", SwigType_str(jniret_type,0));
|
||||
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||
"No or improper directorin typemap defined for %s\n", SwigType_str(jniret_type,0));
|
||||
output_director = false;
|
||||
}
|
||||
|
||||
|
|
@ -2729,16 +2729,16 @@ class JAVA : public Language {
|
|||
{
|
||||
String *jdesc;
|
||||
|
||||
if ((tm = Swig_typemap_lookup_new("inv", retpm, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(retpm, "tmap:inv:parse")) != NULL) {
|
||||
if ((tm = Swig_typemap_lookup_new("directorin", retpm, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(retpm, "tmap:directorin:parse")) != NULL) {
|
||||
String *jnidesc_canon;
|
||||
|
||||
jnidesc_canon = canonicalJNIFDesc(jdesc, n, return_type);
|
||||
Append(classret_desc, jnidesc_canon);
|
||||
Delete(jnidesc_canon);
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
||||
"No or improper inv typemap defined for %s\n", SwigType_str(jniret_type,0));
|
||||
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||
"No or improper directorin typemap defined for %s\n", SwigType_str(jniret_type,0));
|
||||
output_director = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -2805,8 +2805,8 @@ class JAVA : public Language {
|
|||
Parm *tp = NewParm(classname, empty_str);
|
||||
String *jdesc;
|
||||
|
||||
if ((tm = Swig_typemap_lookup_new("inv", tp, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(tp, "tmap:inv:parse")) != NULL) {
|
||||
if ((tm = Swig_typemap_lookup_new("directorin", tp, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(tp, "tmap:directorin:parse")) != NULL) {
|
||||
String *jni_canon;
|
||||
|
||||
jni_canon = canonicalJNIFDesc(jdesc, n, classname);
|
||||
|
|
@ -2814,8 +2814,8 @@ class JAVA : public Language {
|
|||
Delete(jni_canon);
|
||||
Delete(tm);
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
||||
"No or improper inv typemap defined for %s\n", SwigType_str(classname, 0));
|
||||
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||
"No or improper directorin typemap defined for %s\n", SwigType_str(classname, 0));
|
||||
output_director = false;
|
||||
}
|
||||
|
||||
|
|
@ -2865,10 +2865,10 @@ class JAVA : public Language {
|
|||
Wrapper_add_local(w, arg, c_decl);
|
||||
|
||||
/* Add input marshalling code and update JNI field descriptor */
|
||||
if ((desc_tm = Swig_typemap_lookup_new("inv", tp, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(tp, "tmap:inv:parse")) != NULL) {
|
||||
if ((tm = Getattr(p, "tmap:inv")) != NULL
|
||||
&& (cdesc = Getattr(p, "tmap:inv:parse")) != NULL) {
|
||||
if ((desc_tm = Swig_typemap_lookup_new("directorin", tp, "", 0)) != NULL
|
||||
&& (jdesc = Getattr(tp, "tmap:directorin:parse")) != NULL) {
|
||||
if ((tm = Getattr(p, "tmap:directorin")) != NULL
|
||||
&& (cdesc = Getattr(p, "tmap:directorin:parse")) != NULL) {
|
||||
String *jni_canon;
|
||||
|
||||
jni_canon = canonicalJNIFDesc(jdesc, n, c_param_type);
|
||||
|
|
@ -2927,16 +2927,16 @@ class JAVA : public Language {
|
|||
|
||||
p = Getattr(p, "tmap:in:next");
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
||||
"No or improper inv typemap defined for %s\n", SwigType_str(pt, 0));
|
||||
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||
"No or improper directorin typemap defined for %s\n", SwigType_str(pt, 0));
|
||||
output_director = false;
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
||||
Delete(desc_tm);
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_INV_UNDEF, input_file, line_number,
|
||||
"No or improper inv typemap defined for %s\n", SwigType_str(c_param_type, 0));
|
||||
Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number,
|
||||
"No or improper directorin typemap defined for %s\n", SwigType_str(c_param_type, 0));
|
||||
output_director = false;
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1555,9 +1555,9 @@ public:
|
|||
String *arglist = NewString("");
|
||||
|
||||
Swig_typemap_attach_parms("in", l, w);
|
||||
Swig_typemap_attach_parms("inv", l, w);
|
||||
Swig_typemap_attach_parms("outv", l, w);
|
||||
Swig_typemap_attach_parms("argoutv", l, w);
|
||||
Swig_typemap_attach_parms("directorin", l, w);
|
||||
Swig_typemap_attach_parms("directorout", l, w);
|
||||
Swig_typemap_attach_parms("directorargout", l, w);
|
||||
|
||||
Parm* p;
|
||||
int num_arguments = emit_num_arguments(l);
|
||||
|
|
@ -1575,18 +1575,18 @@ public:
|
|||
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* ptype = Getattr(p, "type");
|
||||
|
||||
Putc(',',arglist);
|
||||
if ((tm = Getattr(p, "tmap:inv")) != 0) {
|
||||
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||
Replaceall(tm, "$input", pname);
|
||||
Replaceall(tm, "$owner", "0");
|
||||
if (Len(tm) == 0) Append(tm, pname);
|
||||
Printv(wrap_args, tm, "\n", NIL);
|
||||
p = Getattr(p, "tmap:inv:next");
|
||||
p = Getattr(p, "tmap:directorin:next");
|
||||
continue;
|
||||
} else
|
||||
if (Cmp(ptype, "void")) {
|
||||
|
|
@ -1648,7 +1648,7 @@ public:
|
|||
Delete(mangle);
|
||||
Delete(nonconst);
|
||||
} 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);
|
||||
status = SWIG_NOWRAP;
|
||||
break;
|
||||
|
|
@ -1725,11 +1725,11 @@ public:
|
|||
* occurs in Language::cDeclaration().
|
||||
*/
|
||||
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);
|
||||
if (tm == 0) {
|
||||
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);
|
||||
}
|
||||
if (tm != 0) {
|
||||
|
|
@ -1751,11 +1751,11 @@ public:
|
|||
|
||||
/* marshal outputs */
|
||||
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, "$result", Getattr(p, "name"));
|
||||
Printv(w->code, tm, "\n", NIL);
|
||||
p = Getattr(p, "tmap:argoutv:next");
|
||||
p = Getattr(p, "tmap:directorargout:next");
|
||||
} else {
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1320,9 +1320,9 @@ public:
|
|||
String* parse_args = NewString("");
|
||||
|
||||
Swig_typemap_attach_parms("in", l, w);
|
||||
Swig_typemap_attach_parms("inv", l, w);
|
||||
Swig_typemap_attach_parms("outv", l, w);
|
||||
Swig_typemap_attach_parms("argoutv", l, w);
|
||||
Swig_typemap_attach_parms("directorin", l, w);
|
||||
Swig_typemap_attach_parms("directorout", l, w);
|
||||
Swig_typemap_attach_parms("directorargout", l, w);
|
||||
|
||||
Parm* p;
|
||||
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* ptype = Getattr(p, "type");
|
||||
|
||||
Putc(',',arglist);
|
||||
if ((tm = Getattr(p, "tmap:inv")) != 0) {
|
||||
String* parse = Getattr(p, "tmap:inv:parse");
|
||||
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||
String* parse = Getattr(p, "tmap:directorin:parse");
|
||||
if (!parse) {
|
||||
sprintf(source, "obj%d", idx++);
|
||||
Replaceall(tm, "$input", source);
|
||||
|
|
@ -1372,7 +1372,7 @@ public:
|
|||
if (Len(tm) == 0) Append(tm, pname);
|
||||
Printf(arglist, "%s", tm);
|
||||
}
|
||||
p = Getattr(p, "tmap:inv:next");
|
||||
p = Getattr(p, "tmap:directorin:next");
|
||||
continue;
|
||||
} else
|
||||
if (Cmp(ptype, "void")) {
|
||||
|
|
@ -1436,7 +1436,7 @@ public:
|
|||
Delete(mangle);
|
||||
Delete(nonconst);
|
||||
} 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);
|
||||
status = SWIG_NOWRAP;
|
||||
break;
|
||||
|
|
@ -1523,11 +1523,11 @@ public:
|
|||
* it's not just me, similar silliness also occurs in Language::cDeclaration().
|
||||
*/
|
||||
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);
|
||||
if (tm == 0) {
|
||||
String *name = NewString("result");
|
||||
tm = Swig_typemap_search("outv", return_type, name, NULL);
|
||||
tm = Swig_typemap_search("directorout", return_type, name, NULL);
|
||||
Delete(name);
|
||||
}
|
||||
if (tm != 0) {
|
||||
|
|
@ -1554,7 +1554,7 @@ public:
|
|||
|
||||
/* marshal outputs */
|
||||
for (p = l; p; ) {
|
||||
if ((tm = Getattr(p, "tmap:argoutv")) != 0) {
|
||||
if ((tm = Getattr(p, "tmap:directorargout")) != 0) {
|
||||
if (outputs > 1) {
|
||||
Printf(w->code, "output = PyTuple_GetItem(result, %d);\n", idx++);
|
||||
Replaceall(tm, "$input", "output");
|
||||
|
|
@ -1563,7 +1563,7 @@ public:
|
|||
}
|
||||
Replaceall(tm, "$result", Getattr(p, "name"));
|
||||
Printv(w->code, tm, "\n", NIL);
|
||||
p = Getattr(p, "tmap:argoutv:next");
|
||||
p = Getattr(p, "tmap:directorargout:next");
|
||||
} else {
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2295,15 +2295,15 @@ public:
|
|||
/**
|
||||
* For each parameter to the C++ member function, copy the parameter name
|
||||
* 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.
|
||||
*/
|
||||
Swig_typemap_copy_pname_to_lname(l);
|
||||
|
||||
Swig_typemap_attach_parms("in", l, w);
|
||||
Swig_typemap_attach_parms("inv", l, w);
|
||||
Swig_typemap_attach_parms("outv", l, w);
|
||||
Swig_typemap_attach_parms("argoutv", l, w);
|
||||
Swig_typemap_attach_parms("directorin", l, w);
|
||||
Swig_typemap_attach_parms("directorout", l, w);
|
||||
Swig_typemap_attach_parms("directorargout", l, w);
|
||||
|
||||
int num_arguments = emit_num_arguments(l);
|
||||
int i;
|
||||
|
|
@ -2320,20 +2320,20 @@ public:
|
|||
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* parameterType = Getattr(p, "type");
|
||||
|
||||
Putc(',',arglist);
|
||||
if ((tm = Getattr(p, "tmap:inv")) != 0) {
|
||||
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||
sprintf(source, "obj%d", idx++);
|
||||
Replaceall(tm, "$input", source);
|
||||
Replaceall(tm, "$owner", "0");
|
||||
Printv(wrap_args, tm, "\n", NIL);
|
||||
Wrapper_add_localv(w, source, "VALUE", source, "= Qnil", NIL);
|
||||
Printv(arglist, source, NIL);
|
||||
p = Getattr(p, "tmap:inv:next");
|
||||
p = Getattr(p, "tmap:directorin:next");
|
||||
continue;
|
||||
} else if (Cmp(parameterType, "void")) {
|
||||
/**
|
||||
|
|
@ -2395,7 +2395,7 @@ public:
|
|||
Delete(mangle);
|
||||
Delete(nonconst);
|
||||
} 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);
|
||||
status = SWIG_NOWRAP;
|
||||
break;
|
||||
|
|
@ -2462,11 +2462,11 @@ public:
|
|||
* It's not just me, similar silliness also occurs in Language::cDeclaration().
|
||||
*/
|
||||
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);
|
||||
if (tm == 0) {
|
||||
String *name = NewString("result");
|
||||
tm = Swig_typemap_search("outv", return_type, name, NULL);
|
||||
tm = Swig_typemap_search("directorout", return_type, name, NULL);
|
||||
Delete(name);
|
||||
}
|
||||
if (tm != 0) {
|
||||
|
|
@ -2493,7 +2493,7 @@ public:
|
|||
|
||||
/* Marshal outputs */
|
||||
for (p = l; p; ) {
|
||||
if ((tm = Getattr(p, "tmap:argoutv")) != 0) {
|
||||
if ((tm = Getattr(p, "tmap:directorargout")) != 0) {
|
||||
if (outputs > 1) {
|
||||
Printf(w->code, "output = rb_ary_entry(result, %d);\n", idx++);
|
||||
Replaceall(tm, "$input", "output");
|
||||
|
|
@ -2502,7 +2502,7 @@ public:
|
|||
}
|
||||
Replaceall(tm, "$result", Getattr(p, "name"));
|
||||
Printv(w->code, tm, "\n", NIL);
|
||||
p = Getattr(p, "tmap:argoutv:next");
|
||||
p = Getattr(p, "tmap:directorargout:next");
|
||||
} else {
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue