Cosmetic stray semi-colon removal after %typemap using quotes

This commit is contained in:
William S Fulton 2022-08-20 22:14:58 +01:00
commit c10a84c775
59 changed files with 258 additions and 256 deletions

40
CHANGES
View file

@ -3137,7 +3137,7 @@ Version 3.0.3 (30 Dec 2014)
2014-09-12: olly 2014-09-12: olly
[PHP] Add support for specifying any PHP interfaces a wrapped class [PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator"; implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator"
2014-09-11: olly 2014-09-11: olly
[PHP] Fix throwing a PHP exception through C++ from a subclassed [PHP] Fix throwing a PHP exception through C++ from a subclassed
@ -8396,8 +8396,8 @@ Version 1.3.30 (November 13, 2006)
javabase/csbase typemap, eg in the following, 'Me' will be the base class, javabase/csbase typemap, eg in the following, 'Me' will be the base class,
no matter what Foo is really derived from in the C++ layer. no matter what Foo is really derived from in the C++ layer.
%typemap(javabase, replace="1") Foo "Me"; %typemap(javabase, replace="1") Foo "Me"
%typemap(csbase, replace="1") Foo "Me"; %typemap(csbase, replace="1") Foo "Me"
Previously it was not possible for the javabase/csbase typemaps to override the C++ base. Previously it was not possible for the javabase/csbase typemaps to override the C++ base.
@ -9884,7 +9884,7 @@ Version 1.3.28 (February 12, 2006)
solutions is to write: solutions is to write:
%typemap(in) A * {...} %typemap(in) A * {...}
%typemap(freeag) A * ""; %typemap(freeag) A * ""
overload 'freearg' with an empty definition. overload 'freearg' with an empty definition.
@ -11314,20 +11314,20 @@ Version 1.3.27 (October 15, 2005)
then the typemap will be inserted without the block then the typemap will be inserted without the block
imposed by the brackets, similar to imposed by the brackets, similar to
%typemap(in) Hello "..."; %typemap(in) Hello "..."
So, why you don't just use the quote style?, because: So, why you don't just use the quote style?, because:
1.- The quote style doesn't get preprocessed, for example 1.- The quote style doesn't get preprocessed, for example
%typemap(in) Hello "$1= SWIG_macro($1);"; %typemap(in) Hello "$1= SWIG_macro($1);"
here, SWIG_macro doesn't get expanded here, SWIG_macro doesn't get expanded
2.- Inside a quote typemap, you have to use 2.- Inside a quote typemap, you have to use
quotes carefully quotes carefully
%typemap(in) Hello "$1 = \"hello\" "; %typemap(in) Hello "$1 = \"hello\" "
3.- You can't make emacs and/or other editors 3.- You can't make emacs and/or other editors
to indent inside a string!. to indent inside a string!.
@ -11529,7 +11529,7 @@ Version 1.3.26 (October 9, 2005)
%define hello(name, Type) %define hello(name, Type)
%define name ## a(Type) %define name ## a(Type)
%typemap(in) Type "hello;"; %typemap(in) Type "hello;"
%enddef %enddef
%enddef %enddef
@ -13525,7 +13525,7 @@ Version 1.3.23 (November 11, 2004)
whereupon the default of 0 was used. You can get the same behaviour for C whereupon the default of 0 was used. You can get the same behaviour for C
code by using the "default" typemap: code by using the "default" typemap:
%typemap(default) int val "$1 = 0;"; %typemap(default) int val "$1 = 0;"
%{ %{
void foo(int val); void foo(int val);
%} %}
@ -13854,9 +13854,11 @@ Version 1.3.22 (September 4, 2004)
specifiers from the C type. This makes it possible, for instance, to control specifiers from the C type. This makes it possible, for instance, to control
whether a C "char" argument takes a Lisp character or a Lisp integer value. whether a C "char" argument takes a Lisp character or a Lisp integer value.
The default (taking Lisp characters) is done by these built-in typemaps: The default (taking Lisp characters) is done by these built-in typemaps:
%typemap(ffitype) char ":char"; %typemap(lisptype) char "character"; %typemap(ffitype) char ":char"
%typemap(lisptype) char "character"
If char means an integer instead, use these typemaps: If char means an integer instead, use these typemaps:
%typemap(ffitype) char ":char"; %typemap(lisptype) char "integer"; %typemap(ffitype) char ":char"
%typemap(lisptype) char "integer"
08/22/2004: wsfulton 08/22/2004: wsfulton
As discussed in bug #772453, the SWIG library directory is now installed As discussed in bug #772453, the SWIG library directory is now installed
@ -18874,9 +18876,9 @@ Version 1.3.14 (August 12, 2002)
shadowinterface shadowinterface
Note that it is possible to target a particular proxy class: Note that it is possible to target a particular proxy class:
%typemap(javaimports) Foo "import java.util.*"; %typemap(javaimports) Foo "import java.util.*"
or a particular type wrapper class: or a particular type wrapper class:
%typemap(javaimports) double* "import java.math.*"; %typemap(javaimports) double* "import java.math.*"
Note that $javaclassname in these typemaps are substituted with either the proxy Note that $javaclassname in these typemaps are substituted with either the proxy
classname when using proxy classes or the SWIGTYPE class name. classname when using proxy classes or the SWIGTYPE class name.
@ -21071,7 +21073,7 @@ Version 1.3.11 (January 31, 2002)
Second, a typemap can force a no-match by defining Second, a typemap can force a no-match by defining
%typemap(in) sometype "pass"; %typemap(in) sometype "pass"
If this is used, the typemap system will *not* record a If this is used, the typemap system will *not* record a
typemap match for "sometype". This can be used to block typemap match for "sometype". This can be used to block
@ -21079,7 +21081,7 @@ Version 1.3.11 (January 31, 2002)
a typemap feature for some type, you could do this. a typemap feature for some type, you could do this.
// Do not allow global variables of type 'const char *' to be set. // Do not allow global variables of type 'const char *' to be set.
%typemap(varin) const char * "pass"; %typemap(varin) const char * "pass"
It might also be possible to use this to do subtle and It might also be possible to use this to do subtle and
strange things with typemaps. For example, if you wanted to strange things with typemaps. For example, if you wanted to
@ -21093,8 +21095,8 @@ Version 1.3.11 (January 31, 2002)
... return a value ... ... return a value ...
} }
/* Block unqualified typemaps defined above */ /* Block unqualified typemaps defined above */
%typemap(ignore) const blah * "pass"; %typemap(ignore) const blah * "pass"
%typemap(argout) const blah * "pass"; %typemap(argout) const blah * "pass"
%typemap(in) const blah * { %typemap(in) const blah * {
... get input value ... ... get input value ...
} }
@ -21871,7 +21873,7 @@ Version 1.3.10 (December 10, 2001)
%typemap directive can now accept nearly arbitrary keyword parameters. %typemap directive can now accept nearly arbitrary keyword parameters.
For example: For example:
%typemap(in,parse="i",doc="integer") int "..."; %typemap(in,parse="i",doc="integer") int "..."
The purpose of the keyword parameters is to supply code generation The purpose of the keyword parameters is to supply code generation
hints to the target language module. The intepretation of the hints to the target language module. The intepretation of the
@ -23949,7 +23951,7 @@ Version 1.3 Alpha 4 (September 4, 2000)
Typemaps can now be specified using string literals like Typemaps can now be specified using string literals like
this: this:
%typemap(in) int "$target = SvIV($source);"; %typemap(in) int "$target = SvIV($source);"
When code is specified like this, it is *NOT* enclosed When code is specified like this, it is *NOT* enclosed
inside a local scope (as with older typemap declarations). inside a local scope (as with older typemap declarations).

View file

@ -668,7 +668,7 @@ results. For example:
<div class="code"> <div class="code">
<pre> <pre>
%typemap(newfree) char * "free($1);"; %typemap(newfree) char * "free($1);"
... ...
%newobject strdup; %newobject strdup;
... ...

View file

@ -278,7 +278,7 @@ Like, $imcall, this special variable is only expanded in the "dout" typemap.
<p>This macro is used in the <tt>dimports</tt> typemap if a dependency on another D type generated by SWIG is added by a custom typemap.</p> <p>This macro is used in the <tt>dimports</tt> typemap if a dependency on another D type generated by SWIG is added by a custom typemap.</p>
<p>Consider the following code snippet:</p> <p>Consider the following code snippet:</p>
<div class="code"><pre> <div class="code"><pre>
%typemap(dinterfaces) SomeClass "AnInterface, AnotherInterface"; %typemap(dinterfaces) SomeClass "AnInterface, AnotherInterface"
</pre></div> </pre></div>
<p>This causes SWIG to add <tt>AnInterface</tt> and <tt>AnotherInterface</tt> to the base class list of <tt>SomeClass</tt>:</p> <p>This causes SWIG to add <tt>AnInterface</tt> and <tt>AnotherInterface</tt> to the base class list of <tt>SomeClass</tt>:</p>
<div class="targetlang"><pre> <div class="targetlang"><pre>

View file

@ -1114,7 +1114,7 @@ name of the type with namespace scope delimiters (<tt>::</tt>) replaced with a d
change this, you can define your own typemaps for the custom types, e.g: change this, you can define your own typemaps for the custom types, e.g:
</p> </p>
<div class="code"><pre> <div class="code"><pre>
%typemap(doctype) MyDate "datetime.date"; %typemap(doctype) MyDate "datetime.date"
</pre></div> </pre></div>
<p> <p>

View file

@ -4218,7 +4218,7 @@ You can copy the code below into an interface file and run SWIG on it and examin
%} %}
// Expose C++ exception as a Java Exception by changing the Java base class and providing a getMessage() // Expose C++ exception as a Java Exception by changing the Java base class and providing a getMessage()
%typemap(javabase) MyNS::MyException "java.lang.RuntimeException"; %typemap(javabase) MyNS::MyException "java.lang.RuntimeException"
%rename(getMessage) MyNS::MyException::whatsup; %rename(getMessage) MyNS::MyException::whatsup;
%inline %{ %inline %{
@ -7065,7 +7065,7 @@ The corrected interface file looks like:
<pre> <pre>
// class Foo is handled in a different interface file: // class Foo is handled in a different interface file:
%import "Foo.i" %import "Foo.i"
%typemap("javapackage") Foo, Foo *, Foo &amp; "com.wombat.foo"; %typemap("javapackage") Foo, Foo *, Foo &amp; "com.wombat.foo"
%feature("director") Example; %feature("director") Example;
%inline { %inline {
@ -7093,11 +7093,11 @@ Note the helper macros below, <code>OTHER_PACKAGE_SPEC</code> and <code>ANOTHER_
"package.for.most.classes"; "package.for.most.classes";
%define OTHER_PACKAGE_SPEC(TYPE...) %define OTHER_PACKAGE_SPEC(TYPE...)
%typemap("javapackage") TYPE, TYPE *, TYPE &amp; "package.for.other.classes"; %typemap("javapackage") TYPE, TYPE *, TYPE &amp; "package.for.other.classes"
%enddef %enddef
%define ANOTHER_PACKAGE_SPEC(TYPE...) %define ANOTHER_PACKAGE_SPEC(TYPE...)
%typemap("javapackage") TYPE, TYPE *, TYPE &amp; "package.for.another.set"; %typemap("javapackage") TYPE, TYPE *, TYPE &amp; "package.for.another.set"
%enddef %enddef
OTHER_PACKAGE_SPEC(Package_2_class_one) OTHER_PACKAGE_SPEC(Package_2_class_one)
@ -7291,7 +7291,7 @@ The typemaps to use then are as follows:
<div class="code"> <div class="code">
<pre> <pre>
%typemap(javabase) FileException "java.lang.Exception"; %typemap(javabase) FileException "java.lang.Exception"
%typemap(javacode) FileException %{ %typemap(javacode) FileException %{
public String getMessage() { public String getMessage() {
return what(); return what();

View file

@ -264,7 +264,7 @@ Let's edit the interface file such that the C type "div_t*" is changed
<div class="code"><pre> <div class="code"><pre>
%module test %module test
%typemap(cin) div_t* ":my-pointer"; %typemap(cin) div_t* ":my-pointer"
%feature("intern_function", "1"); %feature("intern_function", "1");
%feature("export"); %feature("export");

View file

@ -836,7 +836,7 @@ so:
</p> </p>
<div class="code"><pre> <div class="code"><pre>
%typemap("phpinterfaces") MyIterator "Iterator"; %typemap("phpinterfaces") MyIterator "Iterator"
</pre></div> </pre></div>
<p> <p>

View file

@ -1707,7 +1707,7 @@ For example: </p>
<div class="code"> <div class="code">
<pre>%rename("is_it_safe?") is_it_safe(); <pre>%rename("is_it_safe?") is_it_safe();
%typemap(out) int is_it_safe "$result = ($1 != 0) ? Qtrue : Qfalse;"; %typemap(out) int is_it_safe "$result = ($1 != 0) ? Qtrue : Qfalse;"
int is_it_safe();</pre> int is_it_safe();</pre>
</div> </div>

View file

@ -787,7 +787,7 @@ Here are some examples of valid typemap specifications:
%typemap(in) int { %typemap(in) int {
$1 = PyInt_AsLong($input); $1 = PyInt_AsLong($input);
} }
%typemap(in) int "$1 = PyInt_AsLong($input);"; %typemap(in) int "$1 = PyInt_AsLong($input);"
%typemap(in) int %{ %typemap(in) int %{
$1 = PyInt_AsLong($input); $1 = PyInt_AsLong($input);
%} %}
@ -803,7 +803,7 @@ Here are some examples of valid typemap specifications:
} }
/* Typemap with modifiers */ /* Typemap with modifiers */
%typemap(in, doc="integer") int "$1 = scm_to_int($input);"; %typemap(in, doc="integer") int "$1 = scm_to_int($input);"
/* Typemap applied to patterns of multiple arguments */ /* Typemap applied to patterns of multiple arguments */
%typemap(in) (char *str, int len), %typemap(in) (char *str, int len),
@ -1356,13 +1356,13 @@ const reference are written like this:
<div class="code"> <div class="code">
<pre> <pre>
%typemap(in) int "... convert to int ..."; %typemap(in) int "... convert to int ..."
%typemap(in) short "... convert to short ..."; %typemap(in) short "... convert to short ..."
%typemap(in) float "... convert to float ..."; %typemap(in) float "... convert to float ..."
... ...
%typemap(in) const int &amp; "... convert ..."; %typemap(in) const int &amp; "... convert ..."
%typemap(in) const short &amp; "... convert ..."; %typemap(in) const short &amp; "... convert ..."
%typemap(in) const float &amp; "... convert ..."; %typemap(in) const float &amp; "... convert ..."
... ...
</pre> </pre>
</div> </div>
@ -1943,7 +1943,7 @@ Occasionally, typemap code will be specified using a few alternative forms. For
<div class="code"> <div class="code">
<pre> <pre>
%typemap(in) int "$1 = PyInt_AsLong($input);"; %typemap(in) int "$1 = PyInt_AsLong($input);"
%typemap(in) int %{ %typemap(in) int %{
$1 = PyInt_AsLong($input); $1 = PyInt_AsLong($input);
%} %}

View file

@ -42,8 +42,8 @@ void *string_to_uintptr(char *in)
// These typemaps convert between an array of strings in Go and a // These typemaps convert between an array of strings in Go and a
// const char** that is NULL terminated in C++. // const char** that is NULL terminated in C++.
%typemap(gotype) (const char * const *) "[]string"; %typemap(gotype) (const char * const *) "[]string"
%typemap(imtype) (const char * const *) "uintptr"; %typemap(imtype) (const char * const *) "uintptr"
%typemap(goin) (const char * const *) { %typemap(goin) (const char * const *) {
if $input == nil || len($input) == 0 { if $input == nil || len($input) == 0 {
$result = 0 $result = 0

View file

@ -15,7 +15,7 @@ extern int squareCubed (int n, int *OUTPUT);
extern int gcd(int x, int y); extern int gcd(int x, int y);
%typemap(arginit) (int argc, char *argv[]) "$2 = 0;"; %typemap(arginit) (int argc, char *argv[]) "$2 = 0;"
%typemap(in) (int argc, char *argv[]) { %typemap(in) (int argc, char *argv[]) {
AV *tempav; AV *tempav;

View file

@ -14,7 +14,7 @@ extern int squareCubed (int n, int *OUTPUT);
extern int gcd(int x, int y); extern int gcd(int x, int y);
%typemap(arginit) (int argc, char *argv[]) "$2 = 0;"; %typemap(arginit) (int argc, char *argv[]) "$2 = 0;"
%typemap(in) (int argc, char *argv[]) { %typemap(in) (int argc, char *argv[]) {
Tcl_Obj **listobjv = 0; Tcl_Obj **listobjv = 0;

View file

@ -5,8 +5,8 @@
%feature("autodoc"); %feature("autodoc");
// special typemap and its docs // special typemap and its docs
%typemap(in) (int c, int d) "$1 = 0; $2 = 0;"; %typemap(in) (int c, int d) "$1 = 0; $2 = 0;"
%typemap(doc,name="hello",type="Tuple") (int c, int d) "hello: int tuple[2]"; %typemap(doc,name="hello",type="Tuple") (int c, int d) "hello: int tuple[2]"
// testing for different documentation levels // testing for different documentation levels
%feature("autodoc","0") A::func0; // names %feature("autodoc","0") A::func0; // names
@ -69,8 +69,8 @@
%typemap(doc) (int c, int d); %typemap(doc) (int c, int d);
// docs for some parameters // docs for some parameters
%typemap(doc) int a "a: special comment for parameter a"; %typemap(doc) int a "a: special comment for parameter a"
%typemap(doc) int b "b: another special comment for parameter b"; %typemap(doc) int b "b: another special comment for parameter b"
%feature("autodoc","0") C::C(int a, int b, Hola h); // names %feature("autodoc","0") C::C(int a, int b, Hola h); // names
%feature("autodoc","1") D::D(int a, int b, Hola h); // names + types %feature("autodoc","1") D::D(int a, int b, Hola h); // names + types

View file

@ -144,7 +144,7 @@
%rename(renamed2arg) Foo::renameme(int x) const; %rename(renamed2arg) Foo::renameme(int x) const;
%rename(renamed1arg) Foo::renameme() const; %rename(renamed1arg) Foo::renameme() const;
%typemap(default) double* null_by_default "$1=0;"; %typemap(default) double* null_by_default "$1=0;"
%inline %{ %inline %{
typedef void* MyHandle; typedef void* MyHandle;

View file

@ -21,7 +21,7 @@ int bar(int a)
} }
%} %}
%typemap(in,fragment="Hi") int hola "$1 = 123;"; %typemap(in,fragment="Hi") int hola "$1 = 123;"
%inline %{ %inline %{

View file

@ -161,8 +161,8 @@ void *string_to_uintptr(char *in)
// These typemaps convert between an array of strings in Go and a // These typemaps convert between an array of strings in Go and a
// const char** that is NULL terminated in C++. // const char** that is NULL terminated in C++.
%typemap(gotype) (const char * const *) "[]string"; %typemap(gotype) (const char * const *) "[]string"
%typemap(imtype) (const char * const *) "uintptr"; %typemap(imtype) (const char * const *) "uintptr"
%typemap(goin) (const char * const *) { %typemap(goin) (const char * const *) {
if $input == nil || len($input) == 0 { if $input == nil || len($input) == 0 {
$result = 0 $result = 0

View file

@ -2,11 +2,11 @@
%module ignore_parameter %module ignore_parameter
%typemap(in,numinputs=0) char* a "static const char* hi = \"hello\"; $1 = const_cast<char *>(hi);"; %typemap(in,numinputs=0) char* a "static const char* hi = \"hello\"; $1 = const_cast<char *>(hi);"
%typemap(in,numinputs=0) int bb "$1 = 101; called_argout = 0;"; %typemap(in,numinputs=0) int bb "$1 = 101; called_argout = 0;"
%typemap(in,numinputs=0) double ccc "$1 = 8.8;"; %typemap(in,numinputs=0) double ccc "$1 = 8.8;"
%typemap(freearg) char* a ""; // ensure freearg is not generated (needed for Java at least) %typemap(freearg) char* a "" // ensure freearg is not generated (needed for Java at least)
%typemap(argout) int bb "called_argout = 1;" %typemap(argout) int bb "called_argout = 1;"

View file

@ -139,7 +139,7 @@
%rename(MyJavaException2) MyNS::Exception2; %rename(MyJavaException2) MyNS::Exception2;
%rename(MyJavaUnexpected) MyNS::Unexpected; %rename(MyJavaUnexpected) MyNS::Unexpected;
%typemap(javabase) ::MyNS::Exception1,::MyNS::Exception2,::MyNS::Unexpected "java.lang.Exception"; %typemap(javabase) ::MyNS::Exception1,::MyNS::Exception2,::MyNS::Unexpected "java.lang.Exception"
%rename(getMessage) what() const; // Rename all what() methods %rename(getMessage) what() const; // Rename all what() methods
namespace MyNS { namespace MyNS {

View file

@ -146,7 +146,7 @@
%rename(MyJavaException2) MyNS::Exception2; %rename(MyJavaException2) MyNS::Exception2;
%rename(MyJavaUnexpected) MyNS::Unexpected; %rename(MyJavaUnexpected) MyNS::Unexpected;
%typemap(javabase) ::MyNS::Exception1,::MyNS::Exception2,::MyNS::Unexpected "java.lang.Exception"; %typemap(javabase) ::MyNS::Exception1,::MyNS::Exception2,::MyNS::Unexpected "java.lang.Exception"
%rename(getMessage) what() const; // Rename all what() methods %rename(getMessage) what() const; // Rename all what() methods
namespace MyNS { namespace MyNS {

View file

@ -88,7 +88,7 @@ int ioTest() { return 0; }
%} %}
// except feature (%javaexception) specifying a checked exception class for the throws clause // except feature (%javaexception) specifying a checked exception class for the throws clause
%typemap(javabase) MyException "Throwable"; %typemap(javabase) MyException "Throwable"
%typemap(javacode) MyException %{ %typemap(javacode) MyException %{
public static final long serialVersionUID = 0x52151000; // Suppress ecj warning public static final long serialVersionUID = 0x52151000; // Suppress ecj warning
%} %}

View file

@ -3,21 +3,21 @@
%module java_typemaps_proxy %module java_typemaps_proxy
%typemap(javaimports) SWIGTYPE "import java.math.*;"; %typemap(javaimports) SWIGTYPE "import java.math.*;"
%typemap(javacode) NS::Farewell %{ %typemap(javacode) NS::Farewell %{
public void saybye(BigDecimal num_times) { public void saybye(BigDecimal num_times) {
// BigDecimal requires the java.math library // BigDecimal requires the java.math library
} }
%} %}
%typemap(javaclassmodifiers) NS::Farewell "public final class"; %typemap(javaclassmodifiers) NS::Farewell "public final class"
%typemap(javaimports) NS::Greeting %{ %typemap(javaimports) NS::Greeting %{
import java.util.*; // for EventListener import java.util.*; // for EventListener
import java.lang.*; // for Exception import java.lang.*; // for Exception
%}; %};
%typemap(javabase) NS::Greeting "Exception"; %typemap(javabase) NS::Greeting "Exception"
%typemap(javainterfaces) NS::Greeting "EventListener"; %typemap(javainterfaces) NS::Greeting "EventListener"
%typemap(javacode) NS::Greeting %{ %typemap(javacode) NS::Greeting %{
public static final long serialVersionUID = 0x52151000; // Suppress ecj warning public static final long serialVersionUID = 0x52151000; // Suppress ecj warning
// Pure Java code generated using %typemap(javacode) // Pure Java code generated using %typemap(javacode)
@ -60,7 +60,7 @@ import java.lang.*; // for Exception
%} %}
// get rid of the finalize method for NS::Farewell // get rid of the finalize method for NS::Farewell
%typemap(javafinalize) NS::Farewell ""; %typemap(javafinalize) NS::Farewell ""
// Test typemaps are being found for templated classes // Test typemaps are being found for templated classes
%typemap(javacode) NS::Adieu<int**> %{ %typemap(javacode) NS::Adieu<int**> %{
@ -89,7 +89,7 @@ namespace NS {
%template(AdieuIntPtrPtr) NS::Adieu<int**>; %template(AdieuIntPtrPtr) NS::Adieu<int**>;
// Check the premature garbage collection prevention parameter can be turned off // Check the premature garbage collection prevention parameter can be turned off
%typemap(jtype, nopgcpp="1") Without * "long"; %typemap(jtype, nopgcpp="1") Without * "long"
%pragma(java) jniclassclassmodifiers="public class" %pragma(java) jniclassclassmodifiers="public class"
%inline %{ %inline %{
@ -109,7 +109,7 @@ struct With {
void global_method_with(With *p) {} void global_method_with(With *p) {}
%} %}
%typemap(jtype, nopgcpp="1") const ConstWithout * "long"; %typemap(jtype, nopgcpp="1") const ConstWithout * "long"
%inline %{ %inline %{
class ConstWithout { class ConstWithout {
public: public:

View file

@ -3,7 +3,7 @@
%module java_typemaps_typewrapper %module java_typemaps_typewrapper
%typemap(javaimports) SWIGTYPE * "import java.math.*;"; %typemap(javaimports) SWIGTYPE * "import java.math.*;"
%typemap(javacode) Farewell * %{ %typemap(javacode) Farewell * %{
public static $javaclassname CreateNullPointer() { public static $javaclassname CreateNullPointer() {
return new $javaclassname(); return new $javaclassname();
@ -12,15 +12,15 @@
// BigDecimal requires the java.math library // BigDecimal requires the java.math library
} }
%} %}
%typemap(javaclassmodifiers) Farewell * "public final class"; %typemap(javaclassmodifiers) Farewell * "public final class"
%typemap(javaimports) Greeting * %{ %typemap(javaimports) Greeting * %{
import java.util.*; // for EventListener import java.util.*; // for EventListener
import java.lang.*; // for Exception import java.lang.*; // for Exception
%}; %};
%typemap(javabase) Greeting * "Exception"; %typemap(javabase) Greeting * "Exception"
%typemap(javainterfaces) Greeting * "EventListener"; %typemap(javainterfaces) Greeting * "EventListener"
%typemap(javacode) Greeting * %{ %typemap(javacode) Greeting * %{
public static final long serialVersionUID = 0x52151000; // Suppress ecj warning public static final long serialVersionUID = 0x52151000; // Suppress ecj warning
// Pure Java code generated using %typemap(javacode) // Pure Java code generated using %typemap(javacode)

View file

@ -40,18 +40,18 @@ $importtype(IRemoteAsyncIO)
#endif #endif
// Modify multiple inherited base classes into inheriting interfaces // Modify multiple inherited base classes into inheriting interfaces
%typemap(javainterfaces) RemoteMpe "IRemoteSyncIO, IRemoteAsyncIO"; %typemap(javainterfaces) RemoteMpe "IRemoteSyncIO, IRemoteAsyncIO"
%typemap(javabase, replace="1") RemoteMpe ""; %typemap(javabase, replace="1") RemoteMpe ""
// Turn the proxy class into an interface // Turn the proxy class into an interface
%typemap(javaclassmodifiers) IRemoteSyncIO "public interface"; %typemap(javaclassmodifiers) IRemoteSyncIO "public interface"
%typemap(javaclassmodifiers) IRemoteAsyncIO "public interface"; %typemap(javaclassmodifiers) IRemoteAsyncIO "public interface"
%typemap(javabody) IRemoteSyncIO ""; %typemap(javabody) IRemoteSyncIO ""
%typemap(javabody) IRemoteAsyncIO ""; %typemap(javabody) IRemoteAsyncIO ""
%typemap(javafinalize) IRemoteSyncIO ""; %typemap(javafinalize) IRemoteSyncIO ""
%typemap(javafinalize) IRemoteAsyncIO ""; %typemap(javafinalize) IRemoteAsyncIO ""
%typemap(javadestruct) IRemoteSyncIO ""; %typemap(javadestruct) IRemoteSyncIO ""
%typemap(javadestruct) IRemoteAsyncIO ""; %typemap(javadestruct) IRemoteAsyncIO ""
// Turn the methods into abstract methods // Turn the methods into abstract methods
%typemap(javaout) void IRemoteSyncIO::syncmethod ";" %typemap(javaout) void IRemoteSyncIO::syncmethod ";"

View file

@ -5,7 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
%} %}
%typemap(default) double y "$1=1000;"; %typemap(default) double y "$1=1000;"
#endif #endif
#ifdef SWIGLUA #ifdef SWIGLUA

View file

@ -1,6 +1,6 @@
%module overload_extend2 %module overload_extend2
%typemap(default) int int2 "$1=1000;"; %typemap(default) int int2 "$1=1000;"
%inline %{ %inline %{
typedef struct Foo { typedef struct Foo {

View file

@ -1,7 +1,7 @@
/* php_iterator.i - PHP-specific testcase for wrapping to a PHP Iterator */ /* php_iterator.i - PHP-specific testcase for wrapping to a PHP Iterator */
%module php_iterator %module php_iterator
%typemap("phpinterfaces") MyIterator "Iterator"; %typemap("phpinterfaces") MyIterator "Iterator"
%inline %{ %inline %{

View file

@ -8,8 +8,8 @@
%feature("autodoc","0") A::func0static; // names %feature("autodoc","0") A::func0static; // names
%feature("autodoc","1") A::func1static; // names + types %feature("autodoc","1") A::func1static; // names + types
// special typemap and its docs // special typemap and its docs
%typemap(in) (int c, int d) "$1 = 0; $2 = 0;"; %typemap(in) (int c, int d) "$1 = 0; $2 = 0;"
%typemap(doc,name="hello",type="Tuple") (int c, int d) "hello: int tuple[2]"; %typemap(doc,name="hello",type="Tuple") (int c, int d) "hello: int tuple[2]"
%extend A { %extend A {
static int staticextended(int i) { return i; } static int staticextended(int i) { return i; }

View file

@ -1,7 +1,7 @@
%module ruby_manual_proxy %module ruby_manual_proxy
%typemap(in, numinputs=0) SWIGTYPE ** ($*1_ltype temp) "$1 = &temp;"; %typemap(in, numinputs=0) SWIGTYPE ** ($*1_ltype temp) "$1 = &temp;"
%typemap(argout) SWIGTYPE **OUTPARAM { %typemap(argout) SWIGTYPE **OUTPARAM {
$result = SWIG_Ruby_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); $result = SWIG_Ruby_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0));

View file

@ -11,9 +11,9 @@ template<class T, class U> class map {
}; };
%} %}
//%typemap(in) vector<int> "$target = new vector<int>();"; //%typemap(in) vector<int> "$target = new vector<int>();"
//%typemap(in) vector<unsigned int> "$target = new vector<unsigned int>();"; //%typemap(in) vector<unsigned int> "$target = new vector<unsigned int>();"
//%typemap(in) map<int,int> "$target = new map<int, int>();"; //%typemap(in) map<int,int> "$target = new map<int, int>();"
%inline %{ %inline %{
void foo(vector<int > v) {} void foo(vector<int > v) {}

View file

@ -68,12 +68,12 @@
%clear int Space::nspace; %clear int Space::nspace;
%clear int Space::Struct::smember; %clear int Space::Struct::smember;
%ignore Space::Struct::member; %ignore Space::Struct::member;
%typemap(varin) int globul "TYPEMAP_VARIABLES_FAIL"; %typemap(varin) int globul "TYPEMAP_VARIABLES_FAIL"
%typemap(varout, noblock=1, fragment=SWIG_From_frag(int)) int globul "if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, SWIG_From_int($result)))) return SWIG_ERROR;"; %typemap(varout, noblock=1, fragment=SWIG_From_frag(int)) int globul "if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, SWIG_From_int($result)))) return SWIG_ERROR;"
%typemap(varin) int Space::nspace "TYPEMAP_VARIABLES_FAIL"; %typemap(varin) int Space::nspace "TYPEMAP_VARIABLES_FAIL"
%typemap(varout, noblock=1, fragment=SWIG_From_frag(int)) int Space::nspace "if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, SWIG_From_int($result)))) return SWIG_ERROR;"; %typemap(varout, noblock=1, fragment=SWIG_From_frag(int)) int Space::nspace "if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, SWIG_From_int($result)))) return SWIG_ERROR;"
%typemap(varin) int Space::Struct::smember "TYPEMAP_VARIABLES_FAIL"; %typemap(varin) int Space::Struct::smember "TYPEMAP_VARIABLES_FAIL"
%typemap(varout, noblock=1, fragment=SWIG_From_frag(int)) int Space::Struct::smember "if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, SWIG_From_int($result)))) return SWIG_ERROR;"; %typemap(varout, noblock=1, fragment=SWIG_From_frag(int)) int Space::Struct::smember "if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, SWIG_From_int($result)))) return SWIG_ERROR;"
#endif #endif
%inline %{ %inline %{

View file

@ -5,62 +5,62 @@
/* Typespecs for basic types. */ /* Typespecs for basic types. */
%typemap(cin) void ":void"; %typemap(cin) void ":void"
%typemap(cin) char ":char"; %typemap(cin) char ":char"
%typemap(cin) char * ":string"; %typemap(cin) char * ":string"
%typemap(cin) unsigned char ":unsigned-char"; %typemap(cin) unsigned char ":unsigned-char"
%typemap(cin) signed char ":char"; %typemap(cin) signed char ":char"
%typemap(cin) short ":short"; %typemap(cin) short ":short"
%typemap(cin) signed short ":short"; %typemap(cin) signed short ":short"
%typemap(cin) unsigned short ":unsigned-short"; %typemap(cin) unsigned short ":unsigned-short"
%typemap(cin) int ":int"; %typemap(cin) int ":int"
%typemap(cin) signed int ":int"; %typemap(cin) signed int ":int"
%typemap(cin) unsigned int ":unsigned-int"; %typemap(cin) unsigned int ":unsigned-int"
%typemap(cin) long ":long"; %typemap(cin) long ":long"
%typemap(cin) signed long ":long"; %typemap(cin) signed long ":long"
%typemap(cin) unsigned long ":unsigned-long"; %typemap(cin) unsigned long ":unsigned-long"
%typemap(cin) long long ":long-long"; %typemap(cin) long long ":long-long"
%typemap(cin) signed long long ":long-long"; %typemap(cin) signed long long ":long-long"
%typemap(cin) unsigned long long ":unsigned-long-long"; %typemap(cin) unsigned long long ":unsigned-long-long"
%typemap(cin) float ":float"; %typemap(cin) float ":float"
%typemap(cin) double ":double"; %typemap(cin) double ":double"
%typemap(cin) SWIGTYPE ":pointer"; %typemap(cin) SWIGTYPE ":pointer"
%typemap(cout) void ":void"; %typemap(cout) void ":void"
%typemap(cout) char ":char"; %typemap(cout) char ":char"
%typemap(cout) char * ":string"; %typemap(cout) char * ":string"
%typemap(cout) unsigned char ":unsigned-char"; %typemap(cout) unsigned char ":unsigned-char"
%typemap(cout) signed char ":char"; %typemap(cout) signed char ":char"
%typemap(cout) short ":short"; %typemap(cout) short ":short"
%typemap(cout) signed short ":short"; %typemap(cout) signed short ":short"
%typemap(cout) unsigned short ":unsigned-short"; %typemap(cout) unsigned short ":unsigned-short"
%typemap(cout) int ":int"; %typemap(cout) int ":int"
%typemap(cout) signed int ":int"; %typemap(cout) signed int ":int"
%typemap(cout) unsigned int ":unsigned-int"; %typemap(cout) unsigned int ":unsigned-int"
%typemap(cout) long ":long"; %typemap(cout) long ":long"
%typemap(cout) signed long ":long"; %typemap(cout) signed long ":long"
%typemap(cout) unsigned long ":unsigned-long"; %typemap(cout) unsigned long ":unsigned-long"
%typemap(cout) long long ":long-long"; %typemap(cout) long long ":long-long"
%typemap(cout) signed long long ":long-long"; %typemap(cout) signed long long ":long-long"
%typemap(cout) unsigned long long ":unsigned-long-long"; %typemap(cout) unsigned long long ":unsigned-long-long"
%typemap(cout) float ":float"; %typemap(cout) float ":float"
%typemap(cout) double ":double"; %typemap(cout) double ":double"
%typemap(cout) SWIGTYPE ":pointer"; %typemap(cout) SWIGTYPE ":pointer"
%typemap(ctype) bool "int"; %typemap(ctype) bool "int"
%typemap(ctype) char, unsigned char, signed char, %typemap(ctype) char, unsigned char, signed char,
short, signed short, unsigned short, short, signed short, unsigned short,
int, signed int, unsigned int, int, signed int, unsigned int,
@ -68,9 +68,9 @@
float, double, long double, char *, void *, void, float, double, long double, char *, void *, void,
enum SWIGTYPE, SWIGTYPE *, enum SWIGTYPE, SWIGTYPE *,
SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$1_ltype"; SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$1_ltype";
%typemap(ctype) SWIGTYPE "$&1_type"; %typemap(ctype) SWIGTYPE "$&1_type"
%typemap(in) bool "$1 = (bool)$input;"; %typemap(in) bool "$1 = (bool)$input;"
%typemap(in) char, unsigned char, signed char, %typemap(in) char, unsigned char, signed char,
short, signed short, unsigned short, short, signed short, unsigned short,
int, signed int, unsigned int, int, signed int, unsigned int,
@ -78,10 +78,10 @@
float, double, long double, char *, void *, void, float, double, long double, char *, void *, void,
enum SWIGTYPE, SWIGTYPE *, enum SWIGTYPE, SWIGTYPE *,
SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$1 = $input;"; SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$1 = $input;";
%typemap(in) SWIGTYPE "$1 = *$input;"; %typemap(in) SWIGTYPE "$1 = *$input;"
%typemap(out) void ""; %typemap(out) void ""
%typemap(out) bool "$result = (int)$1;"; %typemap(out) bool "$result = (int)$1;"
%typemap(out) char, unsigned char, signed char, %typemap(out) char, unsigned char, signed char,
short, signed short, unsigned short, short, signed short, unsigned short,
int, signed int, unsigned int, int, signed int, unsigned int,
@ -114,22 +114,22 @@
SWIGTYPE[ANY], SWIGTYPE { $1 = 1; }; SWIGTYPE[ANY], SWIGTYPE { $1 = 1; };
/* This maps C/C++ types to Lisp classes for overload dispatch */ /* This maps C/C++ types to Lisp classes for overload dispatch */
%typemap(lisptype) bool "cl:boolean"; %typemap(lisptype) bool "cl:boolean"
%typemap(lisptype) char "cl:character"; %typemap(lisptype) char "cl:character"
%typemap(lisptype) unsigned char "cl:integer"; %typemap(lisptype) unsigned char "cl:integer"
%typemap(lisptype) signed char "cl:integer"; %typemap(lisptype) signed char "cl:integer"
%typemap(lispclass) bool "t"; %typemap(lispclass) bool "t"
%typemap(lispclass) char "cl:character"; %typemap(lispclass) char "cl:character"
%typemap(lispclass) unsigned char, signed char, %typemap(lispclass) unsigned char, signed char,
short, signed short, unsigned short, short, signed short, unsigned short,
int, signed int, unsigned int, int, signed int, unsigned int,
long, signed long, unsigned long, long, signed long, unsigned long,
enum SWIGTYPE "cl:integer"; enum SWIGTYPE "cl:integer";
/* CLOS methods can't be specialized on single-float or double-float */ /* CLOS methods can't be specialized on single-float or double-float */
%typemap(lispclass) float "cl:number"; %typemap(lispclass) float "cl:number"
%typemap(lispclass) double "cl:number"; %typemap(lispclass) double "cl:number"
%typemap(lispclass) char * "cl:string"; %typemap(lispclass) char * "cl:string"
/* Array reference typemaps */ /* Array reference typemaps */
%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) }

View file

@ -16,7 +16,7 @@
%define SWIG_STD_ARRAY_INTERNAL(T, N) %define SWIG_STD_ARRAY_INTERNAL(T, N)
%typemap(csinterfaces) std::array< T, N > "global::System.IDisposable, global::System.Collections.IEnumerable\n , global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>\n"; %typemap(csinterfaces) std::array< T, N > "global::System.IDisposable, global::System.Collections.IEnumerable\n , global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>\n"
%proxycode %{ %proxycode %{
public $csclassname(global::System.Collections.ICollection c) : this() { public $csclassname(global::System.Collections.ICollection c) : this() {
if (c == null) if (c == null)

View file

@ -19,7 +19,7 @@
// MACRO for use within the std::list class body // MACRO for use within the std::list class body
%define SWIG_STD_LIST_MINIMUM_INTERNAL(CSINTERFACE, CTYPE...) %define SWIG_STD_LIST_MINIMUM_INTERNAL(CSINTERFACE, CTYPE...)
%typemap(csinterfaces) std::list< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"; %typemap(csinterfaces) std::list< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"
%apply void *VOID_INT_PTR { std::list< CTYPE >::iterator * }; %apply void *VOID_INT_PTR { std::list< CTYPE >::iterator * };

View file

@ -26,7 +26,7 @@
/* K is the C++ key type, T is the C++ value type */ /* K is the C++ key type, T is the C++ value type */
%define SWIG_STD_MAP_INTERNAL(K, T, C) %define SWIG_STD_MAP_INTERNAL(K, T, C)
%typemap(csinterfaces) std::map< K, T, C > "global::System.IDisposable \n , global::System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n"; %typemap(csinterfaces) std::map< K, T, C > "global::System.IDisposable \n , global::System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n"
%proxycode %{ %proxycode %{
public $typemap(cstype, T) this[$typemap(cstype, K) key] { public $typemap(cstype, T) this[$typemap(cstype, K) key] {

View file

@ -28,7 +28,7 @@ namespace std {
template <class T> template <class T>
class set { class set {
%typemap(csinterfaces) std::set<T> "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n"; %typemap(csinterfaces) std::set<T> "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n"
%proxycode %{ %proxycode %{
void global::System.Collections.Generic.ICollection<$typemap(cstype, T)>.Add($typemap(cstype, T) item) { void global::System.Collections.Generic.ICollection<$typemap(cstype, T)>.Add($typemap(cstype, T) item) {
((global::System.Collections.Generic.ISet<$typemap(cstype, T)>)this).Add(item); ((global::System.Collections.Generic.ISet<$typemap(cstype, T)>)this).Add(item);

View file

@ -19,7 +19,7 @@
// MACRO for use within the std::vector class body // MACRO for use within the std::vector class body
%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CSINTERFACE, CONST_REFERENCE, CTYPE...) %define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CSINTERFACE, CONST_REFERENCE, CTYPE...)
%typemap(csinterfaces) std::vector< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"; %typemap(csinterfaces) std::vector< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"
%proxycode %{ %proxycode %{
public $csclassname(global::System.Collections.IEnumerable c) : this() { public $csclassname(global::System.Collections.IEnumerable c) : this() {
if (c == null) if (c == null)

View file

@ -14,7 +14,7 @@
%typemap(in) void * { %typemap(in) void * {
$1 = ($1_ltype)SWIG_MustGetPtr($input, NULL, $argnum, 0); $1 = ($1_ltype)SWIG_MustGetPtr($input, NULL, $argnum, 0);
} }
%typemap(freearg) void * ""; %typemap(freearg) void * ""
%typemap(varin) SWIGTYPE * { %typemap(varin) SWIGTYPE * {
$1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0); $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0);
@ -321,14 +321,14 @@ SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer);
/* SWIG_scm2str makes a malloc'ed copy of the string, so get rid of it after /* SWIG_scm2str makes a malloc'ed copy of the string, so get rid of it after
the function call. */ the function call. */
%typemap (freearg) char * "if (must_free$argnum) SWIG_free($1);"; %typemap (freearg) char * "if (must_free$argnum) SWIG_free($1);"
%typemap (freearg) char **INPUT, char **BOTH "if (must_free$argnum) SWIG_free(*$1);" %typemap (freearg) char **INPUT, char **BOTH "if (must_free$argnum) SWIG_free(*$1);"
%typemap (freearg) char **OUTPUT "SWIG_free(*$1);" %typemap (freearg) char **OUTPUT "SWIG_free(*$1);"
/* But this shall not apply if we try to pass a single char by /* But this shall not apply if we try to pass a single char by
reference. */ reference. */
%typemap (freearg) char *OUTPUT, char *BOTH ""; %typemap (freearg) char *OUTPUT, char *BOTH ""
/* If we set a string variable, delete the old result first, unless const. */ /* If we set a string variable, delete the old result first, unless const. */
@ -348,13 +348,13 @@ SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer);
/* Void */ /* Void */
%typemap (out,doc="") void "gswig_result = SCM_UNSPECIFIED;"; %typemap (out,doc="") void "gswig_result = SCM_UNSPECIFIED;"
/* SCM is passed through */ /* SCM is passed through */
typedef unsigned long SCM; typedef unsigned long SCM;
%typemap (in) SCM "$1=$input;"; %typemap (in) SCM "$1=$input;"
%typemap (out) SCM "$result=$1;"; %typemap (out) SCM "$result=$1;"
%typecheck(SWIG_TYPECHECK_POINTER) SCM "$1=1;"; %typecheck(SWIG_TYPECHECK_POINTER) SCM "$1=1;";
/* ------------------------------------------------------------ /* ------------------------------------------------------------

View file

@ -248,7 +248,7 @@ $1=($1_ltype)&temp;%}
// void (must be empty without the SWIG_arg++) // void (must be empty without the SWIG_arg++)
%typemap(out) void ""; %typemap(out) void ""
/* void* is a special case /* void* is a special case
A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does) A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does)

View file

@ -111,8 +111,8 @@
$1 = ($1_type) SWIG_convert_int($input); $1 = ($1_type) SWIG_convert_int($input);
} }
%typemap(out) enum SWIGTYPE "$result = scheme_make_integer_value($1);"; %typemap(out) enum SWIGTYPE "$result = scheme_make_integer_value($1);"
%typemap(varout) enum SWIGTYPE "$result = scheme_make_integer_value($1);"; %typemap(varout) enum SWIGTYPE "$result = scheme_make_integer_value($1);"
/* Pass-by-value */ /* Pass-by-value */
@ -278,12 +278,12 @@ REF_MAP(double, SCHEME_REALP, scheme_real_to_double,
/* Void */ /* Void */
%typemap(out) void "$result = scheme_void;"; %typemap(out) void "$result = scheme_void;"
/* Pass through Scheme_Object * */ /* Pass through Scheme_Object * */
%typemap (in) Scheme_Object * "$1=$input;"; %typemap (in) Scheme_Object * "$1=$input;"
%typemap (out) Scheme_Object * "$result=$1;"; %typemap (out) Scheme_Object * "$result=$1;"
%typecheck(SWIG_TYPECHECK_POINTER) Scheme_Object * "$1=1;"; %typecheck(SWIG_TYPECHECK_POINTER) Scheme_Object * "$1=1;";

View file

@ -188,12 +188,12 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
/* Void */ /* Void */
%typemap(out) void "$result = Val_unit;"; %typemap(out) void "$result = Val_unit;"
/* Pass through value */ /* Pass through value */
%typemap (in) CAML_VALUE "$1=$input;"; %typemap (in) CAML_VALUE "$1=$input;"
%typemap (out) CAML_VALUE "$result=$1;"; %typemap (out) CAML_VALUE "$result=$1;"
#if 0 #if 0
%include <carray.i> %include <carray.i>

View file

@ -54,7 +54,7 @@
} }
%} %}
%typemap(classconsttab) SWIGTYPE (CLASS::*) ""; %typemap(classconsttab) SWIGTYPE (CLASS::*) ""
%typemap(consttab) int, %typemap(consttab) int,
unsigned int, unsigned int,
@ -100,4 +100,4 @@
} }
/* Handled as a global variable. */ /* Handled as a global variable. */
%typemap(consttab) SWIGTYPE (CLASS::*) ""; %typemap(consttab) SWIGTYPE (CLASS::*) ""

View file

@ -457,7 +457,7 @@
SWIG_SetPointerZval($input, SWIG_as_voidptr(new $1_ltype(SWIG_STD_MOVE($1))), $&1_descriptor, 1); SWIG_SetPointerZval($input, SWIG_as_voidptr(new $1_ltype(SWIG_STD_MOVE($1))), $&1_descriptor, 1);
%} %}
%typemap(out, phptype="void") void ""; %typemap(out, phptype="void") void ""
%typemap(out, phptype="string") char [ANY] %typemap(out, phptype="string") char [ANY]
{ {

View file

@ -86,5 +86,5 @@ namespace std {
/* SWIG will apply the non-const typemap above to const string& without /* SWIG will apply the non-const typemap above to const string& without
* this more specific typemap. */ * this more specific typemap. */
%typemap(argout) const string & ""; %typemap(argout) const string & ""
} }

View file

@ -31,8 +31,8 @@
temp = (Z_TYPE($input) == IS_TRUE); temp = (Z_TYPE($input) == IS_TRUE);
$1 = &temp; $1 = &temp;
%} %}
%typemap(argout) TYPE *INPUT, TYPE &INPUT ""; %typemap(argout) TYPE *INPUT, TYPE &INPUT ""
%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;"; %typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;"
%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT %typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT
{ {
zval o; zval o;
@ -57,8 +57,8 @@
temp = (TYPE) zval_get_double(&$input); temp = (TYPE) zval_get_double(&$input);
$1 = &temp; $1 = &temp;
%} %}
%typemap(argout) TYPE *INPUT, TYPE &INPUT ""; %typemap(argout) TYPE *INPUT, TYPE &INPUT ""
%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;"; %typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;"
%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT %typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT
{ {
zval o; zval o;
@ -82,8 +82,8 @@
temp = (TYPE) zval_get_long(&$input); temp = (TYPE) zval_get_long(&$input);
$1 = &temp; $1 = &temp;
%} %}
%typemap(argout) TYPE *INPUT, TYPE &INPUT ""; %typemap(argout) TYPE *INPUT, TYPE &INPUT ""
%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;"; %typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;"
%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT %typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT
{ {
zval o; zval o;

View file

@ -43,7 +43,7 @@ namespace swig {
%apply PyObject * {SwigPtr_PyObject}; %apply PyObject * {SwigPtr_PyObject};
%apply PyObject * const& {SwigPtr_PyObject const&}; %apply PyObject * const& {SwigPtr_PyObject const&};
%typemap(typecheck,precedence=SWIG_TYPECHECK_SWIGOBJECT,noblock=1) SwigPtr_PyObject const& "$1 = ($input != 0);"; %typemap(typecheck,precedence=SWIG_TYPECHECK_SWIGOBJECT,noblock=1) SwigPtr_PyObject const& "$1 = ($input != 0);"
/* For output */ /* For output */

View file

@ -2,43 +2,43 @@
// Documentation for use with the autodoc feature. // Documentation for use with the autodoc feature.
#ifdef SWIG_DOC_DOXYGEN_STYLE #ifdef SWIG_DOC_DOXYGEN_STYLE
%typemap(doc) SWIGTYPE "@param $1_name $1_type"; %typemap(doc) SWIGTYPE "@param $1_name $1_type"
%typemap(doc) SWIGTYPE * "@param $1_name $1_type"; %typemap(doc) SWIGTYPE * "@param $1_name $1_type"
%typemap(doc) const SWIGTYPE & "@param $1_name $1_type"; %typemap(doc) const SWIGTYPE & "@param $1_name $1_type"
%typemap(doc) const SWIGTYPE && "@param $1_name $1_type"; %typemap(doc) const SWIGTYPE && "@param $1_name $1_type"
%typemap(doc) enum SWIGTYPE "@param $1_name enum $1_type"; %typemap(doc) enum SWIGTYPE "@param $1_name enum $1_type"
%typemap(doc) SWIGTYPE *INOUT, SWIGTYPE &INOUT "@param $1_name $1_type (input/output)"; %typemap(doc) SWIGTYPE *INOUT, SWIGTYPE &INOUT "@param $1_name $1_type (input/output)"
%typemap(doc) SWIGTYPE *INPUT, SWIGTYPE &INPUT "@param $1_name $1_type (input)"; %typemap(doc) SWIGTYPE *INPUT, SWIGTYPE &INPUT "@param $1_name $1_type (input)"
%typemap(doc) SWIGTYPE *OUTPUT, SWIGTYPE &OUTPUT "@param $1_name $1_type (output)"; %typemap(doc) SWIGTYPE *OUTPUT, SWIGTYPE &OUTPUT "@param $1_name $1_type (output)"
#else #else
%typemap(doc) SWIGTYPE "$1_name: $1_type"; %typemap(doc) SWIGTYPE "$1_name: $1_type"
%typemap(doc) SWIGTYPE * "$1_name: $1_type"; %typemap(doc) SWIGTYPE * "$1_name: $1_type"
%typemap(doc) const SWIGTYPE & "$1_name: $1_type"; %typemap(doc) const SWIGTYPE & "$1_name: $1_type"
%typemap(doc) const SWIGTYPE && "$1_name: $1_type"; %typemap(doc) const SWIGTYPE && "$1_name: $1_type"
%typemap(doc) enum SWIGTYPE "$1_name: enum $1_type"; %typemap(doc) enum SWIGTYPE "$1_name: enum $1_type"
%typemap(doc) SWIGTYPE *INOUT, SWIGTYPE &INOUT "$1_name: $1_type (input/output)"; %typemap(doc) SWIGTYPE *INOUT, SWIGTYPE &INOUT "$1_name: $1_type (input/output)"
%typemap(doc) SWIGTYPE *INPUT, SWIGTYPE &INPUT "$1_name: $1_type (input)"; %typemap(doc) SWIGTYPE *INPUT, SWIGTYPE &INPUT "$1_name: $1_type (input)"
%typemap(doc) SWIGTYPE *OUTPUT, SWIGTYPE &OUTPUT "$1_name: $1_type (output)"; %typemap(doc) SWIGTYPE *OUTPUT, SWIGTYPE &OUTPUT "$1_name: $1_type (output)"
#endif #endif
// Types to use in Python documentation for the parameters of the given C++ type. // Types to use in Python documentation for the parameters of the given C++ type.
%typemap(doctype) bool "boolean"; %typemap(doctype) bool "boolean"
%define int_doctype_for_cppint_type(cppint_type) %define int_doctype_for_cppint_type(cppint_type)
%typemap(doctype) cppint_type, unsigned cppint_type "int"; %typemap(doctype) cppint_type, unsigned cppint_type "int"
%enddef %enddef
%formacro(int_doctype_for_cppint_type, short, int, long, long long) %formacro(int_doctype_for_cppint_type, short, int, long, long long)
%typemap(doctype) size_t "int"; %typemap(doctype) size_t "int"
%typemap(doctype) enum SWIGTYPE "int"; %typemap(doctype) enum SWIGTYPE "int"
%typemap(doctype) float, double, long double "float"; %typemap(doctype) float, double, long double "float"
%typemap(doctype) char*, std::string "string"; %typemap(doctype) char*, std::string "string"
%typemap(doctype) SWIGTYPE "$1_basetype" %typemap(doctype) SWIGTYPE "$1_basetype"
%typemap(doctype) SWIGTYPE * "$typemap(doctype, $*1_ltype)" %typemap(doctype) SWIGTYPE * "$typemap(doctype, $*1_ltype)"

View file

@ -83,7 +83,7 @@
{ SWIG_PY_POINTER, "$symname", 0, 0, (void *)($value), &$descriptor } { SWIG_PY_POINTER, "$symname", 0, 0, (void *)($value), &$descriptor }
%typemap(consttab) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); %typemap(consttab) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY));
%typemap(constcode) SWIGTYPE ((*)(ANY)) ""; %typemap(constcode) SWIGTYPE ((*)(ANY)) ""
%typemap(constcode) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); %typemap(constcode) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY));

View file

@ -53,7 +53,7 @@ SWIG_InitializeModule(0);
assert(all(sapply($input, class) == "$R_class")); assert(all(sapply($input, class) == "$R_class"));
%} %}
%typemap(out) void ""; %typemap(out) void ""
%typemap(in) int *, int[ANY], %typemap(in) int *, int[ANY],
signed int *, signed int[ANY], signed int *, signed int[ANY],

View file

@ -3,26 +3,26 @@
for use in class representations. for use in class representations.
*/ */
%typemap("rtype") int, int *, int & "integer"; %typemap("rtype") int, int *, int & "integer"
%typemap("rtype") long, long *, long & "integer"; %typemap("rtype") long, long *, long & "integer"
%typemap("rtype") float, float*, float & "numeric"; %typemap("rtype") float, float*, float & "numeric"
%typemap("rtype") double, double*, double & "numeric"; %typemap("rtype") double, double*, double & "numeric"
%typemap("rtype") char *, char ** "character"; %typemap("rtype") char *, char ** "character"
%typemap("rtype") char "character"; %typemap("rtype") char "character"
%typemap("rtype") string, string *, string & "character"; %typemap("rtype") string, string *, string & "character"
%typemap("rtype") std::string, std::string *, std::string & "character"; %typemap("rtype") std::string, std::string *, std::string & "character"
%typemap("rtype") bool, bool * "logical"; %typemap("rtype") bool, bool * "logical"
%typemap("rtype") enum SWIGTYPE "character"; %typemap("rtype") enum SWIGTYPE "character"
%typemap("rtype") enum SWIGTYPE * "character"; %typemap("rtype") enum SWIGTYPE * "character"
%typemap("rtype") enum SWIGTYPE *const "character"; %typemap("rtype") enum SWIGTYPE *const "character"
%typemap("rtype") enum SWIGTYPE & "character"; %typemap("rtype") enum SWIGTYPE & "character"
%typemap("rtype") const enum SWIGTYPE & "character"; %typemap("rtype") const enum SWIGTYPE & "character"
%typemap("rtype") enum SWIGTYPE && "character"; %typemap("rtype") enum SWIGTYPE && "character"
%typemap("rtype") SWIGTYPE * "$R_class"; %typemap("rtype") SWIGTYPE * "$R_class"
%typemap("rtype") SWIGTYPE *const "$R_class"; %typemap("rtype") SWIGTYPE *const "$R_class"
%typemap("rtype") SWIGTYPE & "$R_class"; %typemap("rtype") SWIGTYPE & "$R_class"
%typemap("rtype") SWIGTYPE && "$R_class"; %typemap("rtype") SWIGTYPE && "$R_class"
%typemap("rtype") SWIGTYPE "$&R_class"; %typemap("rtype") SWIGTYPE "$&R_class"
%typemap("rtypecheck") int, int &, long, long & %typemap("rtypecheck") int, int &, long, long &
%{ (is.integer($arg) || is.numeric($arg)) && length($arg) == 1 %} %{ (is.integer($arg) || is.numeric($arg)) && length($arg) == 1 %}

View file

@ -841,7 +841,7 @@
%typemap("rtypecheck") std::vector<double>, std::vector<double> *, std::vector<double> & %typemap("rtypecheck") std::vector<double>, std::vector<double> *, std::vector<double> &
%{ is.numeric($arg) %} %{ is.numeric($arg) %}
%typemap("rtype") std::vector<double> "numeric" %typemap("rtype") std::vector<double> "numeric"
%typemap("scoercein") std::vector<double>, std::vector<double> *, std::vector<double> & "$input = as.numeric($input);"; %typemap("scoercein") std::vector<double>, std::vector<double> *, std::vector<double> & "$input = as.numeric($input);"
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<float>) %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<float>)
%traits_type_name(std::vector<float>) %traits_type_name(std::vector<float>)
@ -857,7 +857,7 @@
%typemap("rtypecheck") std::vector<bool>, std::vector<bool> *, std::vector<bool> & %typemap("rtypecheck") std::vector<bool>, std::vector<bool> *, std::vector<bool> &
%{ is.logical($arg) %} %{ is.logical($arg) %}
%typemap("rtype") std::vector<bool> "logical" %typemap("rtype") std::vector<bool> "logical"
%typemap("scoercein") std::vector<bool> , std::vector<bool> & "$input = as.logical($input);"; %typemap("scoercein") std::vector<bool> , std::vector<bool> & "$input = as.logical($input);"
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<int>); %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<int>);
@ -866,7 +866,7 @@
%{ is.integer($arg) || is.numeric($arg) %} %{ is.integer($arg) || is.numeric($arg) %}
%typemap("rtype") std::vector<int> "integer" %typemap("rtype") std::vector<int> "integer"
%typemap("scoercein") std::vector<int> , std::vector<int> *, std::vector<int> & "$input = as.integer($input);"; %typemap("scoercein") std::vector<int> , std::vector<int> *, std::vector<int> & "$input = as.integer($input);"
// strings // strings
%typemap("rtype") std::vector< std::basic_string<char> >, %typemap("rtype") std::vector< std::basic_string<char> >,
@ -974,21 +974,21 @@ std::vector< std::basic_string<char> > *,
%typemap("rtypecheck") std::vector<std::vector<int> >, std::vector<std::vector<int> > *, std::vector<std::vector<int> > & %typemap("rtypecheck") std::vector<std::vector<int> >, std::vector<std::vector<int> > *, std::vector<std::vector<int> > &
%{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %}
%typemap("rtype") std::vector<std::vector<int> >, std::vector<std::vector<int> > *, std::vector<std::vector<int> > & "list" %typemap("rtype") std::vector<std::vector<int> >, std::vector<std::vector<int> > *, std::vector<std::vector<int> > & "list"
%typemap("scoercein") std::vector< std::vector<int> >, std::vector<std::vector<int> > *, std::vector<std::vector<int> > & "$input = lapply($input, as.integer);"; %typemap("scoercein") std::vector< std::vector<int> >, std::vector<std::vector<int> > *, std::vector<std::vector<int> > & "$input = lapply($input, as.integer);"
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<std::vector<unsigned int> >); %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<std::vector<unsigned int> >);
%traits_type_name(std::vector< std::vector<unsigned int> >); %traits_type_name(std::vector< std::vector<unsigned int> >);
%typemap("rtypecheck") std::vector<std::vector<unsigned int> >, std::vector<std::vector<unsigned int> > *, std::vector<std::vector<unsigned int> > & %typemap("rtypecheck") std::vector<std::vector<unsigned int> >, std::vector<std::vector<unsigned int> > *, std::vector<std::vector<unsigned int> > &
%{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %}
%typemap("rtype") std::vector<std::vector<unsigned int> >, std::vector<std::vector<unsigned int> > *, std::vector<std::vector<unsigned int> > & "list" %typemap("rtype") std::vector<std::vector<unsigned int> >, std::vector<std::vector<unsigned int> > *, std::vector<std::vector<unsigned int> > & "list"
%typemap("scoercein") std::vector< std::vector<unsigned int> >, std::vector<std::vector<int> > *, std::vector<std::vector<unsigned int> > & "$input = lapply($input, as.integer);"; %typemap("scoercein") std::vector< std::vector<unsigned int> >, std::vector<std::vector<int> > *, std::vector<std::vector<unsigned int> > & "$input = lapply($input, as.integer);"
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<std::vector<float> >); %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<std::vector<float> >);
%traits_type_name(std::vector< std::vector<float> >); %traits_type_name(std::vector< std::vector<float> >);
%typemap("rtypecheck") std::vector<std::vector<float> >, std::vector<std::vector<float> > *, std::vector<std::vector<float> > & %typemap("rtypecheck") std::vector<std::vector<float> >, std::vector<std::vector<float> > *, std::vector<std::vector<float> > &
%{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %}
%typemap("rtype") std::vector<std::vector<float> >, std::vector<std::vector<float> > *, std::vector<std::vector<float> > "list" %typemap("rtype") std::vector<std::vector<float> >, std::vector<std::vector<float> > *, std::vector<std::vector<float> > "list"
%typemap("scoercein") std::vector< std::vector<float> >, std::vector<std::vector<float> > *, std::vector<std::vector<float> > & "$input = lapply($input, as.numeric);"; %typemap("scoercein") std::vector< std::vector<float> >, std::vector<std::vector<float> > *, std::vector<std::vector<float> > & "$input = lapply($input, as.numeric);"
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<std::vector<double> >); %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<std::vector<double> >);
%traits_type_name(std::vector< std::vector<double> >); %traits_type_name(std::vector< std::vector<double> >);
@ -1003,7 +1003,7 @@ std::vector< std::basic_string<char> > *,
%typemap("rtypecheck") std::vector<std::vector<bool> >, std::vector<std::vector<bool> > *, std::vector<std::vector<bool> > & %typemap("rtypecheck") std::vector<std::vector<bool> >, std::vector<std::vector<bool> > *, std::vector<std::vector<bool> > &
%{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %}
%typemap("rtype") std::vector<std::vector<bool> >, std::vector<std::vector<bool> > *, std::vector<std::vector<bool> > & "list" %typemap("rtype") std::vector<std::vector<bool> >, std::vector<std::vector<bool> > *, std::vector<std::vector<bool> > & "list"
%typemap("scoercein") std::vector< std::vector<bool> >, std::vector<std::vector<bool> > *, std::vector<std::vector<bool> > & "$input = lapply($input, as.logical);"; %typemap("scoercein") std::vector< std::vector<bool> >, std::vector<std::vector<bool> > *, std::vector<std::vector<bool> > & "$input = lapply($input, as.logical);"
// we don't want these to be given R classes as they // we don't want these to be given R classes as they
// have already been turned into R vectors. // have already been turned into R vectors.

View file

@ -139,7 +139,7 @@ output values.
*/ */
%define OUTPUT_TYPEMAP(type, converter, convtype) %define OUTPUT_TYPEMAP(type, converter, convtype)
%typemap(in,numinputs=0) type *OUTPUT($*1_ltype temp), type &OUTPUT($*1_ltype temp) "$1 = &temp;"; %typemap(in,numinputs=0) type *OUTPUT($*1_ltype temp), type &OUTPUT($*1_ltype temp) "$1 = &temp;"
%typemap(argout, fragment="output_helper") type *OUTPUT, type &OUTPUT { %typemap(argout, fragment="output_helper") type *OUTPUT, type &OUTPUT {
VALUE o = converter(convtype (*$1)); VALUE o = converter(convtype (*$1));
$result = output_helper($result, o); $result = output_helper($result, o);
@ -161,7 +161,7 @@ OUTPUT_TYPEMAP(double, rb_float_new, (double));
#undef OUTPUT_TYPEMAP #undef OUTPUT_TYPEMAP
%typemap(in,numinputs=0) bool *OUTPUT(bool temp), bool &OUTPUT(bool temp) "$1 = &temp;"; %typemap(in,numinputs=0) bool *OUTPUT(bool temp), bool &OUTPUT(bool temp) "$1 = &temp;"
%typemap(argout, fragment="output_helper") bool *OUTPUT, bool &OUTPUT { %typemap(argout, fragment="output_helper") bool *OUTPUT, bool &OUTPUT {
VALUE o = (*$1) ? Qtrue : Qfalse; VALUE o = (*$1) ? Qtrue : Qfalse;
$result = output_helper($result, o); $result = output_helper($result, o);

View file

@ -448,9 +448,9 @@ namespace std {
/* Set up the typemap for handling new return strings */ /* Set up the typemap for handling new return strings */
#ifdef __cplusplus #ifdef __cplusplus
%typemap(newfree) char * "delete [] $1;"; %typemap(newfree) char * "delete [] $1;"
#else #else
%typemap(newfree) char * "free($1);"; %typemap(newfree) char * "free($1);"
#endif #endif
/* Default typemap for handling char * members */ /* Default typemap for handling char * members */

View file

@ -59,7 +59,7 @@
%typemap(in,noblock=1,numinputs=0) TYPEMAP (Char temp[MAX+1]) { %typemap(in,noblock=1,numinputs=0) TYPEMAP (Char temp[MAX+1]) {
$1 = ($1_ltype) temp; $1 = ($1_ltype) temp;
} }
%typemap(freearg,match="in") TYPEMAP ""; %typemap(freearg,match="in") TYPEMAP ""
%typemap(argout,noblock=1,fragment= #SWIG_FromCharPtr ) TYPEMAP { %typemap(argout,noblock=1,fragment= #SWIG_FromCharPtr ) TYPEMAP {
$1[MAX] = 0; $1[MAX] = 0;
%append_output(SWIG_FromCharPtr($1)); %append_output(SWIG_FromCharPtr($1));
@ -85,7 +85,7 @@
%typemap(in,noblock=1,numinputs=0) TYPEMAP(Char temp[SIZE]) { %typemap(in,noblock=1,numinputs=0) TYPEMAP(Char temp[SIZE]) {
$1 = ($1_ltype) temp; $1 = ($1_ltype) temp;
} }
%typemap(freearg,match="in") TYPEMAP ""; %typemap(freearg,match="in") TYPEMAP ""
%typemap(argout,noblock=1,fragment= #SWIG_FromCharPtrAndSize) TYPEMAP { %typemap(argout,noblock=1,fragment= #SWIG_FromCharPtrAndSize) TYPEMAP {
%append_output(SWIG_FromCharPtrAndSize($1,SIZE)); %append_output(SWIG_FromCharPtrAndSize($1,SIZE));
} }
@ -122,7 +122,7 @@
temp[n - 1] = 0; temp[n - 1] = 0;
$1 = ($1_ltype) temp; $1 = ($1_ltype) temp;
} }
%typemap(freearg,match="in") TYPEMAP ""; %typemap(freearg,match="in") TYPEMAP ""
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP { %typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP {
$1[MAX] = 0; $1[MAX] = 0;
%append_output(SWIG_FromCharPtr($1)); %append_output(SWIG_FromCharPtr($1));
@ -160,7 +160,7 @@
if (alloc == SWIG_NEWOBJ) %delete_array(t); if (alloc == SWIG_NEWOBJ) %delete_array(t);
$1[n-1] = 0; $1[n-1] = 0;
} }
%typemap(freearg,match="in") TYPEMAP ""; %typemap(freearg,match="in") TYPEMAP ""
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP { %typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP {
%append_output(SWIG_FromCharPtr($1)); %append_output(SWIG_FromCharPtr($1));
%delete_array($1); %delete_array($1);
@ -247,7 +247,7 @@
%typemap(in,noblock=1,numinputs=0) TYPEMAP($*1_ltype temp = 0) { %typemap(in,noblock=1,numinputs=0) TYPEMAP($*1_ltype temp = 0) {
$1 = &temp; $1 = &temp;
} }
%typemap(freearg,match="in") TYPEMAP ""; %typemap(freearg,match="in") TYPEMAP ""
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP { %typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP {
if (*$1) { if (*$1) {
%append_output(SWIG_FromCharPtr(*$1)); %append_output(SWIG_FromCharPtr(*$1));
@ -275,7 +275,7 @@
%typemap(in,noblock=1,numinputs=0) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { %typemap(in,noblock=1,numinputs=0) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) {
$1 = &temp; $2 = &tempn; $1 = &temp; $2 = &tempn;
} }
%typemap(freearg,match="in") (TYPEMAP,SIZE) ""; %typemap(freearg,match="in") (TYPEMAP,SIZE) ""
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtrAndSize)(TYPEMAP,SIZE) { %typemap(argout,noblock=1,fragment=#SWIG_FromCharPtrAndSize)(TYPEMAP,SIZE) {
if (*$1) { if (*$1) {
%append_output(SWIG_FromCharPtrAndSize(*$1,*$2)); %append_output(SWIG_FromCharPtrAndSize(*$1,*$2));

View file

@ -35,7 +35,7 @@
$1 = *ptr; $1 = *ptr;
if (SWIG_IsNewObj(res)) %delete(ptr); if (SWIG_IsNewObj(res)) %delete(ptr);
} }
%typemap(freearg) Type ""; %typemap(freearg) Type ""
%typemap(in,fragment=frag) const Type & (int res = SWIG_OLDOBJ) { %typemap(in,fragment=frag) const Type & (int res = SWIG_OLDOBJ) {
Type *ptr = (Type *)0; Type *ptr = (Type *)0;
res = asptr_meth($input, &ptr); res = asptr_meth($input, &ptr);

View file

@ -266,7 +266,7 @@
} }
$1 = %reinterpret_cast(temp, $1_ltype); $1 = %reinterpret_cast(temp, $1_ltype);
} }
%typemap(freearg) Char [ANY], const Char [ANY] ""; %typemap(freearg) Char [ANY], const Char [ANY] ""
%typemap(in,noblock=1,fragment=#SWIG_AsCharArray) const Char (&)[ANY] (Char temp[$1_dim0], int res) %typemap(in,noblock=1,fragment=#SWIG_AsCharArray) const Char (&)[ANY] (Char temp[$1_dim0], int res)
{ {
@ -276,7 +276,7 @@
} }
$1 = &temp; $1 = &temp;
} }
%typemap(freearg) const Char (&)[ANY] ""; %typemap(freearg) const Char (&)[ANY] ""
%typemap(out,fragment=#SWIG_FromCharPtrAndSize,fragment=#SWIG_CharBufLen) %typemap(out,fragment=#SWIG_FromCharPtrAndSize,fragment=#SWIG_CharBufLen)
Char [ANY], const Char[ANY] Char [ANY], const Char[ANY]

View file

@ -2,7 +2,7 @@
* Language Object * - Just pass straight through unmodified * Language Object * - Just pass straight through unmodified
* ------------------------------------------------------------ */ * ------------------------------------------------------------ */
%typemap(in) SWIG_Object "$1 = $input;"; %typemap(in) SWIG_Object "$1 = $input;"
%typemap(in,noblock=1) SWIG_Object const & ($*ltype temp) %typemap(in,noblock=1) SWIG_Object const & ($*ltype temp)
{ {
@ -30,8 +30,8 @@
#if defined(SWIG_DIRECTOR_TYPEMAPS) #if defined(SWIG_DIRECTOR_TYPEMAPS)
%typemap(directorin) SWIG_Object "$input = $1;"; %typemap(directorin) SWIG_Object "$input = $1;"
%typemap(directorout) SWIG_Object "$result = $input;"; %typemap(directorout) SWIG_Object "$result = $input;"
#endif /* SWIG_DIRECTOR_TYPEMAPS */ #endif /* SWIG_DIRECTOR_TYPEMAPS */

View file

@ -9,7 +9,7 @@
} }
$1 = %reinterpret_cast(argp, $ltype); $1 = %reinterpret_cast(argp, $ltype);
} }
%typemap(freearg) SWIGTYPE * ""; %typemap(freearg) SWIGTYPE * ""
%typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0, int res = 0) { %typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags); res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags);
@ -18,7 +18,7 @@
} }
$1 = %reinterpret_cast(argp, $ltype); $1 = %reinterpret_cast(argp, $ltype);
} }
%typemap(freearg) SWIGTYPE [] ""; %typemap(freearg) SWIGTYPE [] ""
%typemap(in, noblock=1) SWIGTYPE *const& (void *argp = 0, int res = 0, $*1_ltype temp) { %typemap(in, noblock=1) SWIGTYPE *const& (void *argp = 0, int res = 0, $*1_ltype temp) {
@ -29,7 +29,7 @@
temp = %reinterpret_cast(argp, $*ltype); temp = %reinterpret_cast(argp, $*ltype);
$1 = %reinterpret_cast(&temp, $1_ltype); $1 = %reinterpret_cast(&temp, $1_ltype);
} }
%typemap(freearg) SWIGTYPE *const& ""; %typemap(freearg) SWIGTYPE *const& ""
/* Reference */ /* Reference */
@ -41,7 +41,7 @@
if (!argp) { %argument_nullref("$type", $symname, $argnum); } if (!argp) { %argument_nullref("$type", $symname, $argnum); }
$1 = %reinterpret_cast(argp, $ltype); $1 = %reinterpret_cast(argp, $ltype);
} }
%typemap(freearg) SWIGTYPE & ""; %typemap(freearg) SWIGTYPE & ""
#if defined(__cplusplus) && defined(%implicitconv_flag) #if defined(__cplusplus) && defined(%implicitconv_flag)
%typemap(in,noblock=1,implicitconv=1) const SWIGTYPE & (void *argp = 0, int res = 0) { %typemap(in,noblock=1,implicitconv=1) const SWIGTYPE & (void *argp = 0, int res = 0) {
@ -76,7 +76,7 @@
if (!argp) { %argument_nullref("$type", $symname, $argnum); } if (!argp) { %argument_nullref("$type", $symname, $argnum); }
$1 = %reinterpret_cast(argp, $ltype); $1 = %reinterpret_cast(argp, $ltype);
} }
%typemap(freearg) SWIGTYPE && ""; %typemap(freearg) SWIGTYPE && ""
#if defined(__cplusplus) && defined(%implicitconv_flag) #if defined(__cplusplus) && defined(%implicitconv_flag)
%typemap(in,noblock=1,implicitconv=1) const SWIGTYPE && (void *argp = 0, int res = 0) { %typemap(in,noblock=1,implicitconv=1) const SWIGTYPE && (void *argp = 0, int res = 0) {

View file

@ -38,7 +38,7 @@
} }
$1 = %static_cast(val,$ltype); $1 = %static_cast(val,$ltype);
} }
%typemap(freearg) Type ""; %typemap(freearg) Type ""
%typemap(in,noblock=1,fragment=frag) const Type & ($*ltype temp, Type val, int ecode = 0) { %typemap(in,noblock=1,fragment=frag) const Type & ($*ltype temp, Type val, int ecode = 0) {
ecode = asval_meth($input, &val); ecode = asval_meth($input, &val);
if (!SWIG_IsOK(ecode)) { if (!SWIG_IsOK(ecode)) {
@ -47,7 +47,7 @@
temp = %static_cast(val, $*ltype); temp = %static_cast(val, $*ltype);
$1 = &temp; $1 = &temp;
} }
%typemap(freearg) const Type& ""; %typemap(freearg) const Type& ""
%enddef %enddef
/* out */ /* out */

View file

@ -10,7 +10,7 @@
%argument_fail(res, "$type", $symname, $argnum); %argument_fail(res, "$type", $symname, $argnum);
} }
} }
%typemap(freearg) void * ""; %typemap(freearg) void * ""
%typemap(in,noblock=1) void * const& ($*ltype temp = 0, int res) { %typemap(in,noblock=1) void * const& ($*ltype temp = 0, int res) {
res = SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown); res = SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown);
@ -19,7 +19,7 @@
} }
$1 = &temp; $1 = &temp;
} }
%typemap(freearg) void * const& ""; %typemap(freearg) void * const& ""
/* out */ /* out */